I'm using victory-native and have a VictoryChart with a VictoryLine and VictoryArea as children and want to remove the axis of the chart. Is there any way to access it through props? Probably the color can be set to transparent then.
Here is some code:
<VictoryChart
containerComponent={
<VictoryContainer />
}
>
<VictoryArea
interpolation={interpolation}
data={this.state.data}
/>
<VictoryLine
interpolation={interpolation}
data={this.state.data}
/>
</VictoryChart>
Add VictoryAxis with transparent stroke and fill:
<VictoryAxis style={{
axis: {stroke: "transparent"},
ticks: {stroke: "transparent"},
tickLabels: { fill:"transparent"}
}} />
Then the result becomes:
<VictoryChart
containerComponent={
<VictoryContainer />
}
>
<VictoryArea
interpolation={interpolation}
data={this.state.data}
/>
<VictoryLine
interpolation={interpolation}
data={this.state.data}
/>
<VictoryAxis style={{
axis: {stroke: "transparent"},
ticks: {stroke: "transparent"},
tickLabels: { fill:"transparent"}
}} />
</VictoryChart>
Maybe you can try to add VictoryAxis with axis stroke none to after your chart
<VictoryChart
containerComponent={
<VictoryContainer />
}
>
<VictoryArea
interpolation={interpolation}
data={this.state.data}
/>
<VictoryLine
interpolation={interpolation}
data={this.state.data}
/>
<VictoryAxis style={{ axis: {stroke: "none"} }} />
</VictoryChart>
VictoryChart uses default axes. If you want to plot data without using any axes, use VictoryGroup instead.
See the FAQ
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With