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

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?

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:
PS: Best always check the example models first, many show how to apply these basic techniques

Related

Format output of formula field (which is used in charts etc.)

The output of my formula field is typically formatted like this:
Output of formula field
In my details I can switch this format to a number without any decimal points or thousand points:
Format in details without points
The problem is, that this changed format isnĀ“t displayed in the diagrams or cross tables later on:
Format failure in diagrams or cross tables
How can I fix this issue?
Thanks in advance!
Formatting charts can be confusing because of how varied the layout can be for each different type of chart. I find its is easier to format the display of a chart when you are previewing data on the chart because the layout for the chart in design view may not match what is output at runtime. While previewing the report you should be able to click on any value or label on the chart to select the object. You should see the four points around the object that allow you to resize the object once it is selected. Then you can right click on the object and select "Format Selected Object" or "Format Axis Label" on the menu. Then you should see a tab labeled "Number" where you will find options that allow you to control the formatting. The options found here will vary a little depending upon the object selected on the chart. If you need specific help with these options, it would be helpful if you could provide a screen shot of the window.

How to mix bar and lines in Grafana in one chart

How can I display one dataseries as bar and another as a line in one graph like it is used in the last comment of: see last picture
Short answer:
It's not possible (yet) using the Grafana UI, only by hand.
Long answer:
As far as I know there is no way of doing this using the UI switches; you'll have to use the use the "alias or regex" fields below the visualisation configuration.
Prepare your data
Before you start, make sure that your queries A and B retrieve actual data. You won't see your data otherwise and be confused why they're not showing.
Adding fields and values to the aliases
Once you are selecting the correct data you want to display, just add the following on the visualisation section of the graph at the 'alias or regex' fields:
Add 2 overrides, one for each value you want to display using the 'Add series override' button.
Add a "Bars:false" option flag and a "Lines:true" for the value you want as a line.
Be sure to use the exact opposite values for your bars ("Bars:true" & "Lines:false")
Add a 'Y-axis: 2' to the value you want to have on the right side of your graph.
Optionally, you can add a "Z-index: 3" for the value that you want to have on top (I added this option to the line to make sure it's always drawing on top of the bars).
Enjoy
You should now have a nice graph with 2 types of data and visualisations in one; something like this:
For those who were asking in the comment section, yes this isn't available in version 8, however, you can still change the time series visualization to graph(old) so you can set the alias/regex.

Change line behavior of a combined chart in SAPUI5 VizFrame

I am using a combined chart (Stacked Column + Line) for my application. Is it possible to change the line plotting?. (somewhat like shown in RED in the image). If yes then how is it possible?
I'm sure you already know the VIZ documentation where you can find all possible properties of VizFrame. As far as I know there currently is no way to get the behavior you're asking for except for writing your own lineRenderer (vizProperties.plotArea.lineRenderer). There is one alternative line plotting mode available which is smoothening it but I'm sure thats not what you want.
However you could use a second series of column chart instead. Just use a standard column chart and add two data series instead of one. I think this would show the exact information you're trying to get with the current diagram just no connection between them.

Google bar chart with difference arrow

Plain and simple, is it possible to do a bar chart like this one.. using google chart ?
I have no code to show you because is very simple to do bar chart but not sure if is possible to generate a difference arrow. (this graph is from Think Cell)
The closest thing I am aware of is Diff Charts. They aren't nearly as explicit in marking the change, but they are a way to visually display the change in a data set.
Using DiffCharts requires to separate google.visualization.DataTable instances with the old data an new data. You then call the computeDiff(oldData, newData) method on the chart instance and it will give you a new DataTable instance that you can use to draw the diff chart.

customise a specific column in ZK charts

i m working on a project using ZK charts Using MVC approach, what i want to do exactly is to change the background or to add a guideline ( with diffrent color) to a specific column for example the one with index 3 : where is what i do want to achieve
here is my chart :
and here is what i want with diffrent color in column with index 3 :
or with a guide line ( green color):
is this possible in Zk ? and thx
I don't know how useful this gonna be to you, i found this example about ZK charts, as the example shows in the model class it manages the colors as public static values, so, maybe you're managing the color in a similar way. here,
https://www.zkoss.org/zkdemo/chart/bar_chart
Then, if you wanna change a specific color of a bar, this example gives you a hint how to do it.