How do I customize what is shown for the value inside the stacked bar on a Dojo Chart - charts

Basically I have a dojo stacked bar chart where I have set these value to show the label on the bar:
"labels": true,
"labelStyle":"inside"
The value IS showing up, but i need to customize it by appending additional text to it.
I thought I could do something like the below, but it isnt working, I do not see my method _labelFunc get called:
p.labelFunc = lang.hitch({
self : this,
options : x.options
}, this._labelFunc);
Anyone have any ideas?

I think you're using lang.hitch a little incorrectly. I believe the first argument is supposed to just be the scope (e.g., this) and the second argument is a function or string name of the function if it already exists in the scope mentioned in argument 1.

Related

Tooltip type bar at zero value

I use a custom tooltip, and there, with null data, the bar type shows a tooltip with a value of 0, as I understand it, it shows the formattedValue. At the same time, if I use the tooltip from ChartJs, then everything is fine and it only shows the label. What do i do?
I tried turning off the custom tooltip and turning on the standard one. It shows only the label along the x-axis.
I also tried to write a callback label, and in this case I managed to return an empty value, but the point and color are displayed without an inscription, which is also not very beautiful

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?
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

Unity Input field not setting value on change

I simply want to set a room name using input fields and the fact that it can pass the input through as an argument, but this does not seem to work for some reason.
here is the function that is called
here is the output in the console when typing in the field
why does it send in a blank string?
I followed this tutorial: Youtube
When you add a listener (HostGame.SetRoomName) you have two sections from which you can choose your functions: Dynamic string and Static Parameters. Your function should be in both sections:
Dynaic string - SetRoomName
Static Parameters - SetRoomName(string)
You have to choose the first one if you want to receive as parameter the input field text. The parameter in the second option is whatever you put in the field below HostGame.SetRoomName in your first image (in your case blank).
I worked around this by creating a reference to the text in "SetRoomName" it's not ideal but works
It hasn't been explained well but you want to select the top method under dynamic value. If you look at this image, you will see two methods, selecting the bottom (static) one will show the input field as you see but the top (dynamic) one (which is what you want) will show no input field.

tableau change dimension to attr(dimension) in dashboard

In a worksheet, if I have a dimension as second dimension in a row label I can "collapse" that dimension with ATTR() by selecting Attribute in the menu:
However, this menu is only available on the worksheet view. How do I enable the user to accomplish this switch on the dashboard?
Create a boolean valued parameter, call it say Should Expand. You can choose readable aliases, such as "Expand" for True and "Collapse" for False.
Show your parameter control and customize the look as desired
Create a calculated, call it, say Collapsable Foo, where Foo should really be the name of your true second dimension. Define it as
if [Should Expand] then [Foo] end
Make sure Collasable Foo is a dimension and use it as desired, presumably in place of Foo. You can edit the aliases for Collapsable Foo to set Null to a single blank to improve the way text appears when collapsed.

Using Jasper ContitionalStyles with named style references

I've got a situation where I create a report based on jrxml-files generated programmaitically and a style template with a given name and given style names. This works fine up to the point where there are conditional styles. Every example I found just uses ConditionalStyles to change some value like setting a different backcolor for specific situations. This can't be done here since there is no way of knowing what separates an even row style from an odd row style. Like wheter an odd row will get a gray background or an even row will get a green foreground and a black bottom pen.
What I tried or looked at:
Using Conditional Styles - There seems to be no way of defining a style reference just to change style values
Using a Variable for the style name - The variable didn't get evaluated
Creating a style with 2 ConditionalStyles using even and odd styles as parent styles - these were ignored when creating the jrtx-file
So... is there a way to create alternate styled rows using style references? If yes how it is done?
As there seems no solution to this, we had to change the structure of the style-files to include the conditional style instead of doing this in the document.
When walking this path and trying to change or create these style-files programmatically, be aware that in the JRXmlTemplateWriter that comes with Jasper, the method toWriteConditionalStyles is implemented as:
protected boolean toWriteConditionalStyles() {
return false;
}
Which is unfortunate. You'll have to use your own Exporter that changes this behavior.
Simply the way of knowing what separates an even row style from an odd row style.
Even row will satisfy the condition
(($V{REPORT_COUNT}%2) == 0)
Odd row will satisfy the condition
(($V{REPORT_COUNT}%2) != 0)
Then you can use a Conditional Styles with above conditions