• 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.  
    40. // full ZingChart schema can be found here:
    41. // https://www.zingchart.com/docs/api/json-configuration/
    42. let chartConfig = {
    43. theme: 'light',
    44. type: 'line',
    45. globals: {
    46. fontSize: '14px'
    47. },
    48. title: {
    49. text: 'Light Theme',
    50. fontSize: '24px'
    51. // will force margin and padding on title
    52. // adjustLayout: true
    53. },
    54. legend: {
    55. cursor: 'hand',
    56. draggable: true
    57. },
    58. // plot represents general series, or plots, styling
    59. plot: {
    60. // hoverstate
    61. tooltip: {
    62. // % symbol represents a token to insert a value. Full list here:
    63. // https://www.zingchart.com/docs/tutorials/chart-elements/zingchart-tokens/
    64. text: '%plot-text %kl was %v (&deg;F)',
    65. padding: '10 15',
    66. borderRadius: '3px',
    67. // htmlMode renders text attribute as html so
    68. // &deg; is rendered
    69. htmlMode: true
    70. },
    71. // animation docs here:
    72. // https://www.zingchart.com/docs/tutorials/design-and-styling/chart-animation/#animation__effect
    73. animation: {
    74. effect: 'ANIMATION_SLIDE_TOP',
    75. method: 'ANIMATION_BOUNCE_EASE_OUT',
    76. sequence: 'ANIMATION_NO_SEQUENCE',
    77. speed: 975
    78. },
    79. lineWidth: '3px',
    80. // line node styling
    81. marker: {
    82. borderWidth: '0px',
    83. size: '6px'
    84. }
    85. },
    86. scaleX: {
    87. // set scale label
    88. label: {
    89. text: 'Days'
    90. },
    91. // convert text on scale indices
    92. labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
    93. },
    94. scaleY: {
    95. // scale label with unicode character
    96. label: {
    97. text: 'Temperature (°F)'
    98. }
    99. },
    100. crosshairX: {
    101. plotLabel: {
    102. padding: '10px 15px',
    103. borderRadius: '3px'
    104. }
    105. },
    106. series: [{
    107. text: 'Week 1',
    108. // plot values
    109. values: [23, 20, 27, 29, 25, 17, 15],
    110. },
    111. {
    112. text: 'Week 2',
    113. // plot values
    114. values: [35, 42, null, 49, 35, 47, 35],
    115. }
    116. ]
    117. };
    118.  
    119. // render chart with width and height to
    120. // fill the parent container CSS dimensions
    121. zingchart.render({
    122. id: 'myChart',
    123. data: chartConfig,
    124. height: '100%',
    125. width: '100%'
    126. });
    127. });
    128. </script>
    129. </body>
    130.  
    131. </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.  
    6. // full ZingChart schema can be found here:
    7. // https://www.zingchart.com/docs/api/json-configuration/
    8. let chartConfig = {
    9. theme: 'light',
    10. type: 'line',
    11. globals: {
    12. fontSize: '14px'
    13. },
    14. title: {
    15. text: 'Light Theme',
    16. fontSize: '24px'
    17. // will force margin and padding on title
    18. // adjustLayout: true
    19. },
    20. legend: {
    21. cursor: 'hand',
    22. draggable: true
    23. },
    24. // plot represents general series, or plots, styling
    25. plot: {
    26. // hoverstate
    27. tooltip: {
    28. // % symbol represents a token to insert a value. Full list here:
    29. // https://www.zingchart.com/docs/tutorials/chart-elements/zingchart-tokens/
    30. text: '%plot-text %kl was %v (&deg;F)',
    31. padding: '10 15',
    32. borderRadius: '3px',
    33. // htmlMode renders text attribute as html so
    34. // &deg; is rendered
    35. htmlMode: true
    36. },
    37. // animation docs here:
    38. // https://www.zingchart.com/docs/tutorials/design-and-styling/chart-animation/#animation__effect
    39. animation: {
    40. effect: 'ANIMATION_SLIDE_TOP',
    41. method: 'ANIMATION_BOUNCE_EASE_OUT',
    42. sequence: 'ANIMATION_NO_SEQUENCE',
    43. speed: 975
    44. },
    45. lineWidth: '3px',
    46. // line node styling
    47. marker: {
    48. borderWidth: '0px',
    49. size: '6px'
    50. }
    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. crosshairX: {
    67. plotLabel: {
    68. padding: '10px 15px',
    69. borderRadius: '3px'
    70. }
    71. },
    72. series: [{
    73. text: 'Week 1',
    74. // plot values
    75. values: [23, 20, 27, 29, 25, 17, 15],
    76. },
    77. {
    78. text: 'Week 2',
    79. // plot values
    80. values: [35, 42, null, 49, 35, 47, 35],
    81. }
    82. ]
    83. };
    84.  
    85. // render chart with width and height to
    86. // fill the parent container CSS dimensions
    87. zingchart.render({
    88. id: 'myChart',
    89. data: chartConfig,
    90. height: '100%',
    91. width: '100%'
    92. });
    93. });