我已经使用 react-chartjs 得到了这段代码。它显示图表,但无论我放什么,选项都会被忽略。您是否应该将选项添加到组件中?
import React, { PropTypes } from 'react'
var LineChart = require("react-chartjs").Line;
var data = {
labels: ['M', 'T', 'W', 'T', 'F', 'S', 'S'],
datasets: [{
label: 'apples',
data: [12, 19, 3, 17, 6, 3, 7]
}]
};
var options = {
lineTension : 0,
fill : false,
showLines : false
};
const Graph = () => (
<span>
<h1>Heart Graph</h1>
<LineChart data={data} options={options} width="600" height="250"/>
</span>
)
export default Graph