|
|
Re: chart: hide legend entry [message #1061528 is a reply to message #1061429] |
Sun, 02 June 2013 03:22 |
|
Try this:
function beforeDrawLegendItem( lerh, bounds, icsc )
{
if(lerh.getLabel().getCaption().getValue() == "yourSeries"){
lerh.getLabel().setVisible(false);
bounds.set(0,0,0,0);
}
}
Michael
Developer Evangelist, Silanis
|
|
|
|
|
|
Re: chart: hide legend entry [message #1734227 is a reply to message #1733881] |
Mon, 06 June 2016 12:18 |
Jörg Steffen Messages: 3 Registered: June 2016 |
Junior Member |
|
|
Hi Miguel,
when you are using Y-series grouping, imho you only can use a workaround. I had the same issue some time ago, and I received the following code:
function beforeDrawLegendItem( lerh, bounds, icsc )
{
var gradient=lerh.getFill().getClass().isAssignableFrom(GradientImpl);
if (gradient)
{
lerh.getLabel().setVisible(false);
bounds.set(0,0,0,0);
}
else
{
lerh.getLabel().setVisible(true);
}
}
You have to insert this into the onRender part of the script for your chart. After that, you have to use gradient coloring in your color palette for the serie you want to hide from legend. You can select the same color for both "ends" of the gradient but you have to use it.
In the example file I added you can see the grey trend line in the chart but hidden in the legend.
I hope this helps.
BR, Jörg
-
Attachment: example.JPG
(Size: 66.46KB, Downloaded 510 times)
|
|
|
Powered by
FUDForum. Page generated in 0.03382 seconds