define(['jquery', 'bootstrap', 'backend', 'addtabs', 'table', 'echarts', 'echarts-theme'], function ($, undefined, Backend, Datatable, Table, Echarts) { var Controller = { index: function () { var myChart = Echarts.init(document.getElementById('echart'), 'walden'); var option = { title: { text: '', subtext: '' }, color: ["#ff6a00"], tooltip: { trigger: 'axis', formatter: '{b}
注册用户数: {c} 人' }, legend: { data: ['注册用户数'], right: 10, top: 0 }, xAxis: { type: 'category', boundaryGap: false, data: Config.column, axisLine: { lineStyle: { color: '#e2e8f0' } }, axisLabel: { color: '#64748b' } }, yAxis: { minInterval: 1, splitLine: { lineStyle: { type: 'dashed', color: '#f1f5f9' } }, axisLabel: { color: '#64748b' } }, grid: [{ left: '2%', top: '15%', right: '2%', bottom: 30, containLabel: true }], series: [{ name: '注册用户数', type: 'line', smooth: true, showSymbol: true, symbolSize: 6, areaStyle: { normal: { color: new Echarts.graphic.LinearGradient(0, 0, 0, 1, [ { offset: 0, color: 'rgba(255, 106, 0, 0.3)' }, { offset: 1, color: 'rgba(255, 106, 0, 0.02)' } ]) } }, lineStyle: { normal: { width: 3, color: '#ff6a00' } }, itemStyle: { color: '#ff6a00', borderColor: '#fff', borderWidth: 2 }, data: Config.userdata }] }; myChart.setOption(option); $(window).resize(function () { myChart.resize(); }); $(document).on("click", ".btn-refresh", function () { setTimeout(function () { myChart.resize(); }, 0); }); } }; return Controller; });