• Edit
  • Download
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</title>
    7.  
    8.  
    9. <script nonce="undefined" src="https://cdn.zingchart.com/zingchart.min.js"></script>
    10. <style></style>
    11. </head>
    12.  
    13. <body>
    14. <div id='myChart'></div>
    15. <script>
    16. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    17. zingchart.loadModules('maps, maps-usa', function(e) {
    18. zingchart.render({
    19. id: 'myChart',
    20. data: {
    21. shapes: [{
    22. type: 'zingchart.maps',
    23. options: {
    24. name: 'usa',
    25.  
    26. zooming: false,
    27. panning: false,
    28. scrolling: false,
    29. style: {
    30. controls: {
    31. visible: false
    32. },
    33. hoverState: {
    34. visible: false
    35. }
    36. }
    37. }
    38. }]
    39. },
    40. height: 400,
    41. width: '100%'
    42. });
    43. });
    44.  
    45. var arrayOfColors = ['red', 'orange', 'yellow', 'green', 'blue', 'purple'];
    46. var index = 0;
    47. zingchart.shape_mousemove = function(e) {
    48. console.log(arguments);
    49. if (index == arrayOfColors.length)
    50. index = 0;
    51. zingchart.exec(e.id, 'updateobject', {
    52. type: 'shape',
    53. data: {
    54. id: e.shapeid,
    55. backgroundColor: arrayOfColors[index++],
    56. label: {
    57. fontColor: 'white'
    58. }
    59. }
    60. });
    61. };
    62. </script>
    63. </body>
    64.  
    65. </html>
    1. <!DOCTYPE html>
    2. <html>
    3.  
    4. <head>
    5. <meta charset="utf-8">
    6. <title>ZingSoft Demo</title>
    7.  
    8.  
    9. <script src="https://cdn.zingchart.com/zingchart.min.js"></script>
    10. </head>
    11.  
    12. <body>
    13. <div id='myChart'></div>
    14. </body>
    15.  
    16. </html>
    1.  
    1. zingchart.loadModules('maps, maps-usa', function(e) {
    2. zingchart.render({
    3. id: 'myChart',
    4. data: {
    5. shapes: [{
    6. type: 'zingchart.maps',
    7. options: {
    8. name: 'usa',
    9.  
    10. zooming: false,
    11. panning: false,
    12. scrolling: false,
    13. style: {
    14. controls: {
    15. visible: false
    16. },
    17. hoverState: {
    18. visible: false
    19. }
    20. }
    21. }
    22. }]
    23. },
    24. height: 400,
    25. width: '100%'
    26. });
    27. });
    28.  
    29. var arrayOfColors = ['red', 'orange', 'yellow', 'green', 'blue', 'purple'];
    30. var index = 0;
    31. zingchart.shape_mousemove = function(e) {
    32. console.log(arguments);
    33. if (index == arrayOfColors.length)
    34. index = 0;
    35. zingchart.exec(e.id, 'updateobject', {
    36. type: 'shape',
    37. data: {
    38. id: e.shapeid,
    39. backgroundColor: arrayOfColors[index++],
    40. label: {
    41. fontColor: 'white'
    42. }
    43. }
    44. });
    45. };