0👍
✅
Well, Chart.JS will show whatever labels
and data
contain. Therefore you can create a function to remove a certain range.
Here is a sample with a line chart: https://codepen.io/adelriosantiago/pen/xxRGVPW?editors=0010
The function rangeWithSkips
will basically filter
the input array between startSkip
and endSkip
. Later in the code you select the new range with:
data: {
labels: rangeWithSkips(3, 10).labels, // Pick the starting and end range here
datasets: [
{
label: "Volume",
data: rangeWithSkips(3, 10).data // Pick the starting and end range here too
}
]
}
Here is an updated version with that does exactly the same with a 2 inputs: https://codepen.io/adelriosantiago/pen/yLVNOGX?editors=1011
Source:stackexchange.com