BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
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
Sorry .. the link to the sample chart is: http://www.burgess.com.au/dropbox/SampleChart.png
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,
Thanks for the reply Vinoth.
That worked beautifully!
Gary