Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
173
rated 0 times [  179] [ 6]  / answers: 1 / hits: 5599  / 4 Years ago, wed, july 22, 2020, 12:00:00

I am using Victory chart and I have roughly the following code


<VictoryChart domainPadding={30} {...commonProps}>
<VictoryBar
data={props.data}
{...labelProps}
/>
</VictoryChart>

I used tickLabels style {angle: 45}, however this is applied internally to both x and y axis , I want the tilted text only for the x-axis but as you can see it, it has also affected the y-axis, how can I do that?


enter


More From » node.js

 Answers
5

try specifying both axis in component and apply style only to one of them


<VictoryChart domainPadding={10}>
<VictoryBar
data={sampleData}
/>
<VictoryAxis dependentAxis
tickValues={[1, 2, 3, 4,5]}
/>
<VictoryAxis
tickValues={[1, 2, 3, 4,5]}
style={{ tickLabels: {angle :45}}}
/>
</VictoryChart>

[#3107] Saturday, July 18, 2020, 4 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
erinh

Total Points: 38
Total Questions: 100
Total Answers: 110

Location: Macau
Member since Mon, Nov 16, 2020
4 Years ago
erinh questions
;