我在反应原生中使用merryjs/react-native-charts库作为折线图。
所需的设计是
我试图自定义,但有些属性不起作用或我没有以适当的方式给它们值。我的设计是:
要自定义的属性:
mChart.getXAxis().setDrawGridLines(false)
完成,但在本机中我无法做到这一点)xAxis: {
$set: {
valueFormatter: ['Q1', 'Q2', 'Q3', 'Q4','Q5','Q6','Q7'],
drawGridLines:false,
}
}
<LineChart
chartDescription={{ text: '' }}
style={styles.chart}
data={this.state.data}
description={{
text: ''
}}
marker={this.state.marker}
xAxis={this.state.xAxis}
yAxis={this.state.axisLeft}
drawGridBackground={false}
gridBackgroundColor={processColor('#3AE2CE')}
borderColor={processColor('teal')}
borderWidth={10}
drawBorders={false}
touchEnabled={true}
dragEnabled={true}
scaleEnabled={true}
scaleXEnabled={true}
scaleYEnabled={true}
pinchZoom={true}
doubleTapToZoomEnabled={true}
dragDecelerationEnabled={true}
dragDecelerationFrictionCoef={0.99}
keepPositionOnRotation={false}
onSelect={this
.handleSelect
.bind(this)}/>
</View>