• 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. #myChart {
    13. width: 100%;
    14. height: 100%;
    15. }
    16. </style>
    17. </head>
    18.  
    19. <body>
    20. <div id='myChart'></div>
    21. <script>
    22. ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
    23. var myConfig = {
    24. "type": "bar",
    25. "title": {
    26. "text": "Custom Tokens"
    27. },
    28. "plot": {
    29. "tooltip": {
    30. "text": "In %data-year, %data-fullname made %v sales."
    31. },
    32. "styles": ["red", "orange", "yellow", "green", "blue", "purple"],
    33. "data-fullname": ["Alice Red", "Brett Oran", "Chris Lemon", "Donna Green", "Emily Blue", "Frank Grape"] //custom token as an array
    34. },
    35. "scale-x": {
    36. "labels": ["Alice", "Brett", "Chris", "Donna", "Emily", "Frank"]
    37. },
    38. "scale-y": {
    39. "values": "0:30:10"
    40. },
    41. "series": [{
    42. "values": [3, 4, 11, 5, 19, 7],
    43. "data-year": "Year One" //custom token as an attribute
    44. },
    45. {
    46. "values": [9, 19, 15, 25, 12, 14],
    47. "data-year": "Year Two" //custom token as an attribute
    48. },
    49. {
    50. "values": [15, 29, 19, 21, 25, 26],
    51. "data-year": "Year 3" //custom token as an attribute
    52. }
    53. ]
    54. };
    55.  
    56. zingchart.render({
    57. id: 'myChart',
    58. data: myConfig,
    59. height: 300,
    60. width: "100%"
    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. <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. #myChart {
    4. width: 100%;
    5. height: 100%;
    6. }
    1. var myConfig = {
    2. "type": "bar",
    3. "title": {
    4. "text": "Custom Tokens"
    5. },
    6. "plot": {
    7. "tooltip": {
    8. "text": "In %data-year, %data-fullname made %v sales."
    9. },
    10. "styles": ["red", "orange", "yellow", "green", "blue", "purple"],
    11. "data-fullname": ["Alice Red", "Brett Oran", "Chris Lemon", "Donna Green", "Emily Blue", "Frank Grape"] //custom token as an array
    12. },
    13. "scale-x": {
    14. "labels": ["Alice", "Brett", "Chris", "Donna", "Emily", "Frank"]
    15. },
    16. "scale-y": {
    17. "values": "0:30:10"
    18. },
    19. "series": [{
    20. "values": [3, 4, 11, 5, 19, 7],
    21. "data-year": "Year One" //custom token as an attribute
    22. },
    23. {
    24. "values": [9, 19, 15, 25, 12, 14],
    25. "data-year": "Year Two" //custom token as an attribute
    26. },
    27. {
    28. "values": [15, 29, 19, 21, 25, 26],
    29. "data-year": "Year 3" //custom token as an attribute
    30. }
    31. ]
    32. };
    33.  
    34. zingchart.render({
    35. id: 'myChart',
    36. data: myConfig,
    37. height: 300,
    38. width: "100%"
    39. });