Chartjs-Chart.js Fill line chart from another value than 0

1👍

As far as I know there’s no simple method. If you want to create a custom fill you will need to work with a plugin or write a hefty amount of code to customize it.

Back when I was looking for a similar thing I came across:

Chart JS Fill Between two lines

This doesn’t do exactly what you’re looking for, but you can customize your chart so that it does.

If you create a dataset where all the datapoints are at 5, then make it invisible (0 width, don’t show datapoints, etc.) using basic options, you can fill between that line and the ‘Merge’ line.

The JSFiddle and code located in the previous answer should be everything you need to make it happen.

Leave a comment