zoukankan      html  css  js  c++  java
  • echarts-for-react

    import React from "react";
    import ReactEcharts from "echarts-for-react";
    
    class TaskChart extends React.PureComponent {
      getOption() {
        var symbolSize = 20;
        var data = [[15, 0], [-50, 10], [-56.5, 20], [-46.5, 30], [-22.1, 40]];
        var points = [];
    
        var option = {
            title: {
                text: 'Click to Add Points'
            },
            tooltip: {
                formatter: function (params) {
                    var data = params.data || [0, 0];
                    return data[0].toFixed(2) + ', ' + data[1].toFixed(2);
                }
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            xAxis: {
                min: -60,
                max: 20,
                type: 'value',
                axisLine: {onZero: false}
            },
            yAxis: {
                min: 0,
                max: 40,
                type: 'value',
                axisLine: {onZero: false}
            },
            series: [
                {
                    id: 'a',
                    type: 'line',
                    smooth: true,
                    symbolSize: symbolSize,
                    data: data
                }
            ],
            // --------------------------------------------------------------------------
            textStyle: {
              color : 'white',
            }
        };  
        // -----------------------------------------------------
        return option;
      }
      /*  */
      render() {
        return (
          <div className="index_chart_box">
            <ReactEcharts
              option={this.getOption()}
              notMerge={true}
              lazyUpdate={true}
              theme={"theme_name"}
            />
          </div>
        );
      }
    }
    
    export default TaskChart;
    

      

  • 相关阅读:
    练习5-3 数字金字塔 (15分)
    JSTL标签
    ssm+mysql+jsp打造在线考试系统WeKnow-学生端
    JSP常用内置对象
    mybatis入门2
    mybtis入门
    数据源的作用
    ssm动态查询向前台传json
    ssm中的注解
    ssm中的模糊查询
  • 原文地址:https://www.cnblogs.com/zhanglanzuopin/p/12921952.html
Copyright © 2011-2022 走看看