25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 4.3 KiB

7 년 전
7 년 전
7 년 전
7 년 전
7 년 전
7 년 전
7 년 전
7 년 전
7 년 전
7 년 전
7 년 전
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <div align="center">
  2. <img src="https://github.com/frappe/design/blob/master/logos/charts-logo.svg" height="128">
  3. <h2>Frappe Charts</h2>
  4. <p align="center">
  5. <p>GitHub-inspired modern, intuitive and responsive charts with zero dependencies</p>
  6. <a href="https://frappe.github.io/charts">
  7. <b>Explore Demos »</b>
  8. </a>
  9. </p>
  10. </div>
  11. <p align="center">
  12. <a href="http://github.com/frappe/charts/tree/master/dist/js/frappe-charts.min.iife.js">
  13. <img src="http://img.badgesize.io/frappe/charts/master/dist/frappe-charts.min.iife.js.svg?compression=gzip">
  14. </a>
  15. </p>
  16. <p align="center">
  17. <a href="https://frappe.github.io/charts">
  18. <img src=".github/example.gif">
  19. </a>
  20. </p>
  21. ### Contents
  22. * [Installation](#installation)
  23. * [Usage](#usage)
  24. * [Updates](#updates)
  25. * [License](#license)
  26. #### Installation
  27. * Install via [`npm`](https://www.npmjs.com/get-npm):
  28. ```console
  29. $ npm install frappe-charts
  30. ```
  31. and include in your project:
  32. ```js
  33. import Chart from "frappe-charts/dist/frappe-charts.min.esm"
  34. ```
  35. * ...or include within your HTML
  36. ```html
  37. <script src="https://cdn.jsdelivr.net/npm/frappe-charts@1.0.0/dist/frappe-charts.min.iife.js"></script>
  38. <!-- or -->
  39. <script src="https://unpkg.com/frappe-charts@1.0.0/dist/frappe-charts.min.iife.js"></script>
  40. ```
  41. #### Usage
  42. ```js
  43. const data = {
  44. labels: ["12am-3am", "3am-6pm", "6am-9am", "9am-12am",
  45. "12pm-3pm", "3pm-6pm", "6pm-9pm", "9am-12am"
  46. ],
  47. datasets: [
  48. {
  49. title: "Some Data", type: "bar",
  50. values: [25, 40, 30, 35, 8, 52, 17, -4]
  51. },
  52. {
  53. title: "Another Set", type: "line",
  54. values: [25, 50, -10, 15, 18, 32, 27, 14]
  55. }
  56. ]
  57. }
  58. const chart = new Chart("#chart", { // or a DOM element
  59. title: "My Awesome Chart",
  60. data: data,
  61. type: 'axis-mixed', // or 'bar', 'line', 'scatter', 'pie', 'percentage'
  62. height: 250,
  63. colors: ['#7cd6fd', '#743ee2']
  64. })
  65. ```
  66. If you want to contribute:
  67. 1. Clone this repo.
  68. 2. `cd` into project directory
  69. 3. `npm install`
  70. 4. `npm run dev`
  71. #### Updates
  72. ##### v1.0.0
  73. - Major rewrite out. Some new features include:
  74. - Mixed type axis datasets
  75. - Stacked bar charts
  76. - Value over data points
  77. - Y Markers and regions
  78. - Dot size, Bar space size, and other options
  79. - Legend for axis charts
  80. - We would be looking to incorporate existing PRs and issues in the meantime.
  81. ##### Please read [#93](https://github.com/frappe/charts/issues/93) for v0.1.0 updates on rework and development.
  82. ##### v0.0.7
  83. - [Custom color values](https://github.com/frappe/charts/pull/71) for charts as hex codes. The API now takes an array of colors for all charts instead of a color for each dataset.
  84. - [@iamkdev's](https://github.com/iamkdev) blog on [usage with Angular](https://medium.com/@iamkdev/frappé-charts-with-angular-c9c5dd075d9f).
  85. ##### v0.0.5
  86. - More [flexible Y values](https://github.com/frappe/charts/commit/3de049c451194dcd8e61ff91ceeb998ce131c709): independent from exponent, minimum Y axis point for line graphs.
  87. - Customisable [Heatmap colors](https://github.com/frappe/charts/pull/53); check out the Halloween demo on the [website](https://frappe.github.io/charts) :D
  88. - Tooltip values can be [formatted](https://github.com/frappe/charts/commit/e3d9ed0eae14b65044dca0542cdd4d12af3f2b44).
  89. ##### v0.0.4
  90. - Build update: [Shipped](https://github.com/frappe/charts/pull/35) an ES6 module, along with the browser friendly IIFE.
  91. ##### v0.0.2
  92. - We have an animated [Pie Chart](https://github.com/frappe/charts/issues/29)! Thanks [@sheweichun](https://github.com/sheweichun).
  93. - [@tobiaslins](https://github.com/tobiaslins) contributed tweaks for his quest to make these easy to use with React. Check out his [repo](https://github.com/tobiaslins/frappe-charts-react-example) and updates at [#24](https://github.com/frappe/charts/issues/24) to learn more :)
  94. - A new logo.
  95. ##### v0.0.1
  96. - The very first version out, with animatable bars and lines, a percentage chart and a heatmap. GitHub-style.
  97. #### License
  98. This repository has been released under the [MIT License](LICENSE)
  99. ------------------
  100. Project maintained by [Frappe](https://frappe.io).
  101. Used in [ERPNext](https://erpnext.com). Read the [blog post](https://medium.com/@pratu16x7/so-we-decided-to-create-our-own-charts-a95cb5032c97).