Added ability to add custom categories to xAxis

This commit is contained in:
Andrés Santibáñez
2020-11-06 23:50:51 -05:00
parent 0aedf541a9
commit 1e7ac1bffb
3 changed files with 17 additions and 5 deletions

View File

@@ -28,7 +28,9 @@
}
})
const categories = []
const categories = component.get('lineChartModel.xAxis.categories').length > 0
? component.get('lineChartModel.xAxis.categories')
: data[series[0].name].map(item => item.title)
const options = {
series: series,
@@ -68,7 +70,7 @@
},
xaxis: {
...component.get('lineChartModel.xAxis') || {},
labels: component.get('lineChartModel.xAxis.labels'),
categories: categories,
},