asciidoctor / asciidoctor-chart

A set of Asciidoctor extensions that add a chart block and block macro to AsciiDoc for including charts in your AsciiDoc document.
Other
31 stars 13 forks source link

Request : Allowing relative width specified for the generated graphs #9

Closed jpminnovation closed 2 years ago

jpminnovation commented 2 years ago

Would it be possible to specify the width of the generated graphs with a relative number (percentage) and not only in pixels ?

I would like to have a definition such as :

chart::sample-data.csv[line,engine="chartjs",width="100%"]

Currently, this is not possible on :

ggrossetie commented 2 years ago

As mentioned in #8, Chart.js always uses a width of 100% (and does not support specific width or height) C3.js seems to only support width and height in pixels. And finally, Chartist always uses a width of 100%.

Again, if my assumptions are incorrect, feel free to comment.

jpminnovation commented 2 years ago

If I don't specify width, it does not scale to 100% per default : image

However, if I try to put whatever number for width and height, it is getting "larger" than the case above, but with the problem of overlaping what is below the graph : image

So not sure of the 100% default.

Finally, if I do specify width and height to 100%, it seems to take the full width (without any relation to the number I do specify, may it be 50% or 100%, but take the full width) : image