Pie Chart - Using Mandrill

Hello All, i am trying to generate a pie chart using the Mandrill package and running into a roadblock. I have put together the following script that is pulling a calculated value from my schedule and trying to chart that. Connecting my ‘List’ node to the ‘Values’ node ends up giving me an error, however using a string of numbers gets me the chart. Do i have to convert my list to a string and then feed to the ‘Values’ node? Would appreciate any help and thanks for taking a look.

Edit Edit: You might also need to check the class of the items in your remove.itematindex node. It is more than likely a string that is outputting if it has that % sign included on it. I would remove it in the Revit schedule and just make it a number and put the % at the top to indicate units. Then it will just be a list of lists again and once you run flatten.list it will match the code block you inputted.

Disregard: It appears that levels are throwing you off. Place a list flatten node and try feeding the data that way.

@dsmith Thanks for your response and taking a stab at it. I removing the % sign and flattened the list with no luck. Also switched up the lacing but still getting the same result… Here’s an updated graph:

What is the error on PieChart.Data? Not really familiar with the package (see a lot of things saying it crashes a lot) but…

Place an Object.Type node off the List.Flatten. I bet that it is a System.String. You want System.Int64 or Double. Try this…

As an aside this script runs to completion for me with no errors but when I attempt to Launch Window it causes Dynamo to crash. I have created an issue on GitHub for the error.

Dustin, You’re right the Object.Type node is giving me a System.String instead of a System.Int64. But what’s interesting is that the list that i am grabbing from my schedule is a System.String compared to a typed up string of the same numbers which is a System.Int64, Thoughts? Typing up a code block of the numbers works fine on my end too, the error only arises when i try feeding a list generated from my schedule.

Screenshot_8

Also this is the error i am getting when feeding the list generated from my schedule:

You haven’t placed the string to number node after list flatten I showed in my image.

Yup, that was it! Thanks a lot!

2 Likes