我想在Google图表中单击时更改所选栏的颜色

时间:2018-12-07 04:35:41

标签: javascript

这是我的代码:

var chart = new google.visualization.ComboChart(document.getElementById('AgeGroupBarchart'));

            google.visualization.events.addListener(chart, 'select', selectHandler);

            function selectHandler() {

                var selecteditem = chart.getSelection()[0];
                if (selecteditem) {

                    var barvalue = olddata.getValue(selecteditem.row,0);
                    var viewc = new google.visualization.DataView(data);
                    viewc.setcolumns([0, 1, {
                        type: 'string',
                        role: 'style',
                        calc: function (data, i) {
                            return (i == row) ? 'color: red' : null;
                        }
                    }]);
                    var YearQtr = "2018-Q2";
                    BandBucketBarChart(Vertical, YearQtr);
                    TenureBarchart(Vertical, YearQtr)



                }
                chart.draw(viewc, {
                    height: 400,
                    width: 600
                });
            }



            chart.draw(olddata, options);

我收到此错误:

Uncaught TypeError: a.Z is not a function
at new gvjs_U (jsapi_compiled_default_module.js:188)

0 个答案:

没有答案