I want to draw custom triangle using renderItem method:
series: [
{
....
type: 'custom',
renderItem: renderGanttItem,
....
}
]
I see some build in functions how to draw rectangle in customer render item method. There are some good examples for it. But I could not find good examples how to draw some triangles. Maybe it is better to use some 'polygon'? Or maybe there are some other opportunities.
var rectNormal = clipRectByRect(params, {
x: x,
y: y,
width: barLength,
height: barHeight
});
return {
type: 'group',
children: [
{
type: 'rect',
ignore: !rectNormal,
shape: rectNormal,
style: api.style()
}
]
};
}
function clipRectByRect(params, rect) {
return echarts.graphic.clipRectByRect(rect, {
x: params.coordSys.x,
y: params.coordSys.y,
width: params.coordSys.width,
height: params.coordSys.height
});
}
