Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

How do I change the colour of the donut chart? #72

Closed
happyharis opened this issue Jul 9, 2018 · 4 comments
Closed

How do I change the colour of the donut chart? #72

happyharis opened this issue Jul 9, 2018 · 4 comments

Comments

@happyharis
Copy link

No description provided.

@truongphamit
Copy link

truongphamit commented Jul 9, 2018

add colorFn to charts.Series.
Example:

new charts.Series<Airline, int>(
        id: 'Airline',
        colorFn: (Airline sales, __) => sales.color,
        domainFn: (Airline sales, _) => sales.name,
        measureFn: (Airline sales, _) => sales.sales,
        data: data,
      )

@happyharis
Copy link
Author

Thank you!

@ascmp
Copy link

ascmp commented Jun 28, 2019

Thank you, appreciated. Pity I didn't think myself about it, seems simple enough but it didn't come to my mind :)
If others are wondering, passing the color via the data series allow each section of the chart to have a different color.

@AeroAngel123
Copy link

I'm trying to implement this. But having hard time figuring out the data type for the color. Is there a way you guys could provide a simple example?

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

No branches or pull requests

4 participants