A WPF and XAML based chart

While having fun with WPF/XAML in my spare time, I came across this work by John Stevien at CodeProject. So I went out to try something fun with WPF and see if we can create something similar to the charts you see on Google finance. Since unlike Adobe Flex platform, WPF/XAML lacks any built-in support for data charts, I think this could be something helpful in real-life applications. Here is the results of this 4-hour adventure. I’ve created a WPF/XAML based 2D filled chart that supports dynamic zooming and panning, and track-ball of the current chart positions for time-series data. This chart could possibly be used in many situations where time-series data needs to be displayed.

This chart utilize the flexibility and power of the “adorner” class in WPF Visual elements. The following shows the chart in action:

[ Update: 7/20/2007]

The source code is uploaded to my Box.net share here. You can download and try the code.

[Update: 1/16/2009]

A new source code link is posted at:

new source code link

30 Responses to “A WPF and XAML based chart”

  1. Yet another WPF chart example « WPF Wonderland Says:

    [...] you are looking for ideas, Li Gao just published another WPF charting example (no source code available [...]

  2. Walt Ritscher Says:

    Any thought about makig the source code available?

    http://wpfwonderland.wordpress.com/

  3. ligao101 Says:

    Walt, thanks for your interests in this chart. I will clean up my code and remove some confidential info and then post the source code here. Stay tuned.

  4. ligao101 Says:

    The source code is posted in my Box.Net share. The link is on the bottom of the blog entry page.
    The download link is http://www.box.net/shared/j2u1ir2nfc

  5. Walt Ritscher Says:

    Thank you. I updated my post.

  6. Jiping Wang Says:

    Can this wpf Chart be implemented in Silverlight ???
    Anyone has an idea ??

  7. ligao101 Says:

    It will be interesting to see this implemented in Silverlight. Since it just went for RC1, I will see if I can make it work under Silverlight.

  8. Another chart in WPF « Tech Blog of Li Gao Says:

    [...] chart in WPF A few weeks back I posted a WPF-based chart in my blog. Currently in one of my projects I need to deploy charts that support displaying [...]

  9. Andy Says:

    Oh, and did not know about it. Thanks for the information …

  10. RandomChartUser Says:

    4 hours hey…

  11. Josh Says:

    Dude, this is awesome!!! GREAT JOB!

  12. watson31 Says:

    hi there ,if you guys are in search of silverlight then chk this out visifire its an amazing charting component under open source for free

  13. Jen Says:

    I can’t download the source code from Box.net account. Could you please check? I really like your chart. Thanks!

  14. WPFNubi Says:

    I think the link is still broken. I really want to download this and checked it out.

  15. Ted Says:

    Looks interesting, can you please republish the code?

    Thanks

  16. Peter Says:

    I cannot download the source for your graph – Could you please send it?
    Thank you!

  17. B j Says:

    Looks great. Can’t download, would be nice if you can repost it. Thanks.

  18. sacha Says:

    Any chance we can download the source, it looks great.

  19. VT Says:

    The Box.net account does not show the file to download and displays an error. could you share the source code please?

    I am impressed and would like to try it out.

    Thanks,
    VT

  20. Chart Says:

    Hi, could you post source code?

  21. boomhauer Says:

    code seems to be missing

  22. Scott Green Says:

    You guys should check out Visifire at http://www.visifire.com. It is open source and supports both WPF and Silverlight using a single API.

  23. Jim Says:

    Any chance of making the source available again?

    Thanks!
    Jim

  24. Qtefzlbw Says:

    Thanks!,

  25. Anonymous Says:

    Could you PLEASE post the source code? Thanks!

  26. oli Says:

    Hi,

    Will the source be available again ?

  27. ligao101 Says:

    Hi all,

    I’ve just posted the new source code link. Check the bottom of the blog page.
    Sorry for the broken link. Haven’t updated it for quite some time.

  28. oli Says:

    thanks a lot

  29. MSDN geekSpeak : Resources for geekSpeak: WPF for the Business Programmer with Paul Sheriff Says:

    [...] http://ligao101.wordpress.com/2007/07/17/a-wpfxaml-based-chart/ [...]

  30. Resources for geekSpeak: WPF for the Business Programmer with Paul Sheriff | Coded Style Says:

    [...] http://ligao101.wordpress.com/2007/07/17/a-wpfxaml-based-chart/ [...]

Leave a Reply