MartinS

Legenditems And Switching Off Legend Click Option

Recommended Posts

I have noticed in the latest release of the fusion library, each legend item is now shown with the series type, i.e. bars/columns/lines in the series colour to identify it, and if you click any legend item, it hides the series from view without the need to re-draw the chart.

As I understand, this used to be be something that had to be coded for using javascript in earlier releases, and so although it is a good addition, can it be switched off so that the user cannot hide series by simply clicking the legend item?

Also, can you use different indicators for the legend items? I have a line chart where I want specific text in the series colour as the legend item.

Thanks

Martin

Share this post


Link to post
Share on other sites

Hi Martin,

 

As I understand, this used to be be something that had to be coded for using javascript in earlier releases, and so although it is a good addition, can it be switched off so that the user cannot hide series by simply clicking the legend item?

Please try setting the attribute "interactiveLegend" to '0' in the <chart> element to disable this functionality.

 

This attribute lets you interact with the legend in your chart. When you click a legend key, the data-plots associated with that series are eliminated from the chart. Re-clicking the key causes the data-plots to reappear.

 

Also, can you use different indicators for the legend items? I have a line chart where I want specific text in the series colour as the legend item.

Could you please specify this issue a bit elaborately? More preferably with a screenshot of your requirement.

 

Hope this helps. :)

Share this post


Link to post
Share on other sites

Please try setting the attribute "interactiveLegend" to '0' in the <chart> element to disable this functionality.

 

This attribute lets you interact with the legend in your chart. When you click a legend key, the data-plots associated with that series are eliminated from the chart. Re-clicking the key causes the data-plots to reappear.

Yes, that's exactly what I was looking for - thanks.

 

Could you please specify this issue a bit elaborately? More preferably with a screenshot of your requirement.

I have a line chart showing three series. The series names are FTSE100, FTSE250 and FTSE350. The series colours are blue, yellow and red respectively. I currently have it set up so that the legend label text is fed from the chart names, and by clicking on the label (which is a link button), it sets the visibility of the series to transparent, and sets the link button text to grey, to mimic being disabled. Clicking again does the opposite.

You can see a before and after image below.

post-1100-057997000 1289467055_thumb.jpg

post-1100-049067200 1289467064_thumb.jpg

What I'd like is to use an interactive legend, but instead of a series identifier and text, just use text. I hope that makes sense?

If you need any further clarification, please let me know.

Martin

Share this post


Link to post
Share on other sites

Hi Martin,

 

You are welcome. :)

 

For the second issue, when a <dataset> element is transparent, the Legend of the plot color shows up perfectly. But clicking the legend icon only makes the icon color grey, no data-plots shows up any way.

 

In case you wish to keep the transparent dataset's icon invisible, try giving the same plot color as that of the background (in this case it is White).

 

Please refer to the screenshots of the rendered Multi-series Column2D chart with a transparent dataset.

 

Hope this helps. :)

 

 

post-8144-073903100 1289468725_thumb.jpg

post-8144-081584300 1289468742_thumb.jpg

post-8144-040526900 1289468760_thumb.jpg

Share this post


Link to post
Share on other sites

Hi Martin,

 

You are always welcome. :)

 

I hope your issue is resolved.

 

Please feel free to revert in case you have any further queries.

Hi

I'm not sure I've explained my question very well.

I want to show a legend without a 'symbol' shown for each series, just the series name, but still keep the interactive element.

In my example, my three series (FTSE 100, FTSE250 and FTSE350) want to show as just text, and when clicked, the interactive element will still switch them on/off without the need for me to set the series colour.

I hope I have explained that better.

Martin

Share this post


Link to post
Share on other sites

Hi Martin,

 

Please try setting the attribute "legendIconScale" to '.001' in the <chart> element to achieve what you intend to.

 

Hope this helps. :)

 

That's great. Many thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now