home.png FoxCharts

A class based on the ImageCanvas class from GdiPlusX that allows VFP developers to directly draw charts and graphs.

38236

Project Manager is Cesar, who can be reached at: vfpimaging {-at-} hotmail {dot-here} com

Goals of FoxCharts:
  • Create good looking and modern charts in pure VFP code
  • NO ActiveX components
  • Easy to setup
  • Easy to customize
  • Easy to save to disk or print
  • Open Source
  • Benefit from all the GdiPlusX drawing capabilities, allowing users to modify the charts the way they like
  • Save as EMF, resulting in perfect charts when printed in VFP reports
  • Full control of the chart shapes
  • Tooltips
  • Mouse control

Prerequisites:
  • Visual FoxPro 9 and the GdiPlusX library from VFPX

Currently available:
  • Single Bars, Multiple Bars, Stacked Bars, Shapes or points, Lines, Area, Pie and Donut charts, in various color variations, using gradients, custom colors, transparent, basic and random colors.
  • Titles, subtitles and legends
  • Scales, Both Axis
  • Drawing texts inside shapes

vfpxreleasesmall.png Download the latest STABLE release of FoxCharts
vfpxreleasesmall.png Download the latest BETA release of FoxCharts

38236

Also available: FoxCharts Tools...
  • VisualChartDesigner - UI control class to allow developers and/or users to modify charts interactively as they are displayed on the screen.
  • GetChartDataFromRows.PRG - PRG to transpose a cursor where each data series is in a row into the form required by FoxCharts.
38236


1Donut.png
2Line.png
3multibar.png
4monoch.png
5Pie.png
6Shapes.png
7Stacked.png
8Area.png
FoxChartsNew_4.png
FoxChartsNew_3.png

Last edited May 23, 2013 at 4:04 PM by VfpImaging, version 24

Comments

vgulielmus Mar 25 at 6:51 PM 
Outstanding work. The words cannot express my gratitude.

Vilhelm-Ion Praisach.

sebae Mar 12 at 2:31 PM 
Brilliant Cesar. Foxcharts makes me look like a wizard!

soykanozcelik Oct 9, 2013 at 12:11 PM 
Is there anyone that complain when execute .exe file under windows8 (32-64) and empty graph

PS : its working well when launch on the form its only occurs at exe file

any suggestion would be very appreciated.

sharereg Sep 20, 2012 at 8:13 AM 
Hello,
If it will be established, for example, SET DECIMAL TO 2, places will occur a syntactic mistake.

deanphillips May 2, 2012 at 4:35 PM 
These charts are truly amazing. They saved us money and look great. I have two questions: 1) Is it possible to keep the FieldLegend values different from the actual Fields(1).Legend value. I have short codes I want in the FieldLegend but want a longer description on the tooltip on the actual chart. 2) Is it possible to stop the chart from drawing when it encounters a 0?

jerryy Apr 24, 2012 at 4:37 PM 
I added chartssample_builder.scx into my project manager.
I am able to run it from project manager (click Run)
but when I compile and run it from the program, I always get an error: Microsoft Visual FoxPro has encountered a problem and needs to close.

please advise
thanks for the help

ceau Mar 28, 2012 at 2:22 PM 
Thanks VFPx. VisualFox is great. Foxcharts is cool is very good, i'm using in my applications. VisualFox is alive! (from Colombia)

jlwade Jan 12, 2012 at 9:26 AM 
After displaying a chart, and issuing:

Set REPORTBEHAVIOR 90
Private oFoxChart && needed by report
oFoxChart = This.Parent.Foxcharts1.ChartCanvas
Report Form FoxChartsView Preview Nowait



I get the error "_REPORTOUTPUT" is not found, and the report doesn't display. I have even copied back in the original report to see if this fixed the issue.



I can save to clipboard, save to file etc, the Toprinter() also works. Just not the VFP report



Please help !

AlanL99 Sep 7, 2011 at 7:32 PM 
Win xp runs great Win 7 is a mess- backgrounds going transparent I need this to work. Hope someone has fix.

DDTech May 31, 2011 at 3:00 PM 
Cesar,
this is a lovely piece of work. Thanks a lot!!
I added a little bit of functionality (just a few lines of code and a few properties):
When having longer data-series (like every day over a month) which would result result in overlapping labels on the xAxis (even with rotation), You can now set .xAxisLegendEvery and .VerticalBackLineEvery to a value greater than 1 (both with an optional offset) giving more "air" below the x-Axis.

Nothing fancy, just a few lines of code. What Should I do to contribute this?

CaptainCyril May 30, 2011 at 2:52 PM 
Great job!

I am still testing it and so far I love everything about the charts. I just have one question. Can we format (InputMask) the values of the data labels? If I wish to have one decimal or none? Does it round?

Thanks!

saintbpp Jan 14, 2011 at 5:55 AM 
Many Thank for great project :2 thumbup:.Very usefull for me.

HansPeterGr Nov 20, 2010 at 6:19 PM 
Is it possible to set numeric-values to xAxis instead of text-values?
I need this to show measurement-data with X- and Y-Values.

KenAGreen Aug 18, 2010 at 4:43 PM 
I'd heard of FoxCharts but ignored it because I thought it required an ActiveX control. It didn't matter as I didn't have much need of charts. But, a new need arose and what a great chunk of code this is. Fantastic job Cesar!

foxpertise Jul 12, 2010 at 11:57 AM 
I was getting an error message "GDIPlusError:InvalidParameter" under certain circumstances. It originated from the _legend class when a subtitle had not been assigned. The "offending code" was tracked down to _legend._updatemeasures and I made the following change to solve the issue:

If Not Empty(lcCaption) && Modified by Paul Newton 12 Jul 2010
loSize = This.Parent.oGfx.MeasureString(lcCaption, This._oFont) &&, This._oStringFormat)
This._Height = loSize.Height
This._Width = loSize.Width
Else
This._Height = 0
This._Width = 0
EndIf

I don't know if this should be necessary but it solves the problem in my case and I thought I would pass this on in case it is of use or interest to anybody

RCampbell12 Jul 1, 2010 at 2:31 AM 
Thanks, Doug. I read that and he had some issues running it across a network, specifically running it off a NAS server. The problem was not fixed, but he did report that it ran fine locally. I am doing the dev and testing locally. I am running in a Win7 VM on a MacBook Pro using VMWare Fusion, but I find that it runs quite fast. I will transfer it to the client's machine and see what I get there.

DougHennig Jun 30, 2010 at 8:02 PM 
See this thread: http://vfpx.codeplex.com/Thread/View.aspx?ThreadId=203777.

RCampbell12 Jun 30, 2010 at 6:53 PM 
I'm having a problem with speed. It's taking about 6 seconds to create a pie chart that I need to display in a web app. This is really too long. What can be done to increase performance?

JimRNelson May 19, 2010 at 5:12 PM 
Users are getting the following bug report ... the folder reference (C:\USERS\BDURBAN) makes no sense, it does not exist on my machine or anybody else's ... looks like Bo's ????

Error message: Error reading file c:\users\bdurban\appdata\local\temp\system.drawing.fxp.
Program: XFCSYSTEM.DRAWING_ACCESS
Line number: 80
Error number: 1104
SYS(2018): C:\USERS\BDURBAN\APPDATA\LOCAL\TEMP\SYSTEM.DRAWING.FXP

Stef78 Apr 15, 2010 at 4:21 PM 
I have many procedures in "set procedure to", so foxchart is really slow.
If I empty "Set procedure to", foxchart is much faster. Why?
Can I do something?
Stef

vitorianop Apr 9, 2010 at 2:15 PM 
i try FoxCharts 1.20 under Windows XP and Windows Vista and works fine. When i try FoxCharts 1.20 in Windows 7, when i'm developing the project, i can see perfectly the graphics, but when i build the project into an Win32 executable the FoxCharts' canvas is not showing anything (but if i run the same executable in XP or Vista i can see perfectly the graphics)
Someone can help me?

(I'm using VFP 9 SP2)

TIA,
Pedro

walney Feb 20, 2010 at 3:57 AM 
aconselho a todos baixarem, muito bom mesmo, o cara é fera

GeneB Jan 29, 2010 at 5:05 AM 
I just installed FoxCharts and went through the video tutorial where the instructor drags the FoxChart control onto a form from the Form Controls toolbar. I can't find a reference on how to install a custom button on an existing or custom toolbar. Can anyone point me in the direction of a tutorial that explains how to do that?

Thanx,
Gene Gerard

JimRNelson Jan 18, 2010 at 7:47 PM 
Pedro -- That is very strange. Is the message you refer to occur when you are trying to run the chart, or when you are trying to edit the form on which the chart is defined?

Jim Nelson

Pedromorais Jan 18, 2010 at 2:00 PM 
sorry, foxcharts v1.20

Pedromorais Jan 18, 2010 at 1:59 PM 
I could not run the example of these graphs using the foxcharts tools. Used the foxcharts v1.2 and when I try to run it states: "Eror loading file - record number 5. cmdchartoptions1 <or one of it's members>. Parent: object class is invalid for this container"
someone help me?

GREGONET Dec 24, 2009 at 12:18 PM 
Cesar... Vc é um mestre imbativel !!!
Muito Obrigado por sua dedicação nesse trabalho
e por compartilhar com o Mundo.
Abraço
Grego.

zokk Dec 22, 2009 at 5:38 AM 
Cesar, this is fantastic, congratulations !

mharpen May 5, 2009 at 4:47 AM 
Awesome stuff. Thank you Cesar!!! If I may suggest, please consider the ability to draw an "Average line" (ie. dotted line) on the bar charts. Where we have the option to specify the average value in case it requires a special calculation, in which case we would supply the value. Thanks again!

cmtrmstr Jan 30, 2009 at 11:54 AM 
Cesar ! Thanks a lot for this beautifull tool I have downloaded Foxcharts 1.10

Q1. What property i have to set for tooltip of every bar shows total amount of selected field as tooltip

Q2. ,(comma) is set on 1000 how can i set comma on X,Y-Axis as i like
e.g. on lacs,crores 23,45,25,940.00

mbabcock16 Jan 13, 2009 at 12:58 AM 
Cesar -- is it possible to see the code you used to generate these samples?

billfitz Dec 29, 2008 at 1:34 PM 
I downloaded Foxcharts yesterday and was producing good charts from my data two hours later.
I crashed the first time because I was a using a numeric month number as a legend. A little debugging showed me that you're looking for a string there and once I made it a string I was off and running.
Great tool.
I hope to be able to add some help with documentation.

jawadfrhad Aug 3, 2008 at 11:28 AM 
hello cesar,
i need to build a program it's about charts and they lead me to you so i'm hoping that you can help me.
i have a chart about childs Vaccinations thats Consists of xy plane in the x plane represants the weight and the y plane represent the age,now i need to make the program that have a buttom that when i enter any given coordinate and push the buttom i t can pull a chart with the position of the given point on the chart, can you help me please.

DJSERGIO Apr 9, 2008 at 7:06 PM 
Great stuff Cesar !
Keep it up :)