Rank: Newbie
Groups: Registered
Joined: 9/4/2014(UTC) Posts: 6
Thanks: 0 times Was thanked: 0 time(s) in 0 post(s)
|
Good afternoon... I'm trying to export 2 charts at the same time llike in the code below but I'm only getting the one from the last call made. How can I export several charts at the same time? obrigado Code: $(document).ready(function () { $('#jqChart1').jqChart({ axes: [ { type: 'category', location: 'bottom', }, { type: 'linear', location: 'left', } ], series: [ { type: 'line', strokeStyle: '#f00', data: [["1", 62], ["B", 60], ["C", 68], ["D", 58], ["E", 52], ["F", 60], ["G", 48]], } ] }); $('#jqChart2').jqChart({ axes: [ { type: 'category', location: 'bottom', }, { type: 'linear', location: 'left', } ], series: [ { type: 'line', strokeStyle: '#0f0', data: [["1", 62], ["B", 60], ["C", 68], ["D", 58], ["E", 52], ["F", 60], ["G", 48]], } ] }); $("#btnExport").click(function (){ $('#jqChart1').jqChart('exportToImage', { fileName: "chart1.png", type: 'image/png' });
$('#jqChart2').jqChart('exportToImage', { fileName: "chart2.png", type: 'image/png' }); });
Code: <div id="jqChart1" style="width: 500px; height: 300px;"></div> <div id="jqChart2" style="width: 500px; height: 300px;"></div> <button id="btnExport">Export</button>
|