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

Dates showing up as integers

I have a chart I'm trying to figure out where the dates are showing up as integers instead of in a date format.

        For Each row As DataRow In dtChartData.Select("ClientID = " & lstClients.SelectedItems.Item(0).Name)
            series.Points.Add(DDate(row("DataDate")), CDbl(row("TotalAmt")))
        Next

row("DataDate") = #3/1/2014#
but when the chart finishes it shows up as 41699

if I break right after the Points.Add: 
series.Points(0).DateX = #3/1/2014#
series.Points(0).X = 41699.0

I've tried changing the chart.PrimaryXAxis.DateTimeFormat = "MM/dd/yyyy" but it doesn't seem to have any effect.

3 Replies

AT Anandaraj T Syncfusion Team May 1, 2014 10:29 AM UTC

Hi Andy,

Thanks for using Syncfusion products.

We suggest you to set "ValueType" property of chart axis to "DateTime" for displaying date time values in axis.

Please refer the following code snippet to achieve this.
<code>
[VB]
        'Setting date time values for primary X axis
        ChartControl1.PrimaryXAxis.ValueType = ChartValueType.DateTime
        ChartControl1.PrimaryXAxis.DateTimeFormat = "MM/dd/yyyy"

</code>

For your convenience, we have created a simple sample for displaying date time values in axis and it can be downloaded from the following link.
DateTimeAxis

Please let us know if you have any concern.

Regards,
Anand



VM Vaughn Miller May 1, 2014 11:01 AM UTC

Cool thanks!


AT Anandaraj T Syncfusion Team May 5, 2014 06:13 AM UTC

Hi Andy,

Thanks for the update. Please let us know if you need further assistance on this.

Regards,
Anand

Loader.
Live Chat Icon For mobile
Up arrow icon