2008-04-04

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



prerequisites:
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


http://www.codeplex.com/vfpx/wiki/view.aspx?title=foxcharts&referringtitle=home




 

 


 













46 comments:

  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

    Olivier

    ReplyDelete
  2. Excelent work once again Cesar.


    VFP and GDI+ Rock!


    Dave Crozier

    ReplyDelete
  3. Terrific!

    This will be very useful to VFP Community.


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

    ReplyDelete
  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 ;-)


    ReplyDelete
  5. Absolutely stunning!!! Thank you!

    Malcolm

    ReplyDelete
  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!

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

    ReplyDelete
  8. Cesar


    Absolutely Brilliant!!!


    Need I say more?

    ReplyDelete
  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.

    ReplyDelete
  10. Cesar

    Terrific work ... again :)


    In my book you already are an MVP


    VFP + GdiPlusX rocks!


    Obrigado !!!

    ReplyDelete
  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?

    Atenciosamente

    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
    César

    ReplyDelete
  12. Impressive stuff. Will give it a shot

    ReplyDelete
  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 !

    ReplyDelete
  14. Bravo Cesar!

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

    Thanks, thanks, thanks


    Shine on you crazy diamond!!!

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

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

    Well done Cesar

    ReplyDelete
  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... :-|


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

    ReplyDelete

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

    ReplyDelete
  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..

    ReplyDelete
  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:
    Thisform.GpCharts.oBmp.ToPrinter()
     
    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.
     
    Regards
     
    Cesar
     

    ReplyDelete
  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,


    José

    ReplyDelete
  24. Parabens César!


    Excellent work. Looking good indeed!

    ReplyDelete
  25. Parabéns Cesar! Excelente trabalho!

    ReplyDelete
  26. How to set up targets?

    ReplyDelete
  27. I have already put in my class


    Very great design

    ReplyDelete
  28. Felicitaciones por este gran trabajo y muchas gracias.

    ReplyDelete
  29. Cesar

    Excelente trabajo, mis felicitaciones por tan generosa entrega.


    Saludos!!


    M.-

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

    Excelente aporte cesar, gracias por compartir..

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

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


    Thank you!

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


    Thank's Chesar ...


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

    Saludos Luis antonio

    ReplyDelete
  35. Very Nice tool.


    Thanks

    ReplyDelete
  36. Excellent job! a gift for VFP community


    Zaheer

    abnasir@gmail.com

    ReplyDelete
  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?

    Thankx

    ReplyDelete
  38. Excelente...!!!

    gracias por todo...

    ReplyDelete
  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?

    StanleyPereira@Gmail.com

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

    ReplyDelete
  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

    ReplyDelete
  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 ?

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

    ReplyDelete