flutter_circular_chart icon indicating copy to clipboard operation
flutter_circular_chart copied to clipboard

Cannot customize radial chart stroke width

Open baoxiehao opened this issue 6 years ago • 2 comments

There are no params for that. And all I do for now it hard code the stroke width...

void _paintChart(Canvas canvas, Size size, CircularChart chart) {
  final Paint segmentPaint = new Paint()
    ..style = chart.chartType == CircularChartType.Radial
        ? PaintingStyle.stroke
        : PaintingStyle.fill
    ..strokeCap = chart.edgeStyle == SegmentEdgeStyle.round
        ? StrokeCap.round
        : StrokeCap.butt;

  for (final CircularChartStack stack in chart.stacks) {
    for (final segment in stack.segments) {
      segmentPaint.color = segment.color;
      segmentPaint.strokeWidth = 3;//stack.width;

      canvas.drawArc(
        new Rect.fromCircle(
          center: new Offset(size.width / 2, size.height / 2),
          radius: stack.radius,
        ),
        stack.startAngle * _kRadiansPerDegree,
        segment.sweepAngle * _kRadiansPerDegree,
        chart.chartType == CircularChartType.Pie,
        segmentPaint,
      );
    }
  }
}

baoxiehao avatar Feb 27 '19 07:02 baoxiehao

Please consider supporting the customize radial chart stroke width with new features

rainedAllNight avatar May 30 '19 08:05 rainedAllNight

I love the animation. I wish the "radial chart stroke width" would be included.

Can you do that?

Thank you very much, BR, Adrian

adrianvintu avatar Jun 17 '19 19:06 adrianvintu