<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>ZingSoft Demo</title> <script nonce="undefined" src="https://cdn.zingchart.com/zingchart.min.js"></script> <style> html, body { height: 100%; width: 100%; margin: 0; padding: 0; } #myChart { height: 100%; width: 100%; min-height: 150px; } .zc-ref { display: none; } #myChart button { position: absolute; top: 15px; left: 10px; z-index: 1000; } </style> </head> <body> <div id="myChart"> <a class="zc-ref" href="https://www.zingchart.com">Powered by ZingChart</a> <button onclick="window.parent.location.reload()">Reload Data</button> </div> <script> ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"]; // make the AJAX request var oReq = new XMLHttpRequest(); oReq.addEventListener("load", renderFirstPlotInChart); oReq.open("GET", "https://zingchart-rest-api.glitch.me/api/data/getAllPlots/seriesObject"); oReq.send(); // define chart JSON var myConfig = { type: 'bar', title: { text: 'Rendering Multiple Plots With All Server Side Parsing', mediaRules: [{ maxWidth: 500, fontSize: 15 }] }, plot: { // barWidth: 25, // this will prevent users from noticing the barwidth changing animation: { effect: 3, method: 2, sequence: 2, }, // add animation to make the chart look alive }, legend: {}, scaleY: { values: '0:300:100' // this will prevent users from noticing the scale repaint }, series: [] }; /* * callback for GET request is when we will render the chart */ function renderFirstPlotInChart() { console.log(this.responseText) myConfig.series = JSON.parse(this.responseText); zingchart.render({ id: 'myChart', data: myConfig, height: '100%', width: '100%' }); } </script> </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>ZingSoft Demo</title> <script src="https://cdn.zingchart.com/zingchart.min.js"></script> </head> <body> <div id="myChart"> <a class="zc-ref" href="https://www.zingchart.com">Powered by ZingChart</a> <button onclick="window.parent.location.reload()">Reload Data</button> </div> </body> </html>
html, body { height: 100%; width: 100%; margin: 0; padding: 0; } #myChart { height: 100%; width: 100%; min-height: 150px; } .zc-ref { display: none; } #myChart button { position: absolute; top: 15px; left: 10px; z-index: 1000; }
// make the AJAX request var oReq = new XMLHttpRequest(); oReq.addEventListener("load", renderFirstPlotInChart); oReq.open("GET", "https://zingchart-rest-api.glitch.me/api/data/getAllPlots/seriesObject"); oReq.send(); // define chart JSON var myConfig = { type: 'bar', title: { text: 'Rendering Multiple Plots With All Server Side Parsing', mediaRules: [{ maxWidth: 500, fontSize: 15 }] }, plot: { // barWidth: 25, // this will prevent users from noticing the barwidth changing animation: { effect: 3, method: 2, sequence: 2, }, // add animation to make the chart look alive }, legend: {}, scaleY: { values: '0:300:100' // this will prevent users from noticing the scale repaint }, series: [] }; /* * callback for GET request is when we will render the chart */ function renderFirstPlotInChart() { console.log(this.responseText) myConfig.series = JSON.parse(this.responseText); zingchart.render({ id: 'myChart', data: myConfig, height: '100%', width: '100%' }); }