amcharts / amcharts5

The newest, fastest, and most advanced amCharts charting library for JavaScript and TypeScript apps.
Other
351 stars 94 forks source link

Can we add custom drawing tool in the same way as we add custom indicators #1666

Closed p3777dev closed 1 month ago

p3777dev commented 2 months ago

Question I want to add one more Fibonacci tool name Fibonacci extension with difference sequence of levels and the other one with the existing sequences . Is it achievable , as I can't see the custom way of adding tools in drawing tool as in custom indicators @martynasma .

Environment (if applicable)

Additional context

var toolbar = am5stock.StockToolbar.new(root, {
  container: document.getElementById("chartcontrols"),
  stockChart: stockChart,
  controls: [
    am5stock.DrawingControl.new(root, {
      stockChart: stockChart,
      toolSettings: {
        "Fibonacci": {
          sequence: [0, 3.618, 4.236],
          colors: [
            am5.color(0xff0000),
            am5.color(0x00ff00),
            am5.color(0x0000ff)
          ]
        }
      }
    })
  ]
});
martynasma commented 2 months ago

I'm afraid there's no easy way to add custom tools / different versions of same tool 🙁

p3777dev commented 2 months ago

If we can customize the indicators, then why not the drawing tools . Any specific reason ?

martynasma commented 2 months ago

Indicators are pretty standard stuff - one or more series based on a variation of data from main chart series.

Drawing tools are very distinctive in their behavior and functionality.

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 30 days with no activity. It will be closed in 5 days unless a new comment is added.