Refactor the layout
This commit is contained in:
+44
-13
@@ -294,16 +294,6 @@
|
|||||||
<input class="form-check-input" type="checkbox" id="showMacd" checked>
|
<input class="form-check-input" type="checkbox" id="showMacd" checked>
|
||||||
<label class="form-check-label" for="showMacd">MACD</label>
|
<label class="form-check-label" for="showMacd">MACD</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" id="showKlcFxType">
|
|
||||||
<label class="form-check-label" for="showKlcFxType">分型类型</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 添加小周期分型显示控制 -->
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" id="showElementKlcFxType" checked>
|
|
||||||
<label class="form-check-label" for="showElementKlcFxType">小周期分型</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-check form-check-inline">
|
<div class="form-check form-check-inline">
|
||||||
<input class="form-check-input" type="checkbox" id="showTradePoints" checked>
|
<input class="form-check-input" type="checkbox" id="showTradePoints" checked>
|
||||||
@@ -328,6 +318,14 @@
|
|||||||
<input class="form-check-input" type="checkbox" id="showMainUncompletedZs" checked>
|
<input class="form-check-input" type="checkbox" id="showMainUncompletedZs" checked>
|
||||||
<label class="form-check-label" for="showMainUncompletedZs">未完成中枢</label>
|
<label class="form-check-label" for="showMainUncompletedZs">未完成中枢</label>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-check form-check-inline">
|
||||||
|
<input class="form-check-input" type="checkbox" id="showMainMacdDiv" checked>
|
||||||
|
<label class="form-check-label" for="showMainMacdDiv">MACD背离</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check form-check-inline">
|
||||||
|
<input class="form-check-input" type="checkbox" id="showKlcFxType">
|
||||||
|
<label class="form-check-label" for="showKlcFxType">分型类型</label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex align-items-center mt-2">
|
<div class="d-flex align-items-center mt-2">
|
||||||
<label class="form-label me-3 mb-0">次周期:</label>
|
<label class="form-label me-3 mb-0">次周期:</label>
|
||||||
@@ -347,6 +345,14 @@
|
|||||||
<input class="form-check-input" type="checkbox" id="showElementUncompletedZs" checked>
|
<input class="form-check-input" type="checkbox" id="showElementUncompletedZs" checked>
|
||||||
<label class="form-check-label" for="showElementUncompletedZs">未完成中枢</label>
|
<label class="form-check-label" for="showElementUncompletedZs">未完成中枢</label>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-check form-check-inline">
|
||||||
|
<input class="form-check-input" type="checkbox" id="showElementMacdDiv" checked>
|
||||||
|
<label class="form-check-label" for="showElementMacdDiv">MACD背离</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check form-check-inline">
|
||||||
|
<input class="form-check-input" type="checkbox" id="showElementKlcFxType" checked>
|
||||||
|
<label class="form-check-label" for="showElementKlcFxType">分型类型</label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
@@ -1556,7 +1562,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 在笔的末端添加macd_div值标记
|
// 在笔的末端添加macd_div值标记
|
||||||
if (bi.macd_div && bi.macd_div !== 0) {
|
if (bi.macd_div && bi.macd_div !== 0 && $('#showMainMacdDiv').is(':checked')) {
|
||||||
console.log(`添加macd_div标记: ${bi.macd_div.toFixed(2)}, 在时间点: ${endTime}`);
|
console.log(`添加macd_div标记: ${bi.macd_div.toFixed(2)}, 在时间点: ${endTime}`);
|
||||||
|
|
||||||
const macdDivLabel = mainChart.addLineSeries({
|
const macdDivLabel = mainChart.addLineSeries({
|
||||||
@@ -1635,7 +1641,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 在笔的末端添加macd_div值标记
|
// 在笔的末端添加macd_div值标记
|
||||||
if (bi.macd_div && bi.macd_div !== 0) {
|
if (bi.macd_div && bi.macd_div !== 0 && $('#showElementMacdDiv').is(':checked')) {
|
||||||
console.log(`添加元素周期macd_div标记: ${bi.macd_div.toFixed(2)}, 在时间点: ${endTime}`);
|
console.log(`添加元素周期macd_div标记: ${bi.macd_div.toFixed(2)}, 在时间点: ${endTime}`);
|
||||||
|
|
||||||
const macdDivLabel = mainChart.addLineSeries({
|
const macdDivLabel = mainChart.addLineSeries({
|
||||||
@@ -3796,9 +3802,34 @@
|
|||||||
updateTables(data);
|
updateTables(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function refreshChartOnly() {
|
||||||
|
// 仅使用当前数据刷新图表显示,不从服务器加载新数据
|
||||||
|
if (currentData) {
|
||||||
|
console.log('仅刷新图表显示,不重新获取数据');
|
||||||
|
refreshChart(currentData);
|
||||||
|
} else {
|
||||||
|
console.log('没有当前数据,无法刷新显示');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 绑定MACD显示开关
|
||||||
|
$('#showMacd').change(function() {
|
||||||
|
updateChart();
|
||||||
|
});
|
||||||
|
|
||||||
|
// 绑定主周期MACD背离显示开关
|
||||||
|
$('#showMainMacdDiv').change(function() {
|
||||||
|
refreshChartOnly();
|
||||||
|
});
|
||||||
|
|
||||||
|
// 绑定次周期MACD背离显示开关
|
||||||
|
$('#showElementMacdDiv').change(function() {
|
||||||
|
refreshChartOnly();
|
||||||
|
});
|
||||||
|
|
||||||
// 绑定分型类型显示开关
|
// 绑定分型类型显示开关
|
||||||
$('#showKlcFxType').change(function() {
|
$('#showKlcFxType').change(function() {
|
||||||
refreshChart(currentData);
|
updateChart();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 绑定小周期分型显示开关
|
// 绑定小周期分型显示开关
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user