Git Product home page Git Product logo

Comments (11)

martynasma avatar martynasma commented on September 7, 2024 2

Why not disable drawing when drawing is selected?

stockChart.events.on('drawingselected', function (ev) {
     unSelectTool();
})

stockChart.events.on('drawingunselected', function (ev) {
   activeDrawSelection(true);
})

from amcharts5.

workingbuddy10 avatar workingbuddy10 commented on September 7, 2024 1

Why not disable drawing when drawing is selected?

True!

That's why I have added it as an alternative!

from amcharts5.

workingbuddy10 avatar workingbuddy10 commented on September 7, 2024

@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.

from amcharts5.

shishima123 avatar shishima123 commented on September 7, 2024

Thanks @workingbuddy10
Can you give me example code?
Or please edit my jsfiddle

from amcharts5.

workingbuddy10 avatar workingbuddy10 commented on September 7, 2024

@shishima123 For testing purpose remove all method on drawingadded event and then Just add this line

stockChart.events.on('drawingadded',  () => {
drawingControl.set("tool", "anchor");
})

from amcharts5.

shishima123 avatar shishima123 commented on September 7, 2024

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.

simplescreenrecorder-2024-08-30_17.58.45.mp4

from amcharts5.

shishima123 avatar shishima123 commented on September 7, 2024

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

from amcharts5.

martynasma avatar martynasma commented on September 7, 2024

Unfortunately, there's no way to disable drawing without exiting drawing mode 🙁

stockChart.events.on("drawingadded", function () {
  drawingControl.set("active", false);
});

from amcharts5.

shishima123 avatar shishima123 commented on September 7, 2024

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

from amcharts5.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.