esbullington / react-d3

Modular React charts made with d3.js
https://reactiva.github.io/react-d3-website/
MIT License
1.75k stars 179 forks source link

Vertical Labels on BarChart (transform / textAnchor) #329

Closed Sineliad closed 8 years ago

Sineliad commented 8 years ago

Hi there - thanks for the great library!

I was trying to get Vertical Labels for the barchart passing down transform and textAnchor properties with no luck, it gets the default behavior.

Tried several methods but no luck either . Any pointers how it has to be done?

Thanks ;)

nickells commented 8 years ago

Hi,

I was able to achieve the following with pure CSS image

.rd3-barchart-xaxis text{
  transform: rotate(65deg) translateX(60px)
}

.rd3-chart {
  height: 350px;
}
Sineliad commented 8 years ago

Hi, thanks :) :)

It's work, I only have to change the classes name. I am using 'react-d3-basic').BarChart

.react-d3-core__axis__xAxis text{ transform: rotate(65deg) translateX(60px); } .react-d3-core__container_svg{ height: 1000px; }