FVANCOP / ChartNew.js

MIT License
420 stars 143 forks source link

Legend - remove series #506

Closed AK1979 closed 7 years ago

AK1979 commented 7 years ago

Hi,

Is it possible to add to data series removal from the chart legend as seen in the following example- left chart / blue ?

image

Thanks !

AK1979 commented 7 years ago

By the way, all of the recent changes to this project is amazing, thanks for all of the features !

FVANCOP commented 7 years ago

Good idea !

This has been implemented has a new option (so you have to download the last version) : legendDrawEmptyData. Set it's value to false to remove the legend for empty datasets.

Documentation :

https://github.com/FVANCOP/ChartNew.js/wiki/100_090_Legend#legenddrawemptydata

AK1979 commented 7 years ago

Hi I’m not talking about null data set. Is it possible when the legend series is clicked ( In the example -> blue ) that the chart will be updated accordingly ? ( the series would be excluded from the chart)

FVANCOP commented 7 years ago

Sorry, I did not understand.

Download the last version (small changes to ChartNew.js) and check Samples\issue_0506_v1.html and Samples\issue_0506_v2.html.

AK1979 commented 7 years ago

Thanks!

I thing it would be better and less confusing that after the legend text is pressed the text will be marked as delete ( middle line ) and color remains as showen above ( Blue) .

FVANCOP commented 7 years ago

Unfortunately, strikethrough text does not exist in canvas; I have updated the ChartNew.js code and the two samples. In this new version, fill colors, legend text color, legend text style and the legend box borders can have a different values when the associated data is hidden.

FVANCOP commented 7 years ago

http://fvancop.github.io/ChartNew.js/Samples/issue_0506_v1.html http://fvancop.github.io/ChartNew.js/Samples/issue_0506_v2.html

AK1979 commented 7 years ago

Hi

I'm trying to use this option in bar chart.

In FUNC displayText the 'other' parameter == undefined and the function exits.

Any solution ?

Thanks, Arie.

FVANCOP commented 7 years ago

I just took the two Pie samples (with some changes in the data) and sets charts as Bar, HorizontalBar, StakedBar, HorizontalStackedBar and Lines : no problem with it...

http://fvancop.github.io/ChartNew.js/Samples/issue_0506_v3.html http://fvancop.github.io/ChartNew.js/Samples/issue_0506_v4.html

Both samples have been integrated in the Samples folder.