react-chartjs

使用 chart.js 制作常见的 react 图表组件。「common react charting components using chart.js」

Github星跟蹤圖

react-chartjs

rich interactive react charting components using chart.js including

  • Line chart
  • Bar chart
  • Radar chart
  • Polar area chart
  • Pie chart
  • Doughnut chart

view chart examples

Installation

This is a CommonJS component only (to be used with something like Webpack or Browserify)

npm install --save react-chartjs

You must also include chart.js and React as dependencies.

npm install --save chart.js@^1.1.1 react react-dom

Example Usage

var LineChart = require("react-chartjs").Line;

var MyComponent = React.createClass({
  render: function() {
    return <LineChart data={chartData} options={chartOptions} width="600" height="250"/>
  }
});
  • data represents the chart data (see chart.js for details)
  • options represents the chart options (see chart.js for details)
  • all other parameters will be passed through to the canvas element
  • if data passed into the component changes, points will animate between values using chart.js' .update(). If you want the chart destroyed and redrawn on every change, pass in redraw as a prop. For example <LineChart data={this.state.chartData} redraw />

Chart References

The canvas element can be retrieved using getCanvas and the chartjs object can be retrieved using getChart.

主要指標

概覽
名稱與所有者reactjs/react-chartjs
主編程語言JavaScript
編程語言JavaScript (語言數: 1)
平台
許可證MIT License
所有者活动
創建於2014-12-26 23:19:20
推送於2022-02-07 10:04:02
最后一次提交2018-01-14 13:24:52
發布數16
最新版本名稱v0.8.0 (發布於 2016-07-26 12:58:46)
第一版名稱v0.0.1 (發布於 )
用户参与
星數2.9k
關注者數56
派生數297
提交數109
已啟用問題?
問題數159
打開的問題數61
拉請求數36
打開的拉請求數12
關閉的拉請求數21
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?