Menu

Remote connection lost error

tvhnet
2012-03-15
2012-07-13
  • Shawn Quinn

    Shawn Quinn - 2012-03-16

    Highcharts/GWT Highcharts can definitely handle charting data sets of that size, although you may want to give the following thread a look to see if any of the points discussed there are relevant to your case.

    A few other related thoughts:

    1. From the exception you noted above it looks like you're trying this test in GWT dev/hosted mode. GWT is notoriously slow in that mode (since every piece of logic needs to essentially translate a call from the browser back to the GWT hosted server logic.) And, ironically, Chrome is particularly slow when running GWT application in dev/hosted mode, as compared to FF or IE. So, you'll certainly want to try your test in a fully GWT compiled/script mode to better gauge how things perform.

    2. Highcharts is most well optimized if you add the series/points to the chart before it is rendered, as opposed to rendering the chart and then adding new series/points to it dynamically after rendering. Either will work, but you will likely find the following approach is more efficient for large data sets:

        public void onModuleLoad() {
            RootPanel.get("container").add(dataSetTest());
        }
    
        private Chart dataSetTest() {
            Chart chart = new Chart();
            chart.getXAxis()
                .setType(Axis.Type.DATE_TIME);
    
            long t = new Date().getTime();
            for (int j = 0; j < 5; j++) {
                Series series = chart.createSeries();
                for (int i = 0; i < 1000; i++) {
                    series.addPoint(new Point(t + i * 1000, Random.nextDouble()));
                }
                chart.addSeries(series);
            }
    
            return chart;
        }
    
    1. In my experience, Highstock appears to be better suited for rendering large data sets than Highcharts. So, (assuming you have the highstock.js file in included in your page), the following will likely behave even more efficiently:
        public void onModuleLoad() {
            RootPanel.get("container").add(dataSetTest());
        }
    
        private StockChart dataSetTest() {
            StockChart chart = new StockChart();
            chart.getXAxis()
                .setType(Axis.Type.DATE_TIME);
    
            long t = new Date().getTime();
            for (int j = 0; j < 5; j++) {
                Series series = chart.createSeries();
                for (int i = 0; i < 1000; i++) {
                    series.addPoint(new Point(t + i * 1000, Random.nextDouble()));
                }
                chart.addSeries(series);
            }
    
            return chart;
        }
    

    I hope that helps, but if you could update this post with any of your additional findings in order to benefit others - that'd be great!

      -Shawn
    
     

    Last edit: Shawn Quinn 2012-03-16

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.