• Edit
  • Download
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</title>
    7.  
    8. <script nonce="undefined" src="https://cdn.zingchart.com/zingchart.min.js"></script>
    9. <style>
    10. html,
    11. body {
    12. height: 100%;
    13. width: 100%;
    14. }
    15. </style>
    16. </head>
    17.  
    18. <body>
    19. <div id='myChart'></div>
    20. <script>
    21. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    22. let chartConfig = {
    23. type: 'gauge',
    24. title: {
    25. text: 'Fetching CSV Data...'
    26. },
    27. plotarea: {
    28. marginTop: 50,
    29. },
    30. legend: {
    31. toggleAction: 'remove',
    32. },
    33. series: []
    34. };
    35.  
    36. zingchart.render({
    37. id: 'myChart',
    38. data: chartConfig,
    39. height: 450,
    40. width: "100%"
    41. });
    42.  
    43. function reqListener(e) {
    44. console.log('----String text----\n\n', this.responseText, this);
    45. var arrayOfRows = this.responseText.split('\n');
    46. let seriesArray = [];
    47. let title = arrayOfRows[1];
    48.  
    49. // initialize 8 date ratio series objects
    50. chartConfig.series[0] = {
    51. values: [Number(arrayOfRows[3])]
    52. };
    53.  
    54. chartConfig.title.text = title;
    55.  
    56. // load data into chart
    57. zingchart.exec('myChart', 'setdata', {
    58. data: chartConfig
    59. });
    60. }
    61.  
    62. setTimeout(function() {
    63. // request data from url
    64. var oReq = new XMLHttpRequest();
    65. oReq.addEventListener('load', reqListener);
    66. oReq.open('GET', 'https://cdn.zingchart.com/datasets/gauge-chart.csv');
    67. oReq.send();
    68. }, 1000);
    69. </script>
    70. </body>
    71.  
    72. </html>
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</title>
    7.  
    8. <script src="https://cdn.zingchart.com/zingchart.min.js"></script>
    9. </head>
    10.  
    11. <body>
    12. <div id='myChart'></div>
    13. </body>
    14.  
    15. </html>
    1. html,
    2. body {
    3. height: 100%;
    4. width: 100%;
    5. }
    1. let chartConfig = {
    2. type: 'gauge',
    3. title: {
    4. text: 'Fetching CSV Data...'
    5. },
    6. plotarea: {
    7. marginTop: 50,
    8. },
    9. legend: {
    10. toggleAction: 'remove',
    11. },
    12. series: []
    13. };
    14.  
    15. zingchart.render({
    16. id: 'myChart',
    17. data: chartConfig,
    18. height: 450,
    19. width: "100%"
    20. });
    21.  
    22. function reqListener(e) {
    23. console.log('----String text----\n\n', this.responseText, this);
    24. var arrayOfRows = this.responseText.split('\n');
    25. let seriesArray = [];
    26. let title = arrayOfRows[1];
    27.  
    28. // initialize 8 date ratio series objects
    29. chartConfig.series[0] = {
    30. values: [Number(arrayOfRows[3])]
    31. };
    32.  
    33. chartConfig.title.text = title;
    34.  
    35. // load data into chart
    36. zingchart.exec('myChart', 'setdata', {
    37. data: chartConfig
    38. });
    39. }
    40.  
    41. setTimeout(function() {
    42. // request data from url
    43. var oReq = new XMLHttpRequest();
    44. oReq.addEventListener('load', reqListener);
    45. oReq.open('GET', 'https://cdn.zingchart.com/datasets/gauge-chart.csv');
    46. oReq.send();
    47. }, 1000);