refactor: 废弃机构持仓图表页面,整理数据库表引用文档
- 将 chartSix.php、chartThree.php、stock_ih.php、index_ih.php 移至 deprecated/ - 从 index.php、index-2.php 移除对应导航链接 - 新增 DB_REFERENCE.md,完整记录 16 张数据库表的使用状态 - 更新 continuation.md Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
#查询个股价格对应机构持仓的数量
|
||||
include_once "../inc/getBasic.inc.php";
|
||||
include_once "../inc/getData.inc.php";
|
||||
|
||||
$ts_code=ts_code_conv($_REQUEST['ts_code']);
|
||||
$ts_name = tscodeToName($ts_code);
|
||||
include_once "../html/headChart.php"; //required after $ts_code and $ts_name
|
||||
|
||||
$day_st=($_REQUEST['s']=='')?'2012-01-01':$_REQUEST['s'];
|
||||
$day_end=($_REQUEST['e']=='')?date('Y-m-d'):$_REQUEST['e'];
|
||||
#item: f9:持股数 f10:持股额 f11:占总股本比例 f12:占流通股比例
|
||||
$item = ($_REQUEST['item']=='')?'f9':$_REQUEST['item'];
|
||||
|
||||
switch($item){
|
||||
case 'f9':
|
||||
case 'F9':
|
||||
$unit = ' - 万股';
|
||||
$item_name = "持股数";
|
||||
break;
|
||||
case 'f10':
|
||||
case 'F10':
|
||||
$unit = ' - 万元';
|
||||
$item_name = "持股金额";
|
||||
break;
|
||||
case 'f11':
|
||||
case 'F11':
|
||||
$unit = ' - %';
|
||||
$item_name = "总股本股比例";
|
||||
break;
|
||||
case 'f12':
|
||||
case 'F12':
|
||||
$unit = ' - %';
|
||||
$item_name = "流通股比例";
|
||||
break;
|
||||
default:
|
||||
$unit = '';
|
||||
}
|
||||
$data = getStockHist($ts_code,$day_st,$day_end);
|
||||
$lx = ''; //define null var avoid error
|
||||
$data2 = getIhDataByStock($ts_code,$item,$lx,$day_st,$day_end);
|
||||
|
||||
#var_dump($data2['data']);
|
||||
$subtext_ext = "Max: ".$data2['data_max'];
|
||||
$subtext_ext .= ", Min: ".$data2['data_min'];
|
||||
$subtext_ext .= ", Average: ".$data2['data_avg'];
|
||||
$subtext_ext .= ", Recent: ".$data2['data_last'];
|
||||
|
||||
$legend=array('不复权股价','深证成指',$item_name);
|
||||
#$value=json_encode($data['data']);
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
window.chartConfig = {
|
||||
data: <?php echo json_encode($data['data']); ?>,
|
||||
data2: <?php echo json_encode($data2['data']); ?>,
|
||||
legend: <?php echo json_encode($legend);?>,
|
||||
unit: '<?php echo $unit; ?>',
|
||||
title: '<?php echo $ts_name.'('.$ts_code.')'; ?>',
|
||||
subtitle: '<?php echo $subtext_ext; ?>'
|
||||
};
|
||||
|
||||
</script>
|
||||
<script type="text/javascript" src="../js/chartSix.js?ver=3.141"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
include_once "../inc/getData.inc.php";
|
||||
include_once "../html/headChart.php"; //required after $ts_code and $ts_name,maybe doesn't matter
|
||||
$day_st=$_REQUEST['s']?$_REQUEST['s']:'2006-01-01';
|
||||
$day_end=$_REQUEST['e']?$_REQUEST['e']:date('Y-m-d');
|
||||
#$day_st_='2006-01-01';
|
||||
#$day_end_=date('Y-m-d');
|
||||
$lx=isset($lx)?$lx:$_REQUEST['lx'];
|
||||
$share =$_REQUEST['share'];
|
||||
$share = ($share)?$share:'ShareHDNum';
|
||||
if($share=='ShareHDNum') $unit = '(亿股)';
|
||||
elseif($share=='vPosition') $unit = '(亿元)';
|
||||
elseif($share=='VSRatio') $unit = '(元)';
|
||||
#var_dump($lx);
|
||||
$data=getIndexData('000001.SH',$day_st,$day_end);
|
||||
#$data1=getIndexData('399001.SZ',$day_st,$day_end);
|
||||
$data2=getIhData($lx,$share,$day_st,$day_end);
|
||||
$legend=array('上证综指','深证成指',lxDefine($lx));
|
||||
#$value=json_encode($data['data']);
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
var dom = document.getElementById("container");
|
||||
var myChart = echarts.init(dom,'dark');
|
||||
var app = {};
|
||||
option = null;
|
||||
window.chartConfig = {
|
||||
legend: <?php echo json_encode($legend); ?>,
|
||||
unit: '<?php echo $unit; ?>'
|
||||
};
|
||||
var cfg = window.chartConfig;
|
||||
|
||||
option = {
|
||||
title: {
|
||||
text: cfg.legend[0]+" V.S "+cfg.legend[2],
|
||||
//subtext:"双轴显示",
|
||||
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
|
||||
},
|
||||
{
|
||||
type:'value',
|
||||
name: cfg.legend[2]+cfg.unit, //图例
|
||||
//scale:true,
|
||||
boundaryGap:false,
|
||||
show:true,
|
||||
splitLine:{
|
||||
show:false, //Y2 坐标刻度横线
|
||||
},
|
||||
}
|
||||
],
|
||||
dataZoom: [{
|
||||
type: 'slider', //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:<?php echo json_encode($data['data']); ?>
|
||||
},
|
||||
{
|
||||
name:legend[2],
|
||||
type:'line',
|
||||
yAxisIndex:1,
|
||||
//symbol:'none',
|
||||
smooth:false,
|
||||
data:<?php echo json_encode($data2['data']); ?>
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
if (option && typeof option === "object") {
|
||||
myChart.setOption(option, true);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
include_once "../inc/getBasic.inc.php";
|
||||
$_REQUEST['code']=$_REQUEST['code']?$_REQUEST['code']:'ShareHDNum'; #code:sh sz zx cy
|
||||
$_REQUEST['t_start']=$_REQUEST['t_start']?$_REQUEST['t_start']:'2006-01-01';
|
||||
$_REQUEST['t_end']=$_REQUEST['t_end']?$_REQUEST['t_end']:'';
|
||||
$title="指数VS机构持仓";
|
||||
include_once "../html/head.php";
|
||||
?>
|
||||
<form name="main" id="main" method="get"> <div style="width:100%;text-align:center">
|
||||
指标代码:
|
||||
<select name='code' id='code'>
|
||||
<option value='ShareHDNum'>持股数-亿股</option>
|
||||
<option value='vPosition'>持股金额-亿元</option>
|
||||
<option value='VSRatio'>每股单价-元</option>
|
||||
</select>
|
||||
<script>
|
||||
document.getElementById('code').value='<?=$_REQUEST['code']?>';
|
||||
</script>
|
||||
开始时间: <input type='date' name='t_start' id='t_start' width='30px' value='<?=$_REQUEST['t_start']?>' >
|
||||
结束时间: <input type='date' name='t_end' id='t_end' width='30px' value='<?=$_REQUEST['t_end']?>'>
|
||||
<input type='submit' value="给我查!">
|
||||
<div > </div>
|
||||
<input type='checkbox' id='cb_01' onclick="hideSwitch(this.id,'1')" > 基金
|
||||
<input type='checkbox' id='cb_02' onclick="hideSwitch(this.id,'2')" checked> QFII
|
||||
<input type='checkbox' id='cb_03' onclick="hideSwitch(this.id,'3')" > 社保
|
||||
<input type='checkbox' id='cb_04' onclick="hideSwitch(this.id,'4')" > 券商
|
||||
<input type='checkbox' id='cb_05' onclick="hideSwitch(this.id,'5')" > 保险
|
||||
<input type='checkbox' id='cb_06' onclick="hideSwitch(this.id,'6')" > 信托
|
||||
</div> </form>
|
||||
<div > </div>
|
||||
<!-- https://echart.doorcome.cn/charts/chartThree.php?lx=1&share=vPosition&s=2010-01-01 -->
|
||||
<div style="width:100%; text-align:center;display:None" id='1'>
|
||||
<iframe src="https://echart.doorcome.cn/charts/chartThree.php?s=<?=$_REQUEST['t_start']?>&lx=1&share=<?=$_REQUEST['code']?>&e=<?=$_REQUEST['t_end']?>
|
||||
height="400px" width="1000px"></iframe>
|
||||
<div > </div>
|
||||
</div>
|
||||
<div style="width:100%; text-align:center; display:block;" id='2'>
|
||||
<iframe src="https://echart.doorcome.cn/charts/chartThree.php?s=<?=$_REQUEST['t_start']?>&lx=2&share=<?=$_REQUEST['code']?>&e=<?=$_REQUEST['t_end']?>
|
||||
height="400px" width="1000px"></iframe>
|
||||
<div > </div>
|
||||
</div>
|
||||
<div style="width:100%; text-align:center; display:None;" id='3'>
|
||||
<iframe src="https://echart.doorcome.cn/charts/chartThree.php?s=<?=$_REQUEST['t_start']?>&lx=3&share=<?=$_REQUEST['code']?>&e=<?=$_REQUEST['t_end']?>
|
||||
height="400px" width="1000px"></iframe>
|
||||
</div>
|
||||
<div > </div>
|
||||
<div style="width:100%; text-align:center; display:None;" id='4'>
|
||||
<iframe src="https://echart.doorcome.cn/charts/chartThree.php?s=<?=$_REQUEST['t_start']?>&lx=4&share=<?=$_REQUEST['code']?>&e=<?=$_REQUEST['t_end']?>
|
||||
height="400px" width="1000px"></iframe>
|
||||
</div>
|
||||
<div > </div>
|
||||
<div style="width:100%; text-align:center; display:None;" id='5'>
|
||||
<iframe src="https://echart.doorcome.cn/charts/chartThree.php?s=<?=$_REQUEST['t_start']?>&lx=5&share=<?=$_REQUEST['code']?>&e=<?=$_REQUEST['t_end']?>
|
||||
height="400px" width="1000px"></iframe>
|
||||
</div>
|
||||
<div > </div>
|
||||
<div style="width:100%; text-align:center; display:None;" id='6'>
|
||||
<iframe src="https://echart.doorcome.cn/charts/chartThree.php?s=<?=$_REQUEST['t_start']?>&lx=6&share=<?=$_REQUEST['code']?>&e=<?=$_REQUEST['t_end']?>
|
||||
height="400px" width="1000px"></iframe>
|
||||
</div>
|
||||
<?php include_once "../html/footer.php"; ?>
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
include_once "../inc/getBasic.inc.php";
|
||||
$_REQUEST['ts_code']=$_REQUEST['ts_code']?$_REQUEST['ts_code']:'000001';
|
||||
$_REQUEST['t_start']=$_REQUEST['t_start']?$_REQUEST['t_start']:'2015-01-01';
|
||||
$_REQUEST['t_end']=$_REQUEST['t_end']?$_REQUEST['t_end']:'';
|
||||
$ts_name = tscodeToName(ts_code_conv($_REQUEST['ts_code']));
|
||||
$title="股价VS机构持仓趋势:".$ts_name.'('.$_REQUEST['ts_code'].')';
|
||||
include_once "../html/head.php";
|
||||
?>
|
||||
|
||||
<form name="main" id="main" method="get"> <div style="width:100%;text-align:center">
|
||||
股票代码: <input type='text' name='ts_code' id='ts_code' width="30px" value='<?=$_REQUEST['ts_code']?>' >
|
||||
|
||||
开始时间: <input type='date' name='t_start' id='t_start' width='30px' value='<?=$_REQUEST['t_start']?>'>
|
||||
结束时间: <input type='date' name='t_end' id='t_end' width='30px' value='<?=$_REQUEST['t_end']?>' >
|
||||
<input type='submit' value="给我查!">
|
||||
<div > </div>
|
||||
<input type='checkbox' id='cb_f9' onclick="hideSwitch(this.id,'F9')" checked> 持股数
|
||||
<input type='checkbox' id='cb_f10' onclick="hideSwitch(this.id,'F10')" checked> 持股金额
|
||||
<input type='checkbox' id='cb_f11' onclick="hideSwitch(this.id,'F11')" checked> 占流通股比例
|
||||
<input type='checkbox' id='cb_f12' onclick="hideSwitch(this.id,'F12')" checked> 占总股本比例
|
||||
</div> </form>
|
||||
<div > </div>
|
||||
|
||||
<div style="width:100%; text-align:center" id='F9'>
|
||||
<iframe src="https://echart.doorcome.cn/charts/chartSix.php?s=<?=$_REQUEST['t_start']?>&item=F9&ts_code=<?=$_REQUEST['ts_code']?>&e=<?=$_REQUEST['t_end']?>
|
||||
height="400px" width="1000px"></iframe>
|
||||
</div>
|
||||
<div > </div>
|
||||
<div style="width:100%; text-align:center; " id='F10'>
|
||||
<iframe src="https://echart.doorcome.cn/charts/chartSix.php?s=<?=$_REQUEST['t_start']?>&item=F10&ts_code=<?=$_REQUEST['ts_code']?>&e=<?=$_REQUEST['t_end']?>
|
||||
height="400px" width="1000px"></iframe>
|
||||
</div>
|
||||
<div > </div>
|
||||
<div style="width:100%; text-align:center; " id='F11'>
|
||||
<iframe src="https://echart.doorcome.cn/charts/chartSix.php?s=<?=$_REQUEST['t_start']?>&item=F11&ts_code=<?=$_REQUEST['ts_code']?>&e=<?=$_REQUEST['t_end']?>
|
||||
height="400px" width="1000px"></iframe>
|
||||
</div>
|
||||
<div style="width:100%; text-align:center; " id='F12'>
|
||||
<iframe src="https://echart.doorcome.cn/charts/chartSix.php?s=<?=$_REQUEST['t_start']?>&item=F12&ts_code=<?=$_REQUEST['ts_code']?>&e=<?=$_REQUEST['t_end']?>
|
||||
height="400px" width="1000px"></iframe>
|
||||
</div>
|
||||
<div > </div>
|
||||
<?php include_once "../html/footer.php"; ?>
|
||||
|
||||
Reference in New Issue
Block a user