Home › forums › Chart Support › Bar chart auto adjust width height
I have plotted a bar chart. It will have different data based on input.the data size might be 1 or 2 or anything.I want a bar chart to be re-adjusted in terms of width and height dynamically based on data size.can someone help me in this ?
@sravya,
By default, Chart takes the size of its container(if set). So you can just set the width and height of the chart-container in which you are rendering the chart as shown below: <div id="chartContainer" style="height: 300px; width: 100%;">
<div id="chartContainer" style="height: 300px; width: 100%;">
If you like to change the height of the chart keeping the dataPointWidth as constant, please take a look at this JSFiddle.
__ Priyanka M S Team CanvasJS
You must be logged in to reply to this topic.