• 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. scaleX: {
    52. // set scale label
    53. label: {
    54. text: 'Days'
    55. },
    56. // convert text on scale indices
    57. labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
    58. },
    59. scaleY: {
    60. // scale label with unicode character
    61. label: {
    62. text: 'Temperature (°F)'
    63. }
    64. },
    65. plot: {
    66. // animation docs here:
    67. // https://www.zingchart.com/docs/tutorials/design-and-styling/chart-animation/#animation__effect
    68. animation: {
    69. effect: 'ANIMATION_EXPAND_BOTTOM',
    70. method: 'ANIMATION_STRONG_EASE_OUT',
    71. sequence: 'ANIMATION_BY_NODE',
    72. speed: 275,
    73. }
    74. },
    75. series: [{
    76. // plot 1 values, linear data
    77. values: [23, 20, 27, 29, 25, 17, 15],
    78. text: 'Week 1',
    79. },
    80. {
    81. // plot 2 values, linear data
    82. values: [35, 42, 33, 49, 35, 47, 35],
    83. text: 'Week 2'
    84. },
    85. {
    86. // plot 2 values, linear data
    87. values: [15, 22, 13, 33, 44, 27, 31],
    88. text: 'Week 3'
    89. }
    90. ]
    91. };
    92.  
    93. // render chart with width and height to
    94. // fill the parent container CSS dimensions
    95. zingchart.render({
    96. id: 'myChart',
    97. data: myConfig,
    98. height: '100%',
    99. width: '100%'
    100. });
    101. });
    102. </script>
    103. </body>
    104.  
    105. </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. scaleX: {
    18. // set scale label
    19. label: {
    20. text: 'Days'
    21. },
    22. // convert text on scale indices
    23. labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
    24. },
    25. scaleY: {
    26. // scale label with unicode character
    27. label: {
    28. text: 'Temperature (°F)'
    29. }
    30. },
    31. plot: {
    32. // animation docs here:
    33. // https://www.zingchart.com/docs/tutorials/design-and-styling/chart-animation/#animation__effect
    34. animation: {
    35. effect: 'ANIMATION_EXPAND_BOTTOM',
    36. method: 'ANIMATION_STRONG_EASE_OUT',
    37. sequence: 'ANIMATION_BY_NODE',
    38. speed: 275,
    39. }
    40. },
    41. series: [{
    42. // plot 1 values, linear data
    43. values: [23, 20, 27, 29, 25, 17, 15],
    44. text: 'Week 1',
    45. },
    46. {
    47. // plot 2 values, linear data
    48. values: [35, 42, 33, 49, 35, 47, 35],
    49. text: 'Week 2'
    50. },
    51. {
    52. // plot 2 values, linear data
    53. values: [15, 22, 13, 33, 44, 27, 31],
    54. text: 'Week 3'
    55. }
    56. ]
    57. };
    58.  
    59. // render chart with width and height to
    60. // fill the parent container CSS dimensions
    61. zingchart.render({
    62. id: 'myChart',
    63. data: myConfig,
    64. height: '100%',
    65. width: '100%'
    66. });
    67. });