dates in chart field list

D

desa

I have a column in a SQL 7 database called PostDate which stores a bunch of
dates. I'm trying to display this information using the Microsoft Office
Chart 11.0 component. I'm using C# in Visual Studio 2003 and developing a
Windows Application.



After creating the chart, I right-click on it and select "Field List." to
access the Chart field list. I add "PostDate" to the data area and then I
add "Days" under "PostDate by Months" to the categories area to sort the
data by each day of the month.



This works fine and displays correctly in the IDE but when I run my program
I get the following error message and my data doesn't display.

--------------------------------------------------------

Not all information could be loaded for the PivotTable list "Microsoft
Office PivotTable 1.0". To rectify the problem, missing data has been
replaced by the default values. If the results are not satisfactory,
consult the creator of this file or Web page.



Details:

In the PivotField collection, we did not load the ParentField tag correctly
because the value "PostDate1" was recognized or is invalid.

--------------------------------------------------------



This error only happens if I try to sort the categories by the options under
"PostDate by Months" or "PostDate by Weeks".



Any ideas?
 
G

Graham Epps

I cannot say that this is going to fix your problem, but it might steer you
in the right direction.

The Chart control is clever, and by default will attempt to interpolate a
complete array of month or week values if it believes that you are supplying
month or week category values. In your case, you might want to try disabling
this default setting in the following way:


Set Chart = Form1.ChartSpace1.Charts.Add()
With Chart



' Disable the Chart's auto-date-scaling feature.
.Axes(Cnst.chAxisPositionTimescale).GroupingType =
Cnst.chAxisGroupingNone



End With



G.
 
A

Alvin Bruney

The Chart control is clever, and by default

This is certainly not clever. It is wrong because an engine should not,
under any circumstances, tamper with data to be rendered. In addition, an
engine has no idea of the context in which it is being run and so, cannot
assume that values on the x-axis are dates. This is absurd. This is so
fundamental, yet it is violated in the chart engine. If the creaters
insisted on putting in this feature then it should not be the default and it
certainly should be very well documented so programmers are aware of this
'adjustment' of data. It means for example, that if it doesn't recognize the
date, the chart blows up. And this is the default behavior.

I hope you can tell that I got seriously burnt by this issue.
regards
 

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