Files
simonandClaude Opus 4.7 eedead0d41 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>
2026-06-06 18:01:55 +08:00

120 lines
3.4 KiB
PHP

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<?php
ini_set('error_reporting', E_ALL);
$mysqli = new mysqli('localhost','root','nancysimon','myquant');
$ts_code = '000001.SH';
$day_st = '20190101';
$day_end = '20190701';
$where = " and trade_date>'".$day_st."'";
if($day_end) $where .= " and trade_date <'".$day_end."'";
$date_range = "and trade_date";
$sql= <<<EOF
select trade_date, close from index_hist_pro where ts_code = '$ts_code' $where order by trade_date asc
EOF;
#echo $sql;
$result = $mysqli->query($sql);
$tDate=array('交易日');
$idx=array('上证指数');
if($result && $result->num_rows>0) {
#$data = $result->fetch_all();
while($row=$result->fetch_assoc()){
array_push($tDate,$row['trade_date']);
array_push($idx,$row['close']);
}
}
#Free result and close connection.
$result->free();
$mysqli->close();
?>
<body style="height: 100%; margin: 0">
<!-- 为 ECharts 准备一个具备大小(宽高)的 DOM -->
<div id="container" style="height: 400px;width: 600px"></div>
<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/echarts.min.js"></script>
<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts-gl/echarts-gl.min.js"></script>
<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts-stat/ecStat.min.js"></script>
<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/extension/dataTool.min.js"></script>
<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/simplex.js"></script>
<script type="text/javascript">
var dom = document.getElementById("container");
var myChart = echarts.init(dom);
var app = {};
option = null;
option = {
title: {
text: '折线图堆叠'
},
tooltip: {
trigger: 'axis'
},
legend: {
data:['邮件营销','联盟广告','视频广告','直接访问','搜索引擎']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['周一','周二','周三','周四','周五','周六','周日']
},
yAxis: {
type: 'value'
},
series: [
{
name:'邮件营销',
type:'line',
stack: '总量',
data:[120, 132, 101, 134, 90, 230, 210]
},
{
name:'联盟广告',
type:'line',
stack: '总量',
data:[220, 182, 191, 234, 290, 330, 310]
},
{
name:'视频广告',
type:'line',
stack: '总量',
data:[150, 232, 201, 154, 190, 330, 410]
},
{
name:'直接访问',
type:'line',
stack: '总量',
data:[320, 332, 301, 334, 390, 330, 320]
},
{
name:'搜索引擎',
type:'line',
stack: '总量',
data:[820, 932, 901, 934, 1290, 1330, 1320]
}
]
};
;
if (option && typeof option === "object") {
myChart.setOption(option, true);
}
</script>
</body>
</html>