Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How PlotBy work ?
Message
From
23/05/2001 04:37:32
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
22/05/2001 20:09:55
Peter Wagner
Point Informática Ltda.
Limeira, Brazil
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00510140
Message ID:
00510222
Views:
15
>I created a chart and saved it in a General field
>Later the user wants to change the way it is ploted
>from Row to Column in a form selecting one option
>button of the form.
>
>Problem:
>I dont know how to do it. Allways returns error: Unknow name
>I tried those 3 codes to plot the chart in the form
>
>1) THISFORM.Olbgrafico.ChartArea.PlotArea.PlotBy = xlColumns
>2) THISFORM.Olbgrafico.PlotArea.PlotBy = xlColumns
>3) THISFORM.Olbgrafico.PlotBy = xlColumns
>
>Nothig worked, why ??
>
>Could someone help me please.
>
>TIA
>
>Below is the code I wrote
>A) Saved the origial graph
>Scan
> lcData = lcData + ALLTRIM(SUBSTR(TTOC(Query1.datahora),1,10))
> lcData = lcData + TAB
> lcData = lcData + ALLTRIM(STR(Query1.valor)) + CRLF
>Endscan
>Select graf
>Append GENERAL grafico DATA lcData CLASS "MSGRAPH.CHART"
>
>B) Code to change Plot By
>#DEFINE xlNone -4142 && p/ remover a borda do grafico
>#DEFINE xlCategory 1
>#DEFINE xlValue 2
>#DEFINE xlPrimary 1
>#DEFINE xlLine 4
>#DEFINE xlLineStyleNone -4142
>#DEFINE xlColumns 2 && como vai plotar o grafico
>#DEFINE xlRows 1 && como vai plotar o grafico
>
>* Type of graph
>THISFORM.Olbgrafico.ChartType = xlLine
>
>
>* Title
>THISFORM.Olbgrafico.HasTitle = .T.
>WITH THISFORM.Olbgrafico.ChartTitle
> .CAPTION = ALLTRIM(graf.NOME) + " / " + ALLTRIM(graf.especie)
> .FONT.SIZE = 18
> .FONT.NAME = "Arial"
> .FONT.COLOR = RGB(255,0,0)
>ENDWITH
>
>* Legend
>THISFORM.Olbgrafico.HasLegend = .F.
>
>* change size of dates
>WITH THISFORM.Olbgrafico.Axes(xlCategory, xlPrimary).TickLabels
> .FONT.SIZE = 8
> .ORIENTATION = 65
> .FONT.BOLD = .T.
>ENDWITH
>
>* Type of plot ( plot by )
>THISFORM.Olbgrafico.PlotBy = xlColumns

Peter,
All you needed was 'object.application'.
THISFORM.Olbgrafico.object.application.PlotBy = xlColumns
'object.application' would be needed for some other properties too like datasheet.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform