Closed shishima123 closed 3 weeks ago
@shishima123 You can do an alternative too, Once you completed the drawing, change the drawing tool to the anchor tool.
By this a new drawing won't appear.
Thanks @workingbuddy10 Can you give me example code? Or please edit my jsfiddle
@shishima123 For testing purpose remove all method on drawingadded
event and then Just add this line
stockChart.events.on('drawingadded', () => {
drawingControl.set("tool", "anchor");
})
Thank you for your reply @workingbuddy10
I have added your code, but it doesn't seem to solve the issue I'm facing.
After a drawing is selected, when clicking outside (focus out), a new drawing is still being created before the "drawingunselected" event is actually executed.
https://github.com/user-attachments/assets/41029660-8df6-4719-981d-a4e483c8a872
Why not disable drawing when drawing is selected?
stockChart.events.on('drawingselected', function (ev) {
unSelectTool();
})
stockChart.events.on('drawingunselected', function (ev) {
activeDrawSelection(true);
})
Why not disable drawing when drawing is selected?
True!
That's why I have added it as an alternative!
If you disable drawing when a drawing is selected, you won't be able to use features like changing color, font, line style, etc.
I want these features to still function normally when a drawing is selected
Unfortunately, there's no way to disable drawing without exiting drawing mode 🙁
stockChart.events.on("drawingadded", function () {
drawingControl.set("active", false);
});
When you set drawingControl to false, the toolbar will also disappear, which is not entirely correct.
I think the drawingunselected event should be executed before the startingdrawing event or something similar
We're implementing the behavior as default in the next version.
When you click on plot area, currently selected drawing will be unselected but the new one will not be added until subsequent clicks.
Implemented in 5.10.5.
scrollToChild()
method added to Container
. Scrolls the container to the target child element if the container is scrollable and the element is currently outside of view.StockChart
drawing tool added: "Line Arrow".StockChart
is inselected by clicking on a chart's plot area the new drawing will not be added anymore.StockChart
.StockChart
drawing while other drawing was selected, would drag the selected drawing as well.Make sure you clear your browser cache after upgrading. And feel free to contact us again if you are still experiencing this issue.
Hello
I want to disable the continuous drawing feature. Everything seems to be working fine; however, when I select "Select" on the toolbar and select a drawing, then click outside, a new drawing appears on the screen before the "drawingunselected" event is executed.
How can I make the "drawingunselected" event execute first after clicking outside?
Here my code
JS Fiddle
https://github.com/user-attachments/assets/52ca2b45-83ec-4c2d-ae78-9458404fcfce