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

Message ListMessage List     Post MessagePost Message

  The colors of surface chart
Posted by Tom on Feb-02-2013 10:17
Attachments:
Hi, ALL

I made the surface chart.
But now the Data [2] is displayed as yellow[2.5-2.0]
and the Data[1] is  displayed as Water Color[1.5-1.0]

How can i display the chart like this?
2 is displayed as green[2.0-1.5]
1 is displayed as blue[1.0-0.5]
2013-02-02_095215.png
Demo.java
Demo.java

2.00 Kb

  Re: The colors of surface chart
Posted by Peter Kwan on Feb-04-2013 20:11
Hi Tom,

The easy method is to modify your data. For example, you may subtract all the data values (except 0) with 0.001. In this way, the chart will be exactly the same, except that the surface at exactly z = 2.0 will become z = 1.999 and will therefore use the color for 1.5 to 2.0 (instead of 2.0 to 2.5).

In Java, it is like:

//Automatically determine a suitable adjustment to be 1/10000 of the z-axis range
//The error will be 1/10000 of the screen dimension, which is not noticible.
ArrayMath m = new ArrayMath(dataZ);
double adjustment = (m.max() - m.min()) * 0.00001;

for (int i = 0; i < dataZ.length; ++i) {
    if (Math.abs(dataZ[i]) > adjustment)
        dataZ[i] -= adjustment;
}

Hope this can help.

Regards
Peter Kwan