Backups Created:
/home/japatmex/public_html/wp-content/edit-wolf.php
Savvy
W
olf -
MANAGER
Edit File: lines_zoom.js
/* ------------------------------------------------------------------------------ * * # Echarts - Line chart with zoom example * * Demo JS code for line chart with zoom option [light theme] * * ---------------------------------------------------------------------------- */ // Setup module // ------------------------------ var EchartsLinesZoomLight = function() { // // Setup module components // // Line chart with zoom var _linesZoomLightExample = function() { if (typeof echarts == 'undefined') { console.warn('Warning - echarts.min.js is not loaded.'); return; } // Define element var line_zoom_element = document.getElementById('line_zoom'); // // Charts configuration // if (line_zoom_element) { // Initialize chart var line_zoom = echarts.init(line_zoom_element); // // Chart config // // Options line_zoom.setOption({ // Define colors color: ["#424956", "#d74e67", '#0092ff'], // Global text styles textStyle: { fontFamily: 'Roboto, Arial, Verdana, sans-serif', fontSize: 13 }, // Chart animation duration animationDuration: 750, // Setup grid grid: { left: 0, right: 40, top: 35, bottom: 60, containLabel: true }, // Add legend legend: { data: ['Software', 'Hardware', 'Accessories'], itemHeight: 8, itemGap: 20 }, // Add tooltip tooltip: { trigger: 'axis', backgroundColor: 'rgba(0,0,0,0.75)', padding: [10, 15], textStyle: { fontSize: 13, fontFamily: 'Roboto, sans-serif' } }, // Horizontal axis xAxis: [{ type: 'category', boundaryGap: false, axisLabel: { color: '#333' }, axisLine: { lineStyle: { color: '#999' } }, data: ['2017/1/17','2017/1/18','2017/1/19','2017/1/20','2017/1/23','2017/1/24','2017/1/25','2017/1/26','2017/2/3','2017/2/6','2017/2/7','2017/2/8','2017/2/9','2017/2/10','2017/2/13','2017/2/14','2017/2/15','2017/2/16','2017/2/17','2017/2/20','2017/2/21','2017/2/22','2017/2/23','2017/2/24','2017/2/27','2017/2/28','2017/3/1分红40万','2017/3/2','2017/3/3','2017/3/6','2017/3/7'] }], // Vertical axis yAxis: [{ type: 'value', axisLabel: { formatter: '{value} ', color: '#333' }, axisLine: { lineStyle: { color: '#999' } }, splitLine: { lineStyle: { color: ['#eee'] } }, splitArea: { show: true, areaStyle: { color: ['rgba(250,250,250,0.1)', 'rgba(0,0,0,0.01)'] } } }], // Zoom control dataZoom: [ { type: 'inside', start: 30, end: 70 }, { show: true, type: 'slider', start: 30, end: 70, height: 40, bottom: 0, borderColor: '#ccc', fillerColor: 'rgba(0,0,0,0.05)', handleStyle: { color: '#585f63' } } ], // Add series series: [ { name: 'Software', type: 'line', smooth: true, symbolSize: 6, itemStyle: { normal: { borderWidth: 2 } }, data: [152,156,479,442,654,835,465,704,643,136,791,254,688,119,948,316,612,378,707,404,485,226,754,142,965,364,887,395,838,113,662] }, { name: 'Hardware', type: 'line', smooth: true, symbolSize: 6, itemStyle: { normal: { borderWidth: 2 } }, data: [677,907,663,137,952,408,976,772,514,102,165,343,374,744,237,662,875,462,409,259,396,744,359,618,127,596,161,574,107,914,708] }, { name: 'Accessories', type: 'line', smooth: true, symbolSize: 6, itemStyle: { normal: { borderWidth: 2 } }, data: [606,919,108,691,424,196,328,136,754,427,544,983,547,834,452,576,343,168,462,756,344,226,511,304,648,339,655,336,605,157,864] } ] }); } // // Resize charts // // Resize function var triggerChartResize = function() { line_zoom_element && line_zoom.resize(); }; // On sidebar width change var sidebarToggle = document.querySelector('.sidebar-control'); sidebarToggle && sidebarToggle.addEventListener('click', triggerChartResize); // On window resize var resizeCharts; window.addEventListener('resize', function() { clearTimeout(resizeCharts); resizeCharts = setTimeout(function () { triggerChartResize(); }, 200); }); }; // // Return objects assigned to module // return { init: function() { _linesZoomLightExample(); } } }(); // Initialize module // ------------------------------ document.addEventListener('DOMContentLoaded', function() { EchartsLinesZoomLight.init(); });