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

Message ListMessage List     Post MessagePost Message

  Contour chart
Posted by chen on Jan-09-2019 11:35
Hi Peter,

How can I set the continuous color gradient with a custom color scale that i assigned in C++.

For example, my colorScale is :

double colorScale[] = {0, 0x0066ff, 15, 0x66ffff, 20, 0x00ff00, 30, 0xff6600, 40};

but when i use setColorGradient, the color scale is change into default

sorry,my english is poor, thank you for your help.

  Re: Contour chart
Posted by Peter Kwan on Jan-10-2019 00:14
Hi Chen,

To set a color scale, the API should be ColorAxis.setColorScale. For a continuous gradient, the number of color stops must equal to the number of colors. See:

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

For your case, the code should be:

// 4 colors at 4 positions
double colorScale[] = {0, 0x0066ff, 15, 0x66ffff, 20, 0x00ff00, 30, 0xff6600};

myColorAxis->setColorScale(DoubleArray(colorScale, 8));

Hope this can help.

Regards
Peter Kwan