Scatter Chart x axis as Date "MM/DD/YYYY HH:MM:SS:MM"

P

Pavr1

hi, I've done a Scatter Chart that's supposed to display the x axis as Date
or text that represents a Date... See the code below:
....
string x = "1\t 2\t 4\t 6\t …";
string y = "1,2\t9,0\t5,7\t....";

category = "10/2/2004 12:00:00 AM\t10/2/2004 12:00:00 AM\t10/5/2004 12:00:00
AM\t10/5/2004 12:00:00 AM\t10/6/2004 12:00:00 AM\t10/7/2004 12:00:00
AM\t10/8/2004 12:00:00 AM\t........";

objChart.Axes[1].NumberFormat = "MM/DD/YYYY HH:MM:SS:MM";

objChart.SeriesCollection[0].SetData
(OWC11.ChartDimensionsEnum.chDimCategories,
(int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, "Chart");
objChart.SeriesCollection[0].SetData
(OWC11.ChartDimensionsEnum.chDimXValues,
(int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, category);
objChart.SeriesCollection[0].SetData
(OWC11.ChartDimensionsEnum.chDimYValues,
(int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, y);

As seen in the code above, I use the category variable (Dates) as
chDimXValues (x axis) and the "y" variable (floats) as chDimYValues:

Issues:
1. This code displays all the points in the same x value (category), and the
dates shown in the x axis are not the same than in the category variable
(they don't match when they're supposed to).
2. Then I chanched chDimXValues from category (Dates) to x (Numbers), the
points are displayed in the correct position, but the problem with dates
remains. I guess the dates are displayed by default, they begin with the year
1899, and so on. (it displays default dates in the x axis label instead of
getting the dates from the category variable to)

Can anyone help finding a way through this?

Thx, Pavr1
 
S

Sridhar

Hi pavr,
I too facing this issue of date as x-axis not showing properly in the OWC10
Chart. It is not showing the dates in the category variable, rather it shows
some different dates which is not at all in the category variable. Please let
me know if you have found the solution for it.

Thanks in advance.

Regards,
Sridhar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top