diff --git a/DocX/Charts/Chart.cs b/DocX/Charts/Chart.cs index b9844012..a6600a5a 100644 --- a/DocX/Charts/Chart.cs +++ b/DocX/Charts/Chart.cs @@ -154,6 +154,27 @@ public Boolean View3D } } + /// + /// Get or set show values for this chart + /// + 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"); + } + } + } + /// /// Specifies how blank cells shall be plotted on a chart /// diff --git a/Examples/Program.cs b/Examples/Program.cs index 2743c2c8..c07e08b2 100644 --- a/Examples/Program.cs +++ b/Examples/Program.cs @@ -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);