• Edit
  • Download
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</title>
    7.  
    8. <script nonce="undefined" src="https://cdn.zingchart.com/zingchart.min.js"></script>
    9. <style>
    10. html,
    11. body {
    12. height: 100%;
    13. width: 100%;
    14. margin: 0;
    15. padding: 0;
    16. }
    17.  
    18. #myChart {
    19. height: 100%;
    20. width: 100%;
    21. min-height: 150px;
    22. }
    23. </style>
    24. </head>
    25.  
    26. <body>
    27. <div id="myChart"></div>
    28. <script>
    29. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    30. var myConfig = {
    31. type: 'hbar',
    32. plot: {
    33. stacked: true
    34. },
    35. legend: {},
    36. tooltip: {
    37. text: 'offset: %offset-values<br> value: %v',
    38. textAlign: 'left'
    39. },
    40. scaleX: {
    41. labels: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu']
    42. },
    43. scaleY: {
    44. minValue: 0,
    45. maxValue: 16,
    46. step: 4.5,
    47. decimals: 1
    48. },
    49. series: [{
    50. values: [5.0, 3.0, 5.5, 2.0, 2.5],
    51. offsetValues: [1.0, 3.0, 1, 2.0, 2.5],
    52. backgroundColor: '#FF6600',
    53. valueBox: {
    54. placement: 'bottom',
    55. rules: [{
    56. rule: '%offset-values == 0',
    57. visible: false
    58. }]
    59. }
    60. },
    61. {
    62. values: [5.0, 8.0, 9.0, 4.0, 3.5],
    63. offsetValues: [1.0, 3.0, 0, 2.0, 2.5],
    64. backgroundColor: '#DC143C',
    65. valueBox: {
    66.  
    67. }
    68. }
    69. ]
    70. };
    71.  
    72. zingchart.render({
    73. id: 'myChart',
    74. data: myConfig,
    75. height: '100%',
    76. width: '100%'
    77. });
    78. </script>
    79. </body>
    80.  
    81. </html>
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</title>
    7.  
    8. <script src="https://cdn.zingchart.com/zingchart.min.js"></script>
    9. </head>
    10.  
    11. <body>
    12. <div id="myChart"></div>
    13. </body>
    14.  
    15. </html>
    1. html,
    2. body {
    3. height: 100%;
    4. width: 100%;
    5. margin: 0;
    6. padding: 0;
    7. }
    8.  
    9. #myChart {
    10. height: 100%;
    11. width: 100%;
    12. min-height: 150px;
    13. }
    1. var myConfig = {
    2. type: 'hbar',
    3. plot: {
    4. stacked: true
    5. },
    6. legend: {},
    7. tooltip: {
    8. text: 'offset: %offset-values<br> value: %v',
    9. textAlign: 'left'
    10. },
    11. scaleX: {
    12. labels: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu']
    13. },
    14. scaleY: {
    15. minValue: 0,
    16. maxValue: 16,
    17. step: 4.5,
    18. decimals: 1
    19. },
    20. series: [{
    21. values: [5.0, 3.0, 5.5, 2.0, 2.5],
    22. offsetValues: [1.0, 3.0, 1, 2.0, 2.5],
    23. backgroundColor: '#FF6600',
    24. valueBox: {
    25. placement: 'bottom',
    26. rules: [{
    27. rule: '%offset-values == 0',
    28. visible: false
    29. }]
    30. }
    31. },
    32. {
    33. values: [5.0, 8.0, 9.0, 4.0, 3.5],
    34. offsetValues: [1.0, 3.0, 0, 2.0, 2.5],
    35. backgroundColor: '#DC143C',
    36. valueBox: {
    37.  
    38. }
    39. }
    40. ]
    41. };
    42.  
    43. zingchart.render({
    44. id: 'myChart',
    45. data: myConfig,
    46. height: '100%',
    47. width: '100%'
    48. });