echarts做出来以后,整个图都变杂乱了是什么原因? echarts 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <!DOCTYPE html><html lang="en"><head> <meta charset="utf-8"> <title>ECharts</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head><body> <div id="main" style="height:500px;border:1px solid #ccc;padding:10px;"></div> </body> <script src="../../resources/njs/echarts-plain.js"></script><script type="text/javascript"> var myChart = echarts.init(document.getElementById('main')); myChart.setOption({ tooltip : { trigger: 'axis' }, toolbox: { show : true, feature : { : {show: true}, dataZoom : {show: true}, dataView : {show: true}, magicType : {show: true, type: ['line', 'bar']}, restore : {show: true}, saveAsImage : {show: true} } }, calculable : true, dataZoom : { show : true, realtime : true, //orient: 'vertical', // 'horizontal' //x: 0, y: 36, //width: 400, height: 20, backgroundColor: 'rgba(221,160,221,0.5)', dataBackgroundColor: 'rgba(138,43,226,0.5)', fillerColor: 'rgba(38,143,26,0.6)', handleColor: 'rgba(128,43,16,0.8)', //xAxisIndex:[], //yAxisIndex:[], start : 40, end : 60 }, xAxis : [ { type : 'category', boundaryGap : false, data : function(){ var datelist = []; var val1="2014-1-3"; var val2="2014-3-13"; var getdate = function (str) { var tempdate = new Date(); var list = str.split("-"); tempdate.setFullYear(list[0]); tempdate.setMonth(list[1] - 1); tempdate.setDate(list[2]); return tempdate; } var date1 = getdate(val1); var date2 = getdate(val2); if(date1>date2){ var temp = date1; date1 = date2; date2 = temp; } date1.setDate(date1.getDate() + 1); while(!(date1.getFullYear()==date2.getFullYear()&&date1.getMonth()==date2.getMonth()&&date1.getDate()==date2.getDate())){ var sdate = date1.toLocaleDateString(); date1.setDate(date1.getDate() + 1); datelist.push(sdate); } return datelist; }() } ], yAxis : [ { type : 'value', splitArea : {show : true} } ], series : [ { name:'dz', type:'line', data:function(){ var list = []; for (var i = 1; i <= 150; i++) { list.push(Math.round(Math.random()* 30)); } return list; }() } ], calculable:false }); </script></html> var fileLocation ='../../js/echars/js/echarts';require.config({ paths:{ echarts: fileLocation, 'echarts/chart/line': fileLocation, 'echarts/chart/bar': fileLocation, 'echarts/chart/pie': fileLocation }});// 作为入口require( [ 'echarts', 'echarts/chart/line', 'echarts/chart/bar' ], displayChart); <script type="text/javascript" src="../../js/echars/js/esl.js"></script> echart 1.4.1chrome 35.0.1916.153firefox 30.0运行正常 iterator中getElementById?求大侠指导 关于区域滚动与元素定位问题 正则如何截取这样的字符 如何获取<select><option...改变之前的value和index?谢谢! javascript高手请进来?'null'为空或不是对象,请问出错在哪里 easyui tabs 加载时如何自动隐藏 a(0)="2335345345"替换为a(0)="kkl",代码就不能执行??? 请教如何在父窗口操作IFRAME的图片。 eclipse检出maven工程错误 大神求助,这段代码IE11正常,360兼容模式不运行,求解。 关于图片渐变轮播 文本区域禁止复制代码怎么实现
<html lang="en">
<head>
<meta charset="utf-8">
<title>ECharts</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div id="main" style="height:500px;border:1px solid #ccc;padding:10px;"></div>
</body>
<script src="../../resources/njs/echarts-plain.js"></script>
<script type="text/javascript">
var myChart = echarts.init(document.getElementById('main'));
myChart.setOption({
tooltip : {
trigger: 'axis'
},
toolbox: {
show : true,
feature : {
: {show: true},
dataZoom : {show: true},
dataView : {show: true},
magicType : {show: true, type: ['line', 'bar']},
restore : {show: true},
saveAsImage : {show: true}
}
},
calculable : true,
dataZoom : {
show : true,
realtime : true,
//orient: 'vertical', // 'horizontal'
//x: 0,
y: 36,
//width: 400,
height: 20,
backgroundColor: 'rgba(221,160,221,0.5)',
dataBackgroundColor: 'rgba(138,43,226,0.5)',
fillerColor: 'rgba(38,143,26,0.6)',
handleColor: 'rgba(128,43,16,0.8)',
//xAxisIndex:[],
//yAxisIndex:[],
start : 40,
end : 60
},
xAxis : [
{
type : 'category',
boundaryGap : false,
data : function(){
var datelist = [];
var val1="2014-1-3";
var val2="2014-3-13";
var getdate = function (str) {
var tempdate = new Date();
var list = str.split("-");
tempdate.setFullYear(list[0]);
tempdate.setMonth(list[1] - 1);
tempdate.setDate(list[2]);
return tempdate; }
var date1 = getdate(val1);
var date2 = getdate(val2);
if(date1>date2){
var temp = date1;
date1 = date2;
date2 = temp;
}
date1.setDate(date1.getDate() + 1);
while(!(date1.getFullYear()==date2.getFullYear()&&date1.getMonth()==date2.getMonth()&&date1.getDate()==date2.getDate())){
var sdate = date1.toLocaleDateString();
date1.setDate(date1.getDate() + 1);
datelist.push(sdate);
}
return datelist;
}()
}
],
yAxis : [
{
type : 'value',
splitArea : {show : true}
}
],
series : [
{
name:'dz',
type:'line',
data:function(){
var list = [];
for (var i = 1; i <= 150; i++) {
list.push(Math.round(Math.random()* 30));
}
return list;
}()
}
],
calculable:false
}); </script>
</html>
require.config({
paths:{
echarts: fileLocation,
'echarts/chart/line': fileLocation,
'echarts/chart/bar': fileLocation,
'echarts/chart/pie': fileLocation
}
});
// 作为入口
require(
[
'echarts',
'echarts/chart/line',
'echarts/chart/bar'
],
displayChart
);
chrome 35.0.1916.153
firefox 30.0
运行正常