Skip to content

Adding a formatter to options causes the donut chart to not update #684

@tormodAase

Description

@tormodAase

If I have an options object inside a component, with a label formatter, the chart will not update.

In my project this started happening after bumping apexcharts to 4.6.0, but in codepen it seems like it doesn't matter which version of apexcharts you use.

const options = {
    tooltip: {
      enabled: false
    },
    colors: ["red", "grey"],
    plotOptions: {
      pie: {
        donut: {
          size: "46%",
          labels: {
            show: true,
            total: {
              show: true,
              label: "",
              //adding this will enable the bug
              formatter: () => {
                return "Any formatter will enable the bug";
              }
            }
          }
        }
      }
    },
    legend: {
      show: false
    }
  };

apexcharts version: 4.7.0
react-apexcharts version: 1.7.0

https://codepen.io/tormodaase/pen/raaJbYB

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