在同一页面上使用highchart和highstock [英] use highchart and highstock on the same page

查看:139
本文介绍了在同一页面上使用highchart和highstock的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个页面:

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

在我使用的页面中

$.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
                }]


            });
        });

和高价图

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.

我该怎么办?

推荐答案

遇到相同的冲突问题Highchart和Highstock。这是官方解决方案:

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


请记住Highcharts.Chart构造函数和
Highcharts的所有功能都包含在Highstock中,因此,如果您正在组合运行Chart和
StockChart,则只需加载highstock.js
文件。

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

这篇关于在同一页面上使用highchart和highstock的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆