我有以下代码,其中 y 轴上只有 2 个值,这意味着单个段就足够了。但事实证明,顶行的 y 标签没有出现。有解决办法吗?当前图表状态
下面是我为此编写的代码。
< LineChart
data = {
dataFrame
}
width = {
width - 20
}
height = {
height
}
withShadow = {
true
}
withDots = {
true
}
withScrollableDot = {
true
}
withOuterLines = {
true
}
transparent = {
true
}
withInnerLines = {
true
}
chartConfig = {
{
backgroundColor: '#fff000',
backgroundGradientFrom: '#ffffff',
backgroundGradientTo: '#fffffa',
decimalPlaces: 0,
linejoinType: 'round',
scrollableDotFill: '#fff',
scrollableDotRadius: 6,
scrollableDotStrokeColor: 'tomato',
scrollableDotStrokeWidth: 3,
scrollableInfoViewStyle: {
justifyContent: 'center',
alignContent: 'center',
backgroundColor: '#121212',
borderRadius: 2,
marginTop: 25,
marginLeft: 25,
},
scrollableInfoTextStyle: {
fontSize: 10,
color: '#C4C4C4',
marginHorizontal: 2,
flex: 1,
textAlign: 'center',
},
scrollableInfoSize: {
width: 30,
height: 30
},
scrollableInfoOffset: 15,
labelColor: (opacity = 1) => `rgba(0, 0, 0, ${opacity})`,
color: (opacity = 1) => `rgb(78, 135, 210, ${opacity})`,
propsForBackgroundLines: {
strokeDasharray: '', // solid background lines with no dashes
strokeDashoffset: 15,
},
}
}
segments = {1}
/>
任何帮助表示赞赏。