• 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. #myChart {
    13. height: 100%;
    14. width: 100%;
    15. }
    16. </style>
    17. </head>
    18.  
    19. <body>
    20. <div id='myChart'></div>
    21. <button id="export">Attempt Export (will return -1)</button>
    22. <script>
    23. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    24. var myConfig = {
    25. type: 'bar',
    26. title: {
    27. text: 'SVG/VML render'
    28. },
    29. series: [{
    30. values: [3, 5, 8, 4, 2, 6]
    31. }]
    32. };
    33.  
    34. zingchart.render({
    35. id: 'myChart',
    36. data: myConfig,
    37. height: "100%",
    38. width: "100%"
    39. });
    40.  
    41. document.getElementById('export').addEventListener('click', function() {
    42. var sImageData = zingchart.exec('myChart', 'getimagedata', {
    43. format: 'png'
    44. });
    45. alert(sImageData);
    46. })
    47. </script>
    48. </body>
    49.  
    50. </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. <button id="export">Attempt Export (will return -1)</button>
    14. </body>
    15.  
    16. </html>
    1. html,
    2. body,
    3. #myChart {
    4. height: 100%;
    5. width: 100%;
    6. }
    1. var myConfig = {
    2. type: 'bar',
    3. title: {
    4. text: 'SVG/VML render'
    5. },
    6. series: [{
    7. values: [3, 5, 8, 4, 2, 6]
    8. }]
    9. };
    10.  
    11. zingchart.render({
    12. id: 'myChart',
    13. data: myConfig,
    14. height: "100%",
    15. width: "100%"
    16. });
    17.  
    18. document.getElementById('export').addEventListener('click', function() {
    19. var sImageData = zingchart.exec('myChart', 'getimagedata', {
    20. format: 'png'
    21. });
    22. alert(sImageData);
    23. })