It is currently Sat Oct 20, 2018 8:16 pm Advanced search

Exporting complex maps with export server

Technical support, bug reports and more.

Exporting complex maps with export server

Postby ma4tek » Fri Aug 10, 2018 11:45 am

Hello,

I am trying to export fairly complex maps with charts on top of them thought the export module, problem is that I can't find a way to do it properly. The Map/Chart need to be redrawn an one point, but I can't find a way to access the charts/map object.
I placed the code in the customCode field, but it only produces errors, also I saw that the customCode is executed before the creation of the map.

So 2 questions:
- is this even possible with the export module?
- should I better ask the question in the github repo of the export server?

Regards!
ma4tek
 
Posts: 3
Joined: Fri Aug 10, 2018 11:38 am

Re: Exporting complex maps with export server

Postby wojtek » Mon Aug 13, 2018 2:20 pm

Hi ma4tek,

This place is better to ask questions then github repo.

To access the chart object you can use callback function or events for e.g chart load event see https://api.highcharts.com/highcharts/chart.events.load, demo: http://jsfiddle.net/wchmiel/j184rnoq/.

If you have more questions please try to explain them more precisely or send us online demo of your problem (jsfiddle for e.g).

Best regards.
Wojciech Chmiel
Highcharts Developer
wojtek
 
Posts: 398
Joined: Tue Jul 03, 2018 2:32 pm

Re: Exporting complex maps with export server

Postby ma4tek » Wed Aug 29, 2018 3:05 pm

Thank you for your answer, in the meantime I solved it through rendering the map on a puppeteer instance and exporting it.
But does the "load" event fire, when I use the export module?
I tried to use the customCode field, but this only gives me access to the options object. What I am trying to do is similar to this: https://www.highcharts.com/maps/demo/map-pies only with columns. And I am scratching my head on how to do the additional stuff properly with the exporting module.
ma4tek
 
Posts: 3
Joined: Fri Aug 10, 2018 11:38 am

Re: Exporting complex maps with export server

Postby wojtek » Thu Aug 30, 2018 8:42 am

ma4tek,

You can use chart.exportChart method to use load even. There you have access to the chart object and can use for example update method to pass new data or add a point to the exported chart:

Code: Select all
  chart.exportChart(null, {
    chart: {
      events: {
        load: function() {
          var chart = this;
          chart.series[0].update({
            borderColor: 'blue'
          });
        }
      }
    },

    title: {
      text: 'Chart exported with new options using update'
    }
  });


Api reference: https://api.highcharts.com/class-reference/Highcharts.Chart#exportChart
Demo: https://jsfiddle.net/yp1ujxad/

Kind regards.
Wojciech Chmiel
Highcharts Developer
wojtek
 
Posts: 398
Joined: Tue Jul 03, 2018 2:32 pm

Re: Exporting complex maps with export server

Postby ma4tek » Thu Aug 30, 2018 9:41 am

Thanks for your help, I will try this.
ma4tek
 
Posts: 3
Joined: Fri Aug 10, 2018 11:38 am

Re: Exporting complex maps with export server

Postby wojtek » Thu Aug 30, 2018 9:57 am

You're welcome :wink:
Wojciech Chmiel
Highcharts Developer
wojtek
 
Posts: 398
Joined: Tue Jul 03, 2018 2:32 pm


Return to Highmaps Usage

Who is online

Users browsing this forum: No registered users and 1 guest