admin管理员组文章数量:1402129
I want to change the background color of my graph, also remove this lines in it. I tried to add backgroundColor property in CartesianChart and also Line but does not worked.
return (
<>
<View style={styles.coinButton}>
<CoinButton selectedItem={selectedItem} setSelectedItem={setSelectedItem}/>
</View>
<View style={styles.graph}>
{formattedData.length > 0 ? (
<CartesianChart
data={formattedData}
xKey="day"
yKeys={['highTmp']}
axisOptions={{ font }}
padding={{ left: 5, top: 90, bottom: 0, right: 5 }}
domainPadding={{ left: 5, right: 0 }}
chartPressState={state}
// labelColor="red"
// xAxis={{labelColor = 'red'}}
>
{({ points }) => (
<>
<Line points={points.highTmp}
color="blue"
strokeWidth={3}
// strokeWidth={3}
animate={{ type: 'spring', duration: 600 }}
/>
{isActive && <ToolTip x={state.x.position} y={state.y.highTmp.position} />}
</>
)}
</CartesianChart>
) : (
<View style={styles.loadingContainer}>
<ActivityIndicator size="large" color="#0000ff" />
</View>
)}
</View>
</>
);
I want to change the background color of my graph, also remove this lines in it. I tried to add backgroundColor property in CartesianChart and also Line but does not worked.
return (
<>
<View style={styles.coinButton}>
<CoinButton selectedItem={selectedItem} setSelectedItem={setSelectedItem}/>
</View>
<View style={styles.graph}>
{formattedData.length > 0 ? (
<CartesianChart
data={formattedData}
xKey="day"
yKeys={['highTmp']}
axisOptions={{ font }}
padding={{ left: 5, top: 90, bottom: 0, right: 5 }}
domainPadding={{ left: 5, right: 0 }}
chartPressState={state}
// labelColor="red"
// xAxis={{labelColor = 'red'}}
>
{({ points }) => (
<>
<Line points={points.highTmp}
color="blue"
strokeWidth={3}
// strokeWidth={3}
animate={{ type: 'spring', duration: 600 }}
/>
{isActive && <ToolTip x={state.x.position} y={state.y.highTmp.position} />}
</>
)}
</CartesianChart>
) : (
<View style={styles.loadingContainer}>
<ActivityIndicator size="large" color="#0000ff" />
</View>
)}
</View>
</>
);
Share
Improve this question
asked Mar 22 at 12:06
Guilherme AlvesGuilherme Alves
1
1 Answer
Reset to default 0I figreout that the backgroundColor of the graph it was made it by the View, so just change it there. And about to remove the grid lines you can pass
axisOptions={{ lineColor:'transparent',}}
本文标签: How to change the background color of a Victory Native graphStack Overflow
版权声明:本文标题:How to change the background color of a Victory Native graph? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744315849a2600259.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论