Next
Prev
Column Chart
Line Chart

The chart style and the chart data (dataset) can be changed dynamically (e.g. change the chart type by clicking the button) by calling setLayout() or setData().

This sample is to show how to change the chart type when users click the button. If users click the button, the JavaScript function which creates the appropriate chart type is called.

<div class="button" onclick="changeColumn()">Column Chart</div>
<div class="button" onclick="changeLine()">Line Chart</div>
					
function changeColumn()
{
  document.getElementById("chart1").setLayoutURL(layoutURL);
}

function changeLine()
{
  document.getElementById("chart1").setLayout(layoutStr);
}

© 2017 KoolChart. All rights reserved.