question

Julio R avatar image
0 Likes"
Julio R asked Julio R commented

Display percentages in state pie

Is there any way to show the percentages of a composite state pie or a simple state pie in the legend?

I am trying to show this information without having to hover over each section of the pie chart.

FlexSim 21.0.1
statisticsflexsim 21.0.1state pie
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image Joerg Vogel commented ·

By table

0 Likes 0 ·
Julio R avatar image Julio R Joerg Vogel commented ·

Helo @Jörg Vogel,

I am doing that rigth now, but if is posible I would like to put it in the same graph.

Also, I had to install the composite pie and create a new calculated table in order to get the percentages, since the original calculated table only has the total times spent in each state and the percentages are calculated internally to display them on the pie graph. Do you know an easier way to achieve this?

1 Like 1 ·

1 Answer

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Julio R commented

I think the problem here is that the legend can be shared across multiple pies in the same chart, so it would only make sense for the case when there is only one pie in the chart. I can suggest it as an option for when there is only one pie/bar in the chart.

· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Julio R avatar image Julio R commented ·

Thanks @jason.lightfoot,

I didn´t think of that, you are right. What I did was use the table graph. But I had to do a series of modifications that may not be the most efficient and definetly are not easy to explain to people with limited knowlege of Calculated Tables and Statistic Collectors.

What I did was first install the graph. This creates a statistic collector and a calculated table.

In the statistic collector I created a new collumn that gets the sum of all times in the table, since I cannot use the time() command because there is two objects (is a composite state pie) and the sum of all times is not the total time.

Then in the calculated table I divided the time for each state by the sum of all times to get the percentage.

Then I did a calculated table pointing to the previous calculated table to filter the rows without any time (states not used).

I cannot upload the model since is a client model, I hope I explained myself.

Is there a simpler way to do this?

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Julio R commented ·

In the attached model I was able to just add the percentage in that state to the stats collector and then have one calculated table that filters out the zero states for use by the Dashboard Table Chart.

CompositeStatePie_Percentages.fsm

0 Likes 0 ·
Julio R avatar image Julio R Jason Lightfoot ♦♦ commented ·

Thanks @jason.lightfoot!!,

This is almost what I needed,but thanks to this example I was able to do it. The only difference was that I want the percentage that is shown in the chart.

I only had to group the results in the second calculated table by State and make the Average in PercentInState.

This is the modify SQL:

SELECT Object, State, AVG(PercentInState) FROM [Composite State 1 Collector] WHERE PercentInState>0

GROUP BY State

0 Likes 0 ·