Hi,
I'm very new to charting with Retool / Plotly. I'm trying to put together a stacked bar chart similar to this (in google Sheets):
I've tried adding to the Plotly JSON field:
"layout": {
"barmode":"stack",
"barnorm":"percent"
},
But I'm still just seeing side-by-side bars:
I also tried the approach outlined in this post but could not get that to work: Build stacked bar chart and rotate x axis labels vertically
I've put the full Plotly JSON in here
Plotly JSON -> Data
[
{
"name": "tempo_unbillable_hours",
"layout": {
"barmode":"stack",
"barnorm":"percent"},
"x": {{formatDataAsObject(query1.data).full_name}},
"y": {{formatDataAsObject(query1.data)['tempo_unbillable_hours']}},
"type": "bar",
"hovertemplate": "<b>%{x}</b><br>%{fullData.name}: %{y}<extra></extra>",
"transforms": [
{
"type": "sort",
"target": {{formatDataAsObject(query1.data).full_name}},
"order": "ascending"
},
{
"type": "aggregate",
"groups": {{formatDataAsObject(query1.data).full_name}},
"aggregations": [
{
"target": "y",
"func": "sum",
"enabled": true
}
]
}
],
"marker": {
"color": "#1E3A8A"
}
},
{
"name": "total_billable",
"x": {{formatDataAsObject(query1.data).full_name}},
"y": {{formatDataAsObject(query1.data)['total_billable']}},
"type": "bar",
"hovertemplate": "<b>%{x}</b><br>%{fullData.name}: %{y}<extra></extra>",
"transforms": [
{
"type": "sort",
"target": {{formatDataAsObject(query1.data).full_name}},
"order": "ascending"
},
{
"type": "aggregate",
"groups": {{formatDataAsObject(query1.data).full_name}},
"aggregations": [
{
"target": "y",
"func": "sum",
"enabled": true
}
]
}
],
"marker": {
"color": "#F59E0B"
}
}
]
query1.data
is from a basic table:
Any pointers hugely appreciated!
Nick