Skip to content

Bug: updateThemeOptions always reset palette to default #5041

Open
@coder-johnz

Description

@coder-johnz

The bug is described in the issue: apexcharts/Blazor-ApexCharts#605
I suggest to change the updateThemeOptions function to below. Prefer to use the options provided by user.

  updateThemeOptions(options) {
    options.chart = options.chart || {}
    options.tooltip = options.tooltip || {}
    const mode = options.theme.mode
    const palette = options.theme.palette
        ? options.theme.palette
        : mode === 'dark'
        ? 'palette4'
        : 'palette1'
    const foreColor = options.chart.foreColor
        ? options.chart.foreColor
        : mode === 'dark'
        ? '#f6f7f8'
        : '#373d3f'

    options.tooltip.theme = mode || 'light'
    options.chart.foreColor = foreColor
    options.theme.palette = palette

    return options
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions