|
Legend Icon Box without border for Donut Chart |
Posted by Dharm on Jan-31-2023 00:36 |
|
Hi Team,
We are working on various chart building, by default Legend Box has border with square icon. We need square icon but without border.
How can we do that?
Thanks,
Dharm |
Re: Legend Icon Box without border for Donut Chart |
Posted by Peter Kwan on Jan-31-2023 01:37 |
|
Hi Dharm,
To hide anything in ChartDirector, one common method is to set its color to transparent. If you are referring to the border of the entire legend box (the icon itself also has a border), you can use Box.setBackground to set the legend box border to transparent.
The exact code depends on your programming language. For example, in C#/Java, it is like:
LegendBox b = c.addLegend(.....);
b.setBackground(Chart.Transparent, Chart.Transparent);
See:
https://www.advsofteng.com/doc/cdnet.htm#Box.setBackground.htm
The following is an example that shows a legend box with no border. Note it calls setBackground on the LegendBox object.
https://www.advsofteng.com/doc/cdnet.htm#concentric.htm
If you are referring to the border of the square icon itself, you can use LegendBox.setKeyBorder to set its color to Transparent.
https://www.advsofteng.com/doc/cdnet.htm#LegendBox.setKeyBorder.htm
Best Regards
Peter Kwan |
|