Skip to content
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

Custom colors #4

Closed
SJente opened this issue Apr 29, 2019 · 5 comments
Closed

Custom colors #4

SJente opened this issue Apr 29, 2019 · 5 comments

Comments

@SJente
Copy link

SJente commented Apr 29, 2019

Goodmorning,

I have custom colors i would love to send within the dataMap, is it possible to do this? Because i can read from your pie_chart.dart that you already specified a list of colors.

Greetings,
Jente

@SJente
Copy link
Author

SJente commented Apr 29, 2019

Also when you have a list with 6 or more you will get this error:

I/flutter ( 6361): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
I/flutter ( 6361): The following RangeError was thrown during paint():
I/flutter ( 6361): RangeError (index): Invalid value: Not in range 0..4, inclusive: 5
I/flutter ( 6361): 
I/flutter ( 6361): When the exception was thrown, this was the stack:
I/flutter ( 6361): #0      List.[] (dart:core/runtime/libgrowable_array.dart:145:60)
I/flutter ( 6361): #1      PieChartPainter.paint (package:pie_chart/pie_chart.dart:201:20)
I/flutter ( 6361): #2      RenderCustomPaint._paintWithPainter (package:flutter/src/rendering/custom_paint.dart:521:13)
I/flutter ( 6361): #3      RenderCustomPaint.paint (package:flutter/src/rendering/custom_paint.dart:559:7)
I/flutter ( 6361): #4      RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2092:7)
I/flutter ( 6361): #5      PaintingContext.paintChild (package:flutter/src/rendering/object.dart:173:13)
I/flutter ( 6361): #6      _RenderFlex&RenderBox&ContainerRenderObjectMixin&RenderBoxContainerDefaultsMixin.defaultPaint (package:flutter/src/rendering/box.dart:2273:15)
I/flutter ( 6361): #7      RenderFlex.paint (package:flutter/src/rendering/flex.dart:931:7)
I/flutter ( 6361): #8      RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2092:7)
I/flutter ( 6361): #9      PaintingContext.paintChild (package:flutter/src/rendering/object.dart:173:13)
I/flutter ( 6361): #10     _RenderFlex&RenderBox&ContainerRenderObjectMixin&RenderBoxContainerDefaultsMixin.defaultPaint (package:flutter/src/rendering/box.dart:2273:15)
I/flutter ( 6361): #11     RenderFlex.paint (package:flutter/src/rendering/flex.dart:931:7)
I/flutter ( 6361): #12     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2092:7)
I/flutter ( 6361): #13     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:173:13)
I/flutter ( 6361): #14     RenderShiftedBox.paint (package:flutter/src/rendering/shifted_box.dart:70:15)
I/flutter ( 6361): #15     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2092:7)
I/flutter ( 6361): #16     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:173:13)
I/flutter ( 6361): #17     RenderShiftedBox.paint (package:flutter/src/rendering/shifted_box.dart:70:15)
I/flutter ( 6361): #18     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2092:7)
I/flutter ( 6361): #19     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:173:13)
I/flutter ( 6361): #20     RenderShiftedBox.paint (package:flutter/src/rendering/shifted_box.dart:70:15)
I/flutter ( 6361): #21     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2092:7)
I/flutter ( 6361): #22     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:173:13)
I/flutter ( 6361): #23     _RenderCustomMultiChildLayoutBox&RenderBox&ContainerRenderObjectMixin&RenderBoxContainerDefaultsMixin.defaultPaint (package:flutter/src/rendering/box.dart:2273:15)
I/flutter ( 6361): #24     RenderCustomMultiChildLayoutBox.paint (package:flutter/src/rendering/custom_layout.dart:361:5)
I/flutter ( 6361): #25     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2092:7)
I/flutter ( 6361): #26     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:173:13)
I/flutter ( 6361): #27     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:123:15)
I/flutter ( 6361): #28     _RenderInkFeatures.paint (package:flutter/src/material/material.dart:504:11)
I/flutter ( 6361): #29     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2092:7)
I/flutter ( 6361): #30     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:173:13)
I/flutter ( 6361): #31     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:123:15)
I/flutter ( 6361): #32     PaintingContext.pushLayer (package:flutter/src/rendering/object.dart:370:12)
I/flutter ( 6361): #33     RenderPhysicalModel.paint (package:flutter/src/rendering/proxy_box.dart:1717:17)
I/flutter ( 6361): #34     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2092:7)
I/flutter ( 6361): #35     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:173:13)
I/flutter ( 6361): #36     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:123:15)
I/flutter ( 6361): #37     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2092:7)
I/flutter ( 6361): #38     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:173:13)
I/flutter ( 6361): #39     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:123:15)
I/flutter ( 6361): #40     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2092:7)
I/flutter ( 6361): #41     PaintingContext._repaintCompositedChild (package:flutter/src/rendering/object.dart:128:11)
I/flutter ( 6361): #42     PaintingContext.repaintCompositedChild (package:flutter/src/rendering/object.dart:96:5)
I/flutter ( 6361): #43     PipelineOwner.flushPaint (package:flutter/src/rendering/object.dart:853:29)
I/flutter ( 6361): #44     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:331:19)
I/flutter ( 6361): #45     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:701:13)
I/flutter ( 6361): #46     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:268:5)
I/flutter ( 6361): #47     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:988:15)
I/flutter ( 6361): #48     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:928:9)
I/flutter ( 6361): #49     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:749:7)
I/flutter ( 6361): #51     _Timer._runTimers (dart:isolate/runtime/libtimer_impl.dart:382:19)
I/flutter ( 6361): #52     _Timer._handleMessage (dart:isolate/runtime/libtimer_impl.dart:416:5)
I/flutter ( 6361): #53     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)
I/flutter ( 6361): (elided one frame from package dart:async)
I/flutter ( 6361): 
I/flutter ( 6361): The following RenderObject was being processed when the exception was fired:
I/flutter ( 6361):   RenderCustomPaint#7b7f2 relayoutBoundary=up6
I/flutter ( 6361):   creator: CustomPaint ← Row ← Column ← Padding ← Container ← Align ← Padding ← Container ← PieChart
I/flutter ( 6361):   ← MediaQuery ← LayoutId-[<_ScaffoldSlot.body>] ← CustomMultiChildLayout ← ⋯
I/flutter ( 6361):   parentData: offset=Offset(0.0, 5.3); flex=null; fit=null (can use size)
I/flutter ( 6361):   constraints: BoxConstraints(unconstrained)
I/flutter ( 6361):   size: Size(133.3, 133.3)
I/flutter ( 6361): This RenderObject had the following child:
I/flutter ( 6361):   RenderConstrainedBox#e0cc0 relayoutBoundary=up7 NEEDS-PAINT
I/flutter ( 6361): ════════════════════════════════════════════════════════════════════════════════════════════════════

@apgapg
Copy link
Owner

apgapg commented Apr 29, 2019

Thanks for pointing out the issue. From above logs i can see that the pie chart fails on data range more than 5.
I will add a custom color list option in the next release. Thanks

@SJente
Copy link
Author

SJente commented Apr 29, 2019

Thanks, when can i expect a new release? Package looks great!

@apgapg
Copy link
Owner

apgapg commented Apr 29, 2019

Most probably today itself. Again Thanks

@SJente
Copy link
Author

SJente commented Apr 29, 2019

Closing issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants