Skip to content

Changing tick color via ThemeService affects doughnut charts displaying X and Y axes #2009

@zaniniflz

Description

@zaniniflz

Hello all,

I'm using ThemeService to change the colors of some chart elements when the user switches between light and dark.
When the user selects the dark theme I need to change the font colors to white for all charts, so I'm using ThemeService to apply the colors globally. However, when I change the tick color, the doughnut chart starts displaying the X and Y axes. I haven't found a way to apply this only to some chart types.
What's the best way to get around this?

See below my implementation:

const overrides: ChartOptions = {
      elements: {
        arc: {
          borderWidth: 0
         }
      },
      scales: {
        x: {
          ticks: {
            color: '#fff'
          }
        },
        y: {
          ticks: {
            color: '#fff'
          }
        }
      },
      plugins: {
        legend: {
          labels: {
            color: '#fff'
          }
        }
      }
    }
    this.chartTheme.setColorschemesOptions(overrides)

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions