Donutchart.data fails

I am trying to make a diagram from Archi-Lab Mandrill the name = the family type used and the value by the area occupied by each of the family type but donutchart.data fails. For what?

It tells you in the error message. The node is expecting a string input for the Names but you’re providing the Revit element. You just need to get the element name and use that instead.

When you are too much in a problem, you no longer see the simplest of solutions. Thanks a lot!
I have another question if you allow me. How to assign a color to each type of family. Right now the colors in my chart are tied to the area result.

Konrad has a primer that may be helpful, however you just need to provide the colors in the same order as your data.
https://konradsobon.gitbooks.io/mandrill-primer/content/

Yes, I had thought about it, but the goal is to make the dynamo script work on several projects that do not have the same values ​​for each type of family. That’s why I’m looking for a solution to fix the colors to the type and not to the area result. I will see with Konrad. Thank you very much once again.

It is based on the type. You just need some logic that creates a list of colors based on the number of types you have. The ColorRange node should make that pretty simple, but it can get hard to read with many types. You could also create a list of random colors so they’re easier to read. This can be done with custom nodes or a little effort with the out of the box nodes.

If you’re trying to define a specific color for a specific type (consistent across all projects) then you need to do that with a dictionary or other “hard coded” list. Then it’s just a matter of using the colors that match the included types.

Hmm I’m a beginner and I’m not sure I understand how to create a dictionary. Do you have an example or a link to provide me, by any chance? Sorry for the bad english, google translate is my best friend :smiling_face:

There are plenty of topics here on the forum that cover dictionaries as well as a section in the Dynamo Primer. Start there and then let us know if you have trouble with any of the specifics.