Sign in to follow this  
Followers 0
dan pfx

automatic resize multi series charts when hiding serie by clicking on label

6 posts in this topic

Hello,

 

I don't know if this is already possible, but I would like that, when a user click on a label of a multi series (multi line for example) chart to hide one line, the chart redraw to take maximum size for visible lines.

 

This is particularly useful when a chart have 10 lines, and when 9 lines are goes from 5 to 10 on Y axis, and 1 line goes from 1000 to 1500 on Y axis... chart can't be read even if you hide the 1000 to 1500 line, all other lines are at bottom of chart.

 

Thank you,

Dan

Share this post


Link to post
Share on other sites
Hi,

 

It seems that you want to re-scale your y-axis when you click on a legend to hide the corresponding dataset series. It is not possible to scale Y-axis when a dataset is hidden by clicking on legend, as of now. However, as a workaround, you may use "LegendItemClicked" event to scale y-axis when a dataset is hidden by clicking on legend. 

 

Please find an attached sample created using this workaround.

 

Hope this helps.

Rescaling yAxis Demo.zip

Share this post


Link to post
Share on other sites

Hello,

 

Is there any update on this one?

Are there any plans to support this feature?

 

 

The proposed walk-around does the work, but doesn't scale well (when having a lot of series). However it did inspire me to come up with similar solution - As using the angular+ngrx, it can get quite easy to just prune out the data for the 'switched off' series entity (on legend events). 

 

Still, I'm interested if this feature planned to be implemented?

Share this post


Link to post
Share on other sites

Hello,


Thanks for the query.
 
Your requirement is achievable by setting transposeAxis attribute as 1 at chart attribute level.
 
If you hide a dataset using legend icon, the transposeAxis attribute (when set to 1) will compute the axes limit with respect to maximum and minimum value of the visible dataset(s). 
 
Kindly refer the sample fiddle below for the implementattion.
 
Please feel free to revert back to us for further assistance.

Share this post


Link to post
Share on other sites

Wow! Really nice that this feature is implemented :)

 

Thank you very much for the input and provided jsfiddle example!

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
Sign in to follow this  
Followers 0