提交 915b5e6b 编写于 作者: HQChart's avatar HQChart

ver 8537

8536 修正 ZoomUp(), ZoomDown() 数据不够一屏的时候K线 显示不正确
上级 549d8d73
......@@ -240,11 +240,15 @@ React 例子:[demo-react.md](/教程/demo-react.md) <br>
7. [HQChart实战教程7-自定义显示手势点击K线显示信息](https://blog.csdn.net/jones2000/article/details/104168610) <br>
8. [HQChart实战教程8-如何手动重新初始化hqchart](https://blog.csdn.net/jones2000/article/details/105302626)<br>
9. [HQChart实战教程9-自定义A股分时图](https://blog.csdn.net/jones2000/article/details/105587559) <br>
10. [HQChart实战教程10-全ws数据对接HQChart(数字货币对接实战)(付费文章)](https://blog.csdn.net/jones2000/article/details/105698038) <br>
11. [HQChart实战教程11-火币网ws数据对接(付费文章)](https://blog.csdn.net/jones2000/article/details/105721190) <br>
12. [HQChart实战教程12-火币网ws数据对接分时图(付费文章)](https://blog.csdn.net/jones2000/article/details/105756659) <br>
13. [HQChart实战教程13-火币网ws数据对接K线(uniapp)(付费文章)](https://blog.csdn.net/jones2000/article/details/105804461)<br>
14. [HQChart实战教程14-K线图对接第3方http/https数据教程整理](https://blog.csdn.net/jones2000/article/details/106064879)<br>
10. [HQChart实战教程14-K线图对接第3方http/https数据教程整理](https://blog.csdn.net/jones2000/article/details/106064879)<br>
## 火币对接完整教程(付费文章)
1. [HQChart实战教程10-全ws数据对接HQChart(数字货币对接实战)](https://blog.csdn.net/jones2000/article/details/105698038) <br>
2. [HQChart实战教程11-火币网ws数据对接](https://blog.csdn.net/jones2000/article/details/105721190) <br>
3. [HQChart实战教程12-火币网ws数据对接分时图](https://blog.csdn.net/jones2000/article/details/105756659) <br>
4. [HQChart实战教程13-火币网ws数据对接K线(uniapp)](https://blog.csdn.net/jones2000/article/details/105804461)<br>
5. [HQChart实战教程15-火币网ws数据对接拖拽下载历史K线图](https://blog.csdn.net/jones2000/article/details/106205584)<br>
6. [HQChart实战教程16-K线图风格配色篇-仿火币网H5配色](https://blog.csdn.net/jones2000/article/details/106226272)<br>
## 设计文档:
......
......@@ -8996,6 +8996,7 @@ function KLineFrame()
var xPointCount=this.CalculateCount(this.ZoomIndex-1);
JSConsole.Chart.Log(`[KLineFrame::ZoomUp] old status. XPointCount=${xPointCount} ZoomIndex=${this.ZoomIndex} DataCount= ${this.Data.Data.length} rightSpaceCount=${rightSpaceCount}`);
var isShowAll=false;
--this.ZoomIndex;
if (cursorIndex.IsLockRight==true) //固定右边
{
......@@ -9016,10 +9017,10 @@ function KLineFrame()
}
else if (xPointCount>=maxDataCount)
{
xPointCount=maxDataCount;
this.XPointCount=xPointCount;
//xPointCount=maxDataCount;
//this.XPointCount=xPointCount;
this.Data.DataOffset=0;
isShowAll=true;
JSConsole.Chart.Log(`[KLineFrame::ZoomUp] Show all data. XPointCount=${xPointCount} ZoomIndex=${this.ZoomIndex} DataCount= ${dataCount}`);
}
else
......@@ -9042,8 +9043,11 @@ function KLineFrame()
this.DataWidth = ZOOM_SEED[this.ZoomIndex][0];
this.DistanceWidth = ZOOM_SEED[this.ZoomIndex][1];
var width=this.GetFrameWidth()-g_JSChartResource.FrameMargin;
this.TrimKLineDataWidth(width);
if (!isShowAll)
{
var width=this.GetFrameWidth()-g_JSChartResource.FrameMargin;
this.TrimKLineDataWidth(width);
}
this.LastCalculateStatus.XPointCount=this.XPointCount;
cursorIndex.Index=lastCursorIndex-this.Data.DataOffset;
......@@ -9056,7 +9060,7 @@ function KLineFrame()
if (this.Data.DataOffset<0) return false;
var dataCount=this.Data.Data.length;
var maxDataCount=dataCount+this.RightSpaceCount;
if (this.XPointCount>=dataCount) return false;
//if (this.XPointCount>=maxDataCount) return false;
var rightSpaceCount=0;
var lastDataIndex = this.Data.DataOffset + this.XPointCount - 1; //最右边的数据索引
......@@ -9072,6 +9076,7 @@ function KLineFrame()
JSConsole.Chart.Log(`[KLineFrame::ZoomDown] old status. XPointCount=${xPointCount} ZoomIndex=${this.ZoomIndex} DataCount= ${this.Data.Data.length} lastCursorIndex=${lastCursorIndex} rightSpaceCount=${rightSpaceCount}`);
var isShowAll=false;
++this.ZoomIndex;
if (cursorIndex.IsLockRight==true) //固定右边
{
......@@ -9092,10 +9097,10 @@ function KLineFrame()
}
else if (xPointCount>=maxDataCount)
{
xPointCount=maxDataCount;
this.XPointCount=xPointCount;
//xPointCount=maxDataCount;
//this.XPointCount=xPointCount;
this.Data.DataOffset=0;
isShowAll=true; //数据铺满全屏, 不需要调整宽度
JSConsole.Chart.Log(`[KLineFrame::ZoomDown] Show all data. XPointCount=${xPointCount} ZoomIndex=${this.ZoomIndex} DataCount= ${dataCount}`);
}
else
......@@ -9119,8 +9124,11 @@ function KLineFrame()
this.DataWidth = ZOOM_SEED[this.ZoomIndex][0];
this.DistanceWidth = ZOOM_SEED[this.ZoomIndex][1];
var width=this.GetFrameWidth()-g_JSChartResource.FrameMargin;
this.TrimKLineDataWidth(width);
if (!isShowAll)
{
var width=this.GetFrameWidth()-g_JSChartResource.FrameMargin;
this.TrimKLineDataWidth(width);
}
this.LastCalculateStatus.XPointCount=this.XPointCount;
cursorIndex.Index=lastCursorIndex-this.Data.DataOffset;
......@@ -5376,6 +5376,7 @@ function KLineFrame()
var xPointCount=this.CalculateCount(this.ZoomIndex-1);
JSConsole.Chart.Log(`[KLineFrame::ZoomUp] old status. XPointCount=${xPointCount} ZoomIndex=${this.ZoomIndex} DataCount= ${this.Data.Data.length} rightSpaceCount=${rightSpaceCount}`);
var isShowAll=false;
--this.ZoomIndex;
if (cursorIndex.IsLockRight==true) //固定右边
{
......@@ -5396,10 +5397,10 @@ function KLineFrame()
}
else if (xPointCount>=maxDataCount)
{
xPointCount=maxDataCount;
this.XPointCount=xPointCount;
//xPointCount=maxDataCount;
//this.XPointCount=xPointCount;
this.Data.DataOffset=0;
isShowAll=true;
JSConsole.Chart.Log(`[KLineFrame::ZoomUp] Show all data. XPointCount=${xPointCount} ZoomIndex=${this.ZoomIndex} DataCount= ${dataCount}`);
}
else
......@@ -5422,8 +5423,11 @@ function KLineFrame()
this.DataWidth = ZOOM_SEED[this.ZoomIndex][0];
this.DistanceWidth = ZOOM_SEED[this.ZoomIndex][1];
var width=this.GetFrameWidth()-g_JSChartResource.FrameMargin;
this.TrimKLineDataWidth(width);
if (!isShowAll)
{
var width=this.GetFrameWidth()-g_JSChartResource.FrameMargin;
this.TrimKLineDataWidth(width);
}
this.LastCalculateStatus.XPointCount=this.XPointCount;
cursorIndex.Index=lastCursorIndex-this.Data.DataOffset;
......@@ -5436,7 +5440,7 @@ function KLineFrame()
if (this.Data.DataOffset<0) return false;
var dataCount=this.Data.Data.length;
var maxDataCount=dataCount+this.RightSpaceCount;
if (this.XPointCount>=dataCount) return false;
//if (this.XPointCount>=maxDataCount) return false;
var rightSpaceCount=0;
var lastDataIndex = this.Data.DataOffset + this.XPointCount - 1; //最右边的数据索引
......@@ -5452,6 +5456,7 @@ function KLineFrame()
JSConsole.Chart.Log(`[KLineFrame::ZoomDown] old status. XPointCount=${xPointCount} ZoomIndex=${this.ZoomIndex} DataCount= ${this.Data.Data.length} lastCursorIndex=${lastCursorIndex} rightSpaceCount=${rightSpaceCount}`);
var isShowAll=false;
++this.ZoomIndex;
if (cursorIndex.IsLockRight==true) //固定右边
{
......@@ -5472,10 +5477,10 @@ function KLineFrame()
}
else if (xPointCount>=maxDataCount)
{
xPointCount=maxDataCount;
this.XPointCount=xPointCount;
//xPointCount=maxDataCount;
//this.XPointCount=xPointCount;
this.Data.DataOffset=0;
isShowAll=true; //数据铺满全屏, 不需要调整宽度
JSConsole.Chart.Log(`[KLineFrame::ZoomDown] Show all data. XPointCount=${xPointCount} ZoomIndex=${this.ZoomIndex} DataCount= ${dataCount}`);
}
else
......@@ -5499,8 +5504,11 @@ function KLineFrame()
this.DataWidth = ZOOM_SEED[this.ZoomIndex][0];
this.DistanceWidth = ZOOM_SEED[this.ZoomIndex][1];
var width=this.GetFrameWidth()-g_JSChartResource.FrameMargin;
this.TrimKLineDataWidth(width);
if (!isShowAll)
{
var width=this.GetFrameWidth()-g_JSChartResource.FrameMargin;
this.TrimKLineDataWidth(width);
}
this.LastCalculateStatus.XPointCount=this.XPointCount;
cursorIndex.Index=lastCursorIndex-this.Data.DataOffset;
......@@ -9040,6 +9040,7 @@ function KLineFrame()
var xPointCount=this.CalculateCount(this.ZoomIndex-1);
JSConsole.Chart.Log(`[KLineFrame::ZoomUp] old status. XPointCount=${xPointCount} ZoomIndex=${this.ZoomIndex} DataCount= ${this.Data.Data.length} rightSpaceCount=${rightSpaceCount}`);
var isShowAll=false;
--this.ZoomIndex;
if (cursorIndex.IsLockRight==true) //固定右边
{
......@@ -9060,10 +9061,10 @@ function KLineFrame()
}
else if (xPointCount>=maxDataCount)
{
xPointCount=maxDataCount;
this.XPointCount=xPointCount;
//xPointCount=maxDataCount;
//this.XPointCount=xPointCount;
this.Data.DataOffset=0;
isShowAll=true;
JSConsole.Chart.Log(`[KLineFrame::ZoomUp] Show all data. XPointCount=${xPointCount} ZoomIndex=${this.ZoomIndex} DataCount= ${dataCount}`);
}
else
......@@ -9086,8 +9087,11 @@ function KLineFrame()
this.DataWidth = ZOOM_SEED[this.ZoomIndex][0];
this.DistanceWidth = ZOOM_SEED[this.ZoomIndex][1];
var width=this.GetFrameWidth()-g_JSChartResource.FrameMargin;
this.TrimKLineDataWidth(width);
if (!isShowAll)
{
var width=this.GetFrameWidth()-g_JSChartResource.FrameMargin;
this.TrimKLineDataWidth(width);
}
this.LastCalculateStatus.XPointCount=this.XPointCount;
cursorIndex.Index=lastCursorIndex-this.Data.DataOffset;
......@@ -9100,7 +9104,7 @@ function KLineFrame()
if (this.Data.DataOffset<0) return false;
var dataCount=this.Data.Data.length;
var maxDataCount=dataCount+this.RightSpaceCount;
if (this.XPointCount>=dataCount) return false;
//if (this.XPointCount>=maxDataCount) return false;
var rightSpaceCount=0;
var lastDataIndex = this.Data.DataOffset + this.XPointCount - 1; //最右边的数据索引
......@@ -9116,6 +9120,7 @@ function KLineFrame()
JSConsole.Chart.Log(`[KLineFrame::ZoomDown] old status. XPointCount=${xPointCount} ZoomIndex=${this.ZoomIndex} DataCount= ${this.Data.Data.length} lastCursorIndex=${lastCursorIndex} rightSpaceCount=${rightSpaceCount}`);
var isShowAll=false;
++this.ZoomIndex;
if (cursorIndex.IsLockRight==true) //固定右边
{
......@@ -9136,10 +9141,10 @@ function KLineFrame()
}
else if (xPointCount>=maxDataCount)
{
xPointCount=maxDataCount;
this.XPointCount=xPointCount;
//xPointCount=maxDataCount;
//this.XPointCount=xPointCount;
this.Data.DataOffset=0;
isShowAll=true; //数据铺满全屏, 不需要调整宽度
JSConsole.Chart.Log(`[KLineFrame::ZoomDown] Show all data. XPointCount=${xPointCount} ZoomIndex=${this.ZoomIndex} DataCount= ${dataCount}`);
}
else
......@@ -9163,8 +9168,11 @@ function KLineFrame()
this.DataWidth = ZOOM_SEED[this.ZoomIndex][0];
this.DistanceWidth = ZOOM_SEED[this.ZoomIndex][1];
var width=this.GetFrameWidth()-g_JSChartResource.FrameMargin;
this.TrimKLineDataWidth(width);
if (!isShowAll)
{
var width=this.GetFrameWidth()-g_JSChartResource.FrameMargin;
this.TrimKLineDataWidth(width);
}
this.LastCalculateStatus.XPointCount=this.XPointCount;
cursorIndex.Index=lastCursorIndex-this.Data.DataOffset;
......@@ -5376,6 +5376,7 @@ function KLineFrame()
var xPointCount=this.CalculateCount(this.ZoomIndex-1);
JSConsole.Chart.Log(`[KLineFrame::ZoomUp] old status. XPointCount=${xPointCount} ZoomIndex=${this.ZoomIndex} DataCount= ${this.Data.Data.length} rightSpaceCount=${rightSpaceCount}`);
var isShowAll=false;
--this.ZoomIndex;
if (cursorIndex.IsLockRight==true) //固定右边
{
......@@ -5396,10 +5397,10 @@ function KLineFrame()
}
else if (xPointCount>=maxDataCount)
{
xPointCount=maxDataCount;
this.XPointCount=xPointCount;
//xPointCount=maxDataCount;
//this.XPointCount=xPointCount;
this.Data.DataOffset=0;
isShowAll=true;
JSConsole.Chart.Log(`[KLineFrame::ZoomUp] Show all data. XPointCount=${xPointCount} ZoomIndex=${this.ZoomIndex} DataCount= ${dataCount}`);
}
else
......@@ -5422,8 +5423,11 @@ function KLineFrame()
this.DataWidth = ZOOM_SEED[this.ZoomIndex][0];
this.DistanceWidth = ZOOM_SEED[this.ZoomIndex][1];
var width=this.GetFrameWidth()-g_JSChartResource.FrameMargin;
this.TrimKLineDataWidth(width);
if (!isShowAll)
{
var width=this.GetFrameWidth()-g_JSChartResource.FrameMargin;
this.TrimKLineDataWidth(width);
}
this.LastCalculateStatus.XPointCount=this.XPointCount;
cursorIndex.Index=lastCursorIndex-this.Data.DataOffset;
......@@ -5436,7 +5440,7 @@ function KLineFrame()
if (this.Data.DataOffset<0) return false;
var dataCount=this.Data.Data.length;
var maxDataCount=dataCount+this.RightSpaceCount;
if (this.XPointCount>=dataCount) return false;
//if (this.XPointCount>=maxDataCount) return false;
var rightSpaceCount=0;
var lastDataIndex = this.Data.DataOffset + this.XPointCount - 1; //最右边的数据索引
......@@ -5452,6 +5456,7 @@ function KLineFrame()
JSConsole.Chart.Log(`[KLineFrame::ZoomDown] old status. XPointCount=${xPointCount} ZoomIndex=${this.ZoomIndex} DataCount= ${this.Data.Data.length} lastCursorIndex=${lastCursorIndex} rightSpaceCount=${rightSpaceCount}`);
var isShowAll=false;
++this.ZoomIndex;
if (cursorIndex.IsLockRight==true) //固定右边
{
......@@ -5472,10 +5477,10 @@ function KLineFrame()
}
else if (xPointCount>=maxDataCount)
{
xPointCount=maxDataCount;
this.XPointCount=xPointCount;
//xPointCount=maxDataCount;
//this.XPointCount=xPointCount;
this.Data.DataOffset=0;
isShowAll=true; //数据铺满全屏, 不需要调整宽度
JSConsole.Chart.Log(`[KLineFrame::ZoomDown] Show all data. XPointCount=${xPointCount} ZoomIndex=${this.ZoomIndex} DataCount= ${dataCount}`);
}
else
......@@ -5499,8 +5504,11 @@ function KLineFrame()
this.DataWidth = ZOOM_SEED[this.ZoomIndex][0];
this.DistanceWidth = ZOOM_SEED[this.ZoomIndex][1];
var width=this.GetFrameWidth()-g_JSChartResource.FrameMargin;
this.TrimKLineDataWidth(width);
if (!isShowAll)
{
var width=this.GetFrameWidth()-g_JSChartResource.FrameMargin;
this.TrimKLineDataWidth(width);
}
this.LastCalculateStatus.XPointCount=this.XPointCount;
cursorIndex.Index=lastCursorIndex-this.Data.DataOffset;
......@@ -5376,6 +5376,7 @@ function KLineFrame()
var xPointCount=this.CalculateCount(this.ZoomIndex-1);
JSConsole.Chart.Log(`[KLineFrame::ZoomUp] old status. XPointCount=${xPointCount} ZoomIndex=${this.ZoomIndex} DataCount= ${this.Data.Data.length} rightSpaceCount=${rightSpaceCount}`);
var isShowAll=false;
--this.ZoomIndex;
if (cursorIndex.IsLockRight==true) //固定右边
{
......@@ -5396,10 +5397,10 @@ function KLineFrame()
}
else if (xPointCount>=maxDataCount)
{
xPointCount=maxDataCount;
this.XPointCount=xPointCount;
//xPointCount=maxDataCount;
//this.XPointCount=xPointCount;
this.Data.DataOffset=0;
isShowAll=true;
JSConsole.Chart.Log(`[KLineFrame::ZoomUp] Show all data. XPointCount=${xPointCount} ZoomIndex=${this.ZoomIndex} DataCount= ${dataCount}`);
}
else
......@@ -5422,8 +5423,11 @@ function KLineFrame()
this.DataWidth = ZOOM_SEED[this.ZoomIndex][0];
this.DistanceWidth = ZOOM_SEED[this.ZoomIndex][1];
var width=this.GetFrameWidth()-g_JSChartResource.FrameMargin;
this.TrimKLineDataWidth(width);
if (!isShowAll)
{
var width=this.GetFrameWidth()-g_JSChartResource.FrameMargin;
this.TrimKLineDataWidth(width);
}
this.LastCalculateStatus.XPointCount=this.XPointCount;
cursorIndex.Index=lastCursorIndex-this.Data.DataOffset;
......@@ -5436,7 +5440,7 @@ function KLineFrame()
if (this.Data.DataOffset<0) return false;
var dataCount=this.Data.Data.length;
var maxDataCount=dataCount+this.RightSpaceCount;
if (this.XPointCount>=dataCount) return false;
//if (this.XPointCount>=maxDataCount) return false;
var rightSpaceCount=0;
var lastDataIndex = this.Data.DataOffset + this.XPointCount - 1; //最右边的数据索引
......@@ -5452,6 +5456,7 @@ function KLineFrame()
JSConsole.Chart.Log(`[KLineFrame::ZoomDown] old status. XPointCount=${xPointCount} ZoomIndex=${this.ZoomIndex} DataCount= ${this.Data.Data.length} lastCursorIndex=${lastCursorIndex} rightSpaceCount=${rightSpaceCount}`);
var isShowAll=false;
++this.ZoomIndex;
if (cursorIndex.IsLockRight==true) //固定右边
{
......@@ -5472,10 +5477,10 @@ function KLineFrame()
}
else if (xPointCount>=maxDataCount)
{
xPointCount=maxDataCount;
this.XPointCount=xPointCount;
//xPointCount=maxDataCount;
//this.XPointCount=xPointCount;
this.Data.DataOffset=0;
isShowAll=true; //数据铺满全屏, 不需要调整宽度
JSConsole.Chart.Log(`[KLineFrame::ZoomDown] Show all data. XPointCount=${xPointCount} ZoomIndex=${this.ZoomIndex} DataCount= ${dataCount}`);
}
else
......@@ -5499,8 +5504,11 @@ function KLineFrame()
this.DataWidth = ZOOM_SEED[this.ZoomIndex][0];
this.DistanceWidth = ZOOM_SEED[this.ZoomIndex][1];
var width=this.GetFrameWidth()-g_JSChartResource.FrameMargin;
this.TrimKLineDataWidth(width);
if (!isShowAll)
{
var width=this.GetFrameWidth()-g_JSChartResource.FrameMargin;
this.TrimKLineDataWidth(width);
}
this.LastCalculateStatus.XPointCount=this.XPointCount;
cursorIndex.Index=lastCursorIndex-this.Data.DataOffset;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册