Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highcharts warning #15 for Bar Chart on update #16104

Closed
anikolaev opened this issue Jul 26, 2021 · 1 comment · Fixed by #16109
Closed

Highcharts warning #15 for Bar Chart on update #16104

anikolaev opened this issue Jul 26, 2021 · 1 comment · Fixed by #16109
Assignees

Comments

@anikolaev
Copy link

Expected behaviour

There is a simple Bar chart. After update of category name (and values) it is expect that chart is updated and that order of values is not important.

Actual behaviour

Highcharts warning #15 (Highcharts expects data to be sorted) shows up in console. 9.1.0 had bug that showed error "Highchart is not defined" but it was fixed in 9.1.1 or 9.1.2. But this warning is also unexpected. It seems everything is correct in the config:

var data1 = [
  {name: 'a', y: 1},
  {name: 'b', y: 2},
  {name: 'c', y: 3},
];

var data2 = [
  {name: 'a', y: 1},
  {name: 'b2', y: 2},
  {name: 'c', y: 3},
];


let chart = Highcharts.chart('container', {
  chart: {
    type: 'bar'
  },
  xAxis: {
    type: 'category',
  },

  series: [{
    data: data1
  }],
});

document.getElementById('update').addEventListener('click', () => {
  chart.update({
    series: [{
      data: data2
    }],
  });
});

Live demo with steps to reproduce

https://jsfiddle.net/aumo7y50/

Product version

Latest (9.1.2)

Affected browser(s)

Chrome and probably others.

@highsoft-bot highsoft-bot added this to To do in Development-Flow Jul 26, 2021
@KacperMadej
Copy link

Hi @anikolaev

Thank you for reporting the problem.

Internal note:
It looks like the error fired when the new data is not matching the old categories, but later the categories are based on the new data and everything works correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

4 participants