Merge pull request #33 from Abhinandan-Kushwaha/development

Fixed strokeWidth issue for Pie and Donut charts
This commit is contained in:
Abhinandan Kushwaha 2021-11-01 21:49:35 +05:30 committed by GitHub
commit 6cd4b7ac40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "react-native-gifted-charts", "name": "react-native-gifted-charts",
"version": "0.1.14", "version": "0.1.15",
"description": "The most complete library for Bar, Line, Area, Pie and Donut charts in React Native. Allows 2D, 3D, gradient, animations and live data updates.", "description": "The most complete library for Bar, Line, Area, Pie and Donut charts in React Native. Allows 2D, 3D, gradient, animations and live data updates.",
"main": "src/index.tsx", "main": "src/index.tsx",
"files": [ "files": [

View File

@ -194,6 +194,18 @@ export const PieChart = (props: propTypes) => {
ctx.fillStyle = backgroundColor; ctx.fillStyle = backgroundColor;
ctx.fill(); ctx.fill();
// Stroke at the end again
ctx.moveTo(
radius + initialValue + shiftX,
radius + initialValue + shiftY,
)
ctx.lineTo(
radius + initialValue + shiftX,
radius + initialValue + shiftY,
);
ctx.stroke();
} }
/*************************************************************************************/ /*************************************************************************************/
@ -221,6 +233,18 @@ export const PieChart = (props: propTypes) => {
ctx.fillStyle = dataItem.color || colors[i++ % 8]; ctx.fillStyle = dataItem.color || colors[i++ % 8];
ctx.fill(); ctx.fill();
// Stroke at the end again
ctx.moveTo(
radius + initialValue + shiftX,
radius + initialValue + shiftY,
)
ctx.lineTo(
radius + initialValue + shiftX,
radius + initialValue + shiftY,
);
ctx.stroke();
/************************* Displaying Text Labels **********************/ /************************* Displaying Text Labels **********************/
if (showText) { if (showText) {