KLineChart
KLineChart copied to clipboard
[Feature] a unclick callback on shape (overlay)
Feature Description
a callback on shape about it lost its editable status...
To Do
When clicks on a drawn shape, it will draw some filled circles on it so we can edit the coordinates and the shape will also call onClick() callback. I use it (onClick) to indicate 'pick a drawn shape' and I will pop a toolbox to change the color, size.... of the shape or delete it :)
But when clicking on the chart area (clicks no shapes) , last clicked shape will lost the click status. I can't find any hooks about it. I need to close my toolbox. For now I am trying to use a timer to pull the click.id value inside ShapeStore.
function checkToCloseEditBox () {
const shapeEventOperate = chart._chartPane.chartStore().shapeStore().eventOperate()
if (!shapeEventOperate.click.id) {
console.log('no shape picked')
// close edit box
}
}
It will be better we have a callback on shape about it lost its editable status...
Agree. onSelect and onDeselect would be absolutely awesome.
V9 alpha has been released and supports this feature. You can try it.