Search code examples
javascriptjqueryamcharts

How to show stock events in Amcharts outside of range of underlying data?


I'm trying to create a stock price chart overlayed with certain events with event-markers in Amcharts. These event markers are future predictions of an event and will be outside the current range of the stock price data. Is there any way to show it in Amcharts Stock Chart v3? I've tried adding stock event but it only shows up if it falls within the data range

Thanks in Advance


Solution

  • As far I understand your challenge, you want to extend the axis.

    One can manually set the maximum value:

    var chart = AmCharts.makeChart("chartdiv",{
      ...
      "valueAxes": [
        {
          "title": "Axis title"
          //"maximum": calculatedNumber(),
          "maximumDate: calculatedDate(),
        }
      ]
    });
    

    read more @

    docs ValueAxis

    search maximum