Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions DocX/Charts/Chart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,27 @@ public Boolean View3D
}
}

/// <summary>
/// Get or set show values for this chart
/// </summary>
public Boolean showVal {
get {
XElement parentElement = ChartXml.Element(XName.Get("dLbls", DocX.c.NamespaceName));
XElement element = parentElement.Element(XName.Get("showVal", DocX.c.NamespaceName));
return(element.GetAttribute("val") == "1");
}
set {
XElement parentElement = ChartXml.Element(XName.Get("dLbls", DocX.c.NamespaceName));
XElement element = parentElement.Element(XName.Get("showVal", DocX.c.NamespaceName));
if (value) {
element.SetAttributeValue("val", "1");
}
else {
element.SetAttributeValue("val", "0");
}
}
}

/// <summary>
/// Specifies how blank cells shall be plotted on a chart
/// </summary>
Expand Down
1 change: 1 addition & 0 deletions Examples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ private static void BarChart()
BarChart c = new BarChart();
c.BarDirection = BarDirection.Column;
c.BarGrouping = BarGrouping.Standard;
c.showVal = true;
c.GapWidth = 400;
c.AddLegend(ChartLegendPosition.Bottom, false);

Expand Down