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

Message ListMessage List     Post MessagePost Message

  Set/Get isoline vaues in a contour chart
Posted by Adil on Sep-12-2022 19:50
Hi Peter,

CD7 does a good job in selecting the intermediate contour levels in a scatter point dataset after calling:

ContourLayer* layer = c->addContourLayer(vectorToArray(dataX), ...)


However, in my application, I need to interactively choose the contour levels in the chart when the first guess by CD7 is not satisfactory.

Are there any methods in the API to Set/Get the isoline values in the contour chart?

Thanks,
Adil

  Re: Set/Get isoline vaues in a contour chart
Posted by Peter Kwan on Sep-13-2022 14:34
Hi Adil,

Yes, you can completely control the contour levels.

The contour lines can be considered as the grid lines of the color axis (the color legend), just like the vertical and horizontal grid lines are those of the x-axis and y-axis. The contour lines are drawn at the major and minor tick positions of the color axis.

There are many APIs for controlling the color axis scale and labels. For example, you can use:

- Axis.setLinearScale to set the scale and major and minor ticks

- Create an axis with a range but no labels using Axis.setLinearScale2 with an empty string array. You can then add the tick position one by one using Axis.addLabel. This can be used for irregularly spaced ticks.

- Axis.addMark can be used to add special ticks to the color axis. This allows the corresponding contour lines to be of different colors, styles (eg. dash style) and line widths.

In ChartDirector 7, there is also a method ContourLayer.addCustomContour to add a custom contour line to the chart without affecting the color axis.

See:

https://www.advsofteng.com/doc/cdcpp.htm#ColorAxis.htm

https://www.advsofteng.com/doc/cdcpp.htm#ContourLayer.addCustomContour.htm

Best Regards
Peter Kwan