jquery - How to draw a two y axis line chart in google charts -
i'm assigned create google chart where, have implement 2 y axis line chart. although, google has tutorial single y axis charts. how can implement 2 y axis line chart using google chart. i'm using ajax response relevant data! if 1 can me tutorial or , example code, grateful.
i've created sample graph idea of i'm trying do.
thank you.
function drawvisualization() { // create , populate data table. var data = google.visualization.arraytodatatable([ ['x', 'data 1', 'data 2', 'data 3'], ['a', 1, 1, 0.5], ['b', 2, 0.5, 1], ['c', 4, 1, 0.5], ['d', 8, 0.5, 1], ['e', 7, 1, 0.5], ['f', 7, 0.5, 1], ['g', 8, 1, 0.5], ['h', 4, 0.5, 1], ['i', 2, 1, 0.5], ['j', 3.5, 0.5, 1], ['k', 3, 1, 0.5], ['l', 3.5, 0.5, 1], ['m', 1, 1, 0.5], ['n', 1, 0.5, 1] ]); // create , draw visualization. new google.visualization.linechart(document.getelementbyid('visualization')). draw(data, {vaxes:[ {title: 'title 1', titletextstyle: {color: '#ff0000'}, maxvalue: 10}, // left axis {title: 'title 2', titletextstyle: {color: '#ff0000'}, maxvalue: 20} // right axis ],series:[ {targetaxisindex:1}, {targetaxisindex:0} ],} ); }
Comments
Post a Comment