GithubHelp home page GithubHelp logo

Comments (12)

TorsteinHonsi avatar TorsteinHonsi commented on May 23, 2024

For adding series, this issue can be worked around by adding the series options to the chart options object in an event handler. See http://jsfiddle.net/qX6Kf/2/

chart: {
    renderTo: 'container',

    // start workaround
    events: {
        addSeries: function(series) {
            this.options.series.push(series.options);
        }
    }
    // end workaround
},

from highcharts.

TorsteinHonsi avatar TorsteinHonsi commented on May 23, 2024

...and with series.remove:

http://jsfiddle.net/qX6Kf/3/

from highcharts.

TorsteinHonsi avatar TorsteinHonsi commented on May 23, 2024

Added feature where exported image reflects updated data in the chart. Closed by 9bd4aad.

from highcharts.

Nickesh avatar Nickesh commented on May 23, 2024

The same problem applies for setCategories() method. New categories don't appear on exported charts.

Reporter at: http://highslide.com/forum/viewtopic.php?f=9&t=7052#p34282

from highcharts.

chubbard avatar chubbard commented on May 23, 2024

Same problem with setTitle(). Click the Set Title link and see the title change on the chart. Then click export button and you see it renders the old title without the new title and subtitle.

http://jsfiddle.net/39C3U/

from highcharts.

jrlampley avatar jrlampley commented on May 23, 2024

I needed the ability to export categories that were added after initial chart creation by setCategories(), so I added the some code into the loop that sets the extremes of the axis to also loop through and set the categories of the axis.

            // reflect axis extremes in the export
            each(['xAxis', 'yAxis'], function (axisType) {
                each(chart[axisType], function (axis, i) {
                    var axisCopy = chartCopy[axisType][i],
                    extremes = axis.getExtremes(),
                    userMin = extremes.userMin,
                    userMax = extremes.userMax;

                    if (userMin !== UNDEFINED || userMax !== UNDEFINED) {
                        axisCopy.setExtremes(userMin, userMax, true, false);
                    }

                    // addition to include categories that were set by setCategories
                    if (axis.categories) {
                        var categories = [];
                        each(axis.categories, function (category, i) {
                            categories.push(category);
                        });
                        axisCopy.setCategories(categories, true);
                    }
                });
            });

from highcharts.

TorsteinHonsi avatar TorsteinHonsi commented on May 23, 2024

Demo for the setCategories case: http://jsfiddle.net/highcharts/WMtv6/

  1. Click the set categories button
  2. Click Export chart button
  3. Observe that the downloaded image doesn't reflect the changes.

from highcharts.

TorsteinHonsi avatar TorsteinHonsi commented on May 23, 2024

Demo after fix: http://jsfiddle.net/highcharts/WMtv6/1/

from highcharts.

Netrumble avatar Netrumble commented on May 23, 2024

Excuse me,
i have Highcharts 2.1.9 version. The problem that have posted "chubbard "

[Same problem with setTitle(). Click the Set Title link and see the title change on the chart. Then click export button and you see it renders the old title without the new title and subtitle.

http://jsfiddle.net/39C3U/]

You have not resolve this problem?

from highcharts.

TorsteinHonsi avatar TorsteinHonsi commented on May 23, 2024

Here's a little workaround that you can use:
http://jsfiddle.net/highcharts/39C3U/22/

from highcharts.

meyerjj avatar meyerjj commented on May 23, 2024

I have found an issue with the workaround. If you click "Set Title" more than once, you lose the formatting on the chart title. I am also seeing this in my application when trying to use the workaround. Does anyone have any thoughts on avoiding this?

from highcharts.

TorsteinHonsi avatar TorsteinHonsi commented on May 23, 2024

I've updated the workaround, and also fixed the issue in the core.

from highcharts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.