Menu

setYAxis undefined in 1.5.0

Anonymous
2013-03-29
2014-03-28
  • Anonymous

    Anonymous - 2013-03-29

    Hello!

    I'm attempting to build my first GWT Highchart and am having some difficulty getting the two-axis sample to work. I'm trying to build a two Y-Axis chart and I'm getting the error '
    not read property 'series' of undefined' when I call the .setYAxis( 1 ) function. If I remove that line, the chart displays fine.

    I'm using GWT-Highcharts 1.5.0, Highcharts 2.3.3. I also have included Prototype 1.7.0 and the prototype-adapter, although only because I couldn't get the charts to load otherwise. If that's not required, I'd just as soon remove it.

    Anywhoooooooo, has anyone else had this sort of problem?

    Thanks!

    Evan

     
  • Shawn Quinn

    Shawn Quinn - 2013-04-01

    GWT Highcharts does provide support for multiple axis charts, and you can see a full code example here:

    http://www.moxiegroup.com/moxieapps/gwt-highcharts/showcase/#combination-multiple-axes

    Not sure of how your code is structured, but one thing to check is to make sure you're using the "chart.getYAxis(index)" method to configure the axis first before setting the axis on a series via the "series.setYAxis(index)" method.

    Let us know if that helps, or if you still run into trouble with this.

     
  • Anonymous

    Anonymous - 2013-04-18

    hey guys,

    Sorry I disappeared a bit, but I was pulled in another direction. So I'm still having some major issues getting this going. I know the demo is working, so I took that and created an entry point in my application. When I run the demo, I still get erros on "Cannot read property 'series' of undefined" when running the multiple axis.

    Do I have some sort of version issue or an incompatibility with something else? How could I check?

    Thanks for any help you can provide!

    E

     
  • Shawn Quinn

    Shawn Quinn - 2013-04-19

    Can you post a boiled-down version of some sample code that demonstrates the problem you're seeing? Or are you saying even if you take the code straight from the showcase example that you still get the problem? If the later, I'm suspecting there may be something missing in the way you have the HTML/JS includes setup in the page that's hosting your GWT component...

     
  • Anonymous

    Anonymous - 2013-04-19

    Hey Shawn,

    Taking the code directly from the page and putting it into it's own entry point creates the problem. The only difference I can see from the example and my code is the inclusion of Prototype and the Prototype adapter. I'm also not using the highstock thing.

    I don't use prototype, but it seems I need it to make Highcharts run?

    Thanks,

    E

     
  • Anonymous

    Anonymous - 2013-04-19

    Okay. So I am using Prototype. Everything I've tried seems to work except this multiple axis thing.

    Thanks for helping me with the problem! I appreciate it!

     
  • Anonymous

    Anonymous - 2013-04-23

    Hi guys,

    So I'm still trying to chance down my problem in my implementation here and I'm still not really getting anything figured out. I tried some hail mary type stuff (downgrading the version, add extras, add highstock) and that didn't have any affect.

    So I'm still working with the example copied verbatim from the GWT-Highcharts website. One interesting thing that I have noticed is some odd behavior when just adding the axis. So here's a screen shot of the chart with only a single axis implemented:

    https://s3.amazonaws.com/gte619n/single_axis.png

    Looks great, with the legend on the right, correct title, etc. When I uncomment the lines that set up the other two axis (chart.getYAxis( 1 ), chart.getYAxis( 2 ) ) but leave the addSeries commented out, I get the following:

    https://s3.amazonaws.com/gte619n/all_axis.png

    Notice how the title of the primary axis has been erased and it moved to the left side of the chart? Then, which I go to add the other two series, it completely bombs out and I get the attached error message.

    Does anyone have any suggestions where I could go from here? Has anyone else experienced any issues with the multi-axis display?

    Thanks guys!

    E

     
  • Anonymous

    Anonymous - 2013-04-23

    Hey guys, So I think I've found a bug. Switching from Prototype to JQuery makes the chart display correctly with all axis.

     
  • Shawn Quinn

    Shawn Quinn - 2013-04-23

    Ah, very good to know! That would explain why others haven't been running into this issue, since many folks are using jQuery. This is probably worth a post over to the Highsoft guys then to let them know that there may be an issue with the Prototype adapter:

    http://www.highcharts.com/support

     
  • Anonymous

    Anonymous - 2013-04-23

    Will do, thanks for all the great work on the GWT adapter.

     
  • Anonymous

    Anonymous - 2013-04-24

    So I posted the problem over there and the guys were unable to reproduce. Perhaps it's a bug in the GWT-Highcharts library?

     
  • Shawn Quinn

    Shawn Quinn - 2013-04-24

    Hmm, not sure... Can you post a zip file that contains a boiled down version of just the HTML file, JS includes you're using, and a simple Java file for a GWT EntryPoint containing a sample chart that demonstrates the problem?

     
  • Matz

    Matz - 2014-03-28

    I'm having the same issue as described here. As soon as I add a second Y Axis the labels disappear and I can't add a series to it without it crashing.

    I am using jquery as described in the installation intructions and GWT 2.5.1.

    A snippet of the HTML I'm using:

    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
        <!--                                                               -->
        <!-- Consider inlining CSS to reduce the number of requested files -->
        <!--                                                               -->
        <link type="text/css" rel="stylesheet" href="MetViewer.css">
    
        <!--                                           -->
        <!-- Any title is fine                         -->
        <!--                                           -->
        <title>Environmental Data</title>
    
        <!--                                           -->
        <!-- This script loads your compiled module.   -->
        <!-- If you add any GWT meta tags, they must   -->
        <!-- be added before this line.                -->
        <!--                                           -->
        <script language="javascript" src="drdc.nw.met.webapp.MetViewer/drdc.nw.met.webapp.MetViewer.nocache.js"></script>
        <script type="text/javascript" 
            src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"> 
        </script>
        <script type="text/javascript" src="js/highcharts.js"></script>
        <script type="text/javascript" src="js/themes/gray.js"></script>
    </head>
    

    Any help is appreciated thanks!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.