I make table for Handlebars in Superset 4.0.0.
I add formatting with CSS in Live CSS editor.
But I still need add histograms to Revenue fact column.
How to add histograms?
Do I need to check settings of Superset / Handlebars?
Superset v. 4.0.0
Docker version 26.1.3
Docker Compose version v2.27.0
Input data:
Handlebars Template code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.jsdelivr.net/npm/handlebars/dist/handlebars.min.js"></script>
<script src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
</head>
<body>
<table id="table">
<thead>
<tr id="table-header">
<th id="date-header">Date</th>
<th id="revenue-plan-header">Revenue plan</th>
<th id="revenue-fact-header">Revenue fact</th>
</tr>
</thead>
<tbody>
{{#each data}}
<tr>
<td id="date-cell">{{dateFormat date locale="en-US" patter='yyyy-mm-dd'}}
<td id="revenue-plan-cell">{{revenue_plan}}</td>
<td id="revenue-fact-cell">
<span class="revenue-value">{{revenue_fact}}</span>
<canvas class="revenue-chart" data-revenue-fact="{{revenue_fact}}"></canvas>
</td>
</tr>
{{/each}}
</tbody>
</table>
<div id="chart-container"></div>
</body>
</html>
CSS-code:
.css-33igcc #user-content-table {
width: 100%;
}
.css-33igcc #user-content-table-header {
border-left-style: solid;
border-left-width: 1px;
border-right-style: solid;
border-right-width: 1px;
border-top-style: solid;
border-top-width: 1px;
border-bottom-style: solid;
border-bottom-width: 1px;
}
.css-33igcc #user-content-date-header {
padding-left: 10px;
border-right-width: 1px;
border-right-style: solid;
}
.css-33igcc #user-content-revenue-plan-header {
padding-left: 10px;
border-right-width: 1px;
border-right-style: solid;
}
.css-33igcc #user-content-revenue-fact-header {
padding-left: 10px;
}
.css-33igcc #user-content-date-cell {
padding-left: 10px;
border-left-width: 1px;
border-left-style: solid;
border-right-width: 1px;
border-right-style: solid;
border-bottom-width: 1px;
border-bottom-style: solid;
}
.css-33igcc #user-content-revenue-plan-cell {
padding-left: 10px;
border-right-width: 1px;
border-right-style: solid;
border-bottom-width: 1px;
border-bottom-style: solid;
}
.css-33igcc #user-content-revenue-fact-cell {
padding-left: 10px;
border-right-width: 1px;
border-right-style: solid;
border-bottom-width: 1px;
border-bottom-style: solid;
}
My table: