• 手机版

    扫码体验手机版

  • 微信公众号

    扫码关注公众号

国内首家协议开发

软芯音视解码保护平台

在线
客服

发布
需求

在线
聊天

天盟
APP

天盟APP下载

关注
微信

微信扫一扫访问
顶部

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

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


app.js
var 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: '

',}const styles = {  graphContainer: {    border: '1px solid black',    padding: '15px'  }}class LineChartExample extends React.Component {  constructor(props) {    super(props)    this.state = {      data: chartData()    }  }  render() {    return (                    
    )  }}var LineChart = require("react-chartjs").Line;var MyComponent = React.createClass({  render: function() {    return   }});ReactDOM.render(,  document.body);

index.html
            Title

免责声明:本内容仅代表回答会员见解不代表天盟观点,请谨慎对待。

版权声明:作者保留权利,不代表天盟立场。

使用道具 举报

全部参与1

没有错误吗?写法能使用class写不, 这个写法没人用了,用es6语法写

使用道具 举报

发新帖

发布任务需求已有1031168位用户正在使用天盟网服务

发布分类: *
任务预算: *
需求内容: *
手机号码: *
任务商家报价为
  • 预算价 :
  • 成交价 :
  • 完工期 :
  • 质保期 :

* 最终任务项目以服务商报价、双方协商为准!