/ / Jestem animatorem wykresu kołowego za pomocą klasy zdarzenia Handler interfejsu API wizualizacji Google - API, Google-Visualization

Animuję wykres kołowy używając klasy zdarzenia Handler w google visualisation API - api, go-wizualizacja

if (element.Category.ChartType == "PieChart") {
console.log(sliceOptions);
var animate = 0.05;
console.log("for your test" + rows[4][1]);
console.log("for your test" + rows[3][1]);
console.log("for your test" + rows[2][1]);
console.log("for your test" + rows[1][1]);
wrapper = new google.visualization.ChartWrapper({
chartType: element.Category.ChartType,
dataTable: rows,
containerId: element.Category.Key,
options: {
is3D:true, height: 270, slices: sliceOptions,
pieStartAngle: 100,
animation: { startup: true, duration: 15000, easing: "Out" },
backgroundColor: "#F8F8FF",
pieSliceText: "label",
tooltip: { color: "#FF0000" },
slices: {
1: { offset:animate },
2: { offset: animate },
3: { offset: animate },
4: { offset: animate },

},

}

});
google.visualization.events.addListener(wrapper, "select", selectHandler);
function selectHandler() {
//alert("A table row was selected");
var data = wrapper.getSelection();
alert(data);
}

}

Ale rzuca powyższy wyjątek. Uncaught TypeError: wrapper.getSelection nie jest funkcją. Animuję wykres kołowy za pomocą klasy zdarzenia Handler interfejsu API wizualizacji Google. proszę podaj mi rozwiązanie.

Odpowiedzi:

0 dla odpowiedzi № 1

getSelection() jest Wykres metoda, nie a ChartWrapper metoda

spróbuj tego zamiast ...

wrapper.getChart().getSelection()