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
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