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.

Dates showing up as integers

Thread ID:

Created:

Updated:

Platform:

Replies:

116230 Apr 29,2014 11:44 PM May 5,2014 02:13 AM Windows Forms 3
loading
Tags: Chart
Vaughn Miller
Asked On April 29, 2014 11:44 PM

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.

Anandaraj T [Syncfusion]
Replied On May 1, 2014 06:29 AM

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


Vaughn Miller
Replied On May 1, 2014 07:01 AM

Cool thanks!

Anandaraj T [Syncfusion]
Replied On May 5, 2014 02:13 AM

Hi Andy,

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

Regards,
Anand

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.

;