Stacked Bar Chart rendering broken?

I have a setup with an XY chart that has three dataSources, all of which are used to generate a triply-stacked bar chart. These sources are getting their data from the same named query with different parameters.

Whenever I view the chart, it looks something like that. Some of the columns are fine, but then they become disjointed and it’s all a mess.

Could there be something I’m doing wrong? Or are things breaking because of how the named queries aren’t quite getting all the data at the exact same time? I’m certain I could modify the query to be a single named query instead of three separate ones, but I just wanted to see if it was an issue with chart rendering before I went through the work to do that.

1 Like

Hi md.szyman,

I think the most important thing to do first is to make sure you are getting the correct expected results that you are looking for. I would suggest you do Following: -

  1. Create three different XY charts with the three different datasources with different parameters and compare those results with the above results that you are getting and see if they match. Then if
    they do match those might be the expected results.

  2. You could also follow the workaround you suggested. Where you modify the named query to be a single query instead of three separate queries and compare the results to the ones you are getting above and see if they are different. If the result are different then there maybe a problem with the way XY charts is rendering results from a triple stacked bar chart.

I would also suggest you providing a gateway backup so that it is easy for us to reproduce the issue internally.

Thanks
Anthony

Its been a year since your post so fingers crossed!. I have a need for stacked Perspective XY Chart (Bar chart) like the one you have created, it will be great if you could give me some pointers on how you got it working? Were you able to track down the gap issue? And were there any performance issues? Thanks.

And now it’s been another year! Hopefully I have the answer for you guys.

I had the same issue and turns out my Bar Chart was being rendered that way because my X axis data was not exactly the same accross my datasources (it was the right data but in a wrong order). I sorted the column in my datasources and that fixed the issue.

1 Like

now a year later , i had this problem too, and for me it was the render of my Yaxes.

Is there a remedy for this issue?

Update:
Two things that helped me to resolve this issue.

  1. Use one data source in the XY chart. It seems like the chart is very sensitive to small variations of the time stamp in multiple data sources.
  2. The resulting dataset from the data source has multiple rows for every timestamp.
    On the screenshot below, I have 3 or 4 rows per each timestamp. The number of rows depends on whether a new datapoint was stored at the timestamp or not.

I added the Transform Script right after my History binding to aggregate this dataset into a new table.

Here is a script:

def transform(self, value, quality,.txt (1.6 KB)

Please post your code as preformatted text, see Wiki - how to post code on this forum.

You can edit your post by clicking the pencil icon in the bottom right.

Yup,
Ended up uploading the script as a text file.
Thank you.

Ignition simply cannot produce "AsStored" with "Wide Format" for multiple tags without repeating values. Use Tall Format and post-process so each tag's actual stored values are in their own arrays with their own timestamps.

(Timestamps have millisecond resolution in Ignition historians--you aren't showing the millis.)

Thank you, Phil,
Your suggestions are always on point.

Ended up with the ‘As-stored’ historical binding in a tall format.
Added a transform script to trim all timestamps to the minute.
Added another transform script to re-arrange the data from the tall to wide format. Wide format makes it easier to add the total column.
Optional, another script to add the total column.

This approach seems to be working fine.

Your other suggestion in another forum thread was to use the Transaction groups for storing of the datapoints that need to be stacked.
We’ll probably do that for all new projects.

Thank you again.