Skip to content

error with line-plot when labels are not specified. #3600

@brentp

Description

@brentp

With a line plot, with no labels specified, I get:
Chart.bundle.js:13295 Uncaught TypeError: Cannot read property 'length' of undefined
in version 2.3.0. Where that error is on the labels attribute and it occurs because I haven't specified labels.
I'm new to using this library, but it doesn't seem like that should be required. I can also get around it by specifying ticks {min: mymin, max:mymax}.

Here is the full, self-contained html to recreate the issue

<!DOCTYPE html>
<html>
    <head>
    <script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.3.0/Chart.bundle.js"></script>
    </head>
    <body>
        <canvas id="canvas" height=400, width=400></canvas>
    </body>
    <script>

    var ctx = document.getElementById("canvas").getContext("2d");
    new Chart(ctx, 
{"type":"line","data":{"datasets":[{"data":[{"x":0.00,"y":0.00},{"x":1.00,"y":1.00},{"x":2.00,"y":2.00},{"x":8.00,"y":8.00},{"x":9.00,"y":9.00}]}]},"options":{"responsive":true}}
    )
    </script>
</html>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions