Arbitrary Clustered Stacked Bar Chart in Perspective

Hello.

I'm looking to visualize some data, from an inspection device.
The relevant data looks like this

date part pass fail
2025-01-01 gear 5 2
2025-01-01 screw 11 2
2025-01-02 gear 7 3
2025-01-02 screw 23 5
2025-01-03 knob 12 9
2025-01-04 knob 11 2
2025-01-04 gear 2 8

I'm wondering how hard it would be to get perspective to generate a chart like this. The x axis would first aggregate by date, and then by part. Then, the pass and fail would stack.


Considering that I had to make this in paint, because excel doesn't natively support this type, I suspect quite difficult.

There are a few particular difficulties: I do not know ahead of time what parts will be created. The parts inspected may change over time. This seems to prevent an approach like Perspective: How to create a grouped bar chart - Ignition - Inductive Automation Forum, which relies on each cluster having a consistent form.

If I'm not able to do the above, I could settle for a chart which looks like below:

I can get it to look as such, by setting the xaxis render to "Cluster", and setting each datapoint like {"pass_count": 100,"fail_count": 38,"ID": "Aug 07 2018 KNOB"}


However, I'd love if I could somehow add a line break between the date and the part number. I've tried adding \n and <Br> into the label plaintext, but neither worked. I want to show at least a weeks worth of data on this graph, but the wide labels make this difficult.

Is it worth looking into the ApexChart Module, to reduce the headache when creating graphs in the future? (it seems like ApexCharts can handle this task simply)

I found I can use a newline character to add a line break
So in my SQL, where I build the compound date + part name, I also use a
DECLARE @NewLineChar AS CHAR(2) = CHAR(13) + CHAR(10)

This can be done pretty easily with our Chart.js component: