vue-charts
vue-charts copied to clipboard
convertOptions
Hello,
Is there a way to use convertOptions
for charts that allow it; to use some 'beta' options like in the Bar chart for example
I'm guessing this could be added as an optional prop ?
I'm looking for the same thing. I don't think there's any way to do it other than forking the repo and placing checks in the buildWrapper
method from the chart component. Something like:
methods: {
buildWrapper (chartType, dataTable, options, containerId) {
if (chartType == 'google.charts.Bar') {
options = google.charts.Bar.coverOptions(options)
} else if (chartType == 'google.charts.Line') {
options = google.charts.Line.coverOptions(options)
} else if (chartType == 'google.charts.Scatter') {
options = google.charts.Scatter.coverOptions(options)
}
let wrapper = new google.visualization.ChartWrapper({
chartType: chartType,
dataTable: dataTable,
options: options,
containerId: containerId
})
return wrapper
},