-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PieChart not fully draw in ios devices when have only one section #1515
Comments
I tried iphone 14 simulator |
your have to add centerSpaceRadius import 'package:fl_chart_app/presentation/resources/app_resources.dart';
import 'package:fl_chart_app/presentation/widgets/indicator.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
class PieChartSample1 extends StatefulWidget {
const PieChartSample1({super.key});
@override
State<StatefulWidget> createState() => PieChartSample1State();
}
class PieChartSample1State extends State {
int touchedIndex = -1;
@override
Widget build(BuildContext context) {
return SizedBox(
height: 300,
width: 300,
child: PieChart(
PieChartData(
pieTouchData: PieTouchData(
touchCallback: (FlTouchEvent event, pieTouchResponse) {
setState(() {
if (!event.isInterestedForInteractions ||
pieTouchResponse == null ||
pieTouchResponse.touchedSection == null) {
touchedIndex = -1;
return;
}
touchedIndex = pieTouchResponse
.touchedSection!.touchedSectionIndex;
});
},
),
borderData: FlBorderData(
show: false,
),
sectionsSpace: 0,
centerSpaceRadius: 80,
sections: showingSections(),
),
),
);
}
List<PieChartSectionData> showingSections() {
return [
PieChartSectionData(
color: AppColors.contentColorBlue,
value: 100,
title: '',
radius: 80,
titlePositionPercentageOffset: 0.55,
borderSide: BorderSide(
color: AppColors.contentColorWhite.withOpacity(0)),
)
];
}
}
|
I think problem in PieChartPainter |
Got it! |
Merged into master |
Landed in 0.66.0 |
PieChart not fully draw in ios devices when have only one section
border doesn't help too
The text was updated successfully, but these errors were encountered: