vue-charts icon indicating copy to clipboard operation
vue-charts copied to clipboard

convertOptions

Open seb-vial opened this issue 7 years ago • 1 comments

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

image

I'm guessing this could be added as an optional prop ?

seb-vial avatar Mar 14 '17 08:03 seb-vial

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
    },

rzb avatar Mar 30 '17 12:03 rzb