Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Graph / msgraph.chart Question
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Graph / msgraph.chart Question
Divers
Thread ID:
00391259
Message ID:
00391259
Vues:
75
Hello all

I am going to put graphs into my program, I download the following from UT (I think) I am looking for the possible variables for the msgraph.chart class i.e. graphtype, show totals yada yada
or do I do that through a olebound control and if so then where can I get a list of those variables?

Thanks

Stephen McLaughlin
"Blastmaster"
stephenmclaughlin@email.com

>>I can generate graphs well using the graph wizard, but I'd like to work out how to provide graphs to our customers - just like generating a report - without having to do them via the wizard. Does anyone know if there is anyway I can do this??

>>You will need a general field in the table and then you will store the graph in this general field, sort of like a memo is stored. Here is an example.

>>lcGeneralString = "" + Chr(9) + "18 to 24" + Chr(9) + "25 to 34" + Chr(9) + "35 to 44" + Chr(9) + "45 to 54" + Chr(9) + "55 to 64" + Chr(9) + "65 and over" + Chr(9) + "Unknown" + Chr(13) + Chr(10) + ;
"Age Range" + Chr(9) + AllTrim(Str(iAgeRange1)) + Chr(9) + AllTrim(Str(iAgeRange2)) + Chr(9) + AllTrim(Str(iAgeRange3)) + Chr(9) + AllTrim(Str(iAgeRange4)) + Chr(9) + AllTrim(Str(iAgeRange5)) + Chr(9) + AllTrim(Str(iAgeRange6)) + Chr(9) + AllTrim(Str(iTotal - iAgeRange1 - iAgeRange2 - iAgeRange3 - iAgeRange4 - iAgeRange5 - iAgeRange6)) + Chr(13) + Chr(10)

>>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 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.
Stephen McLaughlin
"Sexy Steve Valenteno", "Blastmaster"
stephenmclaughlin@gmail.com
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform