|
how to set the marker symbol image size in the legend |
Posted by Moses on Jan-02-2024 14:55 |
|
Hi,
I use the ChartDirector with C++, I want to add a function to configure the marker symbol size for the line chart, but I found after setting the symbol size, the symbol image size in the legend will also be changed accordingly.
How can I set the symbol image size in the legend in a fixed value?
|
Re: how to set the marker symbol image size in the legend |
Posted by Peter Kwan on Jan-02-2024 18:28 |
|
Hi Moses,
You use the following method:
// Disable legend entry for the scatter layer
myScatterLayer->setLegendOrder(Chart::NoLegend);
// Add an empty scatter layer with the desired icon size. The legend box will show this icon.
c->addScatterLayer(DoubleArray(0, 0), DoubleArray(0, 0), "Name", Chart::DiamondSymbol, 11, 0x008000);
Best Regards
Peter Kwan |
Re: how to set the marker symbol image size in the legend |
Posted by Moses on Jan-03-2024 11:11 |
|
Thanks, this works for me. |
Re: how to set the marker symbol image size in the legend |
Posted by Moses on Jan-05-2024 10:34 |
|
One more question, when I use the legend for the line chart, it will show a "line" in the middle of the symbol image. But if I use the "Scatter layer" to show the legend, the "line" will disappear. How to show this line in the "Scatter layer" legend?
|
Re: how to set the marker symbol image size in the legend |
Posted by Peter Kwan on Jan-05-2024 11:56 |
|
Hi Moses,
Sorry for this problem. I should have used an empty line layer instead of empty scatter layer:
c->addLineLayer()->addDataSet(DoubleArray(0, 0), 0x008000, "Name")->setDataSymbol(Chart::DiamondSymbol, 11, 0x008000);
Best Regards
Peter Kwan |
Re: how to set the marker symbol image size in the legend |
Posted by Moses on Jan-10-2024 14:51 |
|
Thank you, Peter. |
|