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

Message ListMessage List     Post MessagePost Message

  Can I get the z value from contour?
Posted by heejin on Nov-17-2018 23:55
Can I get the expectation of z value from the contour graph
when I clicked any spot in graph?

  Re: Can I get the z value from contour?
Posted by Peter Kwan on Nov-20-2018 03:55
Hi heejin,

There is no direct method to read the z value from a contour graph, apart from the original z values provided by your data points. Internally, ChartDirector will not store the z values of the pixels, so it does not really know what are the z values after plotting the chart.

However, it is possible to read the color of a pixel using DrawArea.getPixel. Quite a number of our customers have used this method to obtain the z values. As I do not know which programming language you are using, and whether it is a desktop of web application, I will provide some brief explanation below.

1. Create another contour chart of the same size with the same data, but with only the contour layer visible, and all other things (the chart background, axis, labels, grid lines, ...) are set to transparent.

2. The contour layer should be create with a special smooth coloring scheme so that it would be easy to obtain the data value from the color. The coloring scheme can be configured using ColorAxis.setColorGradient.

3. When given an (x, y) coordinate, the code can obtain the color and compute the z value from the color.

If you need more specific code, please let me know what is your programming language and the type of application.

Regards
Peter Kwan