Click here to Skip to main content
15,899,026 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
So I wanted to create something like this.

Visual representation

Using this tool https://lvcharts.net/

I already have the data to add to the graph but I have no idea what that graph is called or how to use it, I tried looking for docs on the website that would help me with this specific graph but I couldnt find anything. Could anyone help me by showing a code snippet of a working example so I know how to use it? I already added the nuget package to my project and I have all the controls added. From what I understand you need to bind the control to a generic collection like a list that updates or something like that.

What I have tried:

I've tried looking at their website but couldnt make sense of it.
Posted
Updated 5-Jan-18 4:13am

1 solution

But there is all that you need on the website: Live Charts[^]

1. Go to Solution Explorer, right click on references, then Manage NuGet Packages.
2. Browse for LiveCharts.Wpf, select the package and click on install
3. Add namespace to your XAML

C#
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"


And to code behind if necessary
C#
using LiveCharts;
using LiveCharts.Wpf;


4.Code Behind

C#
SeriesCollection = new SeriesCollection
    {
        new LineSeries
        {
            Values = new ChartValues<double> { 3, 5, 7, 4 }
        },
        new ColumnSeries                
        {
            Values = new ChartValues<decimal> { 5, 6, 2, 7 }
        }
    };


5. XAML

XML
<lvc:CartesianChart Series="{Binding SeriesCollection}" />
 
Share this answer
 
v3
Comments
aleksvarga 5-Jan-18 10:14am    
But how do I create the one that I linked? I already added the buGet package and the controls but how do I recreate the visualr epresentation I added?
Leo Chapiro 5-Jan-18 10:15am    
Keep on reading: https://lvcharts.net/App/examples/v1/wpf/Basics

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900