|
Linear Meter - Return color at value/pointer location. |
Posted by Brad on Oct-06-2011 21:53 |
|
Hi,
I'm using ChartDirector in VB.net, specifically the Horizontal Linear Meter chart. My question is whether it is possible to return the color (HTML color code format preferably) at a specified data value, or coordinate. I tried the getColor method, but it only takes an Int as the parameter. The solution is probably very simple, but I might be looking at this the wrong way.
Thanks for any help,
Brad |
Re: Linear Meter - Return color at value/pointer location. |
Posted by Peter Kwan on Oct-07-2011 00:34 |
|
Hi Brad,
Are you referring to the zone colors in the "Horizontal Linear Meter" sample code?
Because the zone colors are specify by your code, your code should already know which color is for which data value. ChartDirector does not have an API to retrieve such information.
There is a DrawArea.getPixel API that gets the color at a particular pixel, but I think this is not what you want. First, the API uses pixel coordinates, not data values. Also, even if you use a point in the "green zone", you can still get the black color if the pixel happens to be on a grid line in the green zone (the grid line is black in color).
Regards
Peter Kwan |
Re: Linear Meter - Return color at value/pointer location. |
Posted by Brad on Oct-07-2011 19:31 |
|
Hi Peter,
Thanks for the quick reply. The DrawArea.getPixel is exactly what I was looking for! I'm using a color gradient, so I use getCoor on the data value, and plug the coordinates into the getPixel function.
Thanks for your help! I greatly appreciate it!
Brad |
|