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

Message ListMessage List     Post MessagePost Message

  change color palette of contour chart
Posted by Vitaly on Sep-06-2013 22:40
Hello,
I am trying to create a contour chart representing soil moisture in the field.
Normally, colors of contours change from blue to red in ascending order. I need it in reverse. The lowest value should be red and the greatest one should be dark blue. My values change in the range from 0% (red) to 40% (dark blue). I think I need to use Layer.yZoneColor() but not sure how to do it.

  Re: change color palette of contour chart
Posted by Peter Kwan on Sep-07-2013 00:31
Hi Vitaly,

The colors can be configured using ColorAxis.setColorGradient. For example, (in C#/Java);

//from red 0xff0000 to dark blue 0x000088
int[] colors = {0xff0000, 0x000088};

ContourLayer layer = c.addContourLayer(..........);
layer.colorAxis().setColorGradient(false, colors);

You can set more color stops along the color gradient if you like:

//from red, to cyan, to dark blue
int[] colors = {0xff0000, 0x6699ff, 0x000088};
layer.colorAxis().setColorGradient(false, colors);

Hope this can help.

Regards
Peter Kwan

  Re: change color palette of contour chart
Posted by Vitaly on Sep-07-2013 15:17
Thank you Peter.
Exactly what I need.
regards
Vitaly