Skip to content

Treat single element backgroundColor option array as string option #4807

@Seabizkit

Description

@Seabizkit

Expected Behavior

BackgroundColor is inconsistent, let me explain, it takes an array but at the same time it take a single value. in other words it should be able to handle ["rgb(54, 162, 235)"] but wants it as "rgb(54, 162, 235)" but when there is multiple then it wants an array. What its not doing updating the hover colour indicator.

Current Behavior

no errors, but the hover info block colour does not match the legend!.

Possible Solution

Forcing unnecessary coding! write extra logic.

Steps to Reproduce (for bugs)

  1. create bar graph
  2. have 1 legend, multiple labels
  3. Set the legend to 1 colour but with an array of colours, yes with only 1 in the array
    4.the hover info colour will not match the legend colour

Context

Why.... well if your mapping this back to a concrete type (java, c#), then its impossible as is it an "array" or a "string". makes it very hard to make class helpers.

Environment

  • Chart.js version: 2.6, but i think its also in latest, need to check
  • Browser name and version: chrome

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions