• 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="//www.zingchart.com/scripts/zcDocs.js"></script>
    8. <link href='//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></style>
    12. </head>
    13.  
    14. <body>
    15. <div id='demo-chart'></div>
    16. <pre id='output'></pre>
    17. <script>
    18. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    19. var myConfig = {
    20. 'type': 'line',
    21. 'title': {
    22. 'text': 'Average Metric'
    23. },
    24. 'tooltip': {
    25. 'height': 60,
    26. 'sticky': true,
    27. 'timeout': 1000,
    28. 'font-size': 11,
    29. 'text': '<div class="chart-tooltip">Node value is %node-value<br><a href="#">Click here for more info</a></div>',
    30. 'text-align': 'left',
    31. 'background-color': '#fff',
    32. 'color': '#333',
    33. 'padding': 10,
    34. 'shadow': false,
    35. 'border-width': 1,
    36. 'border-color': '#ccc',
    37. 'border-radius': 4,
    38. 'html-mode': true,
    39. 'placement': 'horizontal',
    40. 'distance': 10,
    41. 'callout-width': 6,
    42. 'callout-height': 20,
    43. 'callout': true
    44. },
    45. 'series': [{
    46. 'values': [69, 68, 54, 48, 70, 74, 98, 70, 72, 68, 49, 69],
    47. 'text': 'Apple'
    48. },
    49. {
    50. 'values': [51, 53, 47, 60, 48, 52, 75, 52, 55, 47, 60, 48],
    51. 'text': 'Microsoft'
    52. },
    53. {
    54. 'values': [42, 43, 30, 40, 31, 48, 55, 46, 48, 32, 38, 38],
    55. 'text': 'Oracle'
    56. },
    57. {
    58. 'values': [25, 15, 26, 21, 24, 26, 33, 25, 15, 25, 22, 24],
    59. 'text': 'Dell'
    60. }
    61. ]
    62. };
    63.  
    64. zingchart.bind('demo-chart', 'node_mouseover', function(p) {
    65. var el = document.getElementsByClassName('chart-tooltip');
    66. if (el) {
    67. for (var n = 0; n < el.length; n++) {
    68. el[n].addEventListener('mouseover', function(e) {
    69. zingchart.exec(p.id, 'locktooltip');
    70. zcdocs.demos.dump('locktooltip', output);
    71. });
    72. el[n].addEventListener('mouseout', function(e) {
    73. let output = zingchart.exec(p.id, 'unlocktooltip');
    74. zcdocs.demos.dump('unlocktooltip', output);
    75. });
    76. }
    77. }
    78. });
    79.  
    80.  
    81. zingchart.render({
    82. id: 'demo-chart',
    83. data: myConfig,
    84. height: 400,
    85. width: '100%'
    86. });
    87. </script>
    88. </body>
    89.  
    90. </html>
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</title>
    7. <script src="//www.zingchart.com/scripts/zcDocs.js"></script>
    8. <link href='//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. <pre id='output'></pre>
    16. </body>
    17.  
    18. </html>
    1.  
    1. var myConfig = {
    2. 'type': 'line',
    3. 'title': {
    4. 'text': 'Average Metric'
    5. },
    6. 'tooltip': {
    7. 'height': 60,
    8. 'sticky': true,
    9. 'timeout': 1000,
    10. 'font-size': 11,
    11. 'text': '<div class="chart-tooltip">Node value is %node-value<br><a href="#">Click here for more info</a></div>',
    12. 'text-align': 'left',
    13. 'background-color': '#fff',
    14. 'color': '#333',
    15. 'padding': 10,
    16. 'shadow': false,
    17. 'border-width': 1,
    18. 'border-color': '#ccc',
    19. 'border-radius': 4,
    20. 'html-mode': true,
    21. 'placement': 'horizontal',
    22. 'distance': 10,
    23. 'callout-width': 6,
    24. 'callout-height': 20,
    25. 'callout': true
    26. },
    27. 'series': [{
    28. 'values': [69, 68, 54, 48, 70, 74, 98, 70, 72, 68, 49, 69],
    29. 'text': 'Apple'
    30. },
    31. {
    32. 'values': [51, 53, 47, 60, 48, 52, 75, 52, 55, 47, 60, 48],
    33. 'text': 'Microsoft'
    34. },
    35. {
    36. 'values': [42, 43, 30, 40, 31, 48, 55, 46, 48, 32, 38, 38],
    37. 'text': 'Oracle'
    38. },
    39. {
    40. 'values': [25, 15, 26, 21, 24, 26, 33, 25, 15, 25, 22, 24],
    41. 'text': 'Dell'
    42. }
    43. ]
    44. };
    45.  
    46. zingchart.bind('demo-chart', 'node_mouseover', function(p) {
    47. var el = document.getElementsByClassName('chart-tooltip');
    48. if (el) {
    49. for (var n = 0; n < el.length; n++) {
    50. el[n].addEventListener('mouseover', function(e) {
    51. zingchart.exec(p.id, 'locktooltip');
    52. zcdocs.demos.dump('locktooltip', output);
    53. });
    54. el[n].addEventListener('mouseout', function(e) {
    55. let output = zingchart.exec(p.id, 'unlocktooltip');
    56. zcdocs.demos.dump('unlocktooltip', output);
    57. });
    58. }
    59. }
    60. });
    61.  
    62.  
    63. zingchart.render({
    64. id: 'demo-chart',
    65. data: myConfig,
    66. height: 400,
    67. width: '100%'
    68. });