Skip to content

[BUG] zeroLineIndex is undefined for yAxis, prevents setting of zeroLine attributes #5032

@adamheald13

Description

@adamheald13

Expected Behavior

I would expect zeroLine attributes (e.g. zeroLineWidth) to be set on the yAxis.

Current Behavior

if (index === me.zeroLineIndex && options.offset === gridLines.offsetGridLines) {
me.zeroLineIndex results in undefined for the vertical gridLines.

Breakpoint after causing a re-render.
undefined me zerolineindex

This behavior appears to have been introduced in 2.7.0. Reverting back to 2.6.0 fixes this particular issue (but introduces others) at least in the browser. In the CodePen below changing to 2.6.0 doesn't seem to fix it.

Context

I'm trying to create charts with matching styled x and y axes.

Environment

  • Chart.js version: 2.7.1
  • Browser name and version: Firefox (Version 57.0 (64-bit)) & Chrome (Version 62.0.3202.94 (Official Build) (64-bit))
  • Link to your project: Working codepen

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions