Minimal
by stitot
HTML
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/offline-exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@highcharts/grid-pro/grid-pro.js"></script>
<script src="https://code.highcharts.com/dashboards/dashboards.js"></script>
<script src="https://code.highcharts.com/dashboards/modules/layout.js"></script>
<script src="https://code.highcharts.com/modules/accessibility.js"></script>
<script src="https://code.highcharts.com/themes/adaptive.js"></script>
<h1 id="title">MicroElement amount in Foods</h1>
<div id="container"></div>
<p class="highcharts-description">
The basic dashboard shows the amount of Vitamin A and Iron in foods.<br />
*Recommended Dietary Allowance (RDA).
</p>
CSS
@import url("https://code.highcharts.com/css/highcharts.css");
@import url("https://cdn.jsdelivr.net/npm/@highcharts/grid-pro/css/grid-pro.css");
@import url("https://code.highcharts.com/dashboards/css/dashboards.css");
body {
font-family:
-apple-system,
BlinkMacSystemFont,
"Segoe UI",
Roboto,
Helvetica,
Arial,
"Apple Color Emoji",
"Segoe UI Emoji",
"Segoe UI Symbol",
sans-serif;
background: var(--highcharts-background-color);
color: var(--highcharts-neutral-color-100);
}
#title {
text-align: center;
padding: 10px 0;
margin: 0;
background-color: var(--highcharts-neutral-color-0);
}
#kpi-vitamin-a .highcharts-dashboards-component-title::before,
#kpi-iron .highcharts-dashboards-component-title::before {
width: 14px;
height: 14px;
border-radius: 28px;
display: inline-block;
padding: 0;
margin-right: 4px;
background-color: var(--highcharts-color-0);
content: " ";
}
#kpi-iron .highcharts-dashboards-component-title::before {
background-color: var(--highcharts-color-2);
}
#kpi-vitamin-a .highcharts-dashboards-component-kpi-subtitle,
#kpi-iron .highcharts-dashboards-component-kpi-subtitle {
margin-top: 10px;
font-size: 1.2em;
color: var(--highcharts-neutral-color-60);
}
#kpi-vitamin-a .highcharts-dashboards-component-kpi-value,
#kpi-iron .highcharts-dashboards-component-kpi-value {
font-size: 4em;
line-height: 2.4rem;
margin-top: 10px;
color: var(--highcharts-color-0);
}
#kpi-iron .highcharts-dashboards-component-kpi-value {
color: var(--highcharts-color-2);
}
#dashboard-col-1 .highcharts-color-0 {
fill: var(--highcharts-color-2);
stroke: var(--highcharts-color-2);
}
#kpi-vitamin-a .highcharts-dashboards-component-kpi-value::after,
#kpi-iron .highcharts-dashboards-component-kpi-value::after {
content:...
JavaScript
Dashboards.board('container', {
dataPool: {
connectors: [{
id: 'support',
type: 'JSON',
firstRowAsNames: false,
columnIds: [
'Channel', 'Department', 'Satisfaction',
'Wait time', 'Tickets', 'Resolution time'
],
data: [
['Email', 'Marketing', 8, 5, 140, 1.4],
['Chat', 'Marketing', 7, 14, 90, 2.3]
]
}]
},
editMode: {
enabled: true,
contextMenu: {
enabled: true,
items: ['editMode', 'viewFullscreen']
}
},
gui: {
layouts: [{
rows: [{
cells: [{
id: 'dashboard-col-0'
}, {
id: 'dashboard-col-1'
}]
}, {
cells: [{
id: 'dashboard-col-2'
}]
}]
}]
},
components: [
{
renderTo: 'dashboard-col-0',
type: 'Highcharts',
sync: {
highlight: true
},
connector: {
id: 'support',
columnAssignment: [{
seriesId: 'tickets',
data: ['Channel', 'Tickets']
}]
},
chartOptions: {
chart: {
type: 'pie'
},
credits: {
enabled: false
},
legend: {
enabled: false
},
plotOptions: {
pie: {
// innerSize: '60%'
},
series: {
colorByPoint: true
}
},
title: {
text: 'Ticket...