feat: 全面代码更新 - ECharts 5.4.2 重构、新增量化分析模块、前端库升级

- 升级 ECharts 到 5.4.2,重构 lib/ 目录结构
- 新增 DataTables 2.x 和 FixedColumns 插件
- 新增 quant/ 宏观研究报告模块
- 重构图表页面:stock_trend、hkholdbycode 等采用 JS fetch API.doorcome.cn 模式
- 新增 CLAUDE.md 补充页面文档和新数据流说明
- 更新 inc/config.php TuShare API 配置
- 更新新闻联播分析模块 news/ 和相关研究报告 research/
- 新增 api_document/ 参考文档
- 清理 .gitignore,排除 uploads/xls/.mcp.json/ source maps 等非代码文件
- 所有 PHP 文件通过 php -l 语法检查

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-06 18:01:55 +08:00
co-authored by Claude Opus 4.7
parent f3f9d19da7
commit eedead0d41
228 changed files with 721924 additions and 15457 deletions
+68 -68
View File
@@ -1,69 +1,69 @@
var cfg = window.chartConfig;
// ajax with adj set 1
$(function () {
jQuery.support.cors = true;
if($("#adj").val()=='1') {
console.log("Got adj set 1");
var pyurl= "https://py.doorcome.cn/ts/adj?";
pyurl += "ts_code="+$("#ts_code").val();
pyurl += "&s="+$("#s").val();
pyurl += "&e="+$("#e").val();
console.log(pyurl);
//var formData = new FormData($('#form1')[0]);
$.ajax({
crossDomain:true,
//type: 'post',
url: pyurl, //上传文件的请求路径必须是绝对路劲
//data: formData,
cache: false,
processData: false,
contentType: false,
success:function (data) {
console.log("Get data sucessfully");
var adj = getAdj(data);
//console.log(adj);
console.log(cfg.data[0]['value'][0]);
console.log(cfg.data[0]['value'][1]);
cfg.data = adjData(adj,cfg.data,'price');
cfg.data2 = adjData(adj,cfg.data2,'price');
cfg.data3 = adjData(adj,cfg.data3,'price');
cfg.data4 = adjData(adj,cfg.data4,'volum');
cfg.data5 = adjData(adj,cfg.data5,'volum');
console.log(cfg.data[0]['value'][0]);
console.log(cfg.data[0]['value'][1]);
//重新执行画图
if (option && typeof option === "object") {
myChart.setOption(option, true);
}
},
error: function () {
alert("获取数据失败!");
}
});
};
});
function getAdj(data){
var arr = $.parseJSON(data);
var rtArr = {};
var key = '';
//console.log(arr);
var lastAdj= arr[0]['adj_factor'] //last adj number
for(var i = 0; i <arr.length;i++){
key=arr[i]['trade_date'];
rtArr[key] = arr[i]['adj_factor']/lastAdj;
}
return rtArr;
}
function adjData(adj,data,tp){
var k = '';
if(data == null) return 0;
for(var i=0; i<data.length; i++){
k = data[i]['value'][0]; //get date as key
k = k.replace(/-/g,''); //formate key formate from yyyy-mm-dd to yyyymmdd
if(tp=='price')data[i]['value'][1]=Math.round(data[i]['value'][1]*adj[k]*100)/100; //价格保留两位小数
if(tp=='volum')data[i]['value'][1]=Math.round(data[i]['value'][1]/adj[k]); //数量取整数
}
return data;
var cfg = window.chartConfig;
// ajax with adj set 1
$(function () {
jQuery.support.cors = true;
if($("#adj").val()=='1') {
console.log("Got adj set 1");
var pyurl= "https://py.doorcome.cn/ts/adj?";
pyurl += "ts_code="+$("#ts_code").val();
pyurl += "&s="+$("#s").val();
pyurl += "&e="+$("#e").val();
console.log(pyurl);
//var formData = new FormData($('#form1')[0]);
$.ajax({
crossDomain:true,
//type: 'post',
url: pyurl, //上传文件的请求路径必须是绝对路劲
//data: formData,
cache: false,
processData: false,
contentType: false,
success:function (data) {
console.log("Get data sucessfully");
var adj = getAdj(data);
//console.log(adj);
console.log(cfg.data[0]['value'][0]);
console.log(cfg.data[0]['value'][1]);
cfg.data = adjData(adj,cfg.data,'price');
cfg.data2 = adjData(adj,cfg.data2,'price');
cfg.data3 = adjData(adj,cfg.data3,'price');
cfg.data4 = adjData(adj,cfg.data4,'volum');
cfg.data5 = adjData(adj,cfg.data5,'volum');
console.log(cfg.data[0]['value'][0]);
console.log(cfg.data[0]['value'][1]);
//重新执行画图
if (option && typeof option === "object") {
myChart.setOption(option, true);
}
},
error: function () {
alert("获取数据失败!");
}
});
};
});
function getAdj(data){
var arr = $.parseJSON(data);
var rtArr = {};
var key = '';
//console.log(arr);
var lastAdj= arr[0]['adj_factor'] //last adj number
for(var i = 0; i <arr.length;i++){
key=arr[i]['trade_date'];
rtArr[key] = arr[i]['adj_factor']/lastAdj;
}
return rtArr;
}
function adjData(adj,data,tp){
var k = '';
if(data == null) return 0;
for(var i=0; i<data.length; i++){
k = data[i]['value'][0]; //get date as key
k = k.replace(/-/g,''); //formate key formate from yyyy-mm-dd to yyyymmdd
if(tp=='price')data[i]['value'][1]=Math.round(data[i]['value'][1]*adj[k]*100)/100; //价格保留两位小数
if(tp=='volum')data[i]['value'][1]=Math.round(data[i]['value'][1]/adj[k]); //数量取整数
}
return data;
}
+92 -92
View File
@@ -1,93 +1,93 @@
var cfg = window.chartConfig;
$(function (){
var dom = document.getElementById("container");
var myChart = echarts.init(dom,'dark');
var app = {};
var option = null;
option = {
title: {
//text: cfg.legend[0]+' V.S '+cfg.legend[2],
text: cfg.title,
subtext: cfg.subtitle,
textAlign:'center',
left:'50%'
},
tooltip: {
trigger: 'axis'
},
legend: {
data: cfg.legend,
right:'20'
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
//type: 'category',
type: 'time',
boundaryGap: false
},
yAxis: [{
type: 'value',
name: cfg.legend[0], //图列
show:true
},
{
type:'value',
name: cfg.legend[2]+cfg.unit, //图例
//scale:true,
boundaryGap:false,
show:true,
splitLine:{
show:false, //Y2 坐标刻度横线
},
}
],
dataZoom: [{
type: 'inside', //or slider
start: 0,
end: 100
}, {
start: 0,
end: 100,
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '80%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
}
}],
series: [
{
name: cfg.legend[0],
type:'line',
yAxisIndex:0,
symbol:'none',
data: cfg.data
},
{
name: cfg.legend[2],
type:'line',
yAxisIndex:1,
symbol:'none', //数据圆点
smooth:false,
data: cfg.data2
}
]
};
if (option && typeof option === "object") {
myChart.setOption(option, true);
}
var cfg = window.chartConfig;
$(function (){
var dom = document.getElementById("container");
var myChart = echarts.init(dom,'dark');
var app = {};
var option = null;
option = {
title: {
//text: cfg.legend[0]+' V.S '+cfg.legend[2],
text: cfg.title,
subtext: cfg.subtitle,
textAlign:'center',
left:'50%'
},
tooltip: {
trigger: 'axis'
},
legend: {
data: cfg.legend,
right:'20'
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
//type: 'category',
type: 'time',
boundaryGap: false
},
yAxis: [{
type: 'value',
name: cfg.legend[0], //图列
show:true
},
{
type:'value',
name: cfg.legend[2]+cfg.unit, //图例
//scale:true,
boundaryGap:false,
show:true,
splitLine:{
show:false, //Y2 坐标刻度横线
},
}
],
dataZoom: [{
type: 'inside', //or slider
start: 0,
end: 100
}, {
start: 0,
end: 100,
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '80%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
}
}],
series: [
{
name: cfg.legend[0],
type:'line',
yAxisIndex:0,
symbol:'none',
data: cfg.data
},
{
name: cfg.legend[2],
type:'line',
yAxisIndex:1,
symbol:'none', //数据圆点
smooth:false,
data: cfg.data2
}
]
};
if (option && typeof option === "object") {
myChart.setOption(option, true);
}
});
+135 -135
View File
@@ -1,136 +1,136 @@
var cfg = window.chartConfig;
var dom = document.getElementById("container");
var myChart = echarts.init(dom,'dark'); //内置主题:dark, grey,bright,light
var app = {};
option = null;
console.log(cfg.data[0]['value'][0]);
console.log(cfg.data[0]['value'][1]);
option = {
//backgroundColor: '',
title: {
//text: cfg.legend[0]+' V.S '+cfg.legend[2],
text: cfg.title,
subtext: cfg.subtitle,
textAlign:'center',
left:'50%'
},
tooltip: {
trigger: 'axis'
},
legend: [
{
data: [cfg.legend[0],cfg.legend[1],cfg.legend[2]],
right:'50',
},
{
data: [cfg.legend[3],cfg.legend[4]],
right:'100',
top:'30',
},
],
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
//type: 'category',
type: 'time',
boundaryGap: false
},
yAxis: [{
type: 'value',
name:cfg.legend[0], //图列
show:true,
scale:true,
},
{
type:'value',
name: cfg.unit, //图例
scale:true, //自动缩放
boundaryGap:false,
show:true,
axisLine:{
show:true, //Y2 坐标轴
},
axisTick: {
show:true, //Y2 坐标刻度
},
splitLine:{
show:false, //Y2 坐标刻度横线
},
}
],
dataZoom: [{
type: 'inside', //or slider
start: 0,
end: 100
}, {
start: 0,
end: 100,
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '80%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
}
}],
series: [
{
name:cfg.legend[0],
type:'line',
yAxisIndex:0,
symbol:'none',
smooth:false,
data: cfg.data,
},
{
name:cfg.legend[1],
type:'scatter', //散点图
yAxisIndex:0,
symbolSize: 10,
smooth:false,
data: cfg.data2,
},
{
name:cfg.legend[2],
type:'scatter', //散点图
yAxisIndex:0,
symbolSize: 10,
smooth:false,
data: cfg.data3
},
{
name:cfg.legend[3],
type:'bar',
yAxisIndex:1,
symbolSize: 0,
barWidth: 1,
smooth:false,
data: cfg.data4,
},
{
name:cfg.legend[4],
type:'bar',
yAxisIndex:1,
symbolSize: 0,
barWidth: 1,
smooth:false,
data: cfg.data5,
}
]
};
if (option && typeof option === "object") {
myChart.setOption(option, true);
var cfg = window.chartConfig;
var dom = document.getElementById("container");
var myChart = echarts.init(dom,'dark'); //内置主题:dark, grey,bright,light
var app = {};
option = null;
console.log(cfg.data[0]['value'][0]);
console.log(cfg.data[0]['value'][1]);
option = {
//backgroundColor: '',
title: {
//text: cfg.legend[0]+' V.S '+cfg.legend[2],
text: cfg.title,
subtext: cfg.subtitle,
textAlign:'center',
left:'50%'
},
tooltip: {
trigger: 'axis'
},
legend: [
{
data: [cfg.legend[0],cfg.legend[1],cfg.legend[2]],
right:'50',
},
{
data: [cfg.legend[3],cfg.legend[4]],
right:'100',
top:'30',
},
],
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
//type: 'category',
type: 'time',
boundaryGap: false
},
yAxis: [{
type: 'value',
name:cfg.legend[0], //图列
show:true,
scale:true,
},
{
type:'value',
name: cfg.unit, //图例
scale:true, //自动缩放
boundaryGap:false,
show:true,
axisLine:{
show:true, //Y2 坐标轴
},
axisTick: {
show:true, //Y2 坐标刻度
},
splitLine:{
show:false, //Y2 坐标刻度横线
},
}
],
dataZoom: [{
type: 'inside', //or slider
start: 0,
end: 100
}, {
start: 0,
end: 100,
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '80%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
}
}],
series: [
{
name:cfg.legend[0],
type:'line',
yAxisIndex:0,
symbol:'none',
smooth:false,
data: cfg.data,
},
{
name:cfg.legend[1],
type:'scatter', //散点图
yAxisIndex:0,
symbolSize: 10,
smooth:false,
data: cfg.data2,
},
{
name:cfg.legend[2],
type:'scatter', //散点图
yAxisIndex:0,
symbolSize: 10,
smooth:false,
data: cfg.data3
},
{
name:cfg.legend[3],
type:'bar',
yAxisIndex:1,
symbolSize: 0,
barWidth: 1,
smooth:false,
data: cfg.data4,
},
{
name:cfg.legend[4],
type:'bar',
yAxisIndex:1,
symbolSize: 0,
barWidth: 1,
smooth:false,
data: cfg.data5,
}
]
};
if (option && typeof option === "object") {
myChart.setOption(option, true);
}
+93
View File
@@ -0,0 +1,93 @@
var cfg = window.chartConfig;
var dom = document.getElementById("container");
var myChart = echarts.init(dom,'dark');
var app = {};
option = null;
option = {
title: {
//text: legend[0]+' V.S '+legend[2],
text: cfg.title,
subtext: cfg.subtitle,
textAlign:'center',
left:'50%'
},
tooltip: {
trigger: 'axis'
},
legend: {
data: cfg.legend,
right:'20'
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
//type: 'category',
type: 'time',
boundaryGap: false
},
yAxis: [{
type: 'value',
name:legend[0], //图列
show:true,
scale:true,
},
{
type:'value',
name:legend[1]+'-'+unit, //图例
scale:true, //auto sacle
boundaryGap:false,
show:true,
splitLine:{
show:false, //Y2 坐标刻度横线
},
}
],
dataZoom: [{
type: 'inside', //or slider
start: 0,
end: 100
}, {
start: 0,
end: 100,
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '80%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
}
}],
series: [
{
name:legend[0],
type:'line',
yAxisIndex:0,
symbol:'none',
data: cfg.data,
},
{
name:legend[1],
type:'line',
yAxisIndex:1,
symbol:'none', //数据圆点
smooth:false,
data: cfg.data2,
}
]
};
if (option && typeof option === "object") {
myChart.setOption(option, true);
}
+22
View File
@@ -0,0 +1,22 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("echarts")):"function"==typeof define&&define.amd?define(["exports","echarts"],t):t(e.dataTool={},e.echarts)}(this,function(e,t){"use strict";function r(e,t,r){if(e&&t){if(e.map&&e.map===c)return e.map(t,r);for(var a=[],n=0,o=e.length;n<o;n++)a.push(t.call(r,e[n],n,e));return a}}function a(e){return e?r(u(e,"attribute"),function(e){return{id:i(e,"id"),title:i(e,"title"),type:i(e,"type")}}):[]}function n(e,t){return e?r(u(e,"node"),function(e){var r={id:i(e,"id"),name:i(e,"label"),itemStyle:{normal:{}}},a=l(e,"viz:size"),n=l(e,"viz:position"),o=l(e,"viz:color"),s=l(e,"attvalues");if(a&&(r.symbolSize=parseFloat(i(a,"value"))),n&&(r.x=parseFloat(i(n,"x")),r.y=parseFloat(i(n,"y"))),o&&(r.itemStyle.normal.color="rgb("+[0|i(o,"r"),0|i(o,"g"),0|i(o,"b")].join(",")+")"),s){var f=u(s,"attvalue");r.attributes={};for(var c=0;c<f.length;c++){var p=f[c],d=i(p,"for"),v=i(p,"value"),g=t[d];if(g){switch(g.type){case"integer":case"long":v=parseInt(v,10);break;case"float":case"double":v=parseFloat(v);break;case"boolean":v="true"==v.toLowerCase()}r.attributes[d]=v}}}return r}):[]}function o(e){return e?r(u(e,"edge"),function(e){var t={id:i(e,"id"),name:i(e,"label"),source:i(e,"source"),target:i(e,"target"),lineStyle:{normal:{}}},r=t.lineStyle.normal,a=l(e,"viz:thickness"),n=l(e,"viz:color");return a&&(r.width=parseFloat(a.getAttribute("value"))),n&&(r.color="rgb("+[0|i(n,"r"),0|i(n,"g"),0|i(n,"b")].join(",")+")"),t}):[]}function i(e,t){return e.getAttribute(t)}function l(e,t){for(var r=e.firstChild;r;){if(1==r.nodeType&&r.nodeName.toLowerCase()==t.toLowerCase())return r;r=r.nextSibling}return null}function u(e,t){for(var r=e.firstChild,a=[];r;)r.nodeName.toLowerCase()==t.toLowerCase()&&a.push(r),r=r.nextSibling;return a}function s(e){return e.sort(function(e,t){return e-t}),e}function f(e,t){var r=(e.length-1)*t+1,a=Math.floor(r),n=+e[a-1],o=r-a;return o?n+o*(e[a]-n):n}var c=Array.prototype.map,p=(Object.freeze||Object)({parse:function(e){var t;if(!(t="string"==typeof e?(new DOMParser).parseFromString(e,"text/xml"):e)||t.getElementsByTagName("parsererror").length)return null;var r=l(t,"gexf");if(!r)return null;for(var i=l(r,"graph"),u=a(l(i,"attributes")),s={},f=0;f<u.length;f++)s[u[f].id]=u[f];return{nodes:n(l(i,"nodes"),s),links:o(l(i,"edges"))}}}),d=function(e,t){for(var r=[],a=[],n=[],o=(t=t||[]).boundIQR,i="none"===o||0===o,l=0;l<e.length;l++){n.push(l+"");var u=s(e[l].slice()),c=f(u,.25),p=f(u,.5),d=f(u,.75),v=u[0],g=u[u.length-1],h=(null==o?1.5:o)*(d-c),b=i?v:Math.max(v,c-h),m=i?g:Math.min(g,d+h);r.push([b,c,p,d,m]);for(var y=0;y<u.length;y++){var x=u[y];if(x<b||x>m){var w=[l,x];"vertical"===t.layout&&w.reverse(),a.push(w)}}}return{boxData:r,outliers:a,axisData:n}};t.dataTool&&(t.dataTool.version="1.0.0",t.dataTool.gexf=p,t.dataTool.prepareBoxplotData=d),e.version="1.0.0",e.gexf=p,e.prepareBoxplotData=d});
+1
View File
File diff suppressed because one or more lines are too long
+1
View File
File diff suppressed because one or more lines are too long
+22
View File
File diff suppressed because one or more lines are too long
+77
View File
@@ -0,0 +1,77 @@
var cfg = window.chartConfig;
var dom = document.getElementById("container");
var myChart = echarts.init(dom,'dark');
var app = {};
option = null;
option = {
title: {
//text: cfg.legend[0]+' V.S '+cfg.legend[2],
text: cfg.title,
//subtext: subtxt,
textAlign:'center',
left:'50%'
},
tooltip: {
trigger: 'axis'
},
legend: {
data:cfg.legend,
right:'20'
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
//type: 'category',
type: 'time',
boundaryGap: false
},
yAxis: [{
type: 'value',
name:cfg.legend[0], //图列
show:true,
scale:true,
//min:190000,
}
],
dataZoom: [{
type: 'inside', //or slider
start: 0,
end: 100
}, {
start: 0,
end: 100,
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '80%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
}
}],
series: [
{
name:cfg.legend[0],
type:'line',
yAxisIndex:0,
symbol:'none',
data:cfg.data,
itemStyle:{normal:{label:{show:true}}}, //显示数字
}
]
};
if (option && typeof option === "object") {
myChart.setOption(option, true);
}
+105 -105
View File
@@ -1,106 +1,106 @@
/*
* @Author: 杨水淼 yangshuimiao@jsjd.cc
* @Date: 2025-07-08 10:40:52
* @LastEditors: 杨水淼 yangshuimiao@jsjd.cc
* @LastEditTime: 2025-07-09 07:38:46
* @FilePath: \echarts\js\renderCharts.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
function doubleLineChart(params){
/*
需要外部提供:
chartid: div container id
legend: array
unit: str
sub_text: str
data:data1,data2, array
*/
var dom = document.getElementById(params.chartid);
var myChart = echarts.init(dom,'dark');
option = null;
option = {
title: {
text: params.text,
subtext: params.sub_text,
textAlign:'center',
left:'50%'
},
tooltip: {
trigger: 'axis'
},
legend: {
data:params.legend,
right:'20'
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'time',
boundaryGap: false
},
yAxis: [{
type: 'value',
name:params.legend[0], //图列
show:true
},
{
type:'value',
name:params.legend[1], //图例
//scale:true,
boundaryGap:false,
show:true,
splitLine:{
show:false, //Y2 坐标刻度横线
},
}
],
dataZoom: [{
type: 'inside', //or slider
start: 0,
end: 100
}, {
start: 0,
end: 100,
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '80%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
}
}],
series: [
{
name:params.legend[0],
type:'line',
yAxisIndex:0,
symbol:'none',
data:params.data1
},
{
name:params.legend[1],
type:'line',
yAxisIndex:1,
symbol:'none', //数据圆点
smooth:false,
data:params.data2
}
]
};
if (option && typeof option === "object") {
myChart.setOption(option, true);
}
return myChart;
/*
* @Author: 杨水淼 yangshuimiao@jsjd.cc
* @Date: 2025-07-08 10:40:52
* @LastEditors: 杨水淼 yangshuimiao@jsjd.cc
* @LastEditTime: 2025-07-09 07:38:46
* @FilePath: \echarts\js\renderCharts.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
function doubleLineChart(params){
/*
需要外部提供:
chartid: div container id
legend: array
unit: str
sub_text: str
data:data1,data2, array
*/
var dom = document.getElementById(params.chartid);
var myChart = echarts.init(dom,'dark');
option = null;
option = {
title: {
text: params.text,
subtext: params.sub_text,
textAlign:'center',
left:'50%'
},
tooltip: {
trigger: 'axis'
},
legend: {
data:params.legend,
right:'20'
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'time',
boundaryGap: false
},
yAxis: [{
type: 'value',
name:params.legend[0], //图列
show:true
},
{
type:'value',
name:params.legend[1], //图例
//scale:true,
boundaryGap:false,
show:true,
splitLine:{
show:false, //Y2 坐标刻度横线
},
}
],
dataZoom: [{
type: 'inside', //or slider
start: 0,
end: 100
}, {
start: 0,
end: 100,
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '80%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
}
}],
series: [
{
name:params.legend[0],
type:'line',
yAxisIndex:0,
symbol:'none',
data:params.data1
},
{
name:params.legend[1],
type:'line',
yAxisIndex:1,
symbol:'none', //数据圆点
smooth:false,
data:params.data2
}
]
};
if (option && typeof option === "object") {
myChart.setOption(option, true);
}
return myChart;
}
File diff suppressed because one or more lines are too long
+79 -79
View File
@@ -1,80 +1,80 @@
/**
* Created by Simon on 2017-6-14.
*/
(function(){
$("#btn-search").on("click",function(){
if(check_form("myform")){
$("#myform").submit();
}
});
drawGraph();
function drawGraph(){
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById('main'));
var x = $.parseJSON($("#x").val());
var legend = $.parseJSON($("#legend").val());
var total = $.parseJSON($("#total").val());
var l_yield = $.parseJSON($("#yield").val());
var option = {
title: {
text: '经营报表趋势图',
top: "top",
left: "center"
},
tooltip: {
trigger: 'axis',
axisPointer: {
animation: false
}
},
grid: {x: '7%', y: '7%', width: '85%', height: '70%',top: "15%"},
xAxis: {
type : 'category',
data : x
},
yAxis: [{
type: 'value',
name: legend[0],
},{
type: 'value',
name: legend[1],
/* axisLabel: {
formatter:'{value} %'
}, */
scale: true,
boundaryGap: ['20%','20%']
}],
series: [{
name: legend[0],
type: "bar",
yAxisIndex: 0,
data: total,
itemStyle:{
normal:{
color: "#00BB00"
}
}
},{
name: legend[1],
type: "line",
yAxisIndex: 1,
data: l_yield,
label:{
normal:{
show: true
}
},
lineStyle:{
normal:{
color: "#D26900"
}
}
}]
};
//console.info(option);
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
}
/**
* Created by Simon on 2017-6-14.
*/
(function(){
$("#btn-search").on("click",function(){
if(check_form("myform")){
$("#myform").submit();
}
});
drawGraph();
function drawGraph(){
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById('main'));
var x = $.parseJSON($("#x").val());
var legend = $.parseJSON($("#legend").val());
var total = $.parseJSON($("#total").val());
var l_yield = $.parseJSON($("#yield").val());
var option = {
title: {
text: '经营报表趋势图',
top: "top",
left: "center"
},
tooltip: {
trigger: 'axis',
axisPointer: {
animation: false
}
},
grid: {x: '7%', y: '7%', width: '85%', height: '70%',top: "15%"},
xAxis: {
type : 'category',
data : x
},
yAxis: [{
type: 'value',
name: legend[0],
},{
type: 'value',
name: legend[1],
/* axisLabel: {
formatter:'{value} %'
}, */
scale: true,
boundaryGap: ['20%','20%']
}],
series: [{
name: legend[0],
type: "bar",
yAxisIndex: 0,
data: total,
itemStyle:{
normal:{
color: "#00BB00"
}
}
},{
name: legend[1],
type: "line",
yAxisIndex: 1,
data: l_yield,
label:{
normal:{
show: true
}
},
lineStyle:{
normal:{
color: "#D26900"
}
}
}]
};
//console.info(option);
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
}
})();