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.
Unfortunately, activation email could not send to your email. Please try again.

Issues with SfChart date time labels

Thread ID:

Created:

Updated:

Platform:

Replies:

107870 Mar 21,2013 02:56 AM Jun 11,2013 01:44 AM Windows Phone 4
loading
Tags: Chart
Gary Burgess
Asked On March 21, 2013 02:56 AM

Hi.  I am trying to use SfChart to produce a simple chart of pressure (weather pressure) from the last 6 hours with readings taken every 30 minutes.  My data collection has 13 rows .. being the opening reading (eg) at 11:30, then every 30 minutes up to 17:30 .. making 6 hours of data.

I cannot get sensible time labels on the primary axis, which is a DateTimeAxis.  I would like the times shown to be either hourly, 2 hourly or something useful - but instead I get 12:00, 14:24 and 16:48 for the above data.  To re-iterate, all my data is on 30 minute boundaries - there is no data at 14:24, 16:48.

 

I've tried just about every possible combination of DesiredIntervalsCount, etc to no avail.  I'm at wits end as this is not really OK for me to go live with. 

 

I've provided a link to a sample chart produced by SfChart, and the XAML used to produce this is below:

<Charts:SfChart >
  <Charts:SfChart.PrimaryAxis>
    <Charts:DateTimeAxis MajorGridLineStyle="{StaticResource MajorTickLineStyle}"
      MinorGridLineStyle="{StaticResource MinorTickLineStyle}"
      LabelsPosition="Outside"
      LabelFormat="HH:mm"
      SmallTicksPerInterval="5"
      DesiredIntervalsCount="4">
    </Charts:DateTimeAxis>
  </Charts:SfChart.PrimaryAxis>
  <Charts:SfChart.SecondaryAxis>
    <Charts:NumericalAxis DesiredIntervalsCount="5" />
  </Charts:SfChart.SecondaryAxis>
  <Charts:SplineAreaSeries XBindingPath="ObsTime"
    YBindingPath="Pressure"
    ItemsSource="{Binding List}"
    Interior="{StaticResource GraphForegroundBrush}">
  </Charts:SplineAreaSeries>
</Charts:SfChart>

 

Thanks ... in advance.

Gary Burgess


Gary Burgess
Replied On March 21, 2013 02:57 AM

Sorry .. the link to the sample chart is: http://www.burgess.com.au/dropbox/SampleChart.png


Vinoth Kumar J [Syncfusion]
Replied On March 21, 2013 08:21 AM

Hi Gary ,

Thanks for using syncfusion products.

While using DateTimeAxis, intervals are calculated automatically. We will work on improving the nice interval calculation for DateTimeAxis. Since interval of your data is fixed i.e., readings are taken every 30 minutes, we request you to use CategoryAxis with interval 1 (label will be placed for every 30 minutes) or 2 (1 hour interval) or 4 (2 hours interval). You can also format the label using LabelFormat property.

We have prepared a sample using CategoryAxis. Please find the sample from the following location.

CategoryAxis.WP8.zip
Thanks,


Gary Burgess
Replied On March 27, 2013 02:24 AM

Thanks for the reply Vinoth.

 

That worked beautifully!

Gary


Vinoth Kumar J [Syncfusion]
Replied On June 11, 2013 01:44 AM

Hi Garry,

We are glad to know your issue is fixed.

Thanks,
Vinoth Kumar J

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;