I am trying to make a stacked bar chart similar to the one below.
I'd like to use the XY Chart and the X-axis labels should be non-numeric (i.e. string values, such as "apple", "banana", etc). So, my dataset has columns something like
Fruit | John | Sarah | Michael
Apple | 1 | 3 | 5
Banana | 4 | 0 | 2
Cherry | 2 | 2 | 3
How can i create this? The data is bound to a named query.
To my understanding, I need to primarily work on
- X Axis properties
- Y Axis properties
- Series properties
Seems like I'll need to choose a specific render type. I am new to ignition so not entirely sure. Thanks in advance!
Experiment with the default XY Chart.
xAxes.0.render : category
series.0.render : column
series.1.render : column
series.0.yAxis : process temp (It's already set in the default config.)
series.1.yAxis : process temp (Same as series.0 if you want stack to work.)
Now go and change
dataSource.example.0.t_stamp : Apple
dataSource.example.1.t_stamp : Orange
Finally, you may find that it's only displaying every second category label. This can be fixed by modifying
Try a smaller value.
Thanks for the reply. I think i was getting a bit confused because the example/default XY chart used fixed values while I was trying to figure out a binding option.
I was able to figure out the render/axis properties needed, appreciate it!
The grid.minDistance also came in handy for making sure all labels appeared
You're welcome. Don't forget to hit the "Solved" link under my answer.