XY Chart Series Data All Showing Same Data

I've had this issue for a while, but it would magically fix itself by copying and pasting the XY Chart. However, that is not working anymore. I have multiple XY Charts are setup similarly showing different date and all are doing the same thing. These charts to show production for each day for the past 7 days.

The data sources are as follows:

  • Shift1
  • Shift2
  • Shift3
  • Total (total for all three shifts for the day)
  • Spacing (which is just an empty dataset to provide spacing between each day)
    The data sources are bound to separate SQL Query tag.

This is what one of the charts currently looks like:

For the current day, the data looks weird. Not sure what its doing there. For the remaining days all are showing the same values. The data source Shift1 and Shift3 are empty, so those should have no columns. Shift2 and Total have data in them, those are the only two that should have columns.

I tried removing my spacing data source to see if that was causing issues, but it did not change the chart.

Please tag your question (using the dropdown below the title) as Vision or Perspective. It looks like Perspective so you can copy the chart from the Project Browser and past it in here formatting as code. Please see Wiki - how to post code on this forum.

Do the same with the chart data as the binding won't work for us in testing.

I am hitting a character limit. Will it work if I paste it in a text file and upload it?

That should work.

Here is the file. The data sources are at the bottom and I labeled them.

XYChart.txt (46.9 KB)

I looked into your issue and noticed that you're using a dataset to render the series. While I’m not exactly sure what’s causing the problem, I’d recommend transforming your data into an array of dictionaries instead.

There are multiple ways to structure the dictionary, but I prefer using static keys in the series configuration and changing the values at the dataSources level. For example, assign either the "Count" or "Weight" values to the keys in your dataSources, rather than modifying the series[].data.y property dynamically.

Also, the data axis can handle missing or empty dates automatically, so you don’t need to manually fill in gaps for the timeline—it will still render correctly.

I've attached a view you can use as a starting point.
XYChartSample.zip (17.8 KB)

Please modify the transform script I included—it's just meant to demonstrate the concept. I’m not sure how you're building your dataset, so you might even be able to construct the array of dictionaries directly at the source.

I'm not sure what is causing the issue either. It would render the date fine at some points, but then at other points it would be off. Like I mentioned in the post, I could copy the same XY Chart and the date would be fine.

I have implemented your solution and will see if that fixes the problem. So far it looks good. I have the source data bound to a query tag from SQL. I've had issues with having a direct query bind taxing the SQL server if multiple users had the same page open. Also, this keeps the data consistent across multiple users.