Hi Brave,
You mentioned the 3 regions are 1~6, 7~12, 13~24. Does it mean that your chart needs to
have gaps (the region 6 ~ 7 and 12 ~13 has no color)? Or do you really mean 0 - 6.5, 6.5 -
12.5, 12.5 - 24?
In any case, you can use x-zone colors to achieve what you want. For example, for the
case 0 - 6.5, 6.5 - 12.5, 12.5 - 24, there are 3 zones, so the code is like (in C#):
int color1 = 0xff0000;
int color2 = 0x00ff00;
int color3 = 0x0000ff;
int myColor = c.xZoneColor(6.5, color1, c.xZoneColor(12.5, color2, color3));
AreaLayer layer = c.addAreaLayer(myData, myColor);
If you need to have gaps between the 3 regions, then there are actually 5 regions (3
colored regions, and 2 transparent regions for the gaps). In this case, you can use the x-
zone color same as above, except that you need 2 more regions filled with the
Chart.Transparent color.
Hope this can help.
Regards
Peter Kwan |