Highcharts滚动条不显示 [英] Highcharts scrollbar not appearing

查看:141
本文介绍了Highcharts滚动条不显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出于某种原因,Highcharts的滚动条选项不适用于我的Rails 3.2.1应用程序。奇怪的是,一切看起来都是这样的: http://jsfiddle.net/highcharts/fj6d2/



...除了滚动条丢失外。我有与上面的jsfiddle中显示的完全相同的代码,图形出现在我的本地应用程序中,但滚动条丢失。



这是我本地的代码app,与jsfiddle相同:

  var chart = new Highcharts.Chart({

图:{
renderTo:'container'
},

xAxis:{
categories:['Jan','Feb','Mar','Apr ','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
分钟:6
},

legend:{
verticalAlign:'top',
y:100,
align:'right'
},

滚动条:{
启用:真
},

系列:[{
数据:[29.9,71.5,106.4,129.2,144.0,176.0,135.6,148.5, 216.4,194.1,95.6,54.4]
}]
});

同样,图表显示,但只有滚动条不显示。为什么滚动条不显示?有人在他们的高图中使用滚动条成功了吗?我很想为此得到一个解决方案,我真的很难为什么它不能正常工作。

解决方案

我找到了什么错了。在我的本地应用程序中,我加载了highcharts.js文件,而在jsfiddle中加载了highstock.js。添加此项:

 < script type =text / javascriptsrc =http://www.highcharts.com/ JS / highstock.js>< /脚本> 

解决了这个问题。

For some reason, the scrollbar option for Highcharts is not working on my Rails 3.2.1 application. What is odd is that everything looks exactly the same as this: http://jsfiddle.net/highcharts/fj6d2/

... except that the scrollbar is missing. I have the exact same code as that shown in the jsfiddle above, the graph appears on my local application, but the scrollbar is missing.

This is the code in my local app, the same as in the jsfiddle:

var chart = new Highcharts.Chart({

chart: {
    renderTo: 'container'
},

xAxis: {
    categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
    min: 6
},

legend: {
    verticalAlign: 'top',
    y: 100,
    align: 'right'
},

scrollbar: {
    enabled: true
},

series: [{
    data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}]
});

Again, the graph shows, but only the scrollbar doesn't. Why isn't the scrollbar showing? Has anybody had success using a scrollbar in their highcharts graphs? I would love to get a fix for this, I really am stumped as to why its not working.

解决方案

I figured out what was wrong. In my local app, I was loading the highcharts.js file, whereas in the jsfiddle it was loading highstock.js. Adding this:

<script type="text/javascript" src="http://www.highcharts.com/js/highstock.js"></script>

fixed the problem.

这篇关于Highcharts滚动条不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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