• 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="http://www.zingchart.com/scripts/zcDocs.js"></script>
    8. <link href='http://www.zingchart.com/css/zcDocs.css' rel='stylesheet' type='text/css'>
    9.  
    10. <script nonce="undefined" src="https://cdn.zingchart.com/zingchart.min.js"></script>
    11. <style>
    12. #demo-chart {
    13. float: left;
    14. width: 75%;
    15. border-radius: 5px 0px 0px 5px;
    16. }
    17.  
    18. #outputContainer {
    19. height: 400px;
    20. width: 25%;
    21. color: #ffd740;
    22. background-color: #000;
    23. border-radius: 0px 5px 5px 0px;
    24. float: left;
    25. display: flex;
    26. /* instaniate flexbox */
    27. justify-content: center;
    28. /* align horizontal */
    29. align-items: center;
    30. /* align vertical */
    31. }
    32.  
    33. #output {
    34. font-size: 8em;
    35. background-color: inherit;
    36. }
    37. </style>
    38. </head>
    39.  
    40. <body>
    41. <div id='demo-chart'></div>
    42. <div id='outputContainer'><span id='output'></span></div>
    43. <script>
    44. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    45. var myConfig = {
    46. 'type': 'bar',
    47. 'theme': 'dark',
    48. 'palette': ['#00bcd4', '#f44336'],
    49. 'backgroundColor': '#000',
    50. 'legend': {},
    51. 'series': [{
    52. 'values': [11, 26, 7, 44, 11]
    53. },
    54. {
    55. 'values': [42, 13, 21, 15, 33]
    56. }
    57. ]
    58. };
    59.  
    60. // first parameter can be null for all charts or
    61. // 'demo-chart' to bind just to this chart
    62. zingchart.bind(null, 'node_mouseover', function(p) {
    63. console.log(p)
    64. document.getElementById('output').innerHTML = p.value;
    65. });
    66. zingchart.bind(null, 'node_mouseout', function(p) {
    67. document.getElementById('output').innerHTML = '';
    68. });
    69.  
    70. zingchart.render({
    71. id: 'demo-chart',
    72. data: myConfig,
    73. height: 400,
    74. width: '100%'
    75. });
    76. </script>
    77. </body>
    78.  
    79. </html>
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</title>
    7. <script src="http://www.zingchart.com/scripts/zcDocs.js"></script>
    8. <link href='http://www.zingchart.com/css/zcDocs.css' rel='stylesheet' type='text/css'>
    9.  
    10. <script src="https://cdn.zingchart.com/zingchart.min.js"></script>
    11. </head>
    12.  
    13. <body>
    14. <div id='demo-chart'></div>
    15. <div id='outputContainer'><span id='output'></span></div>
    16. </body>
    17.  
    18. </html>
    1. #demo-chart {
    2. float: left;
    3. width: 75%;
    4. border-radius: 5px 0px 0px 5px;
    5. }
    6.  
    7. #outputContainer {
    8. height: 400px;
    9. width: 25%;
    10. color: #ffd740;
    11. background-color: #000;
    12. border-radius: 0px 5px 5px 0px;
    13. float: left;
    14. display: flex;
    15. /* instaniate flexbox */
    16. justify-content: center;
    17. /* align horizontal */
    18. align-items: center;
    19. /* align vertical */
    20. }
    21.  
    22. #output {
    23. font-size: 8em;
    24. background-color: inherit;
    25. }
    1. var myConfig = {
    2. 'type': 'bar',
    3. 'theme': 'dark',
    4. 'palette': ['#00bcd4', '#f44336'],
    5. 'backgroundColor': '#000',
    6. 'legend': {},
    7. 'series': [{
    8. 'values': [11, 26, 7, 44, 11]
    9. },
    10. {
    11. 'values': [42, 13, 21, 15, 33]
    12. }
    13. ]
    14. };
    15.  
    16. // first parameter can be null for all charts or
    17. // 'demo-chart' to bind just to this chart
    18. zingchart.bind(null, 'node_mouseover', function(p) {
    19. console.log(p)
    20. document.getElementById('output').innerHTML = p.value;
    21. });
    22. zingchart.bind(null, 'node_mouseout', function(p) {
    23. document.getElementById('output').innerHTML = '';
    24. });
    25.  
    26. zingchart.render({
    27. id: 'demo-chart',
    28. data: myConfig,
    29. height: 400,
    30. width: '100%'
    31. });