Skip to content
Advertisement

Tag: charts

D3 Bar Chart Negative Values not Showing Up

In my bar chart, I have both negative values and positive values, but the problem is, The negative bars don’t get plotted in the opposite direction (Inverted) rather, they are plotted in the same direction as the positive bars. I understand, the Y-Axis domain, can’t start with 0 when dealing with negative values. But when I use d3.min to get

Putting label array to the chartjs?

I have these codes: let arr = []; This is what console.log(arr); shows: [“Item1”, “Item2”, “Item3”, “Item4”] Below is my graph: How can I loop through the object arr to be put inside the labels? Answer The charts label receives a string or an array of strings: So you will put your array directly to the labels like so: A

Advertisement