FormidableLabs / victory-native-xl

A charting library for React Native with a focus on performance and customization.
https://commerce.nearform.com/open-source/victory-native
648 stars 48 forks source link

Horizontal Bar Chart #157

Open MobileMon opened 10 months ago

MobileMon commented 10 months ago

How can I turn the bar chart horizontal?

lukebars commented 9 months ago

Right now the fastest bet is: transform: rotate(90deg); or contributing 😄

YTRodi commented 6 months ago

Hi @lukebars, where would you add transform: rotate(90deg);?

masiddee commented 6 months ago

@YTRodi you can add this property to the containing View component's style object, like so:

<View style={{ transform: [{ rotate: "90deg" }] }}>
  <CartesianChart>
    ...
  </CartesianChart>
</View>

Though, be mindful this will also rotate the entire chart (including your labels and axis as well).

amitojSingh43 commented 2 months ago

How should we handle the rotated labels and axis?