fixed minor bugs in new Pie Chart
This commit is contained in:
parent
0e099255e0
commit
442052471e
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "react-native-gifted-charts",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"description": "The most complete library for Bar, Line, Area, Pie, Donut and Stacked Bar charts in React Native. Allows 2D, 3D, gradient, animations and live data updates.",
|
||||
"main": "src/index.tsx",
|
||||
"files": [
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react';
|
||||
import {ColorValue, View} from 'react-native';
|
||||
import Svg, {Path, Circle, Text as SvgText, FontStyle, Line} from 'react-native-svg';
|
||||
import Svg, {Path, Circle, Text as SvgText, FontStyle} from 'react-native-svg';
|
||||
|
||||
type propTypes = {
|
||||
radius?: number;
|
||||
|
@ -226,7 +226,6 @@ export const PieChart = (props: propTypes) => {
|
|||
|
||||
{showText &&
|
||||
data.map((item, index) => {
|
||||
console.log('index', index);
|
||||
|
||||
let mx = cx * (1 + Math.sin(2 * pi * mData[index] + initialAngle));
|
||||
let my = cy * (1 - Math.cos(2 * pi * mData[index] + initialAngle));
|
||||
|
@ -259,7 +258,7 @@ export const PieChart = (props: propTypes) => {
|
|||
// console.log('ay', ay);
|
||||
return (
|
||||
<>
|
||||
<Line x1={mx} x2={cx} y1={my} y2={cy} stroke="black" />
|
||||
{/* <Line x1={mx} x2={cx} y1={my} y2={cy} stroke="black" /> */}
|
||||
{showTextBackground && (
|
||||
<Circle
|
||||
cx={x}
|
||||
|
|
Loading…
Reference in New Issue