问题描述
我对在React Native中将组件作为数据传递给Carousel有疑问。
现在,该图来自外部软件包(React native Victory),并且天的值在Array(X轴-天,Y轴-利润(稍后将从Firebase获取值...)中定义为如下:
const data = {
// X will be days,Y will get value from Syncronhized calendar
Weekdays: [
{ x: "Sun",y: 50 },{ x: "Mon",y: 100 },{ x: "Tue",y: 150 },{ x: "Wed",y: 200 },{ x: "Thr",y: 250 },{ x: "Fri",y: 300 },],
轮播代码如下:
<Carousel
layout={"tinder"}
ref={carouselRef}
data={} //Here i Want to Pass the Graphs.
renderItem={RenderItem}
sliderWidth={width}
itemWidth={width - 10}
swipeThreshold={100}
layoutCardOffset={-12}
inactiveSlideOpacity={0.4}
containerCustomStyle={{
overflow: "visible",marginVertical: 30,}}
contentContainerCustomStyle={{
paddingTop: 14,}}
/>
我要通过图表的 data = {},这可能吗?
图形代码:
<VictoryChart>
<VictoryGroup offset={20}>
<VictoryBar data={data.Weekdays} />
</VictoryGroup>
</VictoryChart>
我想创建3-4个图表并在轮播中使用
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)