GoogleWebComponents / google-chart

Google Charts API web components
https://www.webcomponents.org/element/@google-web-components/google-chart/elements/google-chart
Apache License 2.0
358 stars 130 forks source link

Unable to select item #199

Closed bennypowers closed 7 years ago

bennypowers commented 7 years ago

I have a timeline chart:

<google-chart id="chart"
    type="timeline"
    cols="[[cols]]"
    rows="[[rows]]"
    selection="{{chartSelection}}"
    options="[[options]]"
></google-chart>

And a method:

_activeClipChanged(activeClip, activeClipset) {
  if (!activeClipset) return;
  const row = activeClipset.indexOf(activeClip);
  this.set('chartSelection', [{row, column: null}]);
},

And the two are not getting along. I can't seem to set the selection in the google chart from outside.

Reproducable JSBin: https://jsbin.com/qukucon/edit?html,output

wesalvaro commented 7 years ago

Thanks so much for the jsbin! I've tracked down the docs and responsible code. setSelection is actually, currently unavailable for the Timeline chart. While the method exists and does update the chart state, it does not seem possible to draw the chart with the selection set by the user. I've raised a bug for this internally. But a better place to file this would be with the Google Visualization team: https://github.com/google/google-visualization-issues/issues

dpfederighi commented 6 years ago

This is pretty important for us. Any updates?

wesalvaro commented 6 years ago

Hi, this isn't something that can be fixed in the Polymer element. You'll have to follow up with the google-visualization-issue linked above