Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to count and illustrate agents based on specific parmeter values in bar charts?

My source is generating an agent called Sitz with several parameters which get their value out of a database. One of the parameters is product_type.

Now I would like to count and illustrate the number of Sitz for each product_type in bar chart.
I am thinking of a bar chart which shows 2 bars, one with Sitz product_type = A400S and one with Sitz product_type = A660.

My idea is to write something like sink.count(agent.product_type = "A400S") as value in the bar charts data section, but this is not the right way. What would be the right code?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

There are a ton of ways, here is one:

First, create a variable countA440S. Then, in the sink, write

if (agent.product_type.equals("A400S")) {
    countA440S++;
}

In your bar chart, link it to the variable as below:
enter image description here

PS: Best always check the example models first, many show how to apply these basic techniques

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading