线图

时间:2018-04-30 10:52:53

标签: react-native react-native-android linechart

我在反应原生中使用merryjs/react-native-charts库作为折线图。
所需的设计是design required

我试图自定义,但有些属性不起作用或我没有以适当的方式给它们值。我的设计是:design made by me

要自定义的属性:

  1. 删除x轴绘制线(在Android中,这可以使用mChart.getXAxis().setDrawGridLines(false)完成,但在本机中我无法做到这一点)
  2. 替代背景
  3. 从每个点移除点
  4. 在拖动或点击线
  5. 时显示点

    代码: Complete code link

    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>
    

0 个答案:

没有答案