Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with Number datasets #3

Open
AlbinoDrought opened this issue Oct 13, 2017 · 2 comments
Open

Doesn't work with Number datasets #3

AlbinoDrought opened this issue Oct 13, 2017 · 2 comments
Labels

Comments

@AlbinoDrought
Copy link
Owner

In Chart.js, there are two types of data:

  • Point[], which works
  • Number[], which doesn't work

Support should be added for the Number type, and it shouldn't be too hard.


Here's a fiddle demonstrating this issue: https://jsfiddle.net/tx2qnd45/

Reference #1 (comment) #1 (comment)

Dataset generation example:

    var scalingFactor = function(value) {
        return (value * 0.9) + (Math.random() > 0.5 ? 1.0 : -1.0) * Math.round(Math.random() * 10);
    };
    
    var generateData = function (count) {
        var data = [];

        var y = 0;
        for (var i = 0; i < count; i++) {
            y = scalingFactor(y);
            data.push(y);
        }

        return data;
    };

Dataset example:

[
    4,
    -4.4,
    -11.96,
    -20.764000000000003,
    -10.687600000000003,
    -18.618840000000006,
    -22.756956000000006,
    -16.481260400000007,
    -4.833134360000006,
    -12.349820924000007,
    -4.1148388316000055,
    -10.703354948440005
]
@iskrzycki
Copy link

@AlbinoDrought Hi, do you plan to fix this issue soon?

@MickL
Copy link

MickL commented Apr 11, 2020

I cant use this module, too. I only have single numbers, not points.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants