• 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. <!-- IMPORT Javascript variable -->
    9. <script nonce="undefined" src="https://cdn.zingchart.com/themes/vividTheme.js"></script>
    10. <style>
    11. html,
    12. body {
    13. margin: 0;
    14. padding: 0;
    15. width: 100%;
    16. height: 100%;
    17. }
    18.  
    19. .chart--container {
    20. min-height: 150px;
    21. width: 100%;
    22. height: 100%;
    23. }
    24.  
    25. .zc-ref {
    26. display: none;
    27. }
    28. </style>
    29. </head>
    30.  
    31. <body>
    32. <!-- CHART CONTAINER -->
    33. <div id="myChart" class="chart--container">
    34. <a class="zc-ref" href="https://www.zingchart.com/">Powered by ZingChart</a>
    35. </div>
    36. <script>
    37. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"]; // window:load event for Javascript to run after HTML
    38. // because this Javascript is injected into the document head
    39. window.addEventListener('load', () => {
    40. // Javascript code to execute after DOM content
    41.  
    42. // full ZingChart schema can be found here:
    43. // https://www.zingchart.com/docs/api/json-configuration/
    44. let chartConfig = {
    45. type: 'bar',
    46. title: {
    47. text: 'A Simple Bar Chart',
    48. fontSize: '24px'
    49. },
    50. legend: {},
    51. // plot represents general series, or plots, styling
    52. plot: {
    53. // animation docs here:
    54. // https://www.zingchart.com/docs/tutorials/design-and-styling/chart-animation/#animation__effect
    55. animation: {
    56. effect: 'ANIMATION_EXPAND_BOTTOM',
    57. method: 'ANIMATION_STRONG_EASE_OUT',
    58. sequence: 'ANIMATION_BY_NODE',
    59. speed: 275
    60. }
    61. },
    62. scaleX: {
    63. // set scale label
    64. label: {
    65. text: 'Days'
    66. },
    67. // convert text on scale indices
    68. labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
    69. },
    70. scaleY: {
    71. // scale label with unicode character
    72. label: {
    73. text: 'Temperature (°F)'
    74. }
    75. },
    76. // plot values
    77. series: [{
    78. text: 'Week 1',
    79. values: [23, 20, 27, 29, 25, 17, 15],
    80. },
    81. {
    82. text: 'Week 2',
    83. values: [35, 42, 33, 49, 35, 47, 35],
    84. }
    85. ]
    86. };
    87.  
    88. // render chart
    89. zingchart.render({
    90. id: 'myChart',
    91. data: chartConfig,
    92. height: '100%',
    93. width: '100%',
    94. // variable "vividTheme" is pulled in script tag. Check HTML
    95. defaults: vividTheme
    96. });
    97. });
    98. </script>
    99. </body>
    100.  
    101. </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. <!-- IMPORT Javascript variable -->
    9. <script src="https://cdn.zingchart.com/themes/vividTheme.js"></script>
    10. </head>
    11.  
    12. <body>
    13. <!-- CHART CONTAINER -->
    14. <div id="myChart" class="chart--container">
    15. <a class="zc-ref" href="https://www.zingchart.com/">Powered by ZingChart</a>
    16. </div>
    17. </body>
    18.  
    19. </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. title: {
    11. text: 'A Simple Bar Chart',
    12. fontSize: '24px'
    13. },
    14. legend: {},
    15. // plot represents general series, or plots, styling
    16. plot: {
    17. // animation docs here:
    18. // https://www.zingchart.com/docs/tutorials/design-and-styling/chart-animation/#animation__effect
    19. animation: {
    20. effect: 'ANIMATION_EXPAND_BOTTOM',
    21. method: 'ANIMATION_STRONG_EASE_OUT',
    22. sequence: 'ANIMATION_BY_NODE',
    23. speed: 275
    24. }
    25. },
    26. scaleX: {
    27. // set scale label
    28. label: {
    29. text: 'Days'
    30. },
    31. // convert text on scale indices
    32. labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
    33. },
    34. scaleY: {
    35. // scale label with unicode character
    36. label: {
    37. text: 'Temperature (°F)'
    38. }
    39. },
    40. // plot values
    41. series: [{
    42. text: 'Week 1',
    43. values: [23, 20, 27, 29, 25, 17, 15],
    44. },
    45. {
    46. text: 'Week 2',
    47. values: [35, 42, 33, 49, 35, 47, 35],
    48. }
    49. ]
    50. };
    51.  
    52. // render chart
    53. zingchart.render({
    54. id: 'myChart',
    55. data: chartConfig,
    56. height: '100%',
    57. width: '100%',
    58. // variable "vividTheme" is pulled in script tag. Check HTML
    59. defaults: vividTheme
    60. });
    61. });