首页 > 其他分享 >柱状图-横向渐变色柱状图

柱状图-横向渐变色柱状图

时间:2023-07-20 17:23:41浏览次数:31  
标签:false show color 渐变色 横向 柱状图 rgba type true

效果图:

 

  chart.setOption({
    tooltip: {
      trigger: 'axis',
      show: true,
      backgroundColor: 'rgba(10, 30, 30, 0.8)',
      borderColor: 'transparent',
      padding: [8, 20, 8, 8],
      textStyle: {
        color: '#fff',
        opacity: 1,
        fontSize: 15,
      },
      axisPointer: {
        type: 'line'
      }
    },
    grid: {
      left: '16%',
      top: '12%',
      width: '77%',
      height: '74%',
    },
    legend: {
      show: true,
      top: "2%",
      left: "12%",
      itemGap: 10,
      icon: "circle",
      data: ['入库情况'],
      itemWidth: 10,
      itemHeight: 10,
      textStyle: {
        fontSize: 14,
        fontFamily: "Source Han Sans CN",
        fontWeight: "normal",
        color: "#FFFFFF",
        opacity: 0.8,
      },
    },
    xAxis: {
      type: "value",
      splitLine: {
        show: true,
        lineStyle: {
          type: 'dashed',
          color: 'rgba(230, 247, 255, 0.2)'
        },
        alignWithLabel: true,
      },
      axisLine: {
        lineStyle: {
          type: 'solid',
          color: '#CCCCCC'
        },
      },
      axisTick: {
        show: false
      },
      axisLabel: {
        fontSize: 16,
        fontFamily: 'Source Han Sans CN',
        fontWeight: 400,
        lineHeight: 30,
        color: '#cccccc',
        margin: 3
      },
    },
    yAxis: {
      type: "category",
      splitLine: {
        show: false,
        lineStyle: {
          type: "dashed",
          color: "rgba(112,112,112,0.5)",
        },
      },
      axisLine: {
        show: true,
        lineStyle: {
          type: 'solid',
          color: '#CCCCCC'
        },
      },
      axisLabel: {
        show: true,
        textStyle: {
          fontSize: 16,
          fontFamily: 'Source Han Sans CN',
          color: '#cccccc',
          margin: 3
        },
      },
      axisTick: {
        show: false,
      },
      inverse: true,
      data: xLists,
    },
    series: [
      {
        name: "入库情况",
        type: "bar",
        showBackground: false, //柱状背景
        barWidth: 12,
        itemStyle: {
          normal: {
            color: {
              type: "linear",
              x: 1,
              y: 0,
              x2: 0,
              y2: 0,
              colorStops: [{
                offset: 0,
                color: "rgba(184,255,1,1.00)", // 0% 处的颜色
              },
              {
                offset: 1,
                color: "rgba(184,255,1,0.00)", // 100% 处的颜色
              },
              ],
              global: false, // 缺省为 false
            },
          },
        },
        label: {
          show: false,
        },
        emphasis: {
          focus: "series",
        },
        data: xV1s,
      }
    ],
  })

 

标签:false,show,color,渐变色,横向,柱状图,rgba,type,true
From: https://www.cnblogs.com/a973692898/p/17568963.html

相关文章

  • 【echarts】柱状图上方显示数值
    使用官网的例子,只不过加了itemStyle属性<!DOCTYPEhtml><head> <metacharset="utf-8"> <title>ECharts</title></head><body> <!--为ECharts准备一个具备大小(宽高)的Dom--> <divid="main"style="width......
  • 移动端实现横向滚动(隐藏横向滚动条)
    如何实现横向滚动(兼容safari,微信,浏览器)实现横向滚动需要以下几点:1、父级盒子要overflow-y:hidden;overflow-x:auto来防止页面宽度溢出,以及实现左右滚动效果2、::-webkit-scrollbar{display:none;}隐藏横向滚动条(此方法在ios和微信端无效),所以第5步实现兼容3、滚动条所存......
  • 代码随想录算法训练营第60天 | ● 84.柱状图中最大的矩形 - 第10章 动态规划part03
     第十章 单调栈part03有了之前单调栈的铺垫,这道题目就不难了。  ●  84.柱状图中最大的矩形   今天是训练营最后一天,恭喜坚持两个月的录友们,接下来可以写一篇自己 代码随想录一刷的总结。好好回顾一下,这两个月自己的博客内容,以及自己的收获。  ......
  • ios h5出现横向滚动条
    实现iOSH5出现横向滚动条的步骤为了实现iOSH5出现横向滚动条,我们需要按照以下步骤进行操作。每一步都需要相应的代码实现,下面是具体的步骤和代码示例。步骤一:设置viewport的meta标签首先,在HTML文件的头部,我们需要设置viewport的meta标签,以便确保页面可以正确地显示在iOS设备上......
  • echarts柱状图设置选中阴影宽度
    tooltip:{trigger:'axis',axisPointer:{type:'line',lineStyle:{color:newecharts.graphic.LinearGradient(0,0,0,1,[{offset:0,color:'#1950a300'},{......
  • 直播app开发搭建,手指滑动横向切换tabar功能实现
    直播app开发搭建,手指滑动横向切换tabar功能实现<script>import{mapState}from'vuex'; exportdefault{data(){return{swiperCurrent:0,currentNum:0,tabs:[[{value:'111111111111'},{value:'2222222222'},{value:'33333333......
  • 基于LQR控制的无人驾驶轨迹跟踪(横向控制)算法。 使用simul
    基于LQR控制的无人驾驶轨迹跟踪(横向控制)算法。使用simulink模型搭建,并与carsim进行联合仿真。整个联合仿真已经调试完成。具体的控制器设计过程也给出相应的说明。ID:77400623216704421......
  • css 文字横向滚动通知消息
    要在CSS中实现横向滚动的通知消息,你可以使用CSS的动画属性、溢出属性和滚动属性相结合。首先,创建一个包含通知消息的容器,并设置其溢出属性为隐藏。这将确保溢出容器的内容不可见。然后,在容器内部创建一个用于显示通知消息的子元素,并设置其显示为内联块元素。然后,为这个子元素设......
  • 3.柱状图
    1.多个柱状图<template><div><divref="chart1"class="chart"></div></div></template><script>import*asechartsfrom"echarts";exportdefault{data(){return{......
  • echart 柱状图加短线
    letdata=[51,58,63,57,63,40,124,108,63,63]letmax=Math.max.apply(null,data)*0.03letlinedata=Array(data.length).fill(max)this.options={grid:{left:20,right:20,......