Giter VIP home page Giter VIP logo

angular-dygraphs's People

Contributors

cdjackson avatar cesarandreu avatar greggroth avatar jdrobotter avatar xelhark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-dygraphs's Issues

includeZero Y axis doenst work

I need all my dygraphs start at 0. And for that I tried to add to graph options and nothing happen.. my graphs still show negative values... I tried to add to my directive and doenst work either. What can i do?

Directive:

(function() {
    var app = angular.module('dashboard.view', []);

    app.directive('dygraph', function(){
        return {
            restrict: 'E',
            scope: {
                data    : '=',
                options : '=?'
            },
            template: '<div style="width: 100%"></div>',
            link: function (scope, elem, attrs) {
                var div = elem.children()[0];
                scope.options.width = elem.parent()[0];
                scope.options.axes.y.includeZero = true;
                var graph = new Dygraph(div, scope.data, scope.options);

            }

       };
    });

})();

Graph Options:

var options = {
                        labels: labels,
                        showRangeSelector: true,
                        legend: 'always',
                        ylabel: units,
                        title: graphTitle,
                        includeZero: true,
                        axes: {
                            y: {
                                valueFormatter: function (value, opts, seriesName, dygraph, row, col) {
                                    if (seriesName == "Sysmode") {
                                        return modemSysmode[value];
                                    } else if (seriesName == "Roaming") {
                                        return modemRoaming[value];
                                    } 
                                    return value;
                                },
                                includeZero: true
                            }
                        },
                        underlayCallback: function(canvas, area, g) {

                            for (var i=0; i<highlightArea.length; i++) {
                                var left = g.toDomXCoord(highlightArea[i][0]);
                                var right = g.toDomXCoord(highlightArea[i][1]);

                                canvas.fillStyle = "rgba(217, 101, 87, 0.2)";
                                canvas.fillRect(left, area.y, right - left, area.h);
                            }
                        }
                    }

If I debug my options the value includeZero appears with true.

Dygraph should watch options too

Currently there's no watch for the options, meaning that changing them won't update the graph. I added the code in my local copy and doing a pull request

angular 1.3?

Has this directive been tested against angular 1.3? I am getting a race condition on 1.3 with the "resize()" function.

Annotations

Hi Chris,

I'd like to know if there's a way to add annotations in angular-dygraphs.
I'm currently looking in the plugin directory and see "annotations.js".

If you know how to deal with annotations, any help would be appreciated as I really need this feature :/

Thanks in advance.

Dygraph dont shwo onload but when i press f12 (resize) it appears

I'm having troubles showing a graph wyth dygrpah. I can have the options and data of the graph

options: {"labels":["date","live","repeated","passerBy"],"showRangeSelector":true,"title":"Scanning","axes":{"y":{}},"width":0}

data:

[["2017-07-17T10:12:00.000Z","408","396","351"],["2017-07-17T10:17:00.000Z","440","588","582"],["2017-07-17T10:22:01.000Z","410","580","529"],["2017-07-17T10:27:01.000Z","550","578","508"],["2017-07-17T10:37:00.000Z","532","501","544"],["2017-07-17T10:42:00.000Z","528","573","554"],["2017-07-17T10:47:00.000Z","313","376","409"],["2017-07-17T10:48:00.000Z","134","82","69"],["2017-07-17T10:52:00.000Z","296","402","286"],["2017-07-17T10:53:00.000Z","106","163","197"]]

But I'm having troubles presenting the info, is like its crashing or something like it.. can be any bug of the lib? If i press f12 the graph appears... but onLoad the page is blank as you can see on the images on the link below

Images of the problem:
https://stackoverflow.com/questions/45142487/dygraph-with-values-and-options-but-dont-present-graph

div containing graph gets continually smaller

When stretching the window from left to right and vice versa, the graph gets continually smaller until it the height of the div containing the graph goes to the height of the legend plus a margin.

Remove resize on watch of data

In your scope.$watch('data'..., you have complete the update of the graph with a call to resize(). While this may not be an issue for static plotting, if you do use this in a dynamic situation, this function call will result in a performance hit.

Adding Data Dynamically

Hi,
Sorry to bother you with this question. The project works great. I have 2 data sets that i need to draw. The server returns data as 2 separate json's. Do i have to merge the 2 jsons to create the data as one set?
For ex: in all the samples the data is shown as "x","a","b" but my data comes as
"x","a" and "x", "b". Is there a way to first add data for "a" and then add the data for "b"?

  • How do i dynamically add series to "legend".

Would appreciate any pointers.

Thanks,
Srini

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.