Echarts标记异常点

需求:
在折线图中标记出异常的数据,使之一眼就可以被看到

效果图:
在这里插入图片描述
实现:
series中添加markPoint

series: [{
      name: "T011温度",
      data: ["13.9", "14", "13.9", "14", "14.1"],
      //标记异常点
 markPoint: {
      	data: [{
	     coord: ["X轴数据", "Y轴数据"]
               }]
             },
         }]

在这里插入图片描述

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Vue Echarts 中可以通过设置系列的`markPoint`属性来添加标记,具体步骤如下: 1. 在组件中引入 ECharts: ```vue <template> <div> <v-chart :options="echartsOptions"></v-chart> </div> </template> <script> import VChart from 'vue-echarts' export default { components: { VChart }, data() { return { echartsOptions: { // ECharts 配置项 } } } } </script> ``` 2. 在 ECharts 配置项中设置系列的`markPoint`属性: ```js this.echartsOptions = { // 系列配置 series: [ { type: 'line', data: [10, 20, 30, 40, 50], markPoint: { // 标记配置 data: [ { type: 'max', name: '最大值' }, { type: 'min', name: '最小值' } ] } } ] } ``` 在上面的例子中,我们通过`type: 'line'`指定了系列类型为折线,然后通过`data`设置了系列的数据。接着,在`markPoint`属性中设置了两个标记,分别是最大值和最小值。可以看到,每个标记都是一个对象,其中`type`属性指定了标记的类型,`name`属性指定了标记的名称。 3. 通过样式设置标记的样式: ```js this.echartsOptions = { // 系列配置 series: [ { type: 'line', data: [10, 20, 30, 40, 50], markPoint: { // 标记配置 data: [ { type: 'max', name: '最大值', itemStyle: { color: 'red' } }, { type: 'min', name: '最小值', itemStyle: { color: 'green' } } ] } } ] } ``` 在上面的例子中,我们通过`itemStyle`属性设置标记的样式。可以看到,每个标记都是一个对象,其中`type`属性指定了标记的类型,`name`属性指定了标记的名称,`itemStyle`属性指定了标记的样式。在`itemStyle`属性中,我们可以设置标记的颜色、大小、形状等样式属性。 以上就是在 Vue Echarts 中添加标记的基本步骤,可以根据实际需求进行调整和扩展。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值