问题描述
我拥有的数据超过12个x和y值,当我获得13个值时,它将没有呈现。
最后未渲染数据,
代码复制。 https://snack.expo.io/@mrvictoria/victory-native
解决方法
无论如何,我会解决问题以供将来参考,我会写出正确的答案, 我只需要重新检查获胜的docs
代码看起来像这样
<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,}}
// 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,{
"x": 4,{
"x": 5,"y": 34
},{
"x": 6,{
"x": 7,{
"x": 8,"y": 14
},{
"x": 9,"y": 8
},{
"x": 10,"y": 39
},{
"x": 11,{
"x": 12,"y": 14
}
]}
style={{
data: { fill: colors.PRIMARY_COLOR_GPA,width: 30 },parent: { border: '1px solid #ccc' },}}
/>