• 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. zingchart.MODULESDIR = "https://cdn.zingchart.com/modules/"; // set modules dir
    31. zingchart.loadModules('dragging'); // load dragging module
    32.  
    33. var myConfig = { // chart configuration
    34. type: 'vbullet',
    35. title: {
    36. text: 'Pushups Per Day'
    37. },
    38. subtitle: {
    39. text: 'Bars are draggable'
    40. },
    41. scaleX: {
    42. labels: ['Mon', 'Tues', 'Wed', 'Thur', 'Fri', 'Sat', 'Sun']
    43. },
    44. tooltip: { // tooltip changes based on value
    45. fontSize: 14,
    46. borderRadius: 3,
    47. borderWidth: 0,
    48. shadow: true
    49. },
    50. plot: {
    51. valueBox: [{
    52. type: 'all',
    53. color: '#000',
    54. placement: 'goal',
    55. text: '[%node-value / %node-goal-value]'
    56. }]
    57. },
    58. series: [{
    59. dataDragging: true, // need this to enable drag
    60. values: [20, 40, 14, 50, 15, 35, 5],
    61. goals: [25, 43, 30, 40, 21, 59, 35],
    62. goal: {
    63. backgroundColor: '#64b5f6',
    64. borderWidth: 0,
    65. },
    66. rules: [ // rules for color
    67. {
    68. rule: '%v >= %g', // if greater than goal
    69. backgroundColor: '#81c784'
    70. },
    71. {
    72. rule: '%v < %g/2', // if less than half goal
    73. backgroundColor: '#ef5350'
    74. },
    75. {
    76. rule: '%v >= %g/2 && %v < %g', // if in between
    77. backgroundColor: '#ffca28'
    78. }
    79. ]
    80. }]
    81. };
    82.  
    83. zingchart.render({
    84. id: 'myChart',
    85. data: myConfig,
    86. height: 500,
    87. width: '100%',
    88. modules: "dragging" // need this to enable drag
    89. });
    90. </script>
    91. </body>
    92.  
    93. </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. zingchart.MODULESDIR = "https://cdn.zingchart.com/modules/"; // set modules dir
    2. zingchart.loadModules('dragging'); // load dragging module
    3.  
    4. var myConfig = { // chart configuration
    5. type: 'vbullet',
    6. title: {
    7. text: 'Pushups Per Day'
    8. },
    9. subtitle: {
    10. text: 'Bars are draggable'
    11. },
    12. scaleX: {
    13. labels: ['Mon', 'Tues', 'Wed', 'Thur', 'Fri', 'Sat', 'Sun']
    14. },
    15. tooltip: { // tooltip changes based on value
    16. fontSize: 14,
    17. borderRadius: 3,
    18. borderWidth: 0,
    19. shadow: true
    20. },
    21. plot: {
    22. valueBox: [{
    23. type: 'all',
    24. color: '#000',
    25. placement: 'goal',
    26. text: '[%node-value / %node-goal-value]'
    27. }]
    28. },
    29. series: [{
    30. dataDragging: true, // need this to enable drag
    31. values: [20, 40, 14, 50, 15, 35, 5],
    32. goals: [25, 43, 30, 40, 21, 59, 35],
    33. goal: {
    34. backgroundColor: '#64b5f6',
    35. borderWidth: 0,
    36. },
    37. rules: [ // rules for color
    38. {
    39. rule: '%v >= %g', // if greater than goal
    40. backgroundColor: '#81c784'
    41. },
    42. {
    43. rule: '%v < %g/2', // if less than half goal
    44. backgroundColor: '#ef5350'
    45. },
    46. {
    47. rule: '%v >= %g/2 && %v < %g', // if in between
    48. backgroundColor: '#ffca28'
    49. }
    50. ]
    51. }]
    52. };
    53.  
    54. zingchart.render({
    55. id: 'myChart',
    56. data: myConfig,
    57. height: 500,
    58. width: '100%',
    59. modules: "dragging" // need this to enable drag
    60. });