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
close icon

Cannot create ChartDataPoint

Another problem... I have the following code to create data points for my chart:
myData.Add (new ChartDataPoint (new DateTime(2015,8,24,16,0,0), 1.0));
myData.Add (new ChartDataPoint (new DateTime(2015,8,24,16,30,0), 2.0));
myData.Add (new ChartDataPoint (new DateTime(2015,8,24,17,0,0), 1.5));
However, when I go to compile the code, there is no matching constructor. The only constructor it can find is ChartDataPoint(System.IntPtr, Android.Runtime.JniHandleOwnership). However, the examples seem to create data points this way. There appears to be a constructor with ChartDataPoint(Object p0, Object p1) in the ChartDataPoint class, but the compiler can't find it.
What is going wrong here?

3 Replies

YP Yuvaraj Palanisamy Syncfusion Team August 24, 2015 11:49 AM UTC

Hi Cathryn,

Thanks for using Syncfusion products.

We have to use Date object to create ChartDataPoint for date time value. Also, we have prepared a sample based on this.

Please find the sample from the below location,

Sample : http://www.syncfusion.com/downloads/support/forum/120011/ze/ChartSample993295755

Please let us know if you require further assistance.

Thanks,
Yuvaraj


CM Cathryn McDonald August 27, 2015 06:29 AM UTC

Thanks, that works.

However I still can't get the DateTimeAxis to format correctly. I want to show the time with AM or PM, but using "T" or "tt" in the LabelFormat string causes the app to crash. Does Xamarin.Android support these formatting labels?


YP Yuvaraj Palanisamy Syncfusion Team August 28, 2015 05:50 AM UTC

Hi Cathryn,

Thanks for the update.

We have prepared a sample for your requirement. Please find the sample from the below location,

Sample: http://www.syncfusion.com/downloads/support/forum/120011/ze/ChartSample-1392923326

Please let us know if you require further assistance.

Regards,
Yuvaraj

Loader.
Live Chat Icon For mobile
Up arrow icon