This project is read-only.

home.png FoxCharts

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


Note: this project has moved to GitHub:

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

  • 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


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.


Last edited May 2 at 2:42 PM by DougHennig, version 25


ziotaki Jul 16, 2016 at 3:57 PM 
Hi, I have a problem with working with foxcharts. i have downloaded foxcharts_1.20 and extracted it in a sub directory. then i've generated the excutable. then insert all vfp9*.dll that are needed to execute the exe file independently. now, launching the exe fileand selecting any chart from the menu the chart dosen't show. the os of pc is 64 bit ( windows 10) any help for this problem ?

ziotaki Jul 16, 2016 at 9:38 AM 
Is there anyone that complain when execute .exe file under windows10 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.

EricaLima Jul 15, 2014 at 7:53 PM 
Great work! I'm trying to use your class, but i wanna something flexable. I don't want fields fixed. i tried with a for but i couldn't. Can you help me?

Thanks a lot!

lans41 Jun 25, 2014 at 7:44 AM 
Hi, im using newer foxchart 1.46, this is amazing chart, until now no bugs, but, when i use double axis, example : The first axis and the second axis of sales 400000 sales returns 40000, the value displayed overlapping.
Hope this can fixed.

JanBrebera May 3, 2014 at 10:34 AM 
some syntax issues found when compiling FoxCharts 1.46.1 beta


=.DrawContour (EVL(loShape.Front,loShape.Contour ),loShape.CoordNum ),.F.)

DECLARE LONG DrawThemeEdge IN UXTHEME LONG hTheme, LONG hdc, LONG iPartId, LONG iStateId, LONG @pDestRect, uint egde, uint flags, LONG @pRect

DECLARE LONG HitTestThemeBackground IN UXTHEME LONG hTheme, LONG hdc, LONG iPartId, LONG iStateId, LONG dwOptions, LONG @pRect, LONG hrgn, POINT ptTest, STRING @code

VFP9 does not report any error but ignores it and the compiled code is not as expected
- AS clause in PRIVATE command
- unbalanced parenthesis
- type UINT and POINT in DECLARE-DLL command

JoergArand Apr 28, 2014 at 10:22 AM 
Is it possible to generate true xy line/point charts (x-axis decimal values like 1.0, 1.02, 1.05; not categories like years in the samples).

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

Vilhelm-Ion Praisach.

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

soykanozcelik Oct 9, 2013 at 1: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 9:13 AM 
If it will be established, for example, SET DECIMAL TO 2, places will occur a syntactic mistake.

deanphillips May 2, 2012 at 5: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 5: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 3: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 10:26 AM 
After displaying a chart, and issuing:

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 8: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 4:00 PM 
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 3: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?


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

HansPeterGr Nov 20, 2010 at 7: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 5: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 12:57 PM 
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
This._Height = 0
This._Width = 0

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 3: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 9:02 PM 
See this thread:

RCampbell12 Jun 30, 2010 at 7: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 6: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.
Line number: 80
Error number: 1104

Stef78 Apr 15, 2010 at 5: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?

vitorianop Apr 9, 2010 at 3: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)


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

GeneB Jan 29, 2010 at 6: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?

Gene Gerard

JimRNelson Jan 18, 2010 at 8: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 3:00 PM 
sorry, foxcharts v1.20

Pedromorais Jan 18, 2010 at 2: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 1:18 PM 
Cesar... Vc é um mestre imbativel !!!
Muito Obrigado por sua dedicação nesse trabalho
e por compartilhar com o Mundo.

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

mharpen May 5, 2009 at 5: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 12:54 PM 
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 1:58 AM 
Cesar -- is it possible to see the code you used to generate these samples?

billfitz Dec 29, 2008 at 2: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 12:28 PM 
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 8:06 PM 
Great stuff Cesar !
Keep it up :)