zoukankan      html  css  js  c++  java
  • echarts柱形图

    <div id="tourllEchar" ref="reftourll"></div>
    

      

    tourllEcharts(){
                let tourllech = this.$echarts.init(this.$refs.reftourll)
                var xdata = ['南北湖', '三毛乐园', '绮园', '海伦庄园', '泰山核电小镇', '万奥农庄', '猪猪星球','山水六旗'];
                var option = {
                    color: ['#3398DB'],
                    tooltip : {
                        show: false,
                        trigger: 'axis',
                        axisPointer : {            // 坐标轴指示器,坐标轴触发有效
                            type : 'shadow'        // 默认为直线,可选为:'line' | 'shadow'
                        }
                    },
                    grid: {
                        left: '3%',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis : [
                        {
                            type : 'category',
                            data : xdata,
                            axisTick: {
                                alignWithLabel: true
                            },
                            axisLine: {
                                show: false,
                                lineStyle: {
                                    color: '#657CA8'
                                }
                            },
                            splitLine: {
                                show: false,//去除网格线
                            },
                            axisLabel: {
                                show: true,
                                interval: 0,
                                textStyle: {
                                    color: '#fff'
                                },
                                fontSize: 28   //轴分类字体大小
                            },
                        }
                    ],
                    yAxis : [
                        {
                            name: '人数/景点',
                            type : 'value',
                            nameGap: 25, //轴名称与轴线间距
                            nameTextStyle: {
                                fontSize : 24,   //y轴坐标轴名称大小
                                color: '#fff',
                            },
                            splitLine: {
                                show: true,//去除网格线
                            },
                            axisLine: {
                                show: false,//不显示坐标轴线
                            },
                            axisLabel: {
                                show: true,
                                interval: 0,
                                textStyle: {
                                    color: '#fff'
                                },
                                fontSize: 28,//字体大小
                            },
                        }
                    ],
                    series : [
                        {
                            name:'直接访问',
                            type:'bar',
                            barWidth: '30%',
                            avoidLabelOverlap: false,
                            hoverAnimation: false,
                            data:[10, 52, 200, 334, 390, 330, 220,222],
                            itemStyle: {
                                normal: {
                                    label: {
                                            show: true,
                                            position: 'top',
                                            textStyle: {
                                                color: 'white',
                                                fontSize: 30   //柱形图每个柱上边的标注
                                            }
                                    },
                                    color: new this.$echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                                        offset: 0,
                                        color: '#228FFE'
                                    }, {
                                        offset: 1,
                                        color: '#52C5FF'
                                    }]),
                                }
                            },
            
                        }
                    ]
                };
                tourllech.setOption(option);
    
            }
    

      

      

  • 相关阅读:
    hdoj 3376,2686 Matrix Again 【最小费用最大流】
    Trustie站点代码托管使用指南
    POJ 2442 Sequence(堆的使用练习)
    猛犸机器学习开发实践
    关于《金字塔原理》的主要内容
    实战案例:如何快速打造1000万+播放量的抖音网红?
    【限时特惠】网易云易盾验证码全线95折!智能无感知、滑动拼图、点选验证-7天免费体验!
    当GDPR来敲门,中国互联网企业该如何应对?
    H5活动产品设计指南基础版
    Box(视图组件)如何在多个页面不同视觉规范下的复用
  • 原文地址:https://www.cnblogs.com/xhrr/p/11855238.html
Copyright © 2011-2022 走看看