|
make background transparent? |
Posted by john.dobson on Nov-02-2012 04:15 |
|
Hi Peter,
Is there way to make the black areas in the attached image transparent?
Also do you have a gradient fill sample?
Thanks!
J.Dobson
|
Re: make background transparent? |
Posted by Peter Kwan on Nov-02-2012 14:50 |
|
Hi john,
For PNG output, ChartDirector 5.1 should automatically an image with a transparent background if the backgrouind color is transparent (that is, when you create the XYChart, you use transparent as the background color).
Older versions of ChartDirector will remove the transparency information by default. You would need to use (in Java/C#):
c.setTransparentColor(-1);
Hope this can help.
Regards
Peter Kwan |
Re: make background transparent? |
Posted by Peter Kwan on Nov-02-2012 15:06 |
|
Hi John,
For the "gradient fill sample", most of the "Meters and Gauges" sample code should be using a gradient fill color. For example, see the "Round Meter" sample code. (You may look up "Round Meter" from the ChartDirector documentation index).
In brief, you may create a gradient color by using Chart.metalColor or BaseChart.linearGradientColor or BaseChart.radialGradientColor, then use this color to fill the region you want to fill. For example (in Java/C#):
AngularMeter m = new AngularMeter(200, 200);
int myColor = m.linearGradientColor(0, 0, 0, 200, 0x99ccff, 0xffffff);
m.setBackground(myColor);
Hope this can help.
Regards
Peter Kwan |
|