It is currently Fri Oct 20, 2017 3:16 am Advanced search

Speed up dataLabels?

Technical support, bug reports and more.

Speed up dataLabels?

Postby primerano » Mon Oct 02, 2017 5:49 pm

I'm guessing there isn't much that can be done here but.... On this fiddle I can select any state's county map

http://jsfiddle.net/primerano/xepvj1L0/

for the states that start with 'n' i enabled dataLabels.

Code: Select all
dataLabels: {
          enabled: state[0] == 'n',


These states take much longer to draw. I suspect this is due to the calculations involved in placing the dataLabels on the map.

Is there something I can change on my end to make this faster?

Thanks
Tony
primerano
 
Posts: 38
Joined: Fri Jun 02, 2017 8:03 pm

Re: Speed up dataLabels?

Postby d_paul » Wed Oct 04, 2017 1:07 pm

Hi Tony,

To speed up chart a little, simply place your map_data in separate JSON file and get it using $.get() function. Take a look at the example posted below and compare it with the JSFiddle that you provided.

API Reference:
https://api.jquery.com/jquery.get/

Example:
http://jsfiddle.net/zjk1x96a/

Regards.
Paweł Dalek
Highcharts Developer
d_paul
 
Posts: 1872
Joined: Thu Jun 02, 2016 12:28 pm

Re: Speed up dataLabels?

Postby primerano » Tue Oct 10, 2017 8:46 pm

oops. looks like i changed my fiddle so the slowness did not show. The issue is with the map rendering when data labels is turned on.

To turn it on for states beginning with N use

Code: Select all
  enabled: state[0] == 'n',


States like Nebraska and New York take twice as long to render as the states that do not begin with 'N'
primerano
 
Posts: 38
Joined: Fri Jun 02, 2017 8:03 pm


Return to Highmaps Usage

Who is online

Users browsing this forum: No registered users and 1 guest