Search code examples
flutterdartsyncfusion

Is there any way to move RSI Indicator position of Syncfusion Cartesian Chart?


I am trying to RSI Indicator in CandleStick chart using Syncfusion package. Everything works but if the y axis value is very large say it starts at higher than 10000. But RSI is only shown below 100. So, there is large gap 100-10000 in the chart. How can I remove the gap?


Solution

  • We have analyzed your requirement and the scenario can be achieved by rendering the RSI indicator in the secondary y-axis. Find the code below to accomplish this.

    SfCartesianChart(
            axes: [
              NumericAxis(
                opposedPosition: true,
                name: 'yAxis',
                
              )
            ],
            indicators: <TechnicalIndicators<_SalesData, DateTime>>[
              RsiIndicator<_SalesData, DateTime>(
                  seriesName: 'AAPL',
                  yAxisName: 'yAxis',
                  //Other configurations
              ),
            ],
            series: <ChartSeries<_SalesData, DateTime>>[
              CandleSeries<_SalesData, DateTime>(
                  name: 'AAPL'
                  //Other configurations
             )
            ]
           )
    

    We have attached main.dart file here for your reference.