Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Microsoft: FoxPro FAQ


DrawChart() not displaying join by Luikj
Posted: 5 Aug 19

Hi Experts: Learning charting. . .I ran "chartssample_dynamic" from the hlp file but only the form
runs and comes up with an empty canvas. . .it feels like I am missing something fundamental. . .
Can you point me in the right direction . . .!!!!
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 ;
* 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.
browse &&&&&&&&&&&&&&& browse deplays join just fine.
(Years back, I used Mike Lewis' activeX simplechart which makes him a hero!)
Any feedback will be deeply appreciated! thanks Lu

Back to Microsoft: FoxPro FAQ Index
Back to Microsoft: FoxPro Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close