• 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. type: 'bar',
    44. globals: {
    45. fontSize: '14px'
    46. },
    47. title: {
    48. text: 'Show All Axis Labels',
    49. fontSize: '24px'
    50. },
    51. legend: {
    52. draggable: true
    53. },
    54. // plot represents general series, or plots, styling
    55. plot: {
    56. // hoverstate
    57. tooltip: {
    58. // % symbol represents a token to insert a value. Full list here:
    59. // https://www.zingchart.com/docs/tutorials/chart-elements/zingchart-tokens/
    60. text: '%plot-text %kl was %v (&deg;F)',
    61. borderRadius: '3px',
    62. // htmlMode renders text attribute as html so
    63. // &deg; is rendered
    64. htmlMode: true
    65. },
    66. valueBox: {
    67. color: '#fff',
    68. placement: 'top-in'
    69. },
    70. // animation docs here:
    71. // https://www.zingchart.com/docs/tutorials/design-and-styling/chart-animation/#animation__effect
    72. animation: {
    73. effect: 'ANIMATION_EXPAND_BOTTOM',
    74. method: 'ANIMATION_STRONG_EASE_OUT',
    75. sequence: 'ANIMATION_BY_NODE',
    76. speed: 275
    77. }
    78. },
    79. scaleX: {
    80. itemsOverlap: true,
    81. // set scale label
    82. label: {
    83. text: 'Days'
    84. },
    85. // convert text on scale indices
    86. labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
    87. },
    88. scaleY: {
    89. // scale label with unicode character
    90. label: {
    91. text: 'Temperature (°F)'
    92. }
    93. },
    94. // plot values
    95. series: [{
    96. text: 'Week 1',
    97. values: [23, 20, 27, 29, 25, 17, 15],
    98. backgroundColor: '#64b5f6'
    99. },
    100. {
    101. text: 'Week 2',
    102. values: [35, 42, 33, 49, 35, 47, 35],
    103. backgroundColor: '#ffb74d'
    104. }
    105. ]
    106. };
    107.  
    108. // render chart
    109. zingchart.render({
    110. id: 'myChart',
    111. data: chartConfig,
    112. height: '500px',
    113. width: '500px',
    114. });
    115. });
    116. </script>
    117. </body>
    118.  
    119. </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. type: 'bar',
    10. globals: {
    11. fontSize: '14px'
    12. },
    13. title: {
    14. text: 'Show All Axis Labels',
    15. fontSize: '24px'
    16. },
    17. legend: {
    18. draggable: true
    19. },
    20. // plot represents general series, or plots, styling
    21. plot: {
    22. // hoverstate
    23. tooltip: {
    24. // % symbol represents a token to insert a value. Full list here:
    25. // https://www.zingchart.com/docs/tutorials/chart-elements/zingchart-tokens/
    26. text: '%plot-text %kl was %v (&deg;F)',
    27. borderRadius: '3px',
    28. // htmlMode renders text attribute as html so
    29. // &deg; is rendered
    30. htmlMode: true
    31. },
    32. valueBox: {
    33. color: '#fff',
    34. placement: 'top-in'
    35. },
    36. // animation docs here:
    37. // https://www.zingchart.com/docs/tutorials/design-and-styling/chart-animation/#animation__effect
    38. animation: {
    39. effect: 'ANIMATION_EXPAND_BOTTOM',
    40. method: 'ANIMATION_STRONG_EASE_OUT',
    41. sequence: 'ANIMATION_BY_NODE',
    42. speed: 275
    43. }
    44. },
    45. scaleX: {
    46. itemsOverlap: true,
    47. // set scale label
    48. label: {
    49. text: 'Days'
    50. },
    51. // convert text on scale indices
    52. labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
    53. },
    54. scaleY: {
    55. // scale label with unicode character
    56. label: {
    57. text: 'Temperature (°F)'
    58. }
    59. },
    60. // plot values
    61. series: [{
    62. text: 'Week 1',
    63. values: [23, 20, 27, 29, 25, 17, 15],
    64. backgroundColor: '#64b5f6'
    65. },
    66. {
    67. text: 'Week 2',
    68. values: [35, 42, 33, 49, 35, 47, 35],
    69. backgroundColor: '#ffb74d'
    70. }
    71. ]
    72. };
    73.  
    74. // render chart
    75. zingchart.render({
    76. id: 'myChart',
    77. data: chartConfig,
    78. height: '500px',
    79. width: '500px',
    80. });
    81. });