hqchart 1.1.14696 → 1.1.14711
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4569,6 +4569,15 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4569
4569
|
}
|
|
4570
4570
|
}
|
|
4571
4571
|
|
|
4572
|
+
if (option.FastSlide)
|
|
4573
|
+
{
|
|
4574
|
+
var item=option.FastSlide;
|
|
4575
|
+
if (IFrameSplitOperator.IsNumber(item.MinDistance)) chart.FastSlideConfig.MinDistance=item.MinDistance;
|
|
4576
|
+
if (IFrameSplitOperator.IsNumber(item.MinSpeed)) chart.FastSlideConfig.MinSpeed=item.MinSpeed;
|
|
4577
|
+
if (IFrameSplitOperator.IsNumber(item.MaxTime)) chart.FastSlideConfig.MaxTime=item.MaxTime;
|
|
4578
|
+
if (IFrameSplitOperator.IsBool(item.Enable)) chart.FastSlideConfig.Enable=item.Enable;
|
|
4579
|
+
}
|
|
4580
|
+
|
|
4572
4581
|
if (chart.ClassName=="KLineChartContainer")
|
|
4573
4582
|
{
|
|
4574
4583
|
if (!option.DragSelectRect)
|
|
@@ -4637,6 +4646,12 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4637
4646
|
if (IFrameSplitOperator.IsBool(item.RightButton.Enable)) chart.ChartCorssCursor.RightButton.Enable=item.RightButton.Enable;
|
|
4638
4647
|
}
|
|
4639
4648
|
|
|
4649
|
+
if (item.BottomButton)
|
|
4650
|
+
{
|
|
4651
|
+
var subItem=item.BottomButton;
|
|
4652
|
+
if (IFrameSplitOperator.IsBool(subItem.Enable)) chart.ChartCorssCursor.BottomButton.Enable=subItem.Enable;
|
|
4653
|
+
}
|
|
4654
|
+
|
|
4640
4655
|
if (IFrameSplitOperator.IsNumber(item.PriceFormatType)) chart.ChartCorssCursor.StringFormatY.PriceFormatType=item.PriceFormatType;
|
|
4641
4656
|
if (IFrameSplitOperator.IsNumber(item.DataFormatType)) chart.ChartCorssCursor.StringFormatY.DataFormatType=item.DataFormatType;
|
|
4642
4657
|
if (IFrameSplitOperator.IsBool(item.EnableKeyboard)) chart.ChartCorssCursor.EnableKeyboard=item.EnableKeyboard;
|
|
@@ -4738,7 +4753,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4738
4753
|
if(option.KLineTitle.IsShowName==false) chart.TitlePaint[0].IsShowName=false;
|
|
4739
4754
|
if(option.KLineTitle.IsShowSettingInfo==false) chart.TitlePaint[0].IsShowSettingInfo=false;
|
|
4740
4755
|
if(option.KLineTitle.IsShow == false) chart.TitlePaint[0].IsShow = false;
|
|
4741
|
-
if(IFrameSplitOperator.IsBool(item.
|
|
4756
|
+
if (IFrameSplitOperator.IsBool(item.IsShowDateTime)) chartTitle.IsShowDateTime=item.IsShowDateTime;
|
|
4757
|
+
if (IFrameSplitOperator.IsBool(item.IsTitleShowLatestData)) chart.IsTitleShowLatestData=item.IsTitleShowLatestData;
|
|
4742
4758
|
|
|
4743
4759
|
if (item.ShowPosition || item.ShowPostion) //显示位置高级配置
|
|
4744
4760
|
{
|
|
@@ -5121,6 +5137,15 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5121
5137
|
if (IFrameSplitOperator.IsNumber(item.WheelYMove)) chart.EnableYDrag.WheelYMove=item.WheelYMove;
|
|
5122
5138
|
}
|
|
5123
5139
|
|
|
5140
|
+
if (option.FastSlide)
|
|
5141
|
+
{
|
|
5142
|
+
var item=option.FastSlide;
|
|
5143
|
+
if (IFrameSplitOperator.IsNumber(item.MinDistance)) chart.FastSlideConfig.MinDistance=item.MinDistance;
|
|
5144
|
+
if (IFrameSplitOperator.IsNumber(item.MinSpeed)) chart.FastSlideConfig.MinSpeed=item.MinSpeed;
|
|
5145
|
+
if (IFrameSplitOperator.IsNumber(item.MaxTime)) chart.FastSlideConfig.MaxTime=item.MaxTime;
|
|
5146
|
+
if (IFrameSplitOperator.IsBool(item.Enable)) chart.FastSlideConfig.Enable=item.Enable;
|
|
5147
|
+
}
|
|
5148
|
+
|
|
5124
5149
|
//分页
|
|
5125
5150
|
if (option.PageInfo) chart.SetPageInfo(option.PageInfo);
|
|
5126
5151
|
|
|
@@ -5142,6 +5167,12 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5142
5167
|
if (IFrameSplitOperator.IsBool(item.RightButton.Enable)) chart.ChartCorssCursor.RightButton.Enable=item.RightButton.Enable;
|
|
5143
5168
|
}
|
|
5144
5169
|
|
|
5170
|
+
if (item.BottomButton)
|
|
5171
|
+
{
|
|
5172
|
+
var subItem=item.BottomButton;
|
|
5173
|
+
if (IFrameSplitOperator.IsBool(subItem.Enable)) chart.ChartCorssCursor.BottomButton.Enable=subItem.Enable;
|
|
5174
|
+
}
|
|
5175
|
+
|
|
5145
5176
|
if (IFrameSplitOperator.IsNumber(item.PriceFormatType)) chart.ChartCorssCursor.StringFormatY.PriceFormatType=item.PriceFormatType;
|
|
5146
5177
|
if (IFrameSplitOperator.IsNumber(item.DataFormatType)) chart.ChartCorssCursor.StringFormatY.DataFormatType=item.DataFormatType;
|
|
5147
5178
|
|
|
@@ -6879,7 +6910,9 @@ var JSCHART_EVENT_ID=
|
|
|
6879
6910
|
|
|
6880
6911
|
ON_FORMAT_OVERLAY_INDEX_OUT_TEXT:168, //格式化叠指标标题
|
|
6881
6912
|
|
|
6882
|
-
ON_TOUCH_FAST_SLIDE:169 //快速滑动
|
|
6913
|
+
ON_TOUCH_FAST_SLIDE:169, //快速滑动
|
|
6914
|
+
|
|
6915
|
+
ON_CLICK_CROSSCURSOR_BOTTOM:170, //十字光标底部文字点击
|
|
6883
6916
|
}
|
|
6884
6917
|
|
|
6885
6918
|
var JSCHART_OPERATOR_ID=
|
|
@@ -6908,6 +6941,8 @@ var JSCHART_OPERATOR_ID=
|
|
|
6908
6941
|
|
|
6909
6942
|
OP_GOTO:16, //移动到某一个天或某一个分钟
|
|
6910
6943
|
OP_GOTO_BY_DATAINDEX:17, //的移动到某一个数据起始位置
|
|
6944
|
+
|
|
6945
|
+
OP_MOVE_CORSSCURSOR:18, //移动十字光标 { Step, Start:{ Date:, Time: } }
|
|
6911
6946
|
}
|
|
6912
6947
|
|
|
6913
6948
|
var JSCHART_DRAG_ID=
|
|
@@ -7309,7 +7344,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7309
7344
|
this.EnableVerticalDrag=false;
|
|
7310
7345
|
|
|
7311
7346
|
//十字光标长留(手势才有)
|
|
7312
|
-
this.ClickModel={ IsShowCorssCursor:false };
|
|
7347
|
+
this.ClickModel={ IsShowCorssCursor:false, PreventHide:false }; //PreventHide 阻止隐藏十字光标
|
|
7313
7348
|
this.EnableClickModel=false;
|
|
7314
7349
|
|
|
7315
7350
|
//标题栏显示最新数据
|
|
@@ -7340,7 +7375,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7340
7375
|
//SecondKeyID 1=shiftKey 2=ctrlKey 3=altKey
|
|
7341
7376
|
this.AryHotKey=[]; //热键 { KeyID:87, SecondKeyID:1, CMD:JSCHART_MENU_ID.CMD_FULLSCREEN_SUMMARY_ID, Args:null, Description:"Alt+W 全屏区间统计" },
|
|
7342
7377
|
|
|
7343
|
-
this.FastSlideConfig={ MinDistance:500, MinSpeed:3, MaxTime:250 }; //快速滑动配置 MinDistance=最小的距离 MinSpeed=最小速度 MaxTime=最大间隔时间(ms)
|
|
7378
|
+
this.FastSlideConfig={ MinDistance:500, MinSpeed:3, MaxTime:250, Enable:false }; //快速滑动配置 MinDistance=最小的距离 MinSpeed=最小速度 MaxTime=最大间隔时间(ms)
|
|
7344
7379
|
|
|
7345
7380
|
this.RestoreFocus=function(delay)
|
|
7346
7381
|
{
|
|
@@ -7934,11 +7969,23 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7934
7969
|
var button=this.ChartCorssCursor.PtInButton(x,y);
|
|
7935
7970
|
if (!button) return false;
|
|
7936
7971
|
|
|
7937
|
-
|
|
7938
|
-
if (event && event.Callback)
|
|
7972
|
+
if (button.Type==1)
|
|
7939
7973
|
{
|
|
7940
|
-
var
|
|
7941
|
-
event.Callback
|
|
7974
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_CROSSCURSOR_RIGHT);
|
|
7975
|
+
if (event && event.Callback)
|
|
7976
|
+
{
|
|
7977
|
+
var sendData={ Button:button, e };
|
|
7978
|
+
event.Callback(event,sendData,this);
|
|
7979
|
+
}
|
|
7980
|
+
}
|
|
7981
|
+
else if (button.Type==2)
|
|
7982
|
+
{
|
|
7983
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_CROSSCURSOR_BOTTOM);
|
|
7984
|
+
if (event && event.Callback)
|
|
7985
|
+
{
|
|
7986
|
+
var sendData={ Button:button, e };
|
|
7987
|
+
event.Callback(event,sendData,this);
|
|
7988
|
+
}
|
|
7942
7989
|
}
|
|
7943
7990
|
|
|
7944
7991
|
return true;
|
|
@@ -9448,6 +9495,11 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
9448
9495
|
return true;
|
|
9449
9496
|
}
|
|
9450
9497
|
|
|
9498
|
+
if (this.TryClickCrossCursor(x,y))
|
|
9499
|
+
{
|
|
9500
|
+
return true;
|
|
9501
|
+
}
|
|
9502
|
+
|
|
9451
9503
|
return false;
|
|
9452
9504
|
}
|
|
9453
9505
|
|
|
@@ -9460,6 +9512,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
9460
9512
|
this.TouchDrawCount=0;
|
|
9461
9513
|
this.PhonePinch=null;
|
|
9462
9514
|
this.TouchDrag=null;
|
|
9515
|
+
if (this.ClickModel) this.ClickModel.PreventHide=false;
|
|
9463
9516
|
this.StopDragTimer();
|
|
9464
9517
|
|
|
9465
9518
|
var isSingleTouch=this.IsSingleTouch(e);
|
|
@@ -9474,7 +9527,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
9474
9527
|
var touches = this.GetToucheData(e, this.IsForceLandscape);
|
|
9475
9528
|
var pt=this.PointAbsoluteToRelative(touches[0].clientX, touches[0].clientY, true);
|
|
9476
9529
|
|
|
9477
|
-
if (this.TryPhoneClickButton(pt.X, pt.Y, e))
|
|
9530
|
+
if (this.TryPhoneClickButton(pt.X, pt.Y, e))
|
|
9531
|
+
return;
|
|
9478
9532
|
|
|
9479
9533
|
if (this.EnableVerticalDrag )
|
|
9480
9534
|
{
|
|
@@ -10846,6 +10900,10 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
10846
10900
|
{
|
|
10847
10901
|
if (this.TouchStatus.CorssCursorShow==true) this.ChartCorssCursor.Draw();
|
|
10848
10902
|
}
|
|
10903
|
+
else if (this.EnableClickModel)
|
|
10904
|
+
{
|
|
10905
|
+
if (this.ClickModel.IsShowCorssCursor===true) this.ChartCorssCursor.Draw();
|
|
10906
|
+
}
|
|
10849
10907
|
else if (this.IsOnTouch===false && this.CurrentChartDrawPicture && this.CurrentChartDrawPicture.IsShowCorssCursor===true) //开始绘图
|
|
10850
10908
|
{
|
|
10851
10909
|
this.ChartCorssCursor.Draw();
|
|
@@ -13851,6 +13909,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
13851
13909
|
titlePaint.Canvas=this.Canvas;
|
|
13852
13910
|
titlePaint.LanguageID=this.LanguageID;
|
|
13853
13911
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
13912
|
+
titlePaint.HQChart=this;
|
|
13854
13913
|
this.TitlePaint[index+1]=titlePaint;
|
|
13855
13914
|
|
|
13856
13915
|
this.SetSubFrameOption(subFrame,option);
|
|
@@ -14344,6 +14403,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
14344
14403
|
titlePaint.LanguageID=this.LanguageID;
|
|
14345
14404
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
14346
14405
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
14406
|
+
titlePaint.HQChart=this;
|
|
14347
14407
|
this.TitlePaint[index+1]=titlePaint;
|
|
14348
14408
|
|
|
14349
14409
|
this.SetSubFrameOption(subFrame, option);
|
|
@@ -15711,11 +15771,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
15711
15771
|
{
|
|
15712
15772
|
if (!this.TouchDrag) return false;
|
|
15713
15773
|
if (!this.FastSlideConfig) return false;
|
|
15774
|
+
var config=this.FastSlideConfig;
|
|
15775
|
+
if (!config.Enable) return false;
|
|
15714
15776
|
|
|
15715
15777
|
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_TOUCH_FAST_SLIDE);
|
|
15716
15778
|
if (!event || !event.Callback) return false;
|
|
15717
15779
|
|
|
15718
|
-
|
|
15780
|
+
|
|
15719
15781
|
var drag=this.TouchDrag;
|
|
15720
15782
|
var time=Date.now();
|
|
15721
15783
|
var spanTime=time-drag.StartTime;
|
|
@@ -44298,7 +44360,7 @@ function ChartMinuteBuySellBar()
|
|
|
44298
44360
|
this.BuyColor=g_JSChartResource.Minute.BuySellBar.BuyColor;
|
|
44299
44361
|
this.SellColor=g_JSChartResource.Minute.BuySellBar.SellColor;
|
|
44300
44362
|
this.BarWidth=g_JSChartResource.Minute.BuySellBar.BarWidth;
|
|
44301
|
-
this.
|
|
44363
|
+
this.AryBarRange=g_JSChartResource.Minute.BuySellBar.AryBarRange;
|
|
44302
44364
|
this.YOffset=g_JSChartResource.Minute.BuySellBar.YOffset;
|
|
44303
44365
|
this.Font=g_JSChartResource.Minute.BuySellBar.Font;
|
|
44304
44366
|
this.TextColor=g_JSChartResource.Minute.BuySellBar.TextColor;
|
|
@@ -44313,7 +44375,7 @@ function ChartMinuteBuySellBar()
|
|
|
44313
44375
|
this.BuyColor=g_JSChartResource.Minute.BuySellBar.BuyColor;
|
|
44314
44376
|
this.SellColor=g_JSChartResource.Minute.BuySellBar.SellColor;
|
|
44315
44377
|
this.BarWidth=g_JSChartResource.Minute.BuySellBar.BarWidth;
|
|
44316
|
-
this.
|
|
44378
|
+
this.AryBarRange=g_JSChartResource.Minute.BuySellBar.AryBarRange;
|
|
44317
44379
|
this.YOffset=g_JSChartResource.Minute.BuySellBar.YOffset;
|
|
44318
44380
|
this.Font=g_JSChartResource.Minute.BuySellBar.Font;
|
|
44319
44381
|
this.TextColor=g_JSChartResource.Minute.BuySellBar.TextColor;
|
|
@@ -44329,11 +44391,29 @@ function ChartMinuteBuySellBar()
|
|
|
44329
44391
|
var volRange=this.GetVolRange();
|
|
44330
44392
|
if (!volRange) return;
|
|
44331
44393
|
|
|
44394
|
+
var minData=this.HQChart.GetKData();
|
|
44395
|
+
if (!minData || !IFrameSplitOperator.IsNonEmptyArray(minData.Data)) return;
|
|
44396
|
+
|
|
44332
44397
|
var bHScreen=(this.ChartFrame.IsHScreen===true);
|
|
44333
44398
|
var xPointCount=this.ChartFrame.XPointCount;
|
|
44399
|
+
var minuteCount=this.ChartFrame.MinuteCount;
|
|
44400
|
+
var minIndex=(minData.Data.length-1)%minuteCount;
|
|
44401
|
+
|
|
44402
|
+
var startIndex=xPointCount-1-120;
|
|
44403
|
+
var endIndex=xPointCount-1;
|
|
44404
|
+
for(var i=0;i<this.AryBarRange.length;++i)
|
|
44405
|
+
{
|
|
44406
|
+
var item=this.AryBarRange[i];
|
|
44407
|
+
if (minIndex<(minuteCount-1-item.End))
|
|
44408
|
+
{
|
|
44409
|
+
startIndex=xPointCount-1-item.Start;
|
|
44410
|
+
endIndex=xPointCount-1-item.End;
|
|
44411
|
+
break;
|
|
44412
|
+
}
|
|
44413
|
+
}
|
|
44334
44414
|
|
|
44335
|
-
var xStart=this.ChartFrame.GetXFromIndex(
|
|
44336
|
-
var xEnd=this.ChartFrame.GetXFromIndex(
|
|
44415
|
+
var xStart=this.ChartFrame.GetXFromIndex(startIndex);
|
|
44416
|
+
var xEnd=this.ChartFrame.GetXFromIndex(endIndex);
|
|
44337
44417
|
|
|
44338
44418
|
function _Temp_GetXFromData(value)
|
|
44339
44419
|
{
|
|
@@ -59929,6 +60009,12 @@ function ChartCorssCursor()
|
|
|
59929
60009
|
Icon:g_JSChartResource.CorssCursor.RightButton.Icon
|
|
59930
60010
|
};
|
|
59931
60011
|
|
|
60012
|
+
//底部按钮
|
|
60013
|
+
this.BottomButton=
|
|
60014
|
+
{
|
|
60015
|
+
Enable:false, Rect:null,
|
|
60016
|
+
}
|
|
60017
|
+
|
|
59932
60018
|
this.RightMargin=CloneData(g_JSChartResource.CorssCursor.RightMargin);
|
|
59933
60019
|
this.BottomConfig=CloneData(g_JSChartResource.CorssCursor.BottomText); //底部输出配置
|
|
59934
60020
|
this.LeftConfig=CloneData(g_JSChartResource.CorssCursor.LeftText);
|
|
@@ -60132,6 +60218,7 @@ function ChartCorssCursor()
|
|
|
60132
60218
|
{
|
|
60133
60219
|
this.Status=0;
|
|
60134
60220
|
this.RightButton.Rect=null;
|
|
60221
|
+
this.BottomButton.Rect=null;
|
|
60135
60222
|
this.LastValue=null;
|
|
60136
60223
|
|
|
60137
60224
|
if (!this.LastPoint) return;
|
|
@@ -60537,6 +60624,11 @@ function ChartCorssCursor()
|
|
|
60537
60624
|
this.Canvas.textBaseline="bottom";
|
|
60538
60625
|
this.Canvas.fillStyle=this.TextColor;
|
|
60539
60626
|
this.Canvas.fillText(text,rtBG.Left+textOffset.X,rtBG.Bottom+textOffset.Y,textWidth);
|
|
60627
|
+
|
|
60628
|
+
var buttonData={X:x, Y:y, XValue:xValue, FrameID:yValueExtend.FrameID };
|
|
60629
|
+
if (this.StringFormatX.KItem) buttonData.KItem=this.StringFormatX.KItem;
|
|
60630
|
+
this.BottomButton.Rect=rtBG;
|
|
60631
|
+
this.BottomButton.Data=buttonData;
|
|
60540
60632
|
}
|
|
60541
60633
|
}
|
|
60542
60634
|
|
|
@@ -60756,17 +60848,42 @@ function ChartCorssCursor()
|
|
|
60756
60848
|
}
|
|
60757
60849
|
|
|
60758
60850
|
this.PtInButton=function(x,y)
|
|
60851
|
+
{
|
|
60852
|
+
var item=this.PtInRightButton(x,y);
|
|
60853
|
+
if (item) return item;
|
|
60854
|
+
|
|
60855
|
+
item=this.PtInButtomButton(x,y);
|
|
60856
|
+
if (item) return item;
|
|
60857
|
+
|
|
60858
|
+
return null;
|
|
60859
|
+
}
|
|
60860
|
+
|
|
60861
|
+
this.PtInRightButton=function(x,y)
|
|
60759
60862
|
{
|
|
60760
60863
|
if (!this.RightButton.Enable) return null;
|
|
60761
60864
|
if (!this.RightButton.Rect) return null;
|
|
60762
60865
|
|
|
60763
60866
|
var rect=this.RightButton.Rect;
|
|
60764
|
-
|
|
60765
|
-
|
|
60766
|
-
|
|
60867
|
+
if (x>=rect.Left && x<=rect.Right && y>=rect.Top && y<=rect.Bottom)
|
|
60868
|
+
{
|
|
60869
|
+
return { Data:this.RightButton.Data, Rect:rect, Type:1 }; //Type:1=右侧 2=底部
|
|
60870
|
+
}
|
|
60871
|
+
|
|
60872
|
+
return null;
|
|
60873
|
+
}
|
|
60874
|
+
|
|
60875
|
+
this.PtInButtomButton=function(x,y)
|
|
60876
|
+
{
|
|
60877
|
+
if (!this.BottomButton.Enable) return null;
|
|
60878
|
+
if (!this.BottomButton.Rect) return null;
|
|
60879
|
+
|
|
60880
|
+
var rect=this.BottomButton.Rect;
|
|
60881
|
+
if (x>=rect.Left && x<=rect.Right && y>=rect.Top && y<=rect.Bottom)
|
|
60767
60882
|
{
|
|
60768
|
-
return { Data:this.
|
|
60883
|
+
return { Data:this.BottomButton.Data, Rect:rect , Type:2 }; //Type:1=右侧 2=底部
|
|
60769
60884
|
}
|
|
60885
|
+
|
|
60886
|
+
return null;
|
|
60770
60887
|
}
|
|
60771
60888
|
|
|
60772
60889
|
this.DrawTextBGRect=function(x,y, height, width)
|
|
@@ -61814,9 +61931,11 @@ function HQDateStringFormat()
|
|
|
61814
61931
|
|
|
61815
61932
|
this.DateFormatType=0; //0=YYYY-MM-DD 1=YYYY/MM/DD 2=YYYY/MM/DD/W 3=DD/MM/YYYY
|
|
61816
61933
|
this.LanguageID=0;
|
|
61934
|
+
this.KItem=null; //缓存当前的K线
|
|
61817
61935
|
|
|
61818
61936
|
this.Operator=function()
|
|
61819
61937
|
{
|
|
61938
|
+
this.KItem=null;
|
|
61820
61939
|
if (!IFrameSplitOperator.IsNumber(this.Value)) return false;
|
|
61821
61940
|
if (!this.Data) return false;
|
|
61822
61941
|
|
|
@@ -61824,6 +61943,7 @@ function HQDateStringFormat()
|
|
|
61824
61943
|
index=parseInt(index.toFixed(0));
|
|
61825
61944
|
if (this.Data.DataOffset+index>=this.Data.Data.length) return false;
|
|
61826
61945
|
var currentData = this.Data.Data[this.Data.DataOffset+index];
|
|
61946
|
+
this.KItem=currentData;
|
|
61827
61947
|
var dateFormatString="YYYY-MM-DD";
|
|
61828
61948
|
if (this.DateFormatType==1) dateFormatString="YYYY/MM/DD";
|
|
61829
61949
|
else if (this.DateFormatType==2) dateFormatString="YYYY/MM/DD/W";
|
|
@@ -63380,7 +63500,14 @@ function DynamicKLineTitlePainting()
|
|
|
63380
63500
|
|
|
63381
63501
|
this.IsShowLastData=function()
|
|
63382
63502
|
{
|
|
63503
|
+
if (this.HQChart && this.HQChart.EnableClickModel && this.HQChart.ClickModel)
|
|
63504
|
+
{
|
|
63505
|
+
var clickModel=this.HQChart.ClickModel;
|
|
63506
|
+
if (clickModel.IsShowCorssCursor) return false;
|
|
63507
|
+
}
|
|
63508
|
+
|
|
63383
63509
|
var isShow=false;
|
|
63510
|
+
|
|
63384
63511
|
if (this.DrawStatus && this.DrawStatus.IsTitleShowLatestData)
|
|
63385
63512
|
{
|
|
63386
63513
|
var status=this.DrawStatus;
|
|
@@ -64725,6 +64852,12 @@ function DynamicChartTitlePainting()
|
|
|
64725
64852
|
|
|
64726
64853
|
this.IsShowLastData=function()
|
|
64727
64854
|
{
|
|
64855
|
+
if (this.HQChart && this.HQChart.EnableClickModel && this.HQChart.ClickModel)
|
|
64856
|
+
{
|
|
64857
|
+
var clickModel=this.HQChart.ClickModel;
|
|
64858
|
+
if (clickModel.IsShowCorssCursor) return false;
|
|
64859
|
+
}
|
|
64860
|
+
|
|
64728
64861
|
var isShowLastData=false;
|
|
64729
64862
|
if (this.DrawStatus && this.DrawStatus.IsTitleShowLatestData)
|
|
64730
64863
|
{
|
|
@@ -78003,6 +78136,8 @@ function JSChartResource()
|
|
|
78003
78136
|
YOffset:1,
|
|
78004
78137
|
Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
|
|
78005
78138
|
TextColor:"rgb(128,128,128)",
|
|
78139
|
+
|
|
78140
|
+
AryBarRange:[{ Start:240, End:120 }, { Start:120, End:0}],
|
|
78006
78141
|
}
|
|
78007
78142
|
|
|
78008
78143
|
this.DefaultTextColor="rgb(43,54,69)"; //图形中默认的字体颜色
|
|
@@ -79553,7 +79688,7 @@ function JSChartResource()
|
|
|
79553
79688
|
if (item.Font) dest.Font=item.Font;
|
|
79554
79689
|
if (item.TextColor) dest.TextColor=item.TextColor;
|
|
79555
79690
|
if (IFrameSplitOperator.IsNumber(item.BarWidth)) dest.BarWidth=item.BarWidth;
|
|
79556
|
-
if (IFrameSplitOperator.
|
|
79691
|
+
if (IFrameSplitOperator.IsNonEmptyArray(item.AryBarRange)) dest.AryBarRange=item.AryBarRange;
|
|
79557
79692
|
if (IFrameSplitOperator.IsNumber(item.YOffset)) dest.YOffset=item.YOffset;
|
|
79558
79693
|
}
|
|
79559
79694
|
}
|
|
@@ -82766,33 +82901,179 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
82766
82901
|
return;
|
|
82767
82902
|
}
|
|
82768
82903
|
|
|
82904
|
+
return this.ChartOperator_Temp_SetChartCorssCursor(findIndex, item);
|
|
82905
|
+
}
|
|
82906
|
+
else if (id==JSCHART_OPERATOR_ID.OP_MOVE_CORSSCURSOR) //移动十字光标 { Step, Start:{ Date, Time }}
|
|
82907
|
+
{
|
|
82908
|
+
if (!IFrameSplitOperator.IsNumber(obj.Step)) return false;
|
|
82909
|
+
if (obj.Step==0) return false;
|
|
82910
|
+
var step=obj.Step;
|
|
82911
|
+
|
|
82769
82912
|
if (!this.Frame || !this.Frame.SubFrame[0] || !this.Frame.SubFrame[0].Frame) return false;
|
|
82770
|
-
var
|
|
82913
|
+
var showCount=this.Frame.SubFrame[0].Frame.XPointCount; //一屏显示个数
|
|
82771
82914
|
|
|
82772
|
-
var
|
|
82773
|
-
|
|
82915
|
+
var kData=this.GetKData();
|
|
82916
|
+
if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return false; //数据还没有到达
|
|
82774
82917
|
|
|
82775
|
-
|
|
82776
|
-
var
|
|
82777
|
-
|
|
82778
|
-
|
|
82918
|
+
var start=kData.DataOffset;
|
|
82919
|
+
var bDayPeriod=ChartData.IsDayPeriod(this.Period,true);
|
|
82920
|
+
var findItem=null, dataIndex=-1;
|
|
82921
|
+
for(var i=0; i<kData.Data.length; ++i)
|
|
82922
|
+
{
|
|
82923
|
+
var item=kData.Data[i];
|
|
82924
|
+
if (!item) continue;
|
|
82779
82925
|
|
|
82780
|
-
|
|
82781
|
-
|
|
82782
|
-
|
|
82926
|
+
if (bDayPeriod)
|
|
82927
|
+
{
|
|
82928
|
+
if (item.Date==obj.Start.Date)
|
|
82929
|
+
{
|
|
82930
|
+
findItem=item;
|
|
82931
|
+
dataIndex=i;
|
|
82932
|
+
break;
|
|
82933
|
+
}
|
|
82934
|
+
}
|
|
82935
|
+
else
|
|
82936
|
+
{
|
|
82937
|
+
if (item.Date==obj.Start.Date && item.Time==obj.Start.Time)
|
|
82938
|
+
{
|
|
82939
|
+
findItem=item;
|
|
82940
|
+
dataIndex=i;
|
|
82941
|
+
break;
|
|
82942
|
+
}
|
|
82943
|
+
}
|
|
82944
|
+
}
|
|
82783
82945
|
|
|
82784
|
-
|
|
82946
|
+
if (!findItem) return false;
|
|
82785
82947
|
|
|
82786
|
-
var
|
|
82787
|
-
|
|
82788
|
-
|
|
82789
|
-
|
|
82790
|
-
|
|
82791
|
-
|
|
82792
|
-
|
|
82948
|
+
var index=-1;
|
|
82949
|
+
var dataOffset=kData.DataOffset;
|
|
82950
|
+
if (dataIndex>=start && dataIndex<=start+(showCount-1))
|
|
82951
|
+
{
|
|
82952
|
+
index=dataIndex-start;
|
|
82953
|
+
}
|
|
82954
|
+
else //需要调整当前屏范围
|
|
82955
|
+
{
|
|
82956
|
+
if (step>0)
|
|
82957
|
+
{
|
|
82958
|
+
if (dataIndex+showCount>=kData.Data.length)
|
|
82959
|
+
{
|
|
82960
|
+
dataOffset=kData.Data.length-showCount;
|
|
82961
|
+
index=dataIndex-dataOffset;
|
|
82962
|
+
}
|
|
82963
|
+
else
|
|
82964
|
+
{
|
|
82965
|
+
index=0;
|
|
82966
|
+
dataOffset=dataIndex;
|
|
82967
|
+
}
|
|
82968
|
+
}
|
|
82969
|
+
else
|
|
82970
|
+
{
|
|
82971
|
+
if (dataIndex-showCount<0)
|
|
82972
|
+
{
|
|
82973
|
+
dataOffset=0;
|
|
82974
|
+
index=dataIndex;
|
|
82975
|
+
}
|
|
82976
|
+
else if (dataIndex+showCount>=kData.Data.length)
|
|
82977
|
+
{
|
|
82978
|
+
dataOffset=kData.Data.length-showCount;
|
|
82979
|
+
index=dataIndex-dataOffset;
|
|
82980
|
+
}
|
|
82981
|
+
else
|
|
82982
|
+
{
|
|
82983
|
+
index=showCount;
|
|
82984
|
+
dataOffset=dataIndex-showCount;
|
|
82985
|
+
}
|
|
82986
|
+
}
|
|
82987
|
+
}
|
|
82988
|
+
|
|
82989
|
+
var kItem=findItem;
|
|
82990
|
+
if (step>0)
|
|
82991
|
+
{
|
|
82992
|
+
for(var i=dataIndex+1, j=0; i<kData.Data.length && j<step; ++i, ++j)
|
|
82993
|
+
{
|
|
82994
|
+
++index;
|
|
82995
|
+
dataIndex=i;
|
|
82996
|
+
if (index>=(showCount-1))
|
|
82997
|
+
{
|
|
82998
|
+
index=showCount-1;
|
|
82999
|
+
dataOffset+=1;
|
|
83000
|
+
}
|
|
83001
|
+
|
|
83002
|
+
var item=kData.Data[i];
|
|
83003
|
+
if (!item) continue;
|
|
83004
|
+
|
|
83005
|
+
var kItem=item;
|
|
83006
|
+
}
|
|
83007
|
+
}
|
|
83008
|
+
else if (step<0)
|
|
83009
|
+
{
|
|
83010
|
+
for(var i=dataIndex-1, j=0;i>=0 && j<Math.abs(step);--i, ++j)
|
|
83011
|
+
{
|
|
83012
|
+
--index
|
|
83013
|
+
dataIndex=i;
|
|
83014
|
+
if (index<=0)
|
|
83015
|
+
{
|
|
83016
|
+
index=0;
|
|
83017
|
+
dataOffset-=1;
|
|
83018
|
+
}
|
|
83019
|
+
|
|
83020
|
+
var item=kData.Data[i];
|
|
83021
|
+
if (!item) continue;
|
|
83022
|
+
var kItem=item;
|
|
83023
|
+
}
|
|
83024
|
+
}
|
|
83025
|
+
|
|
83026
|
+
if (!kItem) return false;
|
|
83027
|
+
|
|
83028
|
+
obj.KItem=kItem;
|
|
83029
|
+
if (kData.DataOffset==dataOffset)
|
|
83030
|
+
{
|
|
83031
|
+
return this.ChartOperator_Temp_SetChartCorssCursor(index, kItem);
|
|
83032
|
+
}
|
|
83033
|
+
else
|
|
83034
|
+
{
|
|
83035
|
+
kData.DataOffset=dataOffset
|
|
83036
|
+
this.UpdataDataoffset(); //更新数据偏移
|
|
83037
|
+
this.UpdateFrameMaxMin(); //调整坐标最大 最小值
|
|
83038
|
+
this.ResetFrameXSplit();
|
|
83039
|
+
this.Frame.SetSizeChage(true);
|
|
83040
|
+
this.Draw();
|
|
83041
|
+
this.ChartOperator_Temp_SetChartCorssCursor(index, kItem);
|
|
83042
|
+
return true;
|
|
83043
|
+
}
|
|
82793
83044
|
}
|
|
82794
83045
|
}
|
|
82795
83046
|
|
|
83047
|
+
|
|
83048
|
+
this.ChartOperator_Temp_SetChartCorssCursor=function(index, kItem)
|
|
83049
|
+
{
|
|
83050
|
+
if (!this.Frame || !this.Frame.SubFrame[0] || !this.Frame.SubFrame[0].Frame) return false;
|
|
83051
|
+
var frame=this.Frame.SubFrame[0].Frame;
|
|
83052
|
+
|
|
83053
|
+
var x=frame.GetXFromIndex(index);
|
|
83054
|
+
var y=frame.GetYFromData(kItem.Close);
|
|
83055
|
+
|
|
83056
|
+
//保存最后一次鼠标移动信息
|
|
83057
|
+
var MoveStatus={ X:x, Y:y, IsInClient: this.IsMouseOnClient(x,y) };
|
|
83058
|
+
this.LastMouseStatus.OnMouseMove=MoveStatus;
|
|
83059
|
+
this.LastMouseStatus.MoveOnPoint={X:x, Y:y}; //鼠标移动的位置
|
|
83060
|
+
|
|
83061
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_MOUSE_MOVE);
|
|
83062
|
+
var titleChart=this.TitlePaint[0];
|
|
83063
|
+
if (event && titleChart) titleChart.OnMouseMoveEvent=event;
|
|
83064
|
+
|
|
83065
|
+
var pixelTatio = GetDevicePixelRatio();
|
|
83066
|
+
var e={ };
|
|
83067
|
+
e.clientX=(x/pixelTatio)+this.UIElement.getBoundingClientRect().left;
|
|
83068
|
+
e.clientY=(y/pixelTatio)+this.UIElement.getBoundingClientRect().top;
|
|
83069
|
+
this.MoveOnPoint={X:x, Y:y};
|
|
83070
|
+
this.OnMouseMove(x,y,e);
|
|
83071
|
+
this.LastMouseStatus.MoveOnPoint=null;
|
|
83072
|
+
if (titleChart) titleChart.OnMouseMoveEvent=null;
|
|
83073
|
+
|
|
83074
|
+
return true;
|
|
83075
|
+
}
|
|
83076
|
+
|
|
82796
83077
|
//内部函数
|
|
82797
83078
|
this.ChartOperator_Temp_GetHistoryData=function()
|
|
82798
83079
|
{
|
|
@@ -83040,7 +83321,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
83040
83321
|
titlePaint.LanguageID=this.LanguageID;
|
|
83041
83322
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
83042
83323
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
83043
|
-
|
|
83324
|
+
titlePaint.HQChart=this;
|
|
83044
83325
|
this.TitlePaint.push(titlePaint);
|
|
83045
83326
|
}
|
|
83046
83327
|
|
|
@@ -86528,6 +86809,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
86528
86809
|
titlePaint.LanguageID=this.LanguageID;
|
|
86529
86810
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
86530
86811
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
86812
|
+
titlePaint.HQChart=this;
|
|
86531
86813
|
this.TitlePaint[i+1]=titlePaint;
|
|
86532
86814
|
}
|
|
86533
86815
|
|
|
@@ -86672,6 +86954,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
86672
86954
|
titlePaint.LanguageID=this.LanguageID;
|
|
86673
86955
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
86674
86956
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
86957
|
+
titlePaint.HQChart=this;
|
|
86675
86958
|
this.TitlePaint[i+1]=titlePaint;
|
|
86676
86959
|
}
|
|
86677
86960
|
}
|
|
@@ -86976,7 +87259,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
86976
87259
|
{
|
|
86977
87260
|
if (this.DragMode==JSCHART_DRAG_ID.CLICK_TOUCH_MODE_ID)
|
|
86978
87261
|
{
|
|
86979
|
-
if (this.
|
|
87262
|
+
if (this.ClickModel.IsShowCorssCursor==true && this.ClickModel.PreventHide) return;
|
|
87263
|
+
if (this.ClickModel.IsShowCorssCursor==true && this.TouchDrawCount>0 ) return;
|
|
86980
87264
|
|
|
86981
87265
|
this.TouchStatus.CorssCursorShow=false;
|
|
86982
87266
|
this.DrawDynamicInfo();
|
|
@@ -86985,7 +87269,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
86985
87269
|
|
|
86986
87270
|
if (this.EnableClickModel===true)
|
|
86987
87271
|
{
|
|
86988
|
-
if (this.ClickModel.IsShowCorssCursor==true && this.
|
|
87272
|
+
if (this.ClickModel.IsShowCorssCursor==true && this.ClickModel.PreventHide) return; //阻止隐藏
|
|
87273
|
+
if (this.ClickModel.IsShowCorssCursor==true && this.TouchDrawCount>0 ) return;
|
|
86989
87274
|
|
|
86990
87275
|
this.ClickModel.IsShowCorssCursor=false;
|
|
86991
87276
|
this.DrawDynamicInfo();
|
|
@@ -91787,6 +92072,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
91787
92072
|
this.TouchDrawCount=0;
|
|
91788
92073
|
this.PhonePinch=null;
|
|
91789
92074
|
this.TouchDrag=null;
|
|
92075
|
+
if (this.ClickModel) this.ClickModel.PreventHide=false;
|
|
91790
92076
|
this.StopDragTimer();
|
|
91791
92077
|
|
|
91792
92078
|
if (this.EnableScrollUpDown==false) e.preventDefault(); //上下拖动图形不能阻止事件
|
|
@@ -92906,6 +93192,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
92906
93192
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
92907
93193
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
92908
93194
|
titlePaint.MainTitlePaint=this.TitlePaint[0];
|
|
93195
|
+
titlePaint.HQChart=this;
|
|
92909
93196
|
this.TitlePaint.push(titlePaint);
|
|
92910
93197
|
}
|
|
92911
93198
|
|
|
@@ -93117,6 +93404,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
93117
93404
|
titlePaint.LanguageID=this.LanguageID;
|
|
93118
93405
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
|
|
93119
93406
|
titlePaint.MainTitlePaint=this.TitlePaint[0];
|
|
93407
|
+
titlePaint.HQChart=this;
|
|
93120
93408
|
this.TitlePaint[index+1]=titlePaint;
|
|
93121
93409
|
|
|
93122
93410
|
this.SetSubFrameOption(subFrame,option);
|
|
@@ -93255,6 +93543,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
93255
93543
|
buySellBar.Name="Minute-BuySell-Bar";
|
|
93256
93544
|
buySellBar.Identify="Minute-BuySell-Bar";
|
|
93257
93545
|
buySellBar.BuySellData=this.BuySellData;
|
|
93546
|
+
buySellBar.HQChart=this;
|
|
93258
93547
|
this.ChartPaint[3]=buySellBar;
|
|
93259
93548
|
|
|
93260
93549
|
|
|
@@ -93366,6 +93655,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
93366
93655
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
93367
93656
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
93368
93657
|
titlePaint.MainTitlePaint=this.TitlePaint[0];
|
|
93658
|
+
titlePaint.HQChart=this;
|
|
93369
93659
|
this.TitlePaint[i+1]=titlePaint;
|
|
93370
93660
|
}
|
|
93371
93661
|
|
|
@@ -93453,6 +93743,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
93453
93743
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
93454
93744
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
93455
93745
|
titlePaint.MainTitlePaint=this.TitlePaint[0];
|
|
93746
|
+
titlePaint.HQChart=this;
|
|
93456
93747
|
this.TitlePaint[i+1]=titlePaint;
|
|
93457
93748
|
}
|
|
93458
93749
|
}
|
|
@@ -95855,6 +96146,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
95855
96146
|
{
|
|
95856
96147
|
if (this.EnableClickModel===true)
|
|
95857
96148
|
{
|
|
96149
|
+
if (this.ClickModel.IsShowCorssCursor==true && this.ClickModel.PreventHide) return; //阻止隐藏
|
|
95858
96150
|
if (this.ClickModel.IsShowCorssCursor==true && this.TouchDrawCount>0) return;
|
|
95859
96151
|
|
|
95860
96152
|
this.ClickModel.IsShowCorssCursor=false;
|
|
@@ -98414,6 +98706,7 @@ function KLineChartHScreenContainer(uielement)
|
|
|
98414
98706
|
titlePaint.LanguageID=this.LanguageID;
|
|
98415
98707
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
98416
98708
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
98709
|
+
titlePaint.HQChart=this;
|
|
98417
98710
|
this.TitlePaint.push(titlePaint);
|
|
98418
98711
|
}
|
|
98419
98712
|
|
|
@@ -98595,6 +98888,7 @@ function MinuteChartHScreenContainer(uielement)
|
|
|
98595
98888
|
titlePaint.LanguageID=this.LanguageID;
|
|
98596
98889
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
98597
98890
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
98891
|
+
titlePaint.HQChart=this;
|
|
98598
98892
|
this.TitlePaint.push(titlePaint);
|
|
98599
98893
|
}
|
|
98600
98894
|
|
|
@@ -158407,7 +158701,7 @@ function HQChartScriptWorker()
|
|
|
158407
158701
|
|
|
158408
158702
|
|
|
158409
158703
|
|
|
158410
|
-
var HQCHART_VERSION="1.1.
|
|
158704
|
+
var HQCHART_VERSION="1.1.14710";
|
|
158411
158705
|
|
|
158412
158706
|
function PrintHQChartVersion()
|
|
158413
158707
|
{
|