Skip to content

Chart Type Update not working #8416

@cristiansimion

Description

@cristiansimion

Expected Behavior

I'm trying to make a chart that can switch between multiple views. In this situation, it's changing the type of chart from 'line' to 'horizontalBar' or 'radar'. I've created a simple pen script that would showcase the issue I'm currently having.

I expected after updating the config variable ( that contains all the labels, data and options ) to help render a new Chart with the different type.

Current Behavior

What i've noticed is that I can set a variable

let var = { type: "horizontalBar", data: [ data goes here ] };

and I could use that to generate a new functional Chart. The problem is, the title, positioning of the legend and everything else gets reset to defaults and the title is missing. I'd like to keep all of those settings intact, but if I'd use a similar object as initially, the chart no longer displays any values.

Possible Solution

Steps to Reproduce

On https://codepen.io/derains/pen/jOVywBv I've created a sample of the code that would showcase the problem.

  • If you click the "Horizontal Update" - this is the one that is expected to work as intended but it renders an empty Chart.
  • If you click on "Radar Update" - this will work but the INITIAL display of the chart title and legend gets messed up.

Context

Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions