Skip to content

Grid dash option in the wrong place #11136

Description

@pacastro

Expected behavior

Expected to find dash option for gridlines in Namespace: options.scales[scaleId].grid, there is none.

Current behavior

Instead found that the dash option in Namespace: options.scales[scaleId].border works for Grids, so its in the wrong place... and so there is no option to config dash for border.

Reproducible sample

var ctx = document.getElementById("myChart"); var myChart = new Chart(ctx, { type: 'line', data: { labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"], datasets: [{ label: '# of Votes', data: [12, 19, 3, 5, 2, 3] }] }, options: { scales: { x: { }, y: { border: { display: false, color: 'red', dash: [20,20] }, grid: { display: true, color: 'black', } } } } });

Optional extra steps/info to reproduce

use the provided JS in the code pen template.

border display is off, with dash config under border... it still displays dashed line for y axis grid, with no dash config under grid

Possible solution

create dash config for Namespace: options.scales[scaleId].grid

correctly assign dash option in Namespace: options.scales[scaleId].border for dashing the border

Context

No response

chart.js version

v4.2.1

Browser name and version

No response

Link to your project

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions