Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Yousfi Benameur
  Where is Yousfi Benameur?
 El Bayadh
 Algeria
 Yousfi Benameur
 To: frank
  Where is frank?
 
 Indonesia
 frank
 Tags
Subject: RE: FoxCharts
Thread ID: 310631 Message ID: 310685 # Views: 48 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Windows Vista and VFP
Date: Thursday, June 23, 2011 12:56:44 PM         
   


> Hello all,
>
> I wonder if you guys can help me with the FoxChart class from vfpx.
> I have a problem with recno() from the acoord array for charttype=4 (the points chart) since it is not giving me the right record number.
> When I use different type of charttype like charttype=5, it is giving me the right record number.
>
> What is wrong is this:
> with charttype=4 the recno() is 1,1,2,3,4,5
> with charttype=5 the recno() is 1,2,3,4,5,6 (since it's the record number)
>
> This looks like not a big problem but when we have a multiple lines, the recno() is really critical to refer to the right corresponding columns to give a valid response to the user.
>
> I wonder if you guys can help me pointing out the wrong code in the foxchart class so I can fix this problem.
> Thank you.
>
> frank sinatha

Accordinatly to your datas,in your form.init put this code (make a particular attention to build the cursor).
CREATE CURSOR mycurs (myChart1 n(8,2),   Month c(2))
INSERT INTO mycurs VALUES( 12 , "1")
INSERT INTO mycurs VALUES( 30,  "2")
INSERT INTO mycurs VALUES( 17,  "3")
INSERT INTO mycurs VALUES( 70,  "4")
INSERT INTO mycurs VALUES( 84,  "5")
INSERT INTO mycurs VALUES( 15,  "6")
*brow

LOCAL loChart
loChart = This

WITH loChart as FoxCharts of FoxCharts.Vcx
.ChartType = 4 && pOINTS
.ChartsCount = 1
.SourceAlias = "mycurs"
.FieldAxis2 = "Month"
.FieldLegend = "Month"
.Fields(1).FieldValue = "myChart1 " 
.Fields(1).Legend = "myChart1 Legend "
.Fields(1).Color  = RGB(100,175,213)
* Setting the title and subtitle
.Title.Caption = "FoxCharts points sample"
.SubTitle.Caption = ""
.FontName ="Tahoma"

* Setting the Chart Depth ( 3d effect )
.Depth = 0
* Set the backColor
.BackColor = RGB(255,255,255)
* Set the colors to Random
.ColorType = 2 && Random
* Set Colors to Gradient
.BrushType = 2 && Gradient colors
* Set the captions for the axis
.XAxis.Caption = "Month"
.YAxis.Caption = "DINARS"
* Set the 2nd legend
.AxisLegend2.Alignment = 0 && Left
.AxisLegend2.Rotation = 0  && 0-360 degrees
.AxisLegend2.FontName = "Verdana"
.AxisLegend2.FontSize = 12
* Draw the chart
.DrawChart()
ENDWITH


with this there is no problem see this result photo :



Regards
Yousfi Benameur

ENTIRE THREAD

FoxCharts Posted by frank sinatha @ 6/23/2011 5:02:24 AM
RE: FoxCharts Posted by Koen Piller @ 6/23/2011 9:10:21 AM
RE: FoxCharts Posted by frank sinatha @ 6/23/2011 2:20:57 PM
RE: FoxCharts Posted by Koen Piller @ 6/24/2011 2:49:10 AM
RE: FoxCharts Posted by frank sinatha @ 6/24/2011 3:50:59 AM
RE: FoxCharts Posted by Koen Piller @ 6/24/2011 10:39:52 AM
RE: FoxCharts Posted by Yousfi Benameur @ 6/23/2011 12:56:44 PM
RE: FoxCharts Posted by frank sinatha @ 6/23/2011 2:20:23 PM
RE: FoxCharts Posted by Yousfi Benameur @ 6/23/2011 3:02:45 PM
RE: FoxCharts Posted by frank sinatha @ 6/24/2011 3:53:04 AM
RE: FoxCharts Posted by Yousfi Benameur @ 6/24/2011 12:41:00 PM
RE: FoxCharts Posted by Koen Piller @ 6/24/2011 12:52:44 PM
RE: FoxCharts Posted by Yousfi Benameur @ 6/25/2011 8:34:02 AM
RE: FoxCharts Posted by Koen Piller @ 6/26/2011 1:36:07 AM
RE: FoxCharts Posted by Yousfi Benameur @ 6/26/2011 8:54:44 PM
RE: FoxCharts Posted by Mike Yearwood @ 6/27/2011 2:19:48 AM