• 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', function() {
    38. // Javascript code to execute after DOM content
    39.  
    40. // full ZingChart schema can be found here:
    41. // https://www.zingchart.com/docs/api/json-configuration/
    42. const myConfig = {
    43. type: 'bar',
    44. title: {
    45. text: 'Hello World Demo',
    46. fontSize: 24,
    47. color: '#5d7d9a'
    48. },
    49. legend: {
    50. draggable: true,
    51. },
    52. scaleX: {
    53. // set scale label
    54. label: {
    55. text: 'Days'
    56. },
    57. // convert text on scale indices
    58. labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
    59. },
    60. scaleY: {
    61. // scale label with unicode character
    62. label: {
    63. text: 'Temperature (°F)'
    64. }
    65. },
    66. plot: {
    67. // animation docs here:
    68. // https://www.zingchart.com/docs/tutorials/design-and-styling/chart-animation/#animation__effect
    69. animation: {
    70. effect: 'ANIMATION_EXPAND_BOTTOM',
    71. method: 'ANIMATION_STRONG_EASE_OUT',
    72. sequence: 'ANIMATION_BY_NODE',
    73. speed: 275,
    74. }
    75. },
    76. series: [{
    77. // plot 1 values, linear data
    78. values: [23, 20, 27, 29, 25, 17, 15],
    79. text: 'Week 1',
    80. backgroundColor: '#4d80a6'
    81. },
    82. {
    83. // plot 2 values, linear data
    84. values: [35, 42, 33, 49, 35, 47, 35],
    85. text: 'Week 2',
    86. backgroundColor: '#70cfeb'
    87. },
    88. {
    89. // plot 2 values, linear data
    90. values: [15, 22, 13, 33, 44, 27, 31],
    91. text: 'Week 3',
    92. backgroundColor: '#8ee9de'
    93. }
    94. ]
    95. };
    96.  
    97. // render chart with width and height to
    98. // fill the parent container CSS dimensions
    99. zingchart.render({
    100. id: 'myChart',
    101. data: myConfig,
    102. height: '100%',
    103. width: '100%'
    104. });
    105. });
    106. </script>
    107. </body>
    108.  
    109. </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', function() {
    4. // Javascript code to execute after DOM content
    5.  
    6. // full ZingChart schema can be found here:
    7. // https://www.zingchart.com/docs/api/json-configuration/
    8. const myConfig = {
    9. type: 'bar',
    10. title: {
    11. text: 'Hello World Demo',
    12. fontSize: 24,
    13. color: '#5d7d9a'
    14. },
    15. legend: {
    16. draggable: true,
    17. },
    18. scaleX: {
    19. // set scale label
    20. label: {
    21. text: 'Days'
    22. },
    23. // convert text on scale indices
    24. labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
    25. },
    26. scaleY: {
    27. // scale label with unicode character
    28. label: {
    29. text: 'Temperature (°F)'
    30. }
    31. },
    32. plot: {
    33. // animation docs here:
    34. // https://www.zingchart.com/docs/tutorials/design-and-styling/chart-animation/#animation__effect
    35. animation: {
    36. effect: 'ANIMATION_EXPAND_BOTTOM',
    37. method: 'ANIMATION_STRONG_EASE_OUT',
    38. sequence: 'ANIMATION_BY_NODE',
    39. speed: 275,
    40. }
    41. },
    42. series: [{
    43. // plot 1 values, linear data
    44. values: [23, 20, 27, 29, 25, 17, 15],
    45. text: 'Week 1',
    46. backgroundColor: '#4d80a6'
    47. },
    48. {
    49. // plot 2 values, linear data
    50. values: [35, 42, 33, 49, 35, 47, 35],
    51. text: 'Week 2',
    52. backgroundColor: '#70cfeb'
    53. },
    54. {
    55. // plot 2 values, linear data
    56. values: [15, 22, 13, 33, 44, 27, 31],
    57. text: 'Week 3',
    58. backgroundColor: '#8ee9de'
    59. }
    60. ]
    61. };
    62.  
    63. // render chart with width and height to
    64. // fill the parent container CSS dimensions
    65. zingchart.render({
    66. id: 'myChart',
    67. data: myConfig,
    68. height: '100%',
    69. width: '100%'
    70. });
    71. });