正在显示
2 个修改的文件
包含
151 行增加
和
0 行删除
@@ -376,6 +376,157 @@ | @@ -376,6 +376,157 @@ | ||
376 | </div> | 376 | </div> |
377 | </div> | 377 | </div> |
378 | </div> | 378 | </div> |
379 | + <script SRC="/public/echarts.min.js"> | ||
380 | + var posList = [ | ||
381 | + 'left', 'right', 'top', 'bottom', | ||
382 | + 'inside', | ||
383 | + 'insideTop', 'insideLeft', 'insideRight', 'insideBottom', | ||
384 | + 'insideTopLeft', 'insideTopRight', 'insideBottomLeft', 'insideBottomRight' | ||
385 | + ]; | ||
386 | + | ||
387 | + app.configParameters = { | ||
388 | + rotate: { | ||
389 | + min: -90, | ||
390 | + max: 90 | ||
391 | + }, | ||
392 | + align: { | ||
393 | + options: { | ||
394 | + left: 'left', | ||
395 | + center: 'center', | ||
396 | + right: 'right' | ||
397 | + } | ||
398 | + }, | ||
399 | + verticalAlign: { | ||
400 | + options: { | ||
401 | + top: 'top', | ||
402 | + middle: 'middle', | ||
403 | + bottom: 'bottom' | ||
404 | + } | ||
405 | + }, | ||
406 | + position: { | ||
407 | + options: echarts.util.reduce(posList, function (map, pos) { | ||
408 | + map[pos] = pos; | ||
409 | + return map; | ||
410 | + }, {}) | ||
411 | + }, | ||
412 | + distance: { | ||
413 | + min: 0, | ||
414 | + max: 100 | ||
415 | + } | ||
416 | + }; | ||
417 | + | ||
418 | + app.config = { | ||
419 | + rotate: 90, | ||
420 | + align: 'left', | ||
421 | + verticalAlign: 'middle', | ||
422 | + position: 'insideBottom', | ||
423 | + distance: 15, | ||
424 | + onChange: function () { | ||
425 | + var labelOption = { | ||
426 | + normal: { | ||
427 | + rotate: app.config.rotate, | ||
428 | + align: app.config.align, | ||
429 | + verticalAlign: app.config.verticalAlign, | ||
430 | + position: app.config.position, | ||
431 | + distance: app.config.distance | ||
432 | + } | ||
433 | + }; | ||
434 | + myChart.setOption({ | ||
435 | + series: [{ | ||
436 | + label: labelOption | ||
437 | + }, { | ||
438 | + label: labelOption | ||
439 | + }, { | ||
440 | + label: labelOption | ||
441 | + }, { | ||
442 | + label: labelOption | ||
443 | + }] | ||
444 | + }); | ||
445 | + } | ||
446 | + }; | ||
447 | + | ||
448 | + | ||
449 | + var labelOption = { | ||
450 | + show: true, | ||
451 | + position: app.config.position, | ||
452 | + distance: app.config.distance, | ||
453 | + align: app.config.align, | ||
454 | + verticalAlign: app.config.verticalAlign, | ||
455 | + rotate: app.config.rotate, | ||
456 | + formatter: '{c} {name|{a}}', | ||
457 | + fontSize: 16, | ||
458 | + rich: { | ||
459 | + name: { | ||
460 | + textBorderColor: '#fff' | ||
461 | + } | ||
462 | + } | ||
463 | + }; | ||
464 | + | ||
465 | + option = { | ||
466 | + color: ['#003366', '#006699', '#4cabce', '#e5323e'], | ||
467 | + tooltip: { | ||
468 | + trigger: 'axis', | ||
469 | + axisPointer: { | ||
470 | + type: 'shadow' | ||
471 | + } | ||
472 | + }, | ||
473 | + legend: { | ||
474 | + data: ['Forest', 'Steppe', 'Desert', 'Wetland'] | ||
475 | + }, | ||
476 | + toolbox: { | ||
477 | + show: true, | ||
478 | + orient: 'vertical', | ||
479 | + left: 'right', | ||
480 | + top: 'center', | ||
481 | + feature: { | ||
482 | + mark: {show: true}, | ||
483 | + dataView: {show: true, readOnly: false}, | ||
484 | + magicType: {show: true, type: ['line', 'bar', 'stack', 'tiled']}, | ||
485 | + restore: {show: true}, | ||
486 | + saveAsImage: {show: true} | ||
487 | + } | ||
488 | + }, | ||
489 | + xAxis: [ | ||
490 | + { | ||
491 | + type: 'category', | ||
492 | + axisTick: {show: false}, | ||
493 | + data: ['2012', '2013', '2014', '2015', '2016'] | ||
494 | + } | ||
495 | + ], | ||
496 | + yAxis: [ | ||
497 | + { | ||
498 | + type: 'value' | ||
499 | + } | ||
500 | + ], | ||
501 | + series: [ | ||
502 | + { | ||
503 | + name: 'Forest', | ||
504 | + type: 'bar', | ||
505 | + barGap: 0, | ||
506 | + label: labelOption, | ||
507 | + data: [320, 332, 301, 334, 390] | ||
508 | + }, | ||
509 | + { | ||
510 | + name: 'Steppe', | ||
511 | + type: 'bar', | ||
512 | + label: labelOption, | ||
513 | + data: [220, 182, 191, 234, 290] | ||
514 | + }, | ||
515 | + { | ||
516 | + name: 'Desert', | ||
517 | + type: 'bar', | ||
518 | + label: labelOption, | ||
519 | + data: [150, 232, 201, 154, 190] | ||
520 | + }, | ||
521 | + { | ||
522 | + name: 'Wetland', | ||
523 | + type: 'bar', | ||
524 | + label: labelOption, | ||
525 | + data: [98, 77, 101, 99, 40] | ||
526 | + } | ||
527 | + ] | ||
528 | + }; | ||
529 | + </script> | ||
379 | <!--<script>--> | 530 | <!--<script>--> |
380 | <!--var Orderdata = {--> | 531 | <!--var Orderdata = {--> |
381 | <!--column: {:json_encode(array_keys($paylist))},--> | 532 | <!--column: {:json_encode(array_keys($paylist))},--> |
public/echarts.min.js
0 → 100644
此 diff 太大无法显示。
-
请 注册 或 登录 后发表评论