隐藏折线图点之间的时间间隔

时间:2017-12-13 18:01:18

标签: echarts

如果折线图中没有值,我怎样才能隐藏折线图两个数据点之间的时间间隔?

例如,3分:

  • 第一点:时间:星期五,价值:2
  • 星期五和星期一之间没有积分(用直线显示)
  • 第二点:时间:星期一,价值:4

我用

尝试过
series: {
connectNulls: fals,
}

没用。这还有其他财产吗?

1 个答案:

答案 0 :(得分:2)

不显示数据点

使用null作为值:

series: {
    data: [5, 2, null, null, 4, 5]
}

您无需使用connectNulls

enter image description here

不显示x轴刻度

如果要隐藏空数据点的x轴刻度,请将x轴切换为type: category,并排除这些值。请务必将它们从系列中排除。

xAxis: {
    type: 'category',
    data: ['thursday', 'friday', 'monday', 'tuesday']
},
series: {
    data: [5, 2, 4, 5]
}

enter image description here