HighCharts - JQuery -简单的例子不工作
HighCharts - JQuery - Simple example not working
这个来自highcharts网站的简单示例不适合我(http://jsfiddle.net/gh/get/jquery/1.7.2/hililide-software/highcharts.com/tree/master/samples/highcharts/demo/pie-basic/)。
下面是我的代码:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="http://www.highcharts.com/js/highcharts.js"></script>
<script type="text/javascript">
$(function () {
$('#container').highcharts({
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false
},
title: {
text: 'Browser market shares at a specific website, 2010'
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage}%</b>',
percentageDecimals: 1
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
color: '#000000',
connectorColor: '#000000',
formatter: function() {
return '<b>'+ this.point.name +'</b>: '+ this.percentage +' %';
}
}
}
},
series: [{
type: 'pie',
name: 'Browser share',
data: [
['Firefox', 45.0],
['IE', 26.8],
{
name: 'Chrome',
y: 12.8,
sliced: true,
selected: true
},
['Safari', 8.5],
['Opera', 6.2],
['Others', 0.7]
]
}]
});
});
</script>
</head>
<body>
<div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"></div>
</body>
</html>
我刚刚从jsfiddle复制了它,所以不知道为什么它不工作!
谢谢
我无法让HighCharts演示在本地工作,但找到了另一个问题的答案…
问题是。highchart。使用
var chart = new Highcharts.Chart({
chart: {
//alignTicks: false,
type: 'line',
renderTo: 'container'
},
...
}
见此页:JSFiddle API示例被打破
小提琴实际上使用的是http://code.highcharts.com/highcharts.js
的highcharts代码。我测试了这个链接在你的代码,它似乎是工作。我得到一个控制台错误,highcharts method is undefined...
与您显示的链接。
相关文章:
- 不正确的工作jquery插件bxslider与插件elevatezoom
- 更改图像src-dons't工作jquery/js
- event.prventDefault()不工作(jQuery实时)
- delay()不会'第二次工作jquery
- 如何工作 jQuery 就绪
- 几天后,昨天停止工作jQuery
- .click() 不再工作 jquery.
- 如何使工作jquery"“滑动”;在iPad上滚动
- 为什么不是't这个选择器正在工作(Jquery和Asp.net)
- Flexslider无法在html网站中工作(jQuery无法加载?)
- 点击,点击不工作?jquery
- 按钮在“加”和“减”之间切换,需要“点击”;只能在fa +上工作.jQuery
- 突出显示搜索列表不工作(jquery问题)
- 页眉内的Div /靠近页面顶部/在2次点击事件后不显示,而它的's页脚双胞胎工作- jquery
- 为什么css后台jQuery代码不工作jQuery设置多个css值
- .stop()不是't使用我的悬停,使快速移动工作-jQuery
- 自定义验证方法不工作- jQuery验证插件
- 数据表columnDefs不工作:jquery / javascript
- 工作jQuery代码赢得'不要在电话间隙跑步
- 我的Javascript代码不工作- Jquery选择器问题