Skip to content

strange graph generation #24

Description

@rosscdh

Hey there, great integration thanks for that..

Am having a weird result with the output graph (have looked at your examples and many other support items in stackoverflow but to no avail.. its a timerange dataset with x: unixtimestamp and y: int value

but graph looks like

weird

Any input would be appreciated

        // var time = new Rickshaw.Fixtures.Time();
        $scope.graph.features = {
          palette: 'colorwheel',
          // xAxis: {
          //     timeUnit: 'minute',
          //      tickFormat: 'formatKMBT',
          //     // legend: {
          //     //     toggle: true,
          //     //     highlight: true
          //     // }
          // }
        };

        angular.forEach($scope.object.sensors, function(sensor) {
          //console.log(sensor)
          SensorsService.chart(sensor.uuid).then(function (resp_data) {
            var data = [];
            angular.forEach(resp_data.series, function (row, key) {
              angular.forEach(row.values, function (values, key) {
                var x = moment(values[0]);
                var y = values[1];

                data.push({'x': x.unix(), 'y': y});
              });
            });
            //console.log(JSON.stringify(data))
            $scope.graph.series.push({
                'name': sensor.name,
                'color': 'steelblue',
                'data': data
            });
            //console.log($scope.graph)
          });
        });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions