highcharts result is not stable

Technical support, bug reports and more.

highcharts result is not stable

Postby zhang on Thu Jul 22, 2010 8:16 am

Hi, i found one small bug. when i refresh the chart page with firefox or chrome. the chart results are not same. For example. if i have 3 series, when i refresh it, sometime there is only 2 serises, sometime there are 3 series. BTW, i am using the Version 2.0.0 (2010-07-13) of highchart. There is no problem when i use the older one.
zhang
 
Posts: 74
Joined: Wed Mar 03, 2010 1:26 pm

Re: highcharts result is not stable

Postby admin on Fri Jul 23, 2010 9:34 am

Demo?
Torstein Hønsi
Developer,
Highslide Software
User avatar
admin
Site Admin
 
Posts: 7858
Joined: Thu Nov 09, 2006 1:22 pm
Location: Vik i Sogn, Norway

Re: highcharts result is not stable

Postby zhang on Fri Jul 30, 2010 11:09 am

http://users.metropolia.fi/~yongzhez/debug/test/building_monthly_heat_consumption.php
You can refresh it with chrome about 3 or 4 time. with firefox, it needs more time refresh to see the result
zhang
 
Posts: 74
Joined: Wed Mar 03, 2010 1:26 pm

Re: highcharts result is not stable

Postby not on Fri Jul 30, 2010 12:30 pm

@zhang, you have 3 asynchronous AJAX requests there. The last one calls chart initialization. But it doesn't mean that the last requests returns last, too. The problem is that sometimes third request returns from server before the others and immediately calls Highchart.Chart() with options that don't contain all other series yet.
The solution is simple. Initialize chart first, and then call JSON requests who will add series to exiting chart:

Code: Select all
...
chart = new Highcharts.Chart(options);
   
jQuery.getJSON('test1.json', null, function(data) {
  chart.addSeries({
    name:'2010',
    data: data
  });
});
     
jQuery.getJSON('test2.json', null, function(data) {
  chart.addSeries({
    name: '2009',
    data: data
  });
});
 
jQuery.getJSON('test3.json', null, function(data) {
  chart.addSeries({
    name: '2008',
    data: data
  });
});

/* new Highcharts.Chart(options); */
Maciej Piecha,
Highcharts Support Team
User avatar
not
 
Posts: 329
Joined: Mon Jun 07, 2010 4:01 pm

Re: highcharts result is not stable

Postby zhang on Wed Aug 04, 2010 10:01 am

Well, you method indeed solved the problem. but there is another problem if we do like that.: the download function does not work. you can check it from http://users.metropolia.fi/~yongzhez/debug/test/building_monthly_heat_consumption.php the pdf or jpg.. which we downloaded is empty.
zhang
 
Posts: 74
Joined: Wed Mar 03, 2010 1:26 pm

Re: highcharts result is not stable

Postby admin on Wed Aug 04, 2010 3:02 pm

The export utility doesn't include series added with addSeries, only those added in the initial config object. See http://github.com/highslide-software/hi ... s/issue/48.
Torstein Hønsi
Developer,
Highslide Software
User avatar
admin
Site Admin
 
Posts: 7858
Joined: Thu Nov 09, 2006 1:22 pm
Location: Vik i Sogn, Norway

Re: highcharts result is not stable

Postby zhang on Fri Aug 06, 2010 9:05 am

Any other way to solve the first problem? It happens very often when we change the language. For example one chart can be displayed in two languages, when we press the language button, it will happen.
zhang
 
Posts: 74
Joined: Wed Mar 03, 2010 1:26 pm

Re: highcharts result is not stable

Postby zhang on Fri Aug 06, 2010 11:42 am

I have solved this problem :lol:
zhang
 
Posts: 74
Joined: Wed Mar 03, 2010 1:26 pm


Return to Highcharts Usage

Who is online

Users browsing this forum: Progeny and 3 guests