linux网页显示折线图,为甚网页打开后不现实折线图,

node.js配置完成了,node_modules里面的react-chartjs.js和react-chartjs.min.js也配置完成了

app.jsvar React = require('react');

var ReactDOM = require('react-dom');

class HomePage extends React.Component {

render() {

return (

战略布图

);

}

};

function chartData() {

return {

labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],

datasets: [

{

label: 'My First dataset',

fillColor: 'rgba(220,220,220,0.2)',

strokeColor: 'rgba(220,220,220,1)',

pointColor: 'rgba(220,220,220,1)',

pointStrokeColor: '#fff',

pointHighlightFill: '#fff',

pointHighlightStroke: 'rgba(220,220,220,1)',

data: [65, 59, 80, 81, 56, 55, 40],

},

{

label: 'My Second dataset',

fillColor: 'rgba(151,187,205,0.2)',

strokeColor: 'rgba(151,187,205,1)',

pointColor: 'rgba(151,187,205,1)',

pointStrokeColor: '#fff',

pointHighlightFill: '#fff',

pointHighlightStroke: 'rgba(151,187,205,1)',

data: [28, 48, 40, 19, 86, 27, 90],

},

]

}

}

const chartOptions = {

scaleShowGridLines: true,

scaleGridLineColor: 'rgba(0,0,0,.05)',

scaleGridLineWidth: 1,

scaleShowHorizontalLines: true,

scaleShowVerticalLines: true,

bezierCurve: true,

bezierCurveTension: 0.4,

pointDot: true,

pointDotRadius: 4,

pointDotStrokeWidth: 1,

pointHitDetectionRadius: 20,

datasetStroke: true,

datasetStrokeWidth: 2,

datasetFill: true,

legendTemplate: '

  • -legend\">
  • \">
',

}

const styles = {

graphContainer: {

border: '1px solid black',

padding: '15px'

}

}

class LineChartExample extends React.Component {

constructor(props) {

super(props)

this.state = {

data: chartData()

}

}

render() {

return (

chartOptions={chartOptions}

width="600" height="250"/>

)

}

}

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

var MyComponent = React.createClass({

render: function() {

return 

}

});

ReactDOM.render(,  document.body);

index.htmlhtml>

Title

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值