Skip to content

"TypeError: i.strokeColor is undefined" when bar chart strokeColor is not specified in version 1.1.0 #2213

Description

@eemikula

I upgraded from 1.0.2 to 1.1.0 and a chart stopped rendering altogether, instead it was just producing the error: "TypeError: i.strokeColor is undefined"

https://jsbin.com/newaciwuwa/edit?html,output

It turns out it's sort of my fault because I wasn't specifying a strokeColor for the data set, but since it's a change in existing behavior that is a bit difficult to figure out, it's worth a simple fix. I believe this can be fixed by changing src/Chart.Bar.js so that instead of:

strokeColor : (typeof dataset.strokeColor != 'string') ? dataset.strokeColor[index] : dataset.strokeColor

we do:

strokeColor : (typeof dataset.strokeColor == 'object') ? dataset.strokeColor[index] : dataset.strokeColor,

Based on the guidelines for contributing, I'm raising the issue here before creating a pull request. Is there something wrong with this approach?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions