• Edit
  • Download
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingGrid: Blank Grid</title>
    7. <script nonce="undefined" src="https://cdn.zingchart.com/zingchart.min.js"></script>
    8. <style>
    9. html,
    10. body {
    11. height: 100%;
    12. width: 100%;
    13. margin: 0;
    14. padding: 0;
    15. }
    16.  
    17. .chart--container {
    18. height: 100%;
    19. width: 100%;
    20. min-height: 150px;
    21. }
    22.  
    23. .zc-ref {
    24. display: none;
    25. }
    26. </style>
    27. </head>
    28.  
    29. <body>
    30. <!-- CHART CONTAINER -->
    31. <div id="myChart" class="chart--container">
    32. <a class="zc-ref" href="https://www.zingchart.com">Powered by ZingChart</a>
    33. </div>
    34. <script>
    35. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"]; // window:load event for Javascript to run after HTML
    36. // because this Javascript is injected into the document head
    37. window.addEventListener('load', () => {
    38. // Javascript code to execute after DOM content
    39. const myConfig = {
    40. type: 'null',
    41. noData: {
    42. text: 'Fetching remote configuration...',
    43. backgroundColor: '#eeeeee',
    44. fontSize: 18
    45. }
    46. };
    47.  
    48. // fetch the remote json
    49. fetch('https://cdn.zingchart.com/datasets/remote-config.json')
    50. .then(res => {
    51. return res.json();
    52. })
    53. .then(results => {
    54. // use setdata to instantiate the chart
    55. zingchart.exec('myChart', 'setdata', {
    56. data: results
    57. });
    58. })
    59. .catch(e => {
    60. // let the user know there was an error
    61. zingchart.exec('myChart', 'update', {
    62. data: {
    63. noData: {
    64. text: 'Error Fetching remote data, please refresh page.'
    65. }
    66. }
    67. });
    68. });
    69.  
    70. // render chart with width and height to
    71. // fill the parent container CSS dimensions
    72. zingchart.render({
    73. id: 'myChart',
    74. data: myConfig,
    75. height: '100%',
    76. width: '100%'
    77. });
    78. });
    79. </script>
    80. </body>
    81.  
    82. </html>
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingGrid: Blank Grid</title>
    7. <script src="https://cdn.zingchart.com/zingchart.min.js"></script>
    8. </head>
    9.  
    10. <body>
    11. <!-- CHART CONTAINER -->
    12. <div id="myChart" class="chart--container">
    13. <a class="zc-ref" href="https://www.zingchart.com">Powered by ZingChart</a>
    14. </div>
    15. </body>
    16.  
    17. </html>
    1. html,
    2. body {
    3. height: 100%;
    4. width: 100%;
    5. margin: 0;
    6. padding: 0;
    7. }
    8.  
    9. .chart--container {
    10. height: 100%;
    11. width: 100%;
    12. min-height: 150px;
    13. }
    14.  
    15. .zc-ref {
    16. display: none;
    17. }
    1. // window:load event for Javascript to run after HTML
    2. // because this Javascript is injected into the document head
    3. window.addEventListener('load', () => {
    4. // Javascript code to execute after DOM content
    5. const myConfig = {
    6. type: 'null',
    7. noData: {
    8. text: 'Fetching remote configuration...',
    9. backgroundColor: '#eeeeee',
    10. fontSize: 18
    11. }
    12. };
    13.  
    14. // fetch the remote json
    15. fetch('https://cdn.zingchart.com/datasets/remote-config.json')
    16. .then(res => {
    17. return res.json();
    18. })
    19. .then(results => {
    20. // use setdata to instantiate the chart
    21. zingchart.exec('myChart', 'setdata', {
    22. data: results
    23. });
    24. })
    25. .catch(e => {
    26. // let the user know there was an error
    27. zingchart.exec('myChart', 'update', {
    28. data: {
    29. noData: {
    30. text: 'Error Fetching remote data, please refresh page.'
    31. }
    32. }
    33. });
    34. });
    35.  
    36. // render chart with width and height to
    37. // fill the parent container CSS dimensions
    38. zingchart.render({
    39. id: 'myChart',
    40. data: myConfig,
    41. height: '100%',
    42. width: '100%'
    43. });
    44. });