Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

use highchart and highstock on the same page

I have this page:

<script type="text/javascript" src="jQuery/Highcharts/highstock1.1.6.js"></script>
<script type="text/javascript" src="jQuery/Highcharts/highcharts2.1.4.js"></script>

and in the page I use

$.getJSON(
        "server/indice.server.php?row=" + row +"&item="+ item,
        null,
        function(data)
        {
            chartindice = new Highcharts.Chart(
            {
                chart:
                {
                    renderTo: 'graph',
                    defaultSeriesType: 'line',
                    zoomType: 'x'
                },
                        /////moore setting..
                series:
                [{
                    type: 'area',
                    name: titleindice,
                    data: indice,
                    showInLegend : false //disable the the show/hide icon
                }]


            });
        });

and an highstock graph

window.chart = new Highcharts.StockChart({
    chart: {
        renderTo: 'chartHistory'
    },

    rangeSelector: {
            selected: 2
    },


    series: [{
        data: history,
        type: 'spline',
        tooltip: {
            valueDecimals: 2
        }
    }]
});

and they can't work together, just one or the other.

What can I do?

like image 346
devmonster Avatar asked Jul 04 '12 07:07

devmonster


People also ask

Does Highstock include Highcharts?

js and highstock. js separately - it is enough to load only highstock because highstock includes all highcharts features.

What is the difference between Highcharts and Highstock?

Exactly Highstock is much better for big data sets than Highcharts. It's because it was designed for this purpose. It has built-in data grouping facility, data is blazingly fast grouped into optional groups, which fastens the process a lot. Feel free to ask any further questions!

Can I use Highchart for free?

Highcharts is free to use for personal projects, school websites, and non-profit organizations.

Is Highchart paid?

Highcharts is a software library for charting written in pure JavaScript, first released in 2009. The license is proprietary. It is free for personal/non-commercial uses and paid for commercial applications.


1 Answers

Got same trouble with conflicting Highchart and Highstock. here's the official solution:

Keep in mind that the Highcharts.Chart constructor and all features of Highcharts are included in Highstock, so if you are running Chart and StockChart in combination, you only need to load the highstock.js file.

http://highcharts.com/errors/16

like image 155
lbrutti Avatar answered Oct 20 '22 09:10

lbrutti