zoukankan      html  css  js  c++  java
  • 百度Echarts的使用总结

    在HTML写个空div

    <div id="mainTL" style="height:100% ;100%;"></div>

    JS中:

    myChartTL = echarts.init(document.getElementById('mainTL'));
    
    $(function(){
       // 指定图表的配置项和数据
        var optionTL = {
            title : {
                text : '案卷受理统计',

            top : 20,
            textStyle:{
              color:'#fff',
              fontSize:20
            },
            // 居中

                x : 'center'
            },

          areaStyle:{
            normal:{
              //颜色渐变函数 前四个参数分别表示四个位置依次为左、下、右、上
              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
              offset: 0,
              color: 'rgba(255,234,0,0.96)'
              }, {
              offset: .54,
              color: 'rgba(255,234,0,0.36)'
              },{
              offset: 1,
              color: 'rgba(255,234,0,0.0)'
               }])

    
    

            }
          },

            grid: {
                left: '5%',
                right: '5%',
                bottom: '10%',
                containLabel: true
            },
            tooltip : {
                // 提示框触发方式:trigger,坐标轴触发,主要在柱状图,折线图等会使用类目轴的图表中使用
                trigger : 'axis'
            },
            legend : {
                // 靠右显示
                //x : 'right',
                y:'top',
           //设置图标的大小 itemWidth:
    15, itemHeight:10, /*{ name : '受理量', itemStyle : { color : 'CornflowerBlue' //把 itemStyle变为textStyle 字体跟随图标颜色 //color : 'auto' } },*/ data : [ '受理量', '办结量', '退件量', '超期量' ], orient : 'horizontal', top : 30 }, // 是否启用拖拽重计算特性,默认关闭(即值为false) calculable : true, xAxis : [ {

              type : 'category',

            //留白策略
            boundaryGap : false,
            axisLine:{
              lineStyle:{
                color:'#fff'
              }
            },

            //去掉中间的分割线
            splitLine:{
              show:false
            },

              //数据过多时,想要显示全部时需要加上如下属性
            axisLabel:{
              interval: 0,
              //字体斜向显示
              rotate:30,

              textStyle : {
                fontSize:14
              }

                 },

                data : []

            } ],
            //yAxis : {},
            yAxis : [{
                 //type: 'category',
                 type: 'value'
                 //splitNumber   :5

             axisLine:{
               lineStyle:{
                color:'#fff'
              }
            },
            axisLabel : {
              textStyle : {
                fontSize:14
              }
            },
            //去掉中间的分割线
            splitLine:{
              show:false
            }

            //最小单位刻度为1

              minInterval: 1,

             //最大值
              max:max

             }],

            series : [{   

          name:'受理量',
          type:'bar',
          //调整柱子宽度
          barWidth:20,

          data:data

         }]
        };
    //ajax加载之前
    先显示一段简单的loading动画
    myChartTL.showLoading();   
    //ajax加载成功之后隐藏loading动画
    myChartTL.hideLoading();   
        // 使用刚指定的配置项和数据显示图表。
        myChartTL.setOption(optionTL);  
    }

    图标自适应窗口

        //窗口自适应
        $(window).resize(function() {  
            myChartTL.resize();
        }).resize();
  • 相关阅读:
    在pytorch中使用可视化工具visdom
    3"GAN-GAN实战:GD的实现
    31:GAN-js散度的缺陷以及解决办法:WGAN的提出
    31:GAN-DCGAN(deconvolution GAN逆卷积操作)以及JS散度的缺陷
    31:GAN-纳什均衡
    31:GAN-GAN原理
    30:无监督学习-自编码网络的变种
    30:无监督学习-自编码(Auto-Encoder简称AE)原理
    如何打印网络的参数量
    29:迁移学习(当数据集比较小时,可以使用迁移学习达到一个更好的效果)
  • 原文地址:https://www.cnblogs.com/gaomanito/p/8968848.html
Copyright © 2011-2022 走看看