forked from pumpinger/schartjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
573 lines (497 loc) · 15.3 KB
/
index.html
File metadata and controls
573 lines (497 loc) · 15.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta content="telephone=no,email=no" name="format-detection" />
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<script type="text/javascript" src="./js/require.js"></script>
<!--<script type="text/javascript" src="./js/jquery.min.js"></script>-->
<!--<script type="text/javascript" src="./js/snap.svg.js"></script>-->
<!--<script type="text/javascript" src="./js/schart.js"></script>-->
<script>
require.config({
baseUrl: "js",
paths: {
"jquery": "jquery.min",
"snap": "snap.svg",
"schart": "schart"
}
// shim: {
// 'schart': {
// deps: ['snap', 'jquery'],
// exports: 's'
// }
// }
});
</script>
<title>mycharts</title>
<style>
body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,button,input,textarea,th,td,p,span,font,div{padding:0;margin:0;word-wrap:break-word;-webkit-tap-highlight-color: rgba(0,0,0,0);-webkit-tap-highlight-color: transparent;}
a{text-decoration:none;color: inherit;}
img{border: 0;vertical-align: middle;color: #bada55}
html{font-size: 10px;}
body {font-family: "Microsoft YaHei",Arial,Helvetica,sans-serif;-webkit-text-size-adjust:none;color: #1b1b1b;-webkit-user-select:none;}
text {
/*text-anchor: middle;*/
/*pointer-events: auto; */
}
</style>
</head>
<body>
<?php echo 111;?>
<!--<div style="font-size: 24px;position: absolute;text-align: center;width: 100%;" id="abtext">这里是筛选</div>-->
<!--<svg id="svg1" viewBox="0 0 0 240">-->
<!--<svg id="svg1" height="250px" width="100%" style="background-color: #2e83d6">-->
<!--<svg id="svg1" height="400px" width="100%" viewBox="0 0 850 200" preserveAspectRatio="xMidYMid none">-->
<svg id="svg1" height="300px" width="100%" >
</svg>
<svg id="svg3" height="300px" width="100%" >
</svg>
<svg id="svg4" height="300px" width="100%" >
</svg>
<svg id="svg5" height="300px" width="100%" >
</svg>
<svg id="svg6" height="300px" width="100%" >
</svg>
1<br>1<br>1<br>1<br>1<br>1<br>1<br>1<br>1<br>1<br>1<br>1<br>1<br>1<br>1<br>
<div id='ccc' style="margin: 20px 0 0 0;position: static;">
<svg id="svg2" height="300px" width="100%" >
</svg>
</div>
<div class="glob" style="text-align: center;" id="2">
<button ontouchstart="fullScreen()">全屏</button>
</div>
</body>
<script type="text/javascript">
var svgnodataurl='./js/stats_tips_nodate.png';
function chartSuccess(){
}
// require(['jquery'], function ($){
// $(function (){
// alert(1);
// });
// });
require(['schart'], function (s){
// console.time('ss');
// s.drawMixAvgNoTip("#svg1",data10,title10,function(data){});
s.drawMixAvg("#svg6",data10,title10,function(data){});
s.drawColumn("#svg5",data5,title5,function(data){ if(data){ $('#abtext').hide(); }else{ $('#abtext').show(); } });
// s.drawMixAvg("#svg1",data11,title11,function(data){ if(data){ $('#abtext').hide(); }else{ $('#abtext').show(); } });
s.drawLine("#svg3",data1,title1,function(data){ if(data){ $('#abtext').hide(); }else{ $('#abtext').show(); } });
// s.drawPie("#svg1",data0,title0,function(data){ if(data){ $('#abtext').hide(); }else{ $('#abtext').show(); } });
// s.drawLoop("#svg5",data9);
s.drawBar("#svg4",data4,title4,function(data){ if(data){ $('#abtext').hide(); }else{ $('#abtext').show(); } });
// s.drawProgress("#svg1",data6,title6,function(data){ if(data){ $('#abtext').hide(); }else{ $('#abtext').show(); } });
s.drawProgress3("#svg1",data66,title66,function(data){
if(data){
console.log("if");
console.log(data);
}else{
console.log("else");
console.log(data);
}
},true);
// s.drawProgress3("#svg3",data66,title66,function(data){if(data){console.log("if");console.log(data);}else{console.log("else");console.log(data);}},true);
//
// s.draw("#svg1",{
// type:'column',
// is_full:false,
// tip:false,
// tipMsg:this.num+'Km',
// marker:false,
// markerMsg:this.num+'Km',
// avg:15.5,
// avgMsg:this.avg+'Km',
// data:[
// [
// {
// name:'北京',
// num:33
// }
// ],
// [
// {
// name:'北京',
// num:33
// }
// ]
// ],
// nodata_msg:'呵呵'
// });
var extra;
var data={
type:'column',
is_full:false,
tip:false,
tipMsg:this.num+'Km',
marker:false,
markerMsg:this.num+'Km',
avg:false,
avgMsg:this.avg+'Km',
data:[
{
name:'北京',
items:[
{
name:"朝阳",
items:[
{
num:33,
extra:'extra'
},
{
num:33
}
]
},
{
name:"朝阳2",
items:[
{
num:33
},
{
num:33
}
]
}
]
},
{
name:'北京',
items:[
{
name:"朝阳",
num:33
},
{
name:"朝阳2",
num:33
}
]
},
{
name:'北京',
items:[
{
num:33
},
{
num:33
}
]
},
{
name:'北京',
num:12
}
],
nodata_msg:'呵呵'
};
// console.timeEnd('ss');
});
function fullScreen(){
s.drawLine("#svg1",data1,title1,function(data){
if(data){
$('#abtext').hide();
}else{
$('#abtext').show();
}
});
}
var data9=['1','0'];
//条
//平均值
var title10=['今日'];
var data10={
avg:"10",
item:[
{name:"四川",num:"30"},
{name:"广东省",num:"2"},
{name:"云南省",num:"1"},
{name:"辽宁省省",num:"2"},
{name:"黑龙江省",num:"5"},
{name:"湖南省省",num:"10"},
{name:"江西省省",num:"11"},
{name:"上海",num:"30"}
]
};
var title11=['今日'];
var data11=[
{name:"上海",num:" 9",avg:"2"},
{name:"上海",num:" 9",avg:"2"},
{name:"四川",num:"3",avg:"2"},
{name:"广东省",num:"2",avg:"1"},
{name:"云南省",num:"1",avg:"1"},
{name:"辽宁省省",num:"2",avg:"2"},
{name:"黑龙江省",num:"5",avg:"4"},
{name:"湖南省省",num:"10",avg:"9"},
{name:"江西省省",num:"11",avg:"10"},
{name:"上海",num:"3",avg:"2"}
];
//有对比 无层级
var title6=['本月','上月'];
var data6=[
{
name:"天津",
k1:{num:"2",price:"2351"},
k2:{num:"9",price:"1234.3"}
},{
name:"北 京",
k1:{num:"8",price:"60"},
k2:{num:"12",price:"133"}
},{
name:"名字特别名字特别特别",
k1:{num:"0",price:"34"},
k2:{num:"2",price:"1234"}
},{
name:"名字特别",
k1:{num:"8",price:"123"},
k2:{num:"24",price:"4354.3"}
},{
name:"北京",
k1:{num:"5",price:"3"},
k2:{num:"5",price:"123"}
}
];
//有对比 无层级 三条
var title66=['本月','上月'];
var data66=[
{
name:"天津",
k1:{num:"2",price:"2351"},
k2:{num:"10",price:"1234.3"},
k3:{num:"1",price:"6234.3"}
},{
name:"北 京",
k1:{num:"3",price:"60"},
k2:{num:"11",price:"133"},
k3:{num:"2",price:"633"}
},{
name:"名字特别名字特别特别",
k1:{num:"4",price:"34"},
k2:{num:"12",price:"1234"},
k3:{num:"3",price:"6234"}
},{
name:"名字特别",
k1:{num:"5",price:"123"},
k2:{num:"13",price:"4354.3"},
k3:{num:"2",price:"6354.3"}
},{
name:"北京",
k1:{num:"6",price:"3"},
k2:{num:"14",price:"123"},
k3:{num:"1",price:"623"}
},{
name:"成都",
k1:{num:"0",price:"3"},
k2:{num:"6",price:"123"},
k3:{num:"1",price:"623"}
},{
name:"成都2",
k1:{num:"2",price:"3"},
k2:{num:"0",price:"123"},
k3:{num:"2",price:"623"}
},{
name:"成都3",
k1:{num:"0",price:"3"},
k2:{num:"0",price:"123"},
k3:{num:"3",price:"623"}
},{
name:"成都4",
k1:{num:"0",price:"3"},
k2:{num:"0",price:"123"},
k3:{num:"4",price:"623"}
},{
name:"成都5",
k1:{num:"0",price:"3"},
k2:{num:"0",price:"123"},
k3:{num:"5",price:"623"}
},{
name:"成都6",
k1:{num:"0",price:"3"},
k2:{num:"0",price:"123"},
k3:{num:"6",price:"623"}
},{
name:"成都7",
k1:{num:"0",price:"3"},
k2:{num:"0",price:"123"},
k3:{num:"7",price:"623"}
},{
name:"成都8",
k1:{num:"0",price:"3"},
k2:{num:"0",price:"123"},
k3:{num:"8",price:"623"}
},{
name:"成都9",
k1:{num:"0",price:"3"},
k2:{num:"0",price:"123"},
k3:{num:"9",price:"623"}
}
];
//无对比 无层级
var title4=['今年'];
var data4=[
// {name:"四川",num:"3",price:"2223"},
// {name:"广东省",num:"2",price:"700.2"},
// {name:"云南省",num:"1",price:"0"},
// {name:"辽宁省省",num:"2",price:"1863"},
// {name:"黑龙江省",num:"5",price:"2344.3"},
// {name:"湖南省省",num:"10",price:"1000"},
// {name:"江西省省",num:"11",price:"858"},
// {name:"上海",num:"3",price:"450.6"}
{name:"四川",num:"3"},
{name:"广东省",num:"2"},
{name:"云南省",num:"1"},
{name:"辽宁省省",num:"2"},
{name:"黑龙江省",num:"5"},
{name:"湖南省省",num:"10"},
{name:"江西省省",num:"11"},
{name:"上海",num:"3"}
];
//无对比 有层级
var title5=['今年'];
var data5=[
{
name:"四川",
item:[
{name:"成都成都",num:"3",price:"3211"},
{name:"绵延绵绵延",num:"3",price:"12"},
{name:"名字",num:"3",price:"2222"}
]
},{
name:"顿飞",
item:[
{name:"城市说",num:"3",price:"3211"},
{name:"城市是",num:"3",price:"2222"}
]
},{
name:"武汉",
item:[
{name:"城市a",num:"3",price:"3211"},
{name:"城市b",num:"23",price:"12"},
{name:"城市c",num:"3",price:"2222"},
{name:"城市d",num:"13",price:"226"},
{name:"城市e",num:"3",price:"2222"}
]
}
];
//有对比 有层级
var title7=['本月','上月'];
var data7=[
{
name:"四川",
item:[
{
name:"阿什",
k1:{num:"9",price:"1244"},
k2:{num:"8",price:"133"}
},{
name:"阿什阿阿什阿阿什阿",
k1:{num:"9",price:"323"},
k2:{num:"8",price:"222"}
},{
name:"阿什阿阿什阿阿什阿",
k1:{num:"9",price:"11"},
k2:{num:"8",price:"123"}
}
]
},{
name:"重庆",
item:[
{
name:"什阿什",
k1:{num:"1",price:"2222"},
k2:{num:"8",price:"1234.5"}
}
]
},{
name:"名字特别阿斯顿",
item:[
{
name:"sdf",
k1:{num:"9",price:"244"},
k2:{num:"8",price:"133"}
},{
name:"的",
k1:{num:"9",price:"1323"},
k2:{num:"8",price:"222"}
}
]
}
];
//饼 不对比无层级
var title0=['本月'];
var data0=[
// {name:"天津",num:"8",price:"312"},
// {name:"北京",num:"8",price:"123"},
// {name:"重庆",num:"8.9515",price:"123"},
// {name:"乌鲁木齐",num:"8",price:50},
// {name:"西安",num:"8",price:160},
// {name:"重庆",num:"8",price:60},
// {name:"成都",num:"8",price:200},
// {name:"上海",num:"8",price:100},
// {name:"重庆",num:"8",price:160},
// {name:"重庆",num:"8",price:60}
{name:"天津",num:"8",time:"312"},
{name:"北京",num:"8",time:"123"},
{name:"重庆",num:"8.9515",time:"123"},
{name:"乌鲁木齐",num:"8",time:50},
{name:"西安",num:"8",time:160},
{name:"重庆",num:"8",time:60},
{name:"成都",num:"8",time:200},
{name:"上海",num:"8",time:100},
{name:"重庆",num:"8",time:160},
{name:"重庆",num:"8",time:60}
];
//折线 不对比无层级
var title1=['今年'];
var data1=[
{name:"2014-03",num:"3",price:2223},
{name:"2014-04",num:"2",price:700.2},
{name:"2014-05",num:"1",price:300.5},
{name:"2014-06",num:"8",price:3323.5},
{name:"2014-07",num:"0",price:1000},
{name:"2014-08",num:"2",price:1863},
{name:"2014-09",num:"4",price:2041.8},
{name:"2014-10",num:"5",price:2344.3},
{name:"2014-11",num:"10",price:5242},
{name:"2014-12",num:"11",price:858},
{name:"2015-01",num:"2",price:300},
{name:"2015-02",num:"3",price:5000}
];
//折线 对比无层级
var title2=['今年','去年'];
var data2={
k1:[
{name:"2014-03",num:"3",price:2223},
{name:"2014-04",num:"2",price:700.2},
{name:"2014-05",num:"1",price:300.5},
{name:"2014-06",num:"8",price:3323.5},
{name:"2014-07",num:"0",price:1000},
{name:"2014-08",num:"2",price:1863},
{name:"2014-09",num:"4",price:2041.8},
{name:"2014-10",num:"5",price:2344.3},
{name:"2014-11",num:"10",price:5242},
{name:"2014-12",num:"11",price:858},
{name:"2015-01",num:"2",price:300},
{name:"2015-02",num:"3",price:1450.6}
],
k2:[
{name:"2014-03",num:"3",price:120},
{name:"2014-04",num:"2",price:500},
{name:"2014-05",num:"1",price:604},
{name:"2014-06",num:"8",price:2000},
{name:"2014-07",num:"0",price:3000},
{name:"2014-08",num:"2",price:2681.5},
{name:"2014-09",num:"4",price:3624.2},
{name:"2014-10",num:"5",price:5000},
{name:"2014-11",num:"10",price:4322},
{name:"2014-12",num:"11",price:1200},
{name:"2015-01",num:"2",price:2622.5},
{name:"2015-02",num:"3",price:352}
]
};
</script>
</html>