I suggest you ...

Ability to add yAxis after graph creation

It would be great to have the ability to add / remove yAxis after a chart has been created. For example, a AJAX response sends back information with new series data which require additional yAxis (or need some of the existing ones to be removed)

127 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Helgi Þormar ÞorbjörnssonHelgi Þormar Þorbjörnsson shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    35 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • SenthilSenthil commented  ·   ·  Flag as inappropriate

        Thanks Torstein, I temporarily now fixed it by calling directly scroller.render as for me setExtremes event should not be triggered.

      • SenthilSenthil commented  ·   ·  Flag as inappropriate

        Hi Torstein,
        One small issue as we add y axis the chart's width adapts to have the y axis line but the navigator width is not getting adjusted. Could you please help in this issue. You can find this issue here by adding multiple series
        http://jsfiddle.net/senthil_at/bYPJN/16/

        Thanks,
        Senthil

      • Vegard GillestadVegard Gillestad commented  ·   ·  Flag as inappropriate

        It seems that this plugin requires the chart variable to be defined in the global namespace. If not line 37 fails. Im hoping this is not how it is supposed to be? :-)

        Im using it with stockchart.

      • Torstein HønsiAdminTorstein Hønsi (Admin, Highcharts JS) commented  ·   ·  Flag as inappropriate

        Hi Senthil,

        The problem was that the series was tied to the index of the yAxis, which changed when exporting.

        I have fixed the issue in the original plugin fiddle. Now the series is bound to the axis by the axis.id, which doesn't change. So in addition to upgrading the plugin itself, you also need to give your dynamically added axis an id, and make the series refer to this id.

        In Highcharts 3.0 this is added to the core, so this plugin will be redundant.

      • SenthilSenthil commented  ·   ·  Flag as inappropriate

        Hi Torstein,
        Could you please help in fixing the issue of export in stockchart. Its very critical for me and business needs it.

        Thanks,
        Senthil

      • Radu BusuiocRadu Busuioc commented  ·   ·  Flag as inappropriate

        Hi Torstein,

        I'm using this plugin with StockCharts and it works great but the export is not working.

        I have started from this example, that is working: http://jsfiddle.net/AHJz2/1/
        and changed to StockChart and the export is not working: http://jsfiddle.net/radu_busuioc/tEh6k/1/

        I think that maybe it's the same problem in a previous message, because the error is Uncaught TypeError: Cannot read property 'series' of undefined

        Thank you in advance

      • Torstein HønsiAdminTorstein Hønsi (Admin, Highcharts JS) commented  ·   ·  Flag as inappropriate

        There's a potential caveat when changing the index of the axes, that series connected to this axis (by its index) are orphaned. A better approach for connecting axes and series would be by id, so that the indices didn't matter.

      • Timo KriegerTimo Krieger commented  ·   ·  Flag as inappropriate

        I had problems when often adding and removing several axis. First, the chart.options.yAxis filled up more and more and second, the axis.options.index had wrong numers - resulting in adding series twice to the correct and to a wrong axis (both with the same index).

        Here is my jsfiddle which fixes these problems: http://jsfiddle.net/AHJz2/1/
        I don't know if it's a very clean approach, but it's working for me.

      • SenthilSenthil commented  ·   ·  Flag as inappropriate

        Hi Torstein,
        I was trying to fix in the jsfiddle http://jsfiddle.net/senthil_at/ChNLA/1/. I made some changes and after that I found that after the merge, options.series is null.

        Could you please tell me is this the root cause or else just point me the path or idea i will work on it. Now i am getting this error

        Uncaught TypeError: Cannot call method 'getExtremes' of undefined

      • SenthilSenthil commented  ·   ·  Flag as inappropriate

        Hi Torstein,
        Could please let me know is the issue which i recreated in jsfiddle can be fixed. Sorry as its critical for me i am re-posting.

      • Nitulescu FlorinNitulescu Florin commented  ·   ·  Flag as inappropriate

        I am using this plugin. Very useful, works great except I'm unable to export the chart. It throws an execption (Uncaught TypeError: Cannot read property 'series' of undefined ) and I can't figure out how to handle it. You can see it in the example (http://jsfiddle.net/YDWQC/) if you add the exporting script (<script src="http://code.highcharts.com/modules/exporting.js"></script>). Anyone has any suggestions on how to get over this?

      • SenthilSenthil commented  ·   ·  Flag as inappropriate

        Thanks for your Response. I have reused your plugin jsfiddle to reproduce my issue. Here is the jsfiddle which is modified by me:
        http://jsfiddle.net/senthil_at/hYanM/.
        In this one click on "Add Series" and then click on "Switch theme". The theme will be changing but only the series which is created with the chart will be available, series which is added using addSeries method will not be available

      • SenthilSenthil commented  ·   ·  Flag as inappropriate

        I am using this plugin in my project. i am able to add and remove series along with yaxis issue came is tried to apply them by new Highcharts.StockChart(Highcharts.merge(options, theme)). The theme is getting switch but the Yaxis doesnt show the name and also after this i am not able to add axis and series throwing tooltip point error(TypeError: c[i].tooltipPoints is undefined). Could you please provide me some help on this

      ← Previous 1

      Feedback and Knowledge Base