Search code examples
wpfchartsdiagram

WPF tool for charts, diagrams, graphs


I'm looking for a very simple wpf diagram toolset that would allow me to create simple charts based on data from the database. I need a simple solution - I have seen many that were too advanced, allowing the programmer to create UML diagrams, complicated charts, etc. I want to be able to show simple changes over time with a line - that's it.

I would really appreciate any help on that as well as suggestions.

Thanks.


Solution

  • The free WPFToolkit includes a very simple and easy to use charting implementation in its DataVisualization.Toolkit DLL. It tends to be very good for quick and easy charting of data without having to put much thought into it. It can be as simple as:

    <toolkit:Chart>
      <toolkit:LineSeries Title="Series Title"
                          ItemsSource="{Binding Data}"
                          IndependentValueBinding="{Binding Month}"
                          DependentValueBinding="{Binding Value}" />
    
      <toolkit:LineSeries ... />
    </toolkit:Chart>
    

    This assumes your Data is a list of objects each containing a Month and a Value field. Or you can generate such objects with LINQ:

    Data =
      from xyz in myData
      select new { Month = xyz.ComputeMonth(), Value = xyz.Count };