Is it possible to create a 2 line line-chart?

I’m planning to implement this on our dashboard. Is it possible on weweb?

image

Hi @Walds! Of course, thanks to the charts plugin!

You can use the advanced mode of the line chart element and bind your data. You had to respect the chart.js interface (format).

In labels, bind an array of string, that will be your x axis.

['APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP']

In datasets, bind an array of multiple dataset, that will be your lines on y axis.

[
    {
      label: 'Dataset 1',
      data: [0, 10, 15, 50, 60, 20],
      borderColor: 'red',
      backgroundColor: 'grey',
    },
    {
      label: 'Dataset 2',
      data: [0, 15, 20, 60, 80, 30],
      borderColor: 'blue',
      backgroundColor: 'grey', 
    }
  ]

You can get help from the chart.js documentation.

3 Likes

Awesome! Thank you Alexis!