highcharts / highcharts-editor

https://www.highcharts.com/products/highcharts-editor
Other
250 stars 96 forks source link

Can not change chart.type when it is set in default Options #141

Closed shelterless closed 6 years ago

shelterless commented 7 years ago

If ] does not set chart type in default options , it's work properly.

but when i set chart type in default options, i can't change it into another chart type.

can you help me ?

cvasseng commented 7 years ago

I'm sorry but I don't quite understand what you mean. Which default options are you talking about?

minervarm commented 6 years ago

Hi @cvasseng I'm facing the same issue when initializing the editor with defaultChartOptions.

Editor version

Highcharts Editor v0.2.1

Current behavior

If I've initialized the editor with a non empty defaultChartOptions I cannot change to a different chart template later in the editor itself.

Expected behavior

I can initialize the editor with custom default options and then change the chart as desired.

Example code

var myOptions = {
    "chart": {
        "type": "pie"
    },
    "title": {
        "text": "My Chart"
    },
    "subtitle": {
        "text": "My Untitled Chart"
    },
    "data": {
        "csv": "\"slice\";\"val\"\n\"Not Pacman\";24\n\"Pacman\";76",
    }
};

var editor = highed.Editor(document.body, {
    defaultChartOptions: myOptions
});

I've detected that when you initialize the editor with defaultChartOptions then go to the tab Advanced > Chart those options are prefilled but they do not update when you change between templates or other settings for example from type = pie to type = column, this also happens if you initialize from a 3D chart and try to change to a 2D, you can see that in the Preview Options tab those properties are not being updated and you have to manually change the properties in the Advanced tab for this to take effect.

You can check that this is also happening in the live demos, for example https://cloud.highcharts.com/create?q=H1K1rtxZQ, trying to change that Basic Column Chart demo to a pie chart.

Steps to reproduce

  1. Go to https://cloud.highcharts.com/create?q=H1K1rtxZQ
  2. Go to Templates tab
  3. Click on Pie
  4. Select any Pie template

As a side note this doesn't happen when the templates are from the same "family", lest say you want to switch from Pie:basic to Pie:donut.

Thanks in advance.

pawelfus commented 6 years ago

Thank you for the details, you are right it's a bug.

minervarm commented 6 years ago

Hello, any updates on this one?

roborto444 commented 6 years ago

Has this been fixed in recent releases?

jigar-sheth commented 6 years ago

Hi, any updates on this?

cvasseng commented 6 years ago

Still no updates unfortunately.

@kai2468 could you take a look at this?

lovelyelfpop commented 5 years ago

Bug still exsits in 0.2.2-rc3