Skip to content

override donsn't work as expected with type 'scatter' #19

@eloyvallinaes

Description

@eloyvallinaes

Setting specific colors for some traces in Chart of type 'scatter' doesn't prevent them for catching colors from the scheme. More exactly, even though the legend does show what would be expected, the markers on the canvas retain the colors supplied by the colorscheme.

MWE

        var myChart = new Chart(ctx, {
        type: 'scatter',
        data: {
          datasets: [
            {
             data : [
               {"x" : 10, "y" : 10},
               {"x" : 20, "y" : 20}
           ],
             backgroundColor : "gray",
             label : "Set 1"
           },
            {
              data : [
                {"x" : 10, "y" : 20},
                {"x" : 20, "y" : 40}
            ],
            label : "Set 2"
            }
          ]
          },
        options : {
          plugins : {
            colorschemes: {
              scheme: 'tableau.ColorBlind10',
              override : false,
              fillAlpha : 0.2
            }
          }
        }
      });

Output

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions