【问题标题】:Change border width in specific cell of eCharts heatmap更改 eCharts 热图特定单元格中的边框宽度
【发布时间】:2021-09-09 18:25:23
【问题描述】:

我正在尝试更改中间单元格的边框以强调它。

我可以使用series-heatmap.itemStyle 更改整个图表的边框,但不能只更改一个单元格。

我期待的结果如上图所示:

任何帮助将不胜感激!

[编辑]

我在docs 中发现,如果某些特定项目需要自定义,可以在data 数组中设置:

[
    12,
    24,
    {
        value: [24, 32],
        // label style, only works in this data item.
        label: {},
        // item style, only works in this data item.
        itemStyle:{}
    },
    33
]
// Or
[
    [12, 332],
    [24, 32],
    {
        value: [24, 32],
        // label style, only works in this data item.
        label: {},
        // item style, only works in this data item.
        itemStyle:{}
    },
    [33, 31]
]

我的数据系列设置如下:

[[0, 0, 549], [0, 1, 571] ...

已经尝试只更改中间带有“653”的数组,请按照这些示例进行操作,但没有成功...

【问题讨论】:

    标签: echarts apache-echarts


    【解决方案1】:

    我找到了解决方法

    只需添加一个带有我想更改边框的值的新系列

    由于我的DataSerie是一个长度为62的数组,只需将平均值放在第二个系列中即可:

    DataSerie 示例

    [[0,0,1], [0,0,2], ... ]

    ChartOptions = {
    ...
      series: [
        {
          type: 'heatmap',
          data: DataSerie
        },
        {
          type: "heatmap",
          // [ [x, y, value] ]
          data: [ [DataSerie[31] ]
        }
      ]
    ...
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-12-30
      • 1970-01-01
      • 2013-03-23
      • 1970-01-01
      • 1970-01-01
      • 2021-09-30
      • 2019-10-05
      相关资源
      最近更新 更多