'React native chart kit export to pdf

Is there a way to export charts to pdf in react native? Or i need to create them in html and use html-to-pdf library to create pdf?

Chart:

                            data={{
                                labels: ['Constipate', 'Normal', 'Diarrhea'],
                                datasets: [
                                    {
                                        data: [stoolBarChartData.constip, stoolBarChartData.normal, stoolBarChartData.diarrhea]
                                    }
                                ]
                            }}
                            fromZero
                            width={Dimensions.get("window").width - 40}
                            height={350}
                            showValuesOnTopOfBars={true}
                            withInnerLines={false}
                            withHorizontalLabels={false}
                            chartConfig={{
                                barPercentage: 1,
                                backgroundColor: "#0000",
                                backgroundGradientFrom: "white",
                                backgroundGradientTo: "white",
                                decimalPlaces: 0,
                                color: (opacity = 1) => `rgba(47, 80, 31, ${opacity})`,
                                labelColor: (opacity = 1) => `rgba(47, 80, 31, ${opacity})`,
                                style: {
                                    borderRadius: 16
                                },
                            }}

                            style={{
                                marginVertical: 8,
                                borderRadius: 16,
                                margin: 20,
                            }}
                        /> ```


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source