Giter Site home page Giter Site logo

Comments (5)

nbering avatar nbering commented on May 27, 2024

This usually means there's something incomplete, o incorrectly-named key in your "chart object".

Check out the Examples, or upstream documentation for more information.

If you still need help, I'll need more information to assist you. A code sample, what version of Angular and angular-google-chart you're using, etc. This pen can serve as a good starting point for a proof-of-concept for your issue.

from angular-google-chart.

stevenmollie avatar stevenmollie commented on May 27, 2024

It worked until today, nothing is changed in the code, below you will find a code sample. The version of Angular is AngularJS v1.5.3. The version of the angular-google-chart is 0.1.0-beta.2
`$scope.chartObject.type = "LineChart";
$scope.chartObject.displayed = true;

            var data = new google.visualization.DataTable();

            data.addColumn('datetime', 'Time');
            data.addColumn('number', 'x Δ ' + $scope.measurementUnitName);
            data.addColumn({ type: 'string', role: 'tooltip' });
            data.addColumn('number', 'Δ ' + $scope.measurementUnitName);
            data.addColumn({ type: 'string', role: 'tooltip' });
            
            _.each($scope.meterMeasurements, function (meterMeasurement) {
                data.addRow([(new Date(meterMeasurement.measureTime)), parseFloat($scope.dailyAverageMeasurementValue), String($scope.dailyAverageMeasurementTooltip), parseFloat(meterMeasurement.measurementValue), String(meterMeasurement.tooltip)]);
            });

            $scope.chartObject.data = data;

            $scope.chartObject.options = {
                "title": "Verbruik",
                "colors": ['#009900', '#cc2132', '#CC0000', '#DD9900', '#DD0000', '#EE9900'],
                "defaultColors": ['#009900', '#cc2132', '#CC0000', '#DD9900', '#DD0000', '#EE9900'],
                "isStacked": "true",
                "fill": 20,
                "pointSize": 3,
                "displayExactValues": true,
                "vAxis": [{
                    "title": "Δ kWh",
                    "gridlines": {
                        "count": 10
                    }
                }]
                ,
                "hAxis": {
                    "title": "Tijd"
                }
            };

            $scope.chartObject.view = {
                columns: [0, 1, 2, 3, 4]
            };`

from angular-google-chart.

nbering avatar nbering commented on May 27, 2024

Do you have a sample of what $scope.meterMeasurements looks like, so I can populate a pen to try it out?

from angular-google-chart.

nbering avatar nbering commented on May 27, 2024

I think I'd also be missing some other details to be able to run that _.each, so if you could just throw together something to produces a representative output from that block, that would help. It doesn't have to be real data, just something that has data and replicates the issue.

from angular-google-chart.

stevenmollie avatar stevenmollie commented on May 27, 2024

Here's an example of the array, I also transformed the _each into a for loop for you, to make it easier.

[ {measureTime: "2020-04-30T00:00:00", measurementValue: 8, tooltip: "8,000 Δ kWh (9.695,000 kWh) | 30/04/2020"} {measureTime: "2020-04-29T00:00:00", measurementValue: 3, tooltip: "3,000 Δ kWh (9.692,000 kWh) | 29/04/2020"} {measureTime: "2020-04-28T00:00:00", measurementValue: 2, tooltip: "2,000 Δ kWh (9.690,000 kWh) | 28/04/2020"} {measureTime: "2020-04-27T00:00:00", measurementValue: 6, tooltip: "6,000 Δ kWh (9.684,000 kWh) | 27/04/2020"} {measureTime: "2020-04-26T00:00:00", measurementValue: 7, tooltip: "7,000 Δ kWh (9.677,000 kWh) | 26/04/2020"} {measureTime: "2020-04-25T00:00:00", measurementValue: 7, tooltip: "7,000 Δ kWh (9.670,000 kWh) | 25/04/2020"} {measureTime: "2020-04-24T00:00:00", measurementValue: 5, tooltip: "5,000 Δ kWh (9.665,000 kWh) | 24/04/2020"} {measureTime: "2020-04-23T00:00:00", measurementValue: 4, tooltip: "4,000 Δ kWh (9.661,000 kWh) | 23/04/2020"} {measureTime: "2020-04-22T00:00:00", measurementValue: 5, tooltip: "5,000 Δ kWh (9.656,000 kWh) | 22/04/2020"} {measureTime: "2020-04-21T00:00:00", measurementValue: 6, tooltip: "6,000 Δ kWh (9.650,000 kWh) | 21/04/2020"} {measureTime: "2020-04-20T00:00:00", measurementValue: 8, tooltip: "8,000 Δ kWh (9.642,000 kWh) | 20/04/2020"} {measureTime: "2020-04-19T00:00:00", measurementValue: 5, tooltip: "5,000 Δ kWh (9.637,000 kWh) | 19/04/2020"} {measureTime: "2020-04-18T00:00:00", measurementValue: 8, tooltip: "8,000 Δ kWh (9.629,000 kWh) | 18/04/2020"} {measureTime: "2020-04-17T00:00:00", measurementValue: 5, tooltip: "5,000 Δ kWh (9.624,000 kWh) | 17/04/2020"} {measureTime: "2020-04-16T00:00:00", measurementValue: 8, tooltip: "8,000 Δ kWh (9.616,000 kWh) | 16/04/2020"} {measureTime: "2020-04-15T00:00:00", measurementValue: 10, tooltip: "10,000 Δ kWh (9.606,000 kWh) | 15/04/2020"} {measureTime: "2020-04-14T00:00:00", measurementValue: 12, tooltip: "12,000 Δ kWh (9.594,000 kWh) | 14/04/2020"} {measureTime: "2020-04-13T00:00:00", measurementValue: 10, tooltip: "10,000 Δ kWh (9.584,000 kWh) | 13/04/2020"} {measureTime: "2020-04-12T00:00:00", measurementValue: 6, tooltip: "6,000 Δ kWh (9.578,000 kWh) | 12/04/2020"} {measureTime: "2020-04-11T00:00:00", measurementValue: 5, tooltip: "5,000 Δ kWh (9.573,000 kWh) | 11/04/2020"} {measureTime: "2020-04-10T00:00:00", measurementValue: 6, tooltip: "6,000 Δ kWh (9.567,000 kWh) | 10/04/2020"} {measureTime: "2020-04-09T00:00:00", measurementValue: 7, tooltip: "7,000 Δ kWh (9.560,000 kWh) | 09/04/2020"} {measureTime: "2020-04-08T00:00:00", measurementValue: 5, tooltip: "5,000 Δ kWh (9.555,000 kWh) | 08/04/2020"} {measureTime: "2020-04-07T00:00:00", measurementValue: 11, tooltip: "11,000 Δ kWh (9.544,000 kWh) | 07/04/2020"} {measureTime: "2020-04-06T00:00:00", measurementValue: 10, tooltip: "10,000 Δ kWh (9.534,000 kWh) | 06/04/2020"} {measureTime: "2020-04-05T00:00:00", measurementValue: 12, tooltip: "12,000 Δ kWh (9.522,000 kWh) | 05/04/2020"} {measureTime: "2020-04-04T00:00:00", measurementValue: 15, tooltip: "15,000 Δ kWh (9.507,000 kWh) | 04/04/2020"} {measureTime: "2020-04-03T00:00:00", measurementValue: 16, tooltip: "16,000 Δ kWh (9.491,000 kWh) | 03/04/2020"} {measureTime: "2020-04-02T00:00:00", measurementValue: 17, tooltip: "17,000 Δ kWh (9.474,000 kWh) | 02/04/2020"} {measureTime: "2020-04-01T00:00:00", measurementValue: 21, tooltip: "21,000 Δ kWh (9.453,000 kWh) | 01/04/2020"}]

for(var i = 0; i < $scope.meterMeasurements.length; i++){ data.addRow([(new Date($scope.meterMeasurements[i].measureTime)), parseFloat($scope.dailyAverageMeasurementValue), String($scope.dailyAverageMeasurementTooltip), parseFloat($scope.meterMeasurements[i].measurementValue), String($scope.meterMeasurements[i].tooltip)]); }

from angular-google-chart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.