Is there a utility method to add a data point to a series


#1

There are a large number of AddDataPointForXXXSeries methods on IChartDataPointCollection. From their documentation it looks as though you need to have a series of if statements using ChartTypeCharacterizer.IsChartTypeXXX(ChartType) to determine which one to use.

Is there any existing method that would mean I do not have to maintain a method similar to this ?

private static void AddSeriesDataPoint(IChartDataPointCollection dataPoints, ChartType chartType, IChartDataCell datacell) {
if (ChartTypeCharacterizer.IsChartTypeColumn(chartType) || ChartTypeCharacterizer.IsChartTypeBar(chartType) ) {
dataPoints.AddDataPointForBarSeries(datacell);
}


#2

@bruce1027,

I have observed your requirements and like to share that there is no such utility method available to add chart series data points in bulk or together. You have to add data point individually for chart series. The other option that you may try is to set external workbook for chart that have all the data points dta inside that.