FVANCOP / ChartNew.js

MIT License
420 stars 143 forks source link

legendPosX=4 with maxLegendCols=1 is broken #458

Closed eythort closed 7 years ago

eythort commented 7 years ago

works as expected in version 2, but in version 3 the legends appear in one line (not one column) side of the canvas, pushing the chart to be almost zero width.

legendPosX=3 works the same way as in version 2

FVANCOP commented 7 years ago

Yes, it is a "bit" inconsistent, but when legendPosY is not 0 or 4 and legendPosX is 0 or 4, maxLegendCols is in fact the maximum number of ... lines. I have to rethink the name of this option.

For your chart, if you remove option maxLegendCols, you should get a fine chart. Can you try to remove this option from your code ?

eythort commented 7 years ago

Removing the maxLegendCols from the options did the trick! It now appears as in v2. I agree it's a "bit" inconsistent. I'd either change the name of this option or add maxLegendRows, etc. At least change the documentation for the maxLegendCols for now :)

FVANCOP commented 7 years ago

option maxLegendLines has been defined and documentation updated.

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

thanks @eythort :-)