I have a stacked bar for a chart, but if only one production line of data shows up, then I get just one bar that takes up all most 400px width haha.
I thought item margin would help, but it doesn't seem to adjust the width when there is only one bar.
If there isn't a good way for me to thin this bar, then I think I will need to create dummy values for the other bars so that they always show up with zeroes maybe.
However, there is a report where I let users pick department, and that will not work for that chart as there are few lines for some departments.
So is there a way to control the width in a report?
You can dynamically add in "dummy values" via a scripting datasource. base it off of your selected parameters and then if there would be say 5 verticals then you wouldn't need to add the "dummy values" but in your script you could set a threshold saying there can be no less than 5 bars in the chart.
if len(myDatasourceValue) < 5:
addToDataSource(5 - len(myDatasourceValue))
then if you had 10 instances you wouldn't need to worry about taking away unneeded values
you may refer to Inductives Docs on scripting sources: Scripting Data Source | Ignition User Manual (inductiveautomation.com)
Thanks
I think then I would have labels for the additional dummy values for the report that has sometimes up to 12 and sometimes up to 4 depending on department.
I will see if I can get it to work, maybe I can set the labels to spaces.
You are correct. You would need to present the chart with labels for each, but you should in theory be able to make them empty string values or spaces.
I will say, another option would be to handle "dummy values" at your original datasource, but with this most likely being SQL of some flavor that is less clean in my opinion.