【问题标题】:echarts, 2 marker points shared same cell and overlappedecharts,2个标记点共享同一个单元格并重叠
【发布时间】:2020-03-11 22:38:24
【问题描述】:

我正在使用 echarts 热图。我的轴值从 0 到 5 我有一个项目列表,在热图中使用标记点将它们显示为热图中的矩形: 我为列表中的每个项目创建了这个标记点:

mp=
{
name: item.name,
xAxis: item.xVal,
yAxis: item.yVal,
symbol: 'rect',
symbolSize:40,
large:false,
itemStyle: {
color: 'black', margin:3
},
label:{
show: true,
formatter: item.name,
itemStyle:{color:'white'}},
};

问题是,如果 2 项或更多项具有接近的 x 和 y 值,将共享同一个单元格,并且将彼此之上

item1: x:1.5, y:2
item2: x:2, y:2

我想要的是如下图所示,标记点位于单元格的左侧、右侧或顶部。

我尝试了(位置或边距)之类的属性,但没有任何效果。我还在这个 echarts 示例的现场演示中尝试过,他们在其中使用了标记点: example

【问题讨论】:

    标签: angular marker echarts


    【解决方案1】:

    我发现解决方案是:symbolOffset: [0, -20]

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-05-09
      • 2022-11-14
      • 2021-01-02
      • 1970-01-01
      • 1970-01-01
      • 2012-04-28
      • 1970-01-01
      相关资源
      最近更新 更多