ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  ChartDirector AreaChart not producing a Layer.GetDataSetCount
Posted by Mike Cotrone on Jan-05-2021 03:56
Attachments:
Hi,

I am having an issue that is only with an Area chart with trying to get it's dataset count. It is always providing me an index of 0 when I have 6 (the chart draws properly see attached pic).

I am also calling chart.layoutAxes prior to this search and its still not working. BTW this works perfect on my Bar Chart type that has almost identical code.

Do you have any thoughts and a huge thank you in advance.

Mike
areaChart.png

  Re: ChartDirector AreaChart not producing a Layer.GetDataSetCount
Posted by Peter Kwan on Jan-05-2021 14:05
Hi Mike,

In ChartDirector terminology, a data set is a series of data points.

In your chart, it looks like there is only one data set. The data set contains 7 data points.

For an area chart, if there area more than one data sets in a layer, you would need to specify how the data sets are combined in the layer. The following is an example of an area chart with 3 data sets, which are combined by stacking up.

https://www.advsofteng.com/doc/cdnet.htm#stackedarea.htm

Are you referring to the number of data points in a series? The number of data points are just the size of your data array. You can iterate the x series by using Layer.getXPosition. If you iterate beyond the end of the x series, it will return NoValue. You can also use Layer.getNearestXValue to find the x value nearest to the left and right edges of your chart, which is typically the first and last x data value.

Regards
Peter Kwan

  Re: ChartDirector AreaChart not producing a Layer.GetDataSetCount
Posted by Mike Cotrone on Jan-05-2021 21:59
Thank you Peter and yes my terminology was off. You are correct as I am looking for the data array.

Thank you again,
Mike