Chart error (Invalid parameter)

  • Thread starter Alvin Bruney [MVP]
  • Start date
A

Alvin Bruney [MVP]

Line 3 is failing with an invalid parameter exception. I understand that the
chart utilizes the regional date settings but my date settings are verified
and set to MM/dd/yyyy and my short date format shows up as 04/05/2004 after
a reboot.

Commenting out the groupingunit and groupingunittype lines results in a
successful graph being rendered. Have I possibly overlooked something?

object[] strCategory = {"04/05/2004","04/11/2004"};
string strValue = "291,359";

objChart.Axes[ChartAxisTypeEnum.chCategoryAxis].GroupingUnitType =
ChartAxisUnitTypeEnum.chAxisUnitMonth;
objChart.Axes[ChartAxisTypeEnum.chCategoryAxis].GroupingUnit = 1;

//Add a series to the chart's series collection
objChart.SeriesCollection.Add(0);

//add labels
objChart.SeriesCollection[0].DataLabelsCollection.Add();
objChart.SeriesCollection[0].SetData (ChartDimensionsEnum.chDimCategories,
(int)
ChartSpecialDataSourcesEnum.chDataLiteral, strCategory);

objChart.SeriesCollection[0].SetData (ChartDimensionsEnum.chDimValues,
(int)ChartSpecialDataSourcesEnum.chDataLiteral, strValue);

thanks
 
S

Salil Gaitonde

I have seen in other posts that it is apparently necessary to set
HasPlotDetails to true before getting the category axis to recognize
timescale. However, I cannot get this to work. Have you done this in
your code?

Let me know if it works for you. I posted a question about this to
this group, but did not get a response.

Thanks.
 
A

Alvin Bruney [MVP]

that didn't work either. i will have some time this weekend to play with it.
hopefully something should give.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/27cok
Salil Gaitonde said:
I have seen in other posts that it is apparently necessary to set
HasPlotDetails to true before getting the category axis to recognize
timescale. However, I cannot get this to work. Have you done this in
your code?

Let me know if it works for you. I posted a question about this to
this group, but did not get a response.

Thanks.

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
Line 3 is failing with an invalid parameter exception. I understand that the
chart utilizes the regional date settings but my date settings are verified
and set to MM/dd/yyyy and my short date format shows up as 04/05/2004 after
a reboot.

Commenting out the groupingunit and groupingunittype lines results in a
successful graph being rendered. Have I possibly overlooked something?

object[] strCategory = {"04/05/2004","04/11/2004"};
string strValue = "291,359";

objChart.Axes[ChartAxisTypeEnum.chCategoryAxis].GroupingUnitType =
ChartAxisUnitTypeEnum.chAxisUnitMonth;
objChart.Axes[ChartAxisTypeEnum.chCategoryAxis].GroupingUnit = 1;

//Add a series to the chart's series collection
objChart.SeriesCollection.Add(0);

//add labels
objChart.SeriesCollection[0].DataLabelsCollection.Add();
objChart.SeriesCollection[0].SetData (ChartDimensionsEnum.chDimCategories,
(int)
ChartSpecialDataSourcesEnum.chDataLiteral, strCategory);

objChart.SeriesCollection[0].SetData (ChartDimensionsEnum.chDimValues,
(int)ChartSpecialDataSourcesEnum.chDataLiteral, strValue);

thanks
 
A

Alvin Bruney [MVP]

The issue is that the grouping function family can only be applied after the
axis has been loaded with data, not before.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/27cok
Alvin Bruney said:
that didn't work either. i will have some time this weekend to play with
it.
hopefully something should give.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/27cok
Salil Gaitonde said:
I have seen in other posts that it is apparently necessary to set
HasPlotDetails to true before getting the category axis to recognize
timescale. However, I cannot get this to work. Have you done this in
your code?

Let me know if it works for you. I posted a question about this to
this group, but did not get a response.

Thanks.

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
Line 3 is failing with an invalid parameter exception. I understand
that the
chart utilizes the regional date settings but my date settings are verified
and set to MM/dd/yyyy and my short date format shows up as 04/05/2004 after
a reboot.

Commenting out the groupingunit and groupingunittype lines results in a
successful graph being rendered. Have I possibly overlooked something?

object[] strCategory = {"04/05/2004","04/11/2004"};
string strValue = "291,359";

objChart.Axes[ChartAxisTypeEnum.chCategoryAxis].GroupingUnitType =
ChartAxisUnitTypeEnum.chAxisUnitMonth;
objChart.Axes[ChartAxisTypeEnum.chCategoryAxis].GroupingUnit = 1;

//Add a series to the chart's series collection
objChart.SeriesCollection.Add(0);

//add labels
objChart.SeriesCollection[0].DataLabelsCollection.Add();
objChart.SeriesCollection[0].SetData (ChartDimensionsEnum.chDimCategories,
(int)
ChartSpecialDataSourcesEnum.chDataLiteral, strCategory);

objChart.SeriesCollection[0].SetData (ChartDimensionsEnum.chDimValues,
(int)ChartSpecialDataSourcesEnum.chDataLiteral, strValue);

thanks
 

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