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!

*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

foxcharts chartssample_dynamic form

foxcharts chartssample_dynamic form

foxcharts chartssample_dynamic form

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 ;
* 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 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!!)

RE: foxcharts chartssample_dynamic form


Check that you have all VFP updates installed. The sample is working fine as you uploaded it.

RE: foxcharts chartssample_dynamic form

You are not missing anything in this coding, it is coding as in the sample. What you are missing is the instantiation of loCharts in my opinion. Please run the project first.

1. Open the Foxcharts.pjx
2. Activate the demostart.prg
3. Now either use the Foxcharts Sample form:
1. Select a form sample from the grid, hightlight
2. Press the button Run
Press the button Modify


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

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