Hi experts: am trying to learn graphing. . . in vfp9...
(from Doug Hennig sample "Our first chart" FOXCHART)
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
* Get the data for the chart.
open database _samples + 'Northwind\Northwind'
select Categories.CategoryName, ;
sum(OrderDetails.UnitPrice * OrderDetails.Quantity) as Sales ;
from Products ;
join Categories on Products.CategoryID = Categories.CategoryID ;
join OrderDetails on Products.ProductID = OrderDetails.ProductID ;
group by 1 ;
into cursor ChartData
*BROWSE opens ChartData and does joins just fine. . .placed foxchart.vcx on form. . .
with this.oChart as FoxCharts of FoxCharts.vcx
* But throws error says "oChart" not found
** oChart is the name of my blank form, trying to figure out what I am doing wrong.
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
* Specify the chart type and other settings.
.Anchor = 15
.ChartType = 7 && Bar
.ColorType = 0
* Specify the data for the chart.
.SourceAlias = 'ChartData'
.FieldAxis2 = 'CategoryName'
.Fields(1).FieldValue = 'Sales'
.FieldLegend = .FieldAxis2
* Specify the chart and axis captions.
.Title.Caption = 'Sales by Product Category'
.SubTitle.Caption = ''
.XAxis.Caption = 'Product Category'
.YAxis.Caption = 'Total Sales'
* Draw the chart.
.DrawChart()
endwith
Any feedback would be deeply appreciated.
Lui
(from Doug Hennig sample "Our first chart" FOXCHART)
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
* Get the data for the chart.
open database _samples + 'Northwind\Northwind'
select Categories.CategoryName, ;
sum(OrderDetails.UnitPrice * OrderDetails.Quantity) as Sales ;
from Products ;
join Categories on Products.CategoryID = Categories.CategoryID ;
join OrderDetails on Products.ProductID = OrderDetails.ProductID ;
group by 1 ;
into cursor ChartData
*BROWSE opens ChartData and does joins just fine. . .placed foxchart.vcx on form. . .
with this.oChart as FoxCharts of FoxCharts.vcx
* But throws error says "oChart" not found
** oChart is the name of my blank form, trying to figure out what I am doing wrong.
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
* Specify the chart type and other settings.
.Anchor = 15
.ChartType = 7 && Bar
.ColorType = 0
* Specify the data for the chart.
.SourceAlias = 'ChartData'
.FieldAxis2 = 'CategoryName'
.Fields(1).FieldValue = 'Sales'
.FieldLegend = .FieldAxis2
* Specify the chart and axis captions.
.Title.Caption = 'Sales by Product Category'
.SubTitle.Caption = ''
.XAxis.Caption = 'Product Category'
.YAxis.Caption = 'Total Sales'
* Draw the chart.
.DrawChart()
endwith
Any feedback would be deeply appreciated.
Lui