I am using jqPlot to render a graph on a page.
I am following this link. http://www.jqplot.com/tests/bar-charts.php
The data point that I give to the graph are dynamic. so sometime the size of the graph is different. Is there a way/or able to set property for jqPlot?
To be precise, the question is how to set the height and width of graph so that every time I get new data the size of the graph and size of labels are always same. An example with jsFiddle would help everyone including myself.
You can fix the size by configuring the height
and width
:
$.jqplot('chartdiv', [data],
{
height: 400,
width: 400,
...
You also need to give the height
and width
to the target div:
<div id="chartdiv" style="height:500px; width:500px;"></div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With