General information
Category:
Third party products
>thanks for your help,
>... but i seem to be a bit stuck still
>
>what i want to do is form the graph and print it out. i am using a ole bound control working of the data stored in a table column using the append general command
>APPEND GENERAL oledata DATA gcdata CLASS msgraph
>
>this works fine. i place an ole bound control on a report and off i go.... but how do i change the graph type ????? i can only imagine i have to save it to the field as a different class type.
Your on the right track here. This is some code that I have working for a graph currently in production. No complaints from the users.
Append General curGraphs.Age Class "MSGraph.Chart" Data lcGeneralString
Once you have this you can either double-click on the field and edit it to what you want or you can programatically format it as an olebound object on a form (hidden).
Setting the look you want is not difficult, but finding the values is. Here is a piece of the code I used to do a age pie chart.
With ThisForm.oleAgeGraph
.ControlSource = "curGraphs.Age"
.Type = 5
.ChartArea.Font.Name = "Arial"
.ChartArea.Font.Size = 8
.ChartArea.Font.Bold = .F.
.HasLegend = .T.
.Legend.Position = -4107
.Legend.Interior.ColorIndex = -4142
.Legend.Border.LineStyle = -4142
.SeriesCollection(1).Points(1).HasDataLabel = .T.
.SeriesCollection(1).Points(1).DataLabel.Type = 4
.SeriesCollection(1).Points(2).HasDataLabel = .T.
.SeriesCollection(1).Points(2).DataLabel.Type = 4
.SeriesCollection(1).Points(3).HasDataLabel = .T.
.SeriesCollection(1).Points(3).DataLabel.Type = 4
.SeriesCollection(1).Points(4).HasDataLabel = .T.
.SeriesCollection(1).Points(4).DataLabel.Type = 4
.SeriesCollection(1).Points(5).HasDataLabel = .T.
.SeriesCollection(1).Points(5).DataLabel.Type = 4
.SeriesCollection(1).Points(6).HasDataLabel = .T.
.SeriesCollection(1).Points(6).DataLabel.Type = 4
.SeriesCollection(1).Points(7).HasDataLabel = .T.
.SeriesCollection(1).Points(7).DataLabel.Type = 4
EndWith
A nice trick someone showed to me is to start recording a macro in excel and format a graph the way you want there. Stop recording and edit the macro to get the needed values.
Good Luck
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only