FoxCharts !!!

wanna create some cool charts in vfp ?

with no activex controls, dlls, or 3rd party products ?

what do you think of these ?




recently, i’ve seen many discussions about people asking for charts components.
since gdiplusx brings us all these possibilities, i thought it would  be worth to start a project regarding this.


foxcharts is a subclass of the imagecanvas class from gdiplusx, that allows us to direct draw in an image object, among many other cool and useful features, that are not in the scope of this post.

goals of foxcharts:
- create good looking and modern charts in pure vfp
- 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

visual foxpro 9 and the gdiplusx library from vfpx 

in the source code you'll find a sample form, “newchart.scx” that allows to create different kinds of charts using this class.

please note that as it is still in alpha version, the codes that create the charts are still in the sample form. gpcharts.vcx is (at this moment) just a holder that contains the pems needed to draw. in development mode, double click the imagecanvas object to see the source code that generates these charts.

the codes that will instantiate gpcharts reside in the init() event of the sample form, only there.


currently available:
bars, lines, area, pie and donut charts, in various color variations, using gradients, custom colors, basic and random colors.
titles, subtitles and legends


to do:
enhance the data filling, create a builder, allow different kinds of charts to appear together (eg. lines and bars). legends in the y and x axys.

and obviously:
fix some bugs !

if you are interested in developing and enhancing foxcharts, feel free to post a comment here.
your suggestions, tips, critics, testing and bugs hunting will be most appreciated !


download directly from the foxcharts page in vfpx






  1. Hi Cesar,

    Simply congratulation !

    I wait this tips for along time !

    ps : do you know the way to use this class in Report Frx ?

    Thank's for Foxpro and all Fox's developer


  2. Excelent work once again Cesar.

    VFP and GDI+ Rock!

    Dave Crozier

  3. Terrific!

    This will be very useful to VFP Community.

    I don't know why you wasn't named an MVP yet!

  4. Holy Cowpie!

    Great work!!! You've done it again Cesar!

    Although my wife doesn't know it yet, I know what I'll be doing this weekend ;-)

  5. Absolutely stunning!!! Thank you!


  6. Wow...great stuff!

    What's in your future plans?  You seem to make such great things for VFP with GDI that I'd be interested in hearing "what's coming" ...thanks!

  7. awesome dude....keep up the good work.

  8. Cesar

    Absolutely Brilliant!!!

    Need I say more?

  9. Bom trabalho, César 

    O grafismo é Muito Bom. Tomara que eu seja capaz de fazer qualquer coisa com jeito. Vou tentar experimentar.

    Um abraço.

  10. Cesar

    Terrific work ... again :)

    In my book you already are an MVP

    VFP + GdiPlusX rocks!

    Obrigado !!!

  11. Hello, César

    Quando tento compilar o exemplo FoxChartsAlpha obtenho o seguinte erro.

    Compiling f:\documentos\arui\visual foxpro projects\papacalorias\bibls\gdiplusx.vcx
    Error in global include file: Include file 'f:\documentos\arui\visual foxpro projects\papacalorias\bibls\system.drawing.h' is not found.

    É bug?


    Olá Rui !
    Obrigado por testar. Na verdade, eu incluí o arquivo "System.App" para facilitar os testes dos usuários. O ideal´seria baixar a GdiPlusX diretamente do site do CodePlex, assim vc estará seguro de estar usando a versão mais recente.
    De toda forma, eu acabo de atualizar o arquivo, incluindo os arquivos de "Header" necessários. Por favor, baixe novamente !
    Não se esqu~ça de que esta versão é ALPHA ainda, não é recomendada para uso em produção. :-)
    Um abração

  12. Impressive stuff. Will give it a shot

  13. Thanks very much for the kind words, positive feedback and comments! I hope to publish an updated version in the next week, with some few new features.

    IMO, with the help comming from the community, FoxCharts can become a very useful and popular tool.

    GdiPlusX Rocks !

  14. Bravo Cesar!

  15. Simply brilliant, man you are awesome!!!

    Thanks, thanks, thanks

    Shine on you crazy diamond!!!

  16. Uhhh, I don't know what to say.....

  17. Syed Nadeem IqbalApril 5, 2008 at 12:45 PM

    Well done Cesar

  18. Thank you! Cesar!

    But... there is so much new vfp-stuff going around these days...

    I don't have enough time to learn and use all these nice new things... :-|

  19. Wow - Awesome in so many ways!!!!!!!!!!


  20. thank you so much Cesar for this great tool!

  21. Great work Cesar !! I'm loving Foxpro!

    I too had the same thought like Emerson... why you wasn't named an MVP yet!

    but no probs! you are MVP for all here..

  22. No Words of expressing thanks, but simply thank you.
    Kindly explain how to print this??
    Hi, thanks for the kind words.
    About printing, right now the most simple way is to save the image in a temp file and use the report designer to print.
    Another option is to send directly to the printer using Gdi+, just like this:
    Obviously, I hope to show how to use the class directly in a form, but I'll leave this for the future.
    PLEASE wait, don't put this in production yet. I need to apply some important modifications, and in the next few days I'll post a new and more confident version.

  23. Hola César, esto excelente, trabajo desde mucho tiempo en procesamiento de información con VFP y esto me va a servir para añadirle a mis programitas y tal vez mejorar y ayudar crear mejoras en el código para la salida gráfica.

    Muchas gracias por tan excelente trabajo,


  24. Parabens César!

    Excellent work. Looking good indeed!

  25. Parabéns Cesar! Excelente trabalho!

  26. How to set up targets?

  27. I have already put in my class

    Very great design

  28. Felicitaciones por este gran trabajo y muchas gracias.

  29. Cesar

    Excelente trabajo, mis felicitaciones por tan generosa entrega.



  30. Victor VelasquezApril 8, 2008 at 1:43 PM

    Excelente aporte cesar, gracias por compartir..

  31. Very simple!, very beautiful!, very practical!

  32. The effect was very good, looking forward to more features

    Thank you!

  33. Wow..it's very cool. VFP Is Rock !

    Thank's Chesar ...

  34. hi Cesar, estoy enormemente agradecido y felicitaciones por los graficos

    Saludos Luis antonio

  35. Very Nice tool.


  36. Excellent job! a gift for VFP community



  37. Its a beautiful tool! Thankx a lot!

    Just one question... hopefully not too stupid..

    When I try to play around with it, it always says the first time:

    "Error initiating class. Cannot find ...\source\gdiplusx.vcx"

    It then offers "locate, ignore and cancel"

    When I locate it manually it runs from then on..

    Is there any way to avoid this?

    Can you help?


  38. Excelente...!!!

    gracias por todo...

  39. Cesar, Great Stuff.

    Just updated my platform to Windows 7 OS.
    Have started getting this error, only the first time click.

    "Unknown Member System"
    Error from "Form1.FoxCharts1.ChartCanvas.CreateOSB

    Although the same runs flawlessly while in development stage?


    Hi Stanley,
    Do you have VFP9SP2 installed ? Vista and Seven need SP2 to avoid problems.

  40. I have using the Chart in VFP. I see this. This is excellent work and I required the donut chart files. and how to create in vfp

  41. it is cool , but i have try to use foxchart in windows 8 , but i can't see the graphics , only when the projec is compiled. i f i use the application on vfp i see all graphics . what can i do ?

  42. Please upgrade your VFP9 to SP2, that brings some needed fixes for Win Vista / Seven / 8