We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

calculatePointToPixel returns null

          final CartesianChartPoint<dynamic> chartPoint =

                      CartesianChartPoint<dynamic>( 0, double.parse((symbol?.bid ?? 0.0).toStringAsFixed((symbol?.digits ?? 0).toInt())));

                      pointLocation = candleController?.pointToPixel(chartPoint); <--- Return null


and then it display the chart.


the problem is with this method inside package:

  final ChartAxisRendererDetails xAxisDetails =

      seriesRendererDetails.xAxisDetails!; <---- Return null



4 Replies

YG Yuvaraj Gajaraj Syncfusion Team March 30, 2023 11:39 AM UTC

Hi Bar,


We have checked and ensured the pointToPixel method in the ChartSeriesContoller is working fine without any kind of reported issue. We suspect that you have called this before the chart gets rendered in the view so that only it will get through the exception. So, we request you to share more details following,

  • Where did you try to get the pixel value using the pointToPixel public method?
  • Axis type used in primaryXAxis.
  • Please share the sample to reproduce the reported issue if possible

It will be more helpful for to us assist you in a better way.


Regards,

Yuvaraj.



BI Bar Ilan March 30, 2023 12:37 PM UTC

inside stack i call to chart, plotband and annotation





BI Bar Ilan March 30, 2023 12:40 PM UTC

Im using 

DateTimeCategoryAxis

in 



YG Yuvaraj Gajaraj Syncfusion Team March 31, 2023 10:50 AM UTC

Hi Bar,


We have checked the shared code snippet and found that you have called the pointToPixel method inside the builder function of the StoreConnector, so we have tried the same and found that the pointToPixel method gets called before the chart rendering gets completed, in this state chart properties are not even initialized. So please try to call the pointToPixel method after the chart rendering gets completed. This will ensure that the necessary chart detail is available for the conversion to be performed accurately.


Regards,

Yuvaraj.


Loader.
Live Chat Icon For mobile
Up arrow icon