GithubHelp home page GithubHelp logo

Comments (8)

islavstan avatar islavstan commented on May 25, 2024

I tried iphone 14 simulator

from fl_chart.

imaNNeo avatar imaNNeo commented on May 25, 2024

I couldn't reproduce it.
Can you please share a reproducible code? (a main.dart file content)
Simulator Screenshot - iPhone 15 Pro Max - 2023-12-04 at 00 09 19

from fl_chart.

islavstan avatar islavstan commented on May 25, 2024

your have to add centerSpaceRadius
and increase PieChart size
I changed your sample, here is example

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)),
      )
    ];
  }
}

from fl_chart.

islavstan avatar islavstan commented on May 25, 2024

Simulator Screenshot - iPhone 14 - 2023-12-04 at 14 26 12

from fl_chart.

islavstan avatar islavstan commented on May 25, 2024

I think problem in PieChartPainter
if (sectionDegree == 360) {
_sectionPaint
..color = section.color
..strokeWidth = section.radius
..style = PaintingStyle.stroke;
canvasWrapper.drawCircle(
center,
centerRadius + section.radius / 2,
_sectionPaint,
);

from fl_chart.

imaNNeo avatar imaNNeo commented on May 25, 2024

Got it!

from fl_chart.

imaNNeo avatar imaNNeo commented on May 25, 2024

Merged into master

from fl_chart.

imaNNeo avatar imaNNeo commented on May 25, 2024

Landed in 0.66.0

from fl_chart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.