chart.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <!DOCTYPE html>
  2. <html>
  3. <head lang="kr">
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
  6. <title>[Bar Chart] basic</title>
  7. <link rel="stylesheet" type="text/css" href="https://cdn.rawgit.com/nhnent/tui.chart/2.4.0/dist/chart.min.css" />
  8. <link rel="stylesheet" type="text/css" href="https://cdn.rawgit.com/nhnent/tui.chart/2.4.0/samples/css/sample.css" />
  9. </head>
  10. <body>
  11. <h1><a href="https://github.com/nhnent/tui.chart" target="_blank">TUI Chart</a></h1>
  12. <div class="code-html">
  13. <div id="chart-area"></div>
  14. <div class="custom-area">
  15. <div class="apply-btn-area">
  16. <input type="checkbox" id="use-theme" onclick="onCheckboxClick(this);"><label for="use-theme">&nbsp;Theme</label>
  17. &nbsp; &nbsp;
  18. <button id="btn" onclick="onBtnClick();">Apply Custom Data</button>
  19. <input type="hidden" id="type" value="barChart" />
  20. </div>
  21. <div>
  22. <div>Chart Data</div>
  23. <textarea id="data">
  24. {
  25. "categories": ["June", "July", "Aug", "Sep", "Oct", "Nov"],
  26. "series": [
  27. {
  28. "name": "Budget",
  29. "data": [5000, 3000, 5000, 7000, 6000, 4000]
  30. },
  31. {
  32. "name": "Income",
  33. "data": [8000, 1000, 7000, 2000, 5000, 3000]
  34. },
  35. {
  36. "name": "Expenses",
  37. "data": [4000, 4000, 6000, 3000, 4000, 5000]
  38. },
  39. {
  40. "name": "Debt",
  41. "data": [6000, 3000, 3000, 1000, 2000, 4000]
  42. }
  43. ]
  44. }
  45. </textarea>
  46. </div>
  47. <div>
  48. <div>Chart Options</div>
  49. <textarea id="options">
  50. {
  51. "chart": {
  52. "width": 700,
  53. "height": 400,
  54. "title": "Monthly Revenue",
  55. "format": "1,000"
  56. },
  57. "yAxis": {
  58. "title": "Month"
  59. },
  60. "xAxis": {
  61. "title": "Amount",
  62. "min": 0,
  63. "max": 9000
  64. }
  65. }
  66. </textarea>
  67. <div class="btn-area">
  68. <button onclick="openWindow('https://github.nhnent.com/fe/tui.chart/wiki/table-of-supported-options')">More Options</button>
  69. </div>
  70. </div>
  71. <div id="theme-area">
  72. <div>Chart Theme</div>
  73. <textarea id="theme">
  74. {
  75. "series": {
  76. "colors": ["#63A69F", "#F2E1AC", "#F2836B", "#F2594B"]
  77. }
  78. }
  79. </textarea>
  80. <div class="btn-area">
  81. <button onclick="openWindow('https://github.com/nhnent/tui.chart/wiki/tutorial#full-theme')">More Theme</button>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. <script src="https://cdn.rawgit.com/nhnent/tui.code-snippet/1.2.1/code-snippet.js"></script>
  87. <script src="https://cdn.rawgit.com/nhnent/tui.component.effects/1.1.0/effects.min.js"></script>
  88. <script src="https://cdn.rawgit.com/DmitryBaranovskiy/raphael/v2.2.6/raphael.min.js"></script>
  89. <script src="https://cdn.rawgit.com/nhnent/tui.chart/2.4.0/dist/chart.min.js"></script>
  90. <script src="https://cdn.rawgit.com/nhnent/tui.chart/2.4.0/samples/js/sample.js"></script>
  91. <script class="code-js">
  92. var container = document.getElementById('chart-area'),
  93. data = {
  94. categories: ['June', 'July', 'Aug', 'Sep', 'Oct', 'Nov'],
  95. series: [
  96. {
  97. name: 'Budget',
  98. data: [5000, 3000, 5000, 7000, 6000, 4000]
  99. },
  100. {
  101. name: 'Income',
  102. data: [8000, 1000, 7000, 2000, 5000, 3000]
  103. },
  104. {
  105. name: 'Expenses',
  106. data: [4000, 4000, 6000, 3000, 4000, 5000]
  107. },
  108. {
  109. name: 'Debt',
  110. data: [6000, 3000, 3000, 1000, 2000, 4000]
  111. }
  112. ]
  113. },
  114. options = {
  115. chart: {
  116. width: 700,
  117. height: 400,
  118. title: 'Monthly Revenue',
  119. format: '1,000'
  120. },
  121. yAxis: {
  122. title: 'Month'
  123. },
  124. xAxis: {
  125. title: 'Amount',
  126. min: 0,
  127. max: 9000
  128. }
  129. };
  130. tui.chart.barChart(container, data, options);
  131. </script>
  132. </body>
  133. </html>