0

I have the following data in the following chart (with undesired empty spaces marked with blue arrows):

const dataone = [1, 2, 5, 4, 2];
const datatwo = [2, 2, 3, 4, 5];
const datathree = [2, 3, 3, 2, 4];
const datafour = [null, null, 4, null, null];
const datafive = [null, 2, null, null, null];

enter image description here

How can I remove the empty spaces and still have the null values in the arrays?

You can see and edit all the code here: https://codesandbox.io/s/github/pedroRelvas/NoNullSpacesInChart/tree/master/?fontsize=14&hidenavigation=1&theme=dark

Daniel Widdis
  • 8,424
  • 13
  • 41
  • 63
Pedro Relvas
  • 678
  • 7
  • 19

1 Answers1

0

It's quite simple, just do this in each dataset you want to remove (if there is no such values in the dataset array of course! If there is, is 100% understandable to have empty spaces):

data:{
   datasets: [{
            ...
            hidden: true,
            ...
        },],
}
Pedro Relvas
  • 678
  • 7
  • 19