Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Generating graphs
Message
De
14/07/2000 07:21:03
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00380132
Message ID:
00392301
Vues:
18
Dear Robert

Thanks a lot, this one is a real help to my graphing project.

However, i want to change the plot of my graph from rows to column and vice versa. And i found out that by using;

graphObject.plotby=xlRow or xlColumn

it shd change. But somehow I always got OLE error and not able to change the Plot of the graph. can you help me here? Am I missingout something??

Thanks in advance,

Shaishav Merchant
IT - Kaybee Group
edp@kaybee.com.sg


>>>
>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.
>
>Good Luck
Regards
Shaishav
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform