【发布时间】:2020-08-13 16:24:15
【问题描述】:
我在尝试让自定义系列 eChart 中的条形图不重叠时遇到了一些困难,请参见下面的屏幕截图。
我在这里添加的数据之间都有几秒到一分钟,例如,在第一行,实际上有 2x 橙色条重叠,由于时间流逝:
开始 - 12:05 结束 - 12:15
和
开始 - 12:15 结束 - 12:45
这与剪裁有关,不幸的是,各种尝试让它发挥作用,都没有结果。
这是一个在 x 轴上渲染项目的示例:
const index = api.value(0);
const start = api.coord([api.value(7), index]);
const end = api.coord([api.value(6), index]);
const coordsys = params.coordSys;
this.cartesianXBounds[0] = coordsys.x;
this.cartesianXBounds[1] = coordsys.x + coordsys.width;
this.cartesianYBounds[0] = coordsys.y;
this.cartesianYBounds[1] = coordsys.y + coordsys.height;
const barlength = end[0] = start[0];
const barheight = api.size([0, 1])[1] * 0.6;
const x = start[0];
const y = start[1] - barheight;
const rectNormal = this.clipRectByRect(params, {
x,
y,
width: barlength,
height: barheight
});
【问题讨论】:
标签: typescript echarts