vimalavinisha / angular2-google-chart

Angular 2 google chart
MIT License
59 stars 45 forks source link

Problem with 'select' event in piecharts #48

Open GustavoCostaW opened 7 years ago

GustavoCostaW commented 7 years ago

Google charts dispatch the error when some piechart is clicked.

core.es5.js:1084 ERROR Error: Invalid column index null. Should be an integer in the range [0-1].

Checking the code source, the directive uses select event to dispatch emit event, okay! But, inside of method:

            google.visualization.events.addListener(self.wrapper, 'select', function () {
                          ...
                        if (selectedItem.row !== null) {
                            selectedRowValues.push(self.wrapper.getDataTable().getValue(selectedItem.row, 0));
                            selectedRowValues.push(self.wrapper.getDataTable().getValue(selectedItem.row, selectedItem.column));
                          ...
            });

That error is happening because the piechart does not have column property and always is null and dispatching the error.

GustavoCostaW commented 7 years ago

The problem will be fixed in my pull request:

https://github.com/vimalavinisha/angular2-google-chart/pull/47/files#diff-3d20a0f02912cfb1634a3096ed238530R56

matthewdickinson commented 6 years ago

This same error is impacting my application. I can verify that the fix above does work. Can this pull request (or maybe one with just that one line change) be merged and a new version published?

Thanks

GustavoCostaW commented 6 years ago

@matthewdickinson the repo author needs accept my PR :/