LNA
LNA

Reputation: 1447

Simple d3.js bar chart is inverted when I add in .text()

I have a very simple d3.js bar chart that looks like this:

http://jsfiddle.net/jTs9A/9/

However, as soon as I take out the

    .text(function(d) { return d; })

it's fine!

http://jsfiddle.net/jTs9A/10/

Does anyone know why the first case (where I have text from the data list populating in the markup) is inverted? Do I need to set orientation of the axis somewhere?

Upvotes: 1

Views: 66

Answers (1)

david4096
david4096

Reputation: 204

You can right it with vertical-align: bottom per FernOfTheAndes' comment.

http://jsfiddle.net/jTs9A/26/

Upvotes: 1

Related Questions