高架图绘制问题
Highchart drawing issue
我在html文件中有以下代码:
<!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>
</head>
<body>
<div id=0 style='width:400px; height:400px'></div>
<script type='text/javascript' src='https://dl.dropboxusercontent.com/u/93241685/jquery.1.9.1.min.js'></script>
<script type='text/javascript' src='https://dl.dropboxusercontent.com/u/93241685/highcharts.js'></script>
<script>
$(function () {
$('#0').highcharts({
chart: {type: 'area',plotBackgroundColor:'white',plotBorderWidth: '',plotShadow: true,zoomType:'undefined'},
title: {text:'TTT'},
xAxis: {title: {text:'trX'}},
yAxis: {title: {text:'Ygrg'}},
tooltip: {pointFormat: '{series.name} {point.x}'},
});});
var chart = $('#0').highcharts();
chart.addSeries({
name: 'S1',
data: [1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6]
}, false);
chart.redraw();
</script>
</body>
</html>
当我运行这个,只有div显示与图表标题在顶部。别的什么也没有。甚至不显示xAxis标题或yAxis标题。现在,有趣的是,当我尝试在JSFiddle上运行它时,它完美地显示了图形。下面还提供了JSFiddle链接。什么可能是在一个html文件中做它的问题,我试着从文件中删除额外的比特,可能是一切,但仍然没有用。请帮助。
http://jsfiddle.net/5fway/尝试将其包含在document.ready()
中,因为在jsfiddle中,您指示运行代码jquery onload(如document.ready()
),如下所示:
$(document).ready(function(){
$('#0').highcharts({
chart: {type: 'area',plotBackgroundColor:'white',plotBorderWidth: '',plotShadow: true,zoomType:'undefined'},
title: {text:'TTT'},
xAxis: {title: {text:'trX'}},
yAxis: {title: {text:'Ygrg'}},
tooltip: {pointFormat: '{series.name} {point.x}'},
});
var chart = $('#0').highcharts();
chart.addSeries({
name: 'S1',
data: [1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6]
}, false);
chart.redraw();
});
相关文章:
- 传单圆圈绘制/编辑问题
- 在three.js中绘制半个球体的问题
- 服务器编码的JSON数据出现问题,无法绘制图表
- 绘制图表.js包含 ajax 数据和响应式.一些问题和疑问
- 谷歌图表进入JQuery Tab绘制问题
- 绘制形状与形状问题
- Highchart:从 java 传递系列映射时绘制日期时间图表问题
- 绘制 C3 图表时的 JSON 到数组问题
- flot 绘制时间戳问题
- D3JS绘制SVG矩形和线条问题
- 使用谷歌方向 API 问题绘制超过 8 个航点的路线图
- Javascript HTML5 Canvas 绘制路径问题
- Canvas drawImage无法在Cordova中绘制,安全问题
- 绘制图像后获取画布数据时出现问题
- 绘制图形时清除画布的问题
- 这个函数有什么问题,我正在重新绘制我的数据表
- 地图的问题:用2个坐标绘制路线
- 关于使用鼠标(移动事件)用quintus引擎绘制线条的几个问题
- Html 5网格绘制问题
- 在Highcharts 3D散点图中重新绘制问题