• Edit
  • Download
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</title>
    7. <script nonce="undefined" src="//www.zingchart.com/scripts/zcDocs.js"></script>
    8. <link href='//www.zingchart.com/css/zcDocs.css' rel='stylesheet' type='text/css'>
    9.  
    10.  
    11. <script nonce="undefined" src="https://cdn.zingchart.com/zingchart.min.js"></script>
    12. <style>
    13. #displayEvents {
    14. word-wrap: break-word;
    15. }
    16. </style>
    17. </head>
    18.  
    19. <body>
    20. <div id='demo-chart'></div>
    21. <button class='btn btn-info' id="demo1">Demo 1</button>
    22. <button class='btn btn-info' id="demo2">Demo 2</button>
    23. <div id="displayEvents">
    24. <p id="output">&nbsp;</p>
    25. </div>
    26. <script>
    27. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    28. var myConfig = {
    29. graphset: [{
    30. type: "area",
    31. title: {
    32. text: 'Download Raw String'
    33. },
    34. plot: {
    35. stacked: true
    36. },
    37. series: [{
    38. values: [35, 42, 67, 89, 25, 34, 67, 85]
    39. },
    40. {
    41. values: [35, 42, 67, 89, 25, 34, 67, 85]
    42. }
    43. ]
    44. }, ]
    45. };
    46.  
    47. zingchart.render({
    48. id: 'demo-chart',
    49. data: myConfig,
    50. height: 400,
    51. width: '100%'
    52. });
    53.  
    54. demo1.addEventListener('click', function() {
    55. var dump = zingchart.exec('demo-chart', 'downloadRAW');
    56. document.getElementById('output').innerHTML = dump;
    57. });
    58. demo2.addEventListener('click', function() {
    59. var dump = zingchart.exec('demo-chart', 'downloadRAW', {
    60. fn: 'test-filename.txt',
    61. callback: function(e) {
    62. console.log(arguments);
    63. document.getElementById('output').innerHTML = JSON.stringify(arguments);
    64. }
    65. });
    66.  
    67. });
    68. </script>
    69. </body>
    70.  
    71. </html>
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</title>
    7. <script src="//www.zingchart.com/scripts/zcDocs.js"></script>
    8. <link href='//www.zingchart.com/css/zcDocs.css' rel='stylesheet' type='text/css'>
    9.  
    10.  
    11. <script src="https://cdn.zingchart.com/zingchart.min.js"></script>
    12. </head>
    13.  
    14. <body>
    15. <div id='demo-chart'></div>
    16. <button class='btn btn-info' id="demo1">Demo 1</button>
    17. <button class='btn btn-info' id="demo2">Demo 2</button>
    18. <div id="displayEvents">
    19. <p id="output">&nbsp;</p>
    20. </div>
    21. </body>
    22.  
    23. </html>
    1. #displayEvents {
    2. word-wrap: break-word;
    3. }
    1. var myConfig = {
    2. graphset: [{
    3. type: "area",
    4. title: {
    5. text: 'Download Raw String'
    6. },
    7. plot: {
    8. stacked: true
    9. },
    10. series: [{
    11. values: [35, 42, 67, 89, 25, 34, 67, 85]
    12. },
    13. {
    14. values: [35, 42, 67, 89, 25, 34, 67, 85]
    15. }
    16. ]
    17. }, ]
    18. };
    19.  
    20. zingchart.render({
    21. id: 'demo-chart',
    22. data: myConfig,
    23. height: 400,
    24. width: '100%'
    25. });
    26.  
    27. demo1.addEventListener('click', function() {
    28. var dump = zingchart.exec('demo-chart', 'downloadRAW');
    29. document.getElementById('output').innerHTML = dump;
    30. });
    31. demo2.addEventListener('click', function() {
    32. var dump = zingchart.exec('demo-chart', 'downloadRAW', {
    33. fn: 'test-filename.txt',
    34. callback: function(e) {
    35. console.log(arguments);
    36. document.getElementById('output').innerHTML = JSON.stringify(arguments);
    37. }
    38. });
    39.  
    40. });