Hi Experts; Learning foxcharts/gdiplusx. . .starting on samples. . .
Question regardng the following= "chartssample_dynamic". the following is the int
of that form in "help". It runs fine and displays a "blank" canvas.
I am missing something fundamental I believe.
*************************************************************************************
Thisform.Newobject("MyChart", "FoxCharts", LOCFILE("FoxCharts.vcx"))
loChart = ThisForm.MyChart
With loChart as FoxCharts of FoxCharts.vcx
.Move(0, 0, Thisform.Width, ThisForm.Height)
.Anchor = 15 && Resize width and Height
.SubTitle.CAPTION = ''
.BrushType = 2 && gradient brush
.ColorType = 2 && Random colors
.Depth = 30
.Legend1 = "Legend #1"
.ChartsCount = 2
.ShowSideLegend = .T.
* Execute the SQL for the chart.
OPEN DATABASE HOME(1) + 'Samples\Northwind\Northwind'
SELECT Categories.CategoryName, ;
SUM(OrderDetails.UnitPrice * OrderDetails.Quantity) AS Sales, ;
(SUM(OrderDetails.UnitPrice * OrderDetails.Quantity) / 2) AS Sales2 ;
FROM Products ;
JOIN Categories ON Products.CategoryID = Categories.CategoryID ;
JOIN OrderDetails ON Products.ProductID = OrderDetails.ProductID ;
GROUP BY 1 ;
INTO CURSOR ChartData
* Specify the data source for the chart.
.SourceAlias = 'ChartData'
.FieldAxis2 = 'CategoryName'
.FIELDS(1).FieldValue = "Sales"
.FIELDS(1).Legend = "Sales"
.FIELDS(2).FieldValue = "Sales2"
.FIELDS(2).Legend = "Half Sales"
.FieldLegend = .FieldAxis2
* Specify the chart type and chart and axis captions.
.TITLE.CAPTION = 'Sales by Product Category'
.XAxis.CAPTION = 'Product Category'
.YAxis.CAPTION = 'Total Sales'
.AxisLegend2.ROTATION = -45
.AxisLegend2.ALIGNMENT = 1 && Right
.ScaleLegend.FORMAT = '@$ 9,999,999.99'
.ChartType = 7 && Bar
.Visible = .T.
.DrawChart()
ENDWITH
***************************************************************************
browse && browse works good displaying the join.
. . .but the ".DrawChart()" opens the form and displays only the canvas.
Can you give me some direction on what I am missing? Lu
(. . .I am spoiled by Mike Lewis' simplechart from years back!!)
***************************************************************************
Question regardng the following= "chartssample_dynamic". the following is the int
of that form in "help". It runs fine and displays a "blank" canvas.
I am missing something fundamental I believe.
*************************************************************************************
Thisform.Newobject("MyChart", "FoxCharts", LOCFILE("FoxCharts.vcx"))
loChart = ThisForm.MyChart
With loChart as FoxCharts of FoxCharts.vcx
.Move(0, 0, Thisform.Width, ThisForm.Height)
.Anchor = 15 && Resize width and Height
.SubTitle.CAPTION = ''
.BrushType = 2 && gradient brush
.ColorType = 2 && Random colors
.Depth = 30
.Legend1 = "Legend #1"
.ChartsCount = 2
.ShowSideLegend = .T.
* Execute the SQL for the chart.
OPEN DATABASE HOME(1) + 'Samples\Northwind\Northwind'
SELECT Categories.CategoryName, ;
SUM(OrderDetails.UnitPrice * OrderDetails.Quantity) AS Sales, ;
(SUM(OrderDetails.UnitPrice * OrderDetails.Quantity) / 2) AS Sales2 ;
FROM Products ;
JOIN Categories ON Products.CategoryID = Categories.CategoryID ;
JOIN OrderDetails ON Products.ProductID = OrderDetails.ProductID ;
GROUP BY 1 ;
INTO CURSOR ChartData
* Specify the data source for the chart.
.SourceAlias = 'ChartData'
.FieldAxis2 = 'CategoryName'
.FIELDS(1).FieldValue = "Sales"
.FIELDS(1).Legend = "Sales"
.FIELDS(2).FieldValue = "Sales2"
.FIELDS(2).Legend = "Half Sales"
.FieldLegend = .FieldAxis2
* Specify the chart type and chart and axis captions.
.TITLE.CAPTION = 'Sales by Product Category'
.XAxis.CAPTION = 'Product Category'
.YAxis.CAPTION = 'Total Sales'
.AxisLegend2.ROTATION = -45
.AxisLegend2.ALIGNMENT = 1 && Right
.ScaleLegend.FORMAT = '@$ 9,999,999.99'
.ChartType = 7 && Bar
.Visible = .T.
.DrawChart()
ENDWITH
***************************************************************************
browse && browse works good displaying the join.
. . .but the ".DrawChart()" opens the form and displays only the canvas.
Can you give me some direction on what I am missing? Lu
(. . .I am spoiled by Mike Lewis' simplechart from years back!!)
***************************************************************************