diff --git a/html/head.php b/html/head.php
index 14e5c2f..9200d77 100644
--- a/html/head.php
+++ b/html/head.php
@@ -6,7 +6,7 @@
-
+
个股:股票代码: ' >
+
diff --git a/js/pubfunc.js b/js/pubfunc.js
index 62ef1a6..cc36ad1 100644
--- a/js/pubfunc.js
+++ b/js/pubfunc.js
@@ -2,7 +2,7 @@
* @Author: 杨水淼 yangshuimiao@jsjd.cc
* @Date: 2025-03-21 11:58:51
* @LastEditors: 杨水淼 yangshuimiao@jsjd.cc
- * @LastEditTime: 2025-07-09 12:28:30
+ * @LastEditTime: 2025-07-16 16:15:16
* @FilePath: \echarts\js\pubfunc.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
@@ -87,18 +87,18 @@ function formatDateToYYYYMMDD(dateStr) {
return dateStr.replace(/-/g, '');
}
-function pickData(data, dateKey, valueKey) {
+function pickData(data, dateKey, valueKey,fixed=2) {
data.sort((a, b) => a[dateKey] - b[dateKey]);
return data.map(item => ({
value: [
item[dateKey].slice(0, 4) + '-' + item[dateKey].slice(4, 6) + '-' + item[dateKey].slice(6, 8), // 格式化日期 yyyymmdd 转为 yyyy-mm-dd
- item[valueKey].toFixed(2) // 保留两位小数
+ item[valueKey].toFixed(fixed) // 保留两位小数
]
}));
}
/* 将上述pickData函数返回的结果,value计算返回最大值,最小值,均值,以及最后一个值 */
-function calculateStats(data) {
+function calculateStats(data,fixed=2) {
if (data.length === 0) {
return {
max: null,
@@ -129,9 +129,9 @@ function calculateStats(data) {
const avg = sum / data.length;
return {
- max: max.toFixed(2),
- min: min.toFixed(2),
- avg: avg.toFixed(2),
- last: last.toFixed(2)
+ max: max.toFixed(fixed),
+ min: min.toFixed(fixed),
+ avg: avg.toFixed(fixed),
+ last: last.toFixed(fixed)
};
}
\ No newline at end of file
diff --git a/stock_trend.php b/stock_trend.php
index f029847..6516985 100644
--- a/stock_trend.php
+++ b/stock_trend.php
@@ -26,8 +26,6 @@ include_once "html/head.php";
正在加载数据,请稍候...
-
-