react-native - 胜利原生胜利轴没有渲染最后一个y轴值,反应原生
问题描述
我有超过 12 个 x 和 y 值的数据,当我得到 13 个值时,它将未渲染。
输出页面 1 看起来像
最后,数据未渲染,
解决方案
无论如何我解决了这个问题以备将来参考我会写正确的答案,我只需要重新检查胜利原生文档
代码看起来像这样
<VictoryChart
width={1000}
theme={Theme}
labelComponent={<VictoryTooltip renderInPortal={false} />}
domainPadding={{ x: 25 }}
domainPadding={25}>
{/* Horizontal */}
<VictoryAxis
responsive={false}
style={{
ticks: {
// padding: 12,
},
tickLabels: {
fontSize: 13,
},
}}
/>
{/* Vertical */}
<VictoryAxis
dependentAxis
/>
<VictoryBar
style={{
ticks: {
// padding: 12,
},
tickLabels: {
fontSize: 13,
},
}}
// labelComponent={
// <VictoryTooltip
// flyoutStyle={{ stroke: "tomato", strokeWidth: 2 }}
// />}
categories={{
x: [
"10-06",
"10-07",
"10-08",
"10-09",
"10-12",
"10-13",
"10-14",
"10-15",
"10-16",
"10-19",
"10-20",
"10-21"
]
}}
data={[
{
"x": 1,
"y": 13
},
{
"x": 2,
"y": 12
},
{
"x": 3,
"y": 13
},
{
"x": 4,
"y": 12
},
{
"x": 5,
"y": 34
},
{
"x": 6,
"y": 12
},
{
"x": 7,
"y": 12
},
{
"x": 8,
"y": 14
},
{
"x": 9,
"y": 8
},
{
"x": 10,
"y": 39
},
{
"x": 11,
"y": 14
},
{
"x": 12,
"y": 14
}
]}
style={{
data: { fill: colors.PRIMARY_COLOR_GPA, width: 30 },
parent: { border: '1px solid #ccc' },
}}
/>
推荐阅读
- javascript - 在数字输入上使用按钮不会更新第一个输入
- ios - 将 ipa 文件上传到 Testflight 时 iOS Fastlane 构建失败
- java - JPA,Hibernate:子类的字段为空,@MappedSuperclass 和 InheritanceType.JOINED 策略
- c# - 数据未在 Linq 中排序
- ios - 我没有看到创建新 iOS 分发证书的选项
- vue.js - VueJS:如何使嵌套的路由器视图始终呈现其路由之一?
- azure - 术语“Register-AzResourceProvider”未被识别为 cmdlet 的名称
- db2 - 按依赖顺序部署 DB2 用户定义函数
- r - R中学生化外部残差的快速准确计算
- matlab - Matlab 绘制超过 2 个 y 轴