• Edit
  • Download
    1. <!doctype html>
    2. <html class="zc-html">
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</title>
    7. <script nonce="undefined" src="https://cdn.zingchart.com/zingchart.min.js"></script>
    8. <style>
    9. .chart--container {
    10. height: 100%;
    11. width: 100%;
    12. min-height: 530px;
    13. }
    14.  
    15. .zc-ref {
    16. display: none;
    17. }
    18. </style>
    19. </head>
    20.  
    21. <body class="zc-body">
    22. <div id="myChart" class="chart--container">
    23. <a href="https://www.zingchart.com/" rel="noopener" class="zc-ref">Powered by ZingChart</a>
    24. </div>
    25.  
    26. <script>
    27. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"]; // CHART CONFIG
    28. // -----------------------------
    29. let myConfig = {
    30. shapes: [{
    31. type: 'zingchart.maps',
    32. options: {
    33. name: 'usa',
    34. scrolling: false,
    35. style: {
    36. label: {
    37. visible: false
    38. },
    39. items: {
    40. CA: {
    41. backgroundColor: '#9e9e9e'
    42. }
    43. }
    44. }
    45. }
    46. },
    47. {
    48. type: 'circle', // shapeid is OPTIONAL but smart if you are targeting events to this shape
    49. id: 'sd',
    50. map: 'usa', // assigning to map name or id is necessary
    51. backgroundColor: '#4dd0e1',
    52. cursor: 'pointer',
    53. size: 15,
    54. target: '_blank', // just like HTMl we have
    55. url: 'https://en.wikipedia.org/wiki/Anchorman:_The_Legend_of_Ron_Burgundy', // is how you link url to shapestarget _blank
    56. x: '-117.1611lon', // hook shape based on lon/lat
    57. y: '32.7157lat', // hook shape based on lon/lat
    58. tooltip: {
    59. text: 'We\'re located right in San Diego!',
    60. backgroundColor: '#ff9800',
    61. borderColor: '#333',
    62. borderRadius: 4,
    63. fontSize: 16
    64. }
    65. }
    66. ]
    67. };
    68.  
    69. // EVENTS
    70. // -----------------------------
    71. zingchart.bind(null, 'shape_click', function(e) {
    72. if (e.shapeid === 'sd')
    73. console.log(e)
    74. });
    75.  
    76. // RENDER CHARTS
    77. // -----------------------------
    78. zingchart.loadModules('maps, maps-usa', function() {
    79. zingchart.render({
    80. id: 'myChart',
    81. data: myConfig,
    82. height: '100%',
    83. width: '100%'
    84. });
    85. });
    86. </script>
    87. </body>
    88.  
    89. </html>
    1. <!doctype html>
    2. <html class="zc-html">
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</title>
    7. <script src="https://cdn.zingchart.com/zingchart.min.js"></script>
    8. </head>
    9.  
    10. <body class="zc-body">
    11. <div id="myChart" class="chart--container">
    12. <a href="https://www.zingchart.com/" rel="noopener" class="zc-ref">Powered by ZingChart</a>
    13. </div>
    14.  
    15. </body>
    16.  
    17. </html>
    1. .chart--container {
    2. height: 100%;
    3. width: 100%;
    4. min-height: 530px;
    5. }
    6.  
    7. .zc-ref {
    8. display: none;
    9. }
    1. // CHART CONFIG
    2. // -----------------------------
    3. let myConfig = {
    4. shapes: [{
    5. type: 'zingchart.maps',
    6. options: {
    7. name: 'usa',
    8. scrolling: false,
    9. style: {
    10. label: {
    11. visible: false
    12. },
    13. items: {
    14. CA: {
    15. backgroundColor: '#9e9e9e'
    16. }
    17. }
    18. }
    19. }
    20. },
    21. {
    22. type: 'circle', // shapeid is OPTIONAL but smart if you are targeting events to this shape
    23. id: 'sd',
    24. map: 'usa', // assigning to map name or id is necessary
    25. backgroundColor: '#4dd0e1',
    26. cursor: 'pointer',
    27. size: 15,
    28. target: '_blank', // just like HTMl we have
    29. url: 'https://en.wikipedia.org/wiki/Anchorman:_The_Legend_of_Ron_Burgundy', // is how you link url to shapestarget _blank
    30. x: '-117.1611lon', // hook shape based on lon/lat
    31. y: '32.7157lat', // hook shape based on lon/lat
    32. tooltip: {
    33. text: 'We\'re located right in San Diego!',
    34. backgroundColor: '#ff9800',
    35. borderColor: '#333',
    36. borderRadius: 4,
    37. fontSize: 16
    38. }
    39. }
    40. ]
    41. };
    42.  
    43. // EVENTS
    44. // -----------------------------
    45. zingchart.bind(null, 'shape_click', function(e) {
    46. if (e.shapeid === 'sd')
    47. console.log(e)
    48. });
    49.  
    50. // RENDER CHARTS
    51. // -----------------------------
    52. zingchart.loadModules('maps, maps-usa', function() {
    53. zingchart.render({
    54. id: 'myChart',
    55. data: myConfig,
    56. height: '100%',
    57. width: '100%'
    58. });
    59. });