Add stacked option to bar chart

This commit is contained in:
Andrew Kingston 2020-11-03 09:48:35 +00:00
parent 0ea30587de
commit ae876c6c09
4 changed files with 15 additions and 4 deletions

View File

@ -573,6 +573,13 @@ export default {
control: Input,
defaultValue: "400",
},
{
label: "Stacked",
key: "stacked",
control: Checkbox,
valueKey: "checked",
defaultValue: false,
},
{
label: "Horizontal",
key: "horizontal",

View File

@ -573,10 +573,8 @@
},
"xAxisLabel": "string",
"yAxisLabel": "string",
"legend": {
"type": "bool",
"default": false
}
"legend": "bool",
"stacked": "bool"
}
},
"line": {

View File

@ -104,4 +104,8 @@ export class ApexOptionsBuilder {
legend(legend) {
return this.setOption(["legend", "show"], legend)
}
stacked(stacked) {
return this.setOption(["chart", "stacked"], stacked)
}
}

View File

@ -18,6 +18,7 @@
export let dataLabels
export let animate
export let legend
export let stacked
let data
$: options = getChartOptions(data)
@ -43,6 +44,7 @@
.dataLabels(dataLabels)
.animate(animate)
.legend(legend)
.stacked(stacked)
// Add data if valid datasource
if (rows && rows.length) {