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