The chart component (stack) stacks my 4 values in one bar instead of two

I want the chart component (stack) to show two values in one bar, and two other values in another bar (next to the first bar). But it takes the four values and stacks them in one bar. In other words, I have the values in item 1, item 2, item 3 and item 4. How can I indicate for example that item 1 and 2 be shown in the first bar, and item 3 and 4 be shown in the second bar?

I don’t think there’s an easy way to do that.

I assume your current structure looks like this.

It has to look somewhat like this to be able to “stack”.

But then, I feel like it doesn’t represent a good structure for you anymore. You might want to look into Quickchart to be able to customize charts better.

1 Like

Thanks! I tried quickcharts but once I have the code, what component in glide do I use to show my chart?

If you have the right params already, you can use an image component for that.

They have a sandbox environment to test stuff, it’s pretty neat. You can use the Construct URL column in Glide to build out your chart URL.

I used a TEMPLATE column and the graph shows neatly on an image component. However, I have to hardcode the values (it does not let me do replacements). Any hint why?

If you’re using the template column, you can do something like: {D} as a variable, and then replace {D} with your data.

I assume you would have to build your data in another template column, from the data you have in your app.

Tried the {D} and other letters (I assume it has to be a unique text in the code). But no matter what I always get this error:

Can you check your result to see where the “.” letter is? How are you setting up your {D} variable?

First, thanks a lot for your help and patience!!! I did not understand what you mean by your first sentence (check the result). Here is my code (that works perfectly when I hardcode values):


Can you show us what your {A} value looks like?

I’d probably change the formatting of your number column to remove the thousands separator and maybe the decimal if you don’t need it. The thousands separator is probably getting you because that is the delimiter value for each data point.

Right on Jeff !! Now it works! Thank you very much

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.