• 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. #myChart {
    13. height: 100%;
    14. width: 100%;
    15. }
    16. </style>
    17. </head>
    18.  
    19. <body>
    20. <div id='myChart'></div>
    21. <script>
    22. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    23. var myConfig = {
    24. "graphset": [{
    25. "type": "bar",
    26. "background-color": "#333",
    27. "title": {
    28. "text": "Using Rules to Change Border Radius",
    29. "background-color": "#999"
    30. },
    31. "plot": {
    32. "rules": [{
    33. "rule": "%v > 50",
    34. "border-radius": "25px",
    35. "background-color": "#0cf"
    36. },
    37. {
    38. "rule": "%v <= 50",
    39. "border-radius": "-14px",
    40. "background-color": "#f93"
    41. },
    42. {
    43. "rule": "%v < 16 && %v > -16",
    44. "border-radius": "0",
    45. "background-color": "#6c6"
    46. },
    47. {
    48. "rule": "%v < -50",
    49. "border-radius": "25px",
    50. "background-color": "#0cf"
    51. }
    52. ]
    53. },
    54. "scale-x": {
    55. "item": {
    56. "font-color": "#fff"
    57. },
    58. "guide": {
    59. "line-color": "#fff"
    60. }
    61. },
    62. "scale-y": {
    63. "item": {
    64. "font-color": "#fff"
    65. },
    66. "guide": {
    67. "line-color": "#fff"
    68. }
    69. },
    70. "series": [{
    71. "values": [50, 20, 48, -45, -5, 98, 35, -10, -30, -55, 15, -90, 49, 72, 81, 32]
    72. }]
    73. }]
    74. };
    75.  
    76. zingchart.render({
    77. id: 'myChart',
    78. data: myConfig,
    79. height: "100%",
    80. width: "100%"
    81. });
    82. </script>
    83. </body>
    84.  
    85. </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. #myChart {
    4. height: 100%;
    5. width: 100%;
    6. }
    1. var myConfig = {
    2. "graphset": [{
    3. "type": "bar",
    4. "background-color": "#333",
    5. "title": {
    6. "text": "Using Rules to Change Border Radius",
    7. "background-color": "#999"
    8. },
    9. "plot": {
    10. "rules": [{
    11. "rule": "%v > 50",
    12. "border-radius": "25px",
    13. "background-color": "#0cf"
    14. },
    15. {
    16. "rule": "%v <= 50",
    17. "border-radius": "-14px",
    18. "background-color": "#f93"
    19. },
    20. {
    21. "rule": "%v < 16 && %v > -16",
    22. "border-radius": "0",
    23. "background-color": "#6c6"
    24. },
    25. {
    26. "rule": "%v < -50",
    27. "border-radius": "25px",
    28. "background-color": "#0cf"
    29. }
    30. ]
    31. },
    32. "scale-x": {
    33. "item": {
    34. "font-color": "#fff"
    35. },
    36. "guide": {
    37. "line-color": "#fff"
    38. }
    39. },
    40. "scale-y": {
    41. "item": {
    42. "font-color": "#fff"
    43. },
    44. "guide": {
    45. "line-color": "#fff"
    46. }
    47. },
    48. "series": [{
    49. "values": [50, 20, 48, -45, -5, 98, 35, -10, -30, -55, 15, -90, 49, 72, 81, 32]
    50. }]
    51. }]
    52. };
    53.  
    54. zingchart.render({
    55. id: 'myChart',
    56. data: myConfig,
    57. height: "100%",
    58. width: "100%"
    59. });