Show chartJS chart even if you don’t have data

Asked

Viewed 64 times

0

There is a way to display the columns of the Chartjs Barchart chart, even if they do not have data to display?

1 answer

1


From what I have seen in several libraries, including Chartjs, it is only possible to show the column with some value, even if it is zero (0).

Because a graph is based on values, so if it has no values, it will not be shown.

I made a Jsfiddle to illustrate. In it I inform the array of date with zero values, so the graph appears, but not the columns. As I said, they will only appear if they have value.

  • I guess I’ll have to treat the array then to bring in the zeros.

  • Yes, treat before moving to graph.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.