Echarts网格颜色渐变 + 折线图折线发光高亮效果

Echarts网格颜色渐变 + 折线图折线发光高亮效果series:里面定义折线发光高亮的效果网格颜色的渐变附上封住代码

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全家桶1年46,售后保障稳定

在这里插入图片描述 

series:里面定义

折线发光高亮的效果

   lineStyle: {
              shadowColor: "#5cfbff", //透明的颜色
              shadowOffsetX: 0,
              shadowOffsetY: 0,
              opacity: 1, //透明度
              shadowBlur: 8, //阴影大小
              type: "solid", //实线
              width: 2,
            },

Jetbrains全家桶1年46,售后保障稳定

网格颜色的渐变

   areaStyle: {
              normal: {
                //前四个参数代表位置 左下右上,暗青色到亮青色,
                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                  { offset: 0, color: "rgba(12,180,250, 1)" }, //从上往下的渐变
                  { offset: 1, color: "rgba(63, 208, 249, 0)" },
                ]),
              },
            },

附上封住代码

<template>
  <div id="linechart" />
</template>
<script>
import echarts from "echarts";

export default {
  props: ["id"],
  data() {
    return {
      charts: "",
    };
  },
  mounted() {
    this.$nextTick(() => {
      this.initChart("linechart");
    });
  },
  methods: {
    initChart(id) {
      this.charts = echarts.init(document.getElementById(id), "blue");
      this.charts.setOption({
        color: ["#00D8FF"],
        tooltip: {
          trigger: "axis",
        },
        legend: {
          y: "bottom",
          itemGap: 30,
          itemWidth: 30,
          itemHeight: 10,
          textStyle: {
            fontSize: 13, //字体大小
            color: "rgb(142, 199, 220)", //字体颜色
          },
        },
        calculable: true,

        xAxis: [
          {
            type: "category",
            boundaryGap: false,
            data: [
              "06:00",
              "09:00",
              "12:00",
              "15:00",
              "18:00",
              "21:00",
              "24:00",
            ],
            axisLabel: {
              show: true,
              textStyle: {
                color: ["rgb(142, 199, 220)"],
              },
            },
            axisLine: {
              lineStyle: {
                color: "#023c7a",
                width: 1,
              },
            },
          },
        ],
        yAxis: [
          {
            type: "value",
            axisLabel: {
              formatter: "{value} °C",
            },
            splitLine: {
              lineStyle: {
                color: "#023c7a",
                width: 1,
              },
            },
            axisLine: {
              lineStyle: {
                color: "#023c7a",
                width: 1,
              },
            },
            axisLabel: {
              show: true,
              textStyle: {
                color: ["rgb(142, 199, 220)"],
              },
            },
          },
        ],
        series: [
          {
            symbolSize: 0, //折线点的大小

            type: "line",
            data: [6000, 4000, 8000, 10000, 4000, 2000, 4000, 2000, 6000],
            areaStyle: {
              normal: {
                //前四个参数代表位置 左下右上,暗青色到亮青色,
                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                  { offset: 0, color: "rgba(12,180,250, 1)" }, //从上往下的渐变
                  { offset: 1, color: "rgba(63, 208, 249, 0)" },
                ]),
              },
            },

            lineStyle: {
              shadowColor: "#5cfbff", //透明的颜色
              shadowOffsetX: 0,
              shadowOffsetY: 0,
              opacity: 1, //透明度
              shadowBlur: 8, //阴影大小
              type: "solid", //实线
              width: 2,
            },
          },
        ],
      });
    },
  },
};
</script>

 

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/203619.html原文链接:https://javaforall.net

赞 (0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • fedora 12 QQ 的安装使用过程「建议收藏」

    fedora 12 QQ 的安装使用过程「建议收藏」一 下载地址:http://im.qq.com/qq/linux/download.shtml  由于装的是fedora  12于是下linuxqq-v1.0.2-beta1.i386.rmp直接双击安装就可以了。安装完后,应用程序出现在Internet下的腾讯QQ。二 成功登录后,不小心按了最小化后,郁闷的发现找不到qq图标。其实解决很简单,在面板上右击,选择添加到面板

    2022年9月2日
  • properties中文乱码问题解决办法

    properties中文乱码问题解决办法

    2020年11月12日
  • notepad复制列[通俗易懂]

    notepad复制列[通俗易懂]notepad复制列

    2022年4月23日
  • 13 RangeValidator

    13 RangeValidatorRangeValidator的属性有:MinimumValue:范围的最小值;MaximumValue:范围的最大值。Type:为数据类型,包括String,Intege,Double,Date,CurrencyRangeValidator,CompareValidator,RegularExpressValidator都不会对非空值进行校验,所…

    2022年7月12日
  • 基于python的个人博客系统的设计开题报告_基于SSM的个人博客系统设计开题报告…「建议收藏」

    基于python的个人博客系统的设计开题报告_基于SSM的个人博客系统设计开题报告…「建议收藏」本科毕业设计(论文)开题报告题目:基于SSM的个人博客系统设计与实现专题题目(若无专题则不填):本课题来源及研究现状:关于博客的未来:在创办了博客中国(blogchina)、被誉为“博客教父”的方兴东接受了记者的专访。他认为,博客这一事物在中国的发展大致经过以下三个阶段:第一阶段是2002年至2003年,少数人写博;第二阶段是2003年至2005年,博客爱好者写博;第三阶段是2…

    2022年7月21日
  • C# excel转换Json

    C# excel转换Json//如果要支持xlsx格式表格,请在本机电脑安装这个//http://download.microsoft.com/download/7/0/3/703ffbcb-dc0c-4e19-b0da-1463960fdcdb/AccessDatabaseEngine.exe参考案例:https://www.cnblogs.com/fengxiang/p/3551621.html使用的时候记得…

    2022年6月11日

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号