zoukankan      html  css  js  c++  java
  • Echarts整理

     var option = {
              
             tooltip: {//提示框组件。
                    trigger: 'axis',//触发类型。
                       formatter : function(params, ticket, callback) { //提示框浮层内容格式器,支持字符串模板和回调函数两种形式。當前是囘調模式
                       var str=params[0].name + "點:";  
                       for(var i=0;i<params.length;i++)
                       {
                       str+= " <br />" +params[i].marker + params[i].value + "%";
                       }  
                     return   str;    
                       }
                },
            legend: {//图例组件。
                data: ['達成率', '目標'],
                textStyle: {
                    color: '#fff',
                     fontWeight: 'bold',
                            fontSize: 16
                }
            },
            toolbox: {
                show: true,
                feature: {
                    restore: { show: true, iconStyle: { borderColor: '#fff'} }, //圖標顯色
                    saveAsImage: { show: true, iconStyle: { borderColor: '#fff'},backgroundColor:'#000' }
                }
            },
            calculable: true,
            //X軸
            xAxis: [
                {
                    type: 'category',
                    boundaryGap: false,
                    data: [],
                    axisLabel: {
                        show: true,
                        interval: 0,
                        textStyle: {
                            color: '#fff',
                            fontWeight: 'bold',
                            fontSize: 16
                        }
                    },
                     //设置轴线的属性
                        axisLine:{
                            lineStyle:{
                                color:'#fff',
                                1,//这里是为了突出显示加上的
                            }
                        } 
                }
            ],
            yAxis: [
                {
                    type: 'value',
                     max: 100,
                     min: 90,
                     axisLine: {  //调节Y轴样式、颜色
                            lineStyle:{
                             color:'#fff',
                             1,//这里是为了突出显示加上的
                            }
                    },
                    splitLine: {   //调节网格线样式、颜色
                        show: false,
                        lineStyle: {
                            color: '#fff'
                        }
                    },
                    axisLabel: {//文字格式
                        formatter: function (value, index) {           
                     return value.toFixed(0)+'%';      
                   } ,
                        textStyle: {
                            color: '#fff',
                            fontWeight: 'bold',
                            fontSize: 16
                        }
                    }
                }
            ],
            series: [
                {
                    name: '達成率',
                    type: 'line',
                     color: '#F34444',
                    data: [],
                    markPoint: {
                        data: [
                       {type: 'max', name: '最大值'},
                       ]
                    },
                },
                {
                    name: '目標',
                    type: 'line',
                    color: '#35EC35',

    itemStyle: {
    normal: {
    lineStyle: {
    3 //折线宽度
     }
          }
     },

     data: []

                },
    
            ]
        };
  • 相关阅读:
    Palindrome Partitioning
    triangle
    Populating Next Right Pointers in Each Node(I and II)
    分苹果(网易)
    Flatten Binary Tree to Linked List
    Construct Binary Tree from Inorder and Postorder Traversal(根据中序遍历和后序遍历构建二叉树)
    iOS系统navigationBar背景色,文字颜色处理
    登录,注销
    ios 文字上下滚动效果Demo
    经常崩溃就是数组字典引起的
  • 原文地址:https://www.cnblogs.com/zmaiwxl/p/10240300.html
Copyright © 2011-2022 走看看