C# Excel Chart Series Option (Change Second Plot value)
C#
2
Posts
1
Posters
0
Views
1
Watching
-
Hi, How can we change the Excel Chart Series Option (Second Plot last value) in C#? Here is the picture in Excel http://www.flickr.com/photos/31464532@N02/2948659930/ Here is my code..
ChartObjects chartObjects = (ChartObjects)activeSheet.ChartObjects(Type.Missing); Range range = activeSheet.get\_Range(cellStart, cellEnd); ChartObject obj = null; obj = chartObjects.Add(leftLocation, topLocation, chartWidth, chartHeight); obj.Chart.SetSourceData(range, XlRowCol.xlColumns); obj.Chart.HasTitle = true; obj.Chart.ChartTitle.Text = title; obj.Chart.ChartTitle.Font.Bold = true; obj.Chart.ChartType = XlChartType.xlBarOfPie; Series series = (Series)obj.Chart.SeriesCollection(1); **// Here Dont know how to access the Formatting Option - Second Pot Last Value :confused:** obj.Chart.ApplyDataLabels(XlDataLabelsType.xlDataLabelsShowLabelAndPercent, //XlDataLabelsType Type, Type.Missing, //LegendKey, Type.Missing, //AutoText, Type.Missing, //HasLeaderLines, Type.Missing, //ShowSeriesName, Type.Missing, //ShowCategoryName, Type.Missing, //ShowValue, Type.Missing, //ShowPercentage, Type.Missing, //ShowBubbleSize, Type.Missing);
It seems not easy to find article for this one, so if somebody can help i would really appreciate it. Thanks
-
Hi, How can we change the Excel Chart Series Option (Second Plot last value) in C#? Here is the picture in Excel http://www.flickr.com/photos/31464532@N02/2948659930/ Here is my code..
ChartObjects chartObjects = (ChartObjects)activeSheet.ChartObjects(Type.Missing); Range range = activeSheet.get\_Range(cellStart, cellEnd); ChartObject obj = null; obj = chartObjects.Add(leftLocation, topLocation, chartWidth, chartHeight); obj.Chart.SetSourceData(range, XlRowCol.xlColumns); obj.Chart.HasTitle = true; obj.Chart.ChartTitle.Text = title; obj.Chart.ChartTitle.Font.Bold = true; obj.Chart.ChartType = XlChartType.xlBarOfPie; Series series = (Series)obj.Chart.SeriesCollection(1); **// Here Dont know how to access the Formatting Option - Second Pot Last Value :confused:** obj.Chart.ApplyDataLabels(XlDataLabelsType.xlDataLabelsShowLabelAndPercent, //XlDataLabelsType Type, Type.Missing, //LegendKey, Type.Missing, //AutoText, Type.Missing, //HasLeaderLines, Type.Missing, //ShowSeriesName, Type.Missing, //ShowCategoryName, Type.Missing, //ShowValue, Type.Missing, //ShowPercentage, Type.Missing, //ShowBubbleSize, Type.Missing);
It seems not easy to find article for this one, so if somebody can help i would really appreciate it. Thanks