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

Message ListMessage List     Post MessagePost Message

  Set semitransparent the contour layer to see a background map
Posted by Francisco on Aug-02-2010 05:11
Hi all
It is possible to see a background image by setting the contour layer with semitransparent colors?

  Re: Set semitransparent the contour layer to see a background map
Posted by Peter Kwan on Aug-02-2010 23:26
Hi Francisco,

I assume the "background image" you refer to is the background image of the chart (eg. added using something like BaseChart.setBgImage or PlotArea.setBackground2). In this case, you may simply use ColorAxis.setColorGradient to set the contour fill colors to semi-transparent colors. For example (in Java/C#):

int[] fillColors =
{
0x800000C0, 0x800000FF, 0x800030FF, 0x800060FF, 0x800090FF, 0x8000C0FF, 0x8000FFFF, 0x8030FFC0, 0x8060FF90, 0x8090FF60, 0x80C0FF30, 0x80FFFF00, 0x80FFCC00, 0x80FF8800, 0x80FF5500, 0x80FF0000
};

//layer = ContourLayer object
layer.colorAxis().setColorGradient(true, fillColors);

If the background is not related to ChartDirector (eg. is part of the HTML web page), you would also need to output the alpha channel, so that the browser knows how to compose the chart created by ChartDirector to the HTML web page background:

//ask ChartDirector to retain the alpha transparency when creating the PNG
c.setTransparentColor(-1);

Hope this can help.

Regards
Peter Kwan

  Re: Set semitransparent the contour layer to see a background map
Posted by Francisco on Aug-03-2010 03:30
Thanks
Awesome support!!!