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

Message ListMessage List     Post MessagePost Message

  To find color at runtime drawing chart
Posted by anbu on May-08-2012 20:57
while drawing line in XY chart  how do i find color at runtime in chartdirector

  Re: To find color at runtime drawing chart
Posted by Peter Kwan on May-09-2012 01:59
Hi anbu,

Would you mind to clarify which color you would like to find, and how would you like to look up the color?

For all of the charts in ChartDirector, you code can specify the color of everything. For example, to plot a bar chart, your code can specify the color of the bars. In this case, to obtain the color of a bar, you may look up your code to see what colors it is using.

If you let ChartDirector to automatically color the bars, then the Nth auto-color is:

myColor = cd.defaultPalette(7 + N)

See "Color Specification" (you may look up "Color Specification" from the ChartDirector documentation index) for details.

If you would like to know the color of a pixel after drawing the chart (after calling makeChart or makePicture or makeSession), you may use:

color = c.getDrawArea().getPixel(xPixelCoor, yPixelCoor)

Hope this can help.

Regards
Peter Kwan