• 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="https://cdn.zingchart.com/zingchart.min.js"></script>
    8. <style>
    9. html,
    10. body {
    11. margin: 0;
    12. padding: 0;
    13. width: 100%;
    14. height: 100%;
    15. }
    16.  
    17. .chart--container {
    18. min-height: 150px;
    19. width: 100%;
    20. height: 100%;
    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. let chartConfig = {
    40. type: 'flame',
    41. plotarea: {
    42. margin: '10 10 10 10'
    43. },
    44. scaleX: {},
    45. tooltip: {
    46. text: "<span style='font-size:19px'>%data-vbtext</span><br>Global value: %data-value (%data-percent%)<br>Local value: %data-local-value (%data-local-percent%)"
    47. },
    48. options: {
    49. palette: ['#ff9900']
    50. },
    51. series: []
    52. };
    53. fetch('/api/file/X2GRC1WK/m9JaezkmToq9YsTjHjd8_stacks.json')
    54. .then(res => res.json())
    55. .then(data => {
    56. // assign series data
    57. chartConfig.series = data;
    58. // render chart
    59. zingchart.render({
    60. id: 'myChart',
    61. width: '100%',
    62. height: 450,
    63. output: 'svg',
    64. data: chartConfig
    65. });
    66. }).catch(e => {
    67. console.error('Error fetching data for flame chart');
    68. });
    69. });
    70. </script>
    71. </body>
    72.  
    73. </html>
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</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. margin: 0;
    4. padding: 0;
    5. width: 100%;
    6. height: 100%;
    7. }
    8.  
    9. .chart--container {
    10. min-height: 150px;
    11. width: 100%;
    12. height: 100%;
    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. let chartConfig = {
    6. type: 'flame',
    7. plotarea: {
    8. margin: '10 10 10 10'
    9. },
    10. scaleX: {},
    11. tooltip: {
    12. text: "<span style='font-size:19px'>%data-vbtext</span><br>Global value: %data-value (%data-percent%)<br>Local value: %data-local-value (%data-local-percent%)"
    13. },
    14. options: {
    15. palette: ['#ff9900']
    16. },
    17. series: []
    18. };
    19. fetch('/api/file/X2GRC1WK/m9JaezkmToq9YsTjHjd8_stacks.json')
    20. .then(res => res.json())
    21. .then(data => {
    22. // assign series data
    23. chartConfig.series = data;
    24. // render chart
    25. zingchart.render({
    26. id: 'myChart',
    27. width: '100%',
    28. height: 450,
    29. output: 'svg',
    30. data: chartConfig
    31. });
    32. }).catch(e => {
    33. console.error('Error fetching data for flame chart');
    34. });
    35. });