import React from 'react'; import { TouchableOpacity, Alert, Text, GestureResponderEvent, View, Dimensions } from 'react-native'; import RenderHtml, { TChildrenRenderer } from 'react-native-render-html'; import { LineChart, BarChart, PieChart, ProgressChart, ContributionGraph, StackedBarChart } from "react-native-chart-kit"; import { Cfg } from './action'; export function ChartRenderer({ ...props }: { [key: string]: any; }) { const { tnode } = props; const { domNode } = tnode; const { attribs } = domNode; const onPress = () => { const config = Cfg.action as { [key: string]: (event: Function) => void }; const custAction: ((event: Function) => void) | null = (attribs?.action && typeof config[attribs?.action] === 'function') ? config[attribs?.action] : null; if (custAction) { attribs.pop = custAction; custAction(attribs); } } return ( `rgba(255, 255, 255, ${opacity})`, labelColor: (opacity = 1) => `rgba(255, 255, 255, ${opacity})`, style: { borderRadius: 16 }, propsForDots: { r: "6", strokeWidth: "2", stroke: "#ffa726" } }} bezier style={{ marginVertical: 8, borderRadius: 16 }} /> ); }