hqchart 1.1.14696 → 1.1.14705
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.
package/package.json
CHANGED
package/src/jscommon/umychart.js
CHANGED
|
@@ -429,6 +429,15 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
431
|
|
|
432
|
+
if (option.FastSlide)
|
|
433
|
+
{
|
|
434
|
+
var item=option.FastSlide;
|
|
435
|
+
if (IFrameSplitOperator.IsNumber(item.MinDistance)) chart.FastSlideConfig.MinDistance=item.MinDistance;
|
|
436
|
+
if (IFrameSplitOperator.IsNumber(item.MinSpeed)) chart.FastSlideConfig.MinSpeed=item.MinSpeed;
|
|
437
|
+
if (IFrameSplitOperator.IsNumber(item.MaxTime)) chart.FastSlideConfig.MaxTime=item.MaxTime;
|
|
438
|
+
if (IFrameSplitOperator.IsBool(item.Enable)) chart.FastSlideConfig.Enable=item.Enable;
|
|
439
|
+
}
|
|
440
|
+
|
|
432
441
|
if (chart.ClassName=="KLineChartContainer")
|
|
433
442
|
{
|
|
434
443
|
if (!option.DragSelectRect)
|
|
@@ -497,6 +506,12 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
497
506
|
if (IFrameSplitOperator.IsBool(item.RightButton.Enable)) chart.ChartCorssCursor.RightButton.Enable=item.RightButton.Enable;
|
|
498
507
|
}
|
|
499
508
|
|
|
509
|
+
if (item.BottomButton)
|
|
510
|
+
{
|
|
511
|
+
var subItem=item.BottomButton;
|
|
512
|
+
if (IFrameSplitOperator.IsBool(subItem.Enable)) chart.ChartCorssCursor.BottomButton.Enable=subItem.Enable;
|
|
513
|
+
}
|
|
514
|
+
|
|
500
515
|
if (IFrameSplitOperator.IsNumber(item.PriceFormatType)) chart.ChartCorssCursor.StringFormatY.PriceFormatType=item.PriceFormatType;
|
|
501
516
|
if (IFrameSplitOperator.IsNumber(item.DataFormatType)) chart.ChartCorssCursor.StringFormatY.DataFormatType=item.DataFormatType;
|
|
502
517
|
if (IFrameSplitOperator.IsBool(item.EnableKeyboard)) chart.ChartCorssCursor.EnableKeyboard=item.EnableKeyboard;
|
|
@@ -981,6 +996,15 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
981
996
|
if (IFrameSplitOperator.IsNumber(item.WheelYMove)) chart.EnableYDrag.WheelYMove=item.WheelYMove;
|
|
982
997
|
}
|
|
983
998
|
|
|
999
|
+
if (option.FastSlide)
|
|
1000
|
+
{
|
|
1001
|
+
var item=option.FastSlide;
|
|
1002
|
+
if (IFrameSplitOperator.IsNumber(item.MinDistance)) chart.FastSlideConfig.MinDistance=item.MinDistance;
|
|
1003
|
+
if (IFrameSplitOperator.IsNumber(item.MinSpeed)) chart.FastSlideConfig.MinSpeed=item.MinSpeed;
|
|
1004
|
+
if (IFrameSplitOperator.IsNumber(item.MaxTime)) chart.FastSlideConfig.MaxTime=item.MaxTime;
|
|
1005
|
+
if (IFrameSplitOperator.IsBool(item.Enable)) chart.FastSlideConfig.Enable=item.Enable;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
984
1008
|
//分页
|
|
985
1009
|
if (option.PageInfo) chart.SetPageInfo(option.PageInfo);
|
|
986
1010
|
|
|
@@ -1002,6 +1026,12 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
1002
1026
|
if (IFrameSplitOperator.IsBool(item.RightButton.Enable)) chart.ChartCorssCursor.RightButton.Enable=item.RightButton.Enable;
|
|
1003
1027
|
}
|
|
1004
1028
|
|
|
1029
|
+
if (item.BottomButton)
|
|
1030
|
+
{
|
|
1031
|
+
var subItem=item.BottomButton;
|
|
1032
|
+
if (IFrameSplitOperator.IsBool(subItem.Enable)) chart.ChartCorssCursor.BottomButton.Enable=subItem.Enable;
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1005
1035
|
if (IFrameSplitOperator.IsNumber(item.PriceFormatType)) chart.ChartCorssCursor.StringFormatY.PriceFormatType=item.PriceFormatType;
|
|
1006
1036
|
if (IFrameSplitOperator.IsNumber(item.DataFormatType)) chart.ChartCorssCursor.StringFormatY.DataFormatType=item.DataFormatType;
|
|
1007
1037
|
|
|
@@ -2739,7 +2769,9 @@ var JSCHART_EVENT_ID=
|
|
|
2739
2769
|
|
|
2740
2770
|
ON_FORMAT_OVERLAY_INDEX_OUT_TEXT:168, //格式化叠指标标题
|
|
2741
2771
|
|
|
2742
|
-
ON_TOUCH_FAST_SLIDE:169 //快速滑动
|
|
2772
|
+
ON_TOUCH_FAST_SLIDE:169, //快速滑动
|
|
2773
|
+
|
|
2774
|
+
ON_CLICK_CROSSCURSOR_BOTTOM:170, //十字光标底部文字点击
|
|
2743
2775
|
}
|
|
2744
2776
|
|
|
2745
2777
|
var JSCHART_OPERATOR_ID=
|
|
@@ -2768,6 +2800,8 @@ var JSCHART_OPERATOR_ID=
|
|
|
2768
2800
|
|
|
2769
2801
|
OP_GOTO:16, //移动到某一个天或某一个分钟
|
|
2770
2802
|
OP_GOTO_BY_DATAINDEX:17, //的移动到某一个数据起始位置
|
|
2803
|
+
|
|
2804
|
+
OP_MOVE_CORSSCURSOR:18, //移动十字光标 { Step, Start:{ Date:, Time: } }
|
|
2771
2805
|
}
|
|
2772
2806
|
|
|
2773
2807
|
var JSCHART_DRAG_ID=
|
|
@@ -3169,7 +3203,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3169
3203
|
this.EnableVerticalDrag=false;
|
|
3170
3204
|
|
|
3171
3205
|
//十字光标长留(手势才有)
|
|
3172
|
-
this.ClickModel={ IsShowCorssCursor:false };
|
|
3206
|
+
this.ClickModel={ IsShowCorssCursor:false, PreventHide:false }; //PreventHide 阻止隐藏十字光标
|
|
3173
3207
|
this.EnableClickModel=false;
|
|
3174
3208
|
|
|
3175
3209
|
//标题栏显示最新数据
|
|
@@ -3200,7 +3234,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3200
3234
|
//SecondKeyID 1=shiftKey 2=ctrlKey 3=altKey
|
|
3201
3235
|
this.AryHotKey=[]; //热键 { KeyID:87, SecondKeyID:1, CMD:JSCHART_MENU_ID.CMD_FULLSCREEN_SUMMARY_ID, Args:null, Description:"Alt+W 全屏区间统计" },
|
|
3202
3236
|
|
|
3203
|
-
this.FastSlideConfig={ MinDistance:500, MinSpeed:3, MaxTime:250 }; //快速滑动配置 MinDistance=最小的距离 MinSpeed=最小速度 MaxTime=最大间隔时间(ms)
|
|
3237
|
+
this.FastSlideConfig={ MinDistance:500, MinSpeed:3, MaxTime:250, Enable:false }; //快速滑动配置 MinDistance=最小的距离 MinSpeed=最小速度 MaxTime=最大间隔时间(ms)
|
|
3204
3238
|
|
|
3205
3239
|
this.RestoreFocus=function(delay)
|
|
3206
3240
|
{
|
|
@@ -3794,11 +3828,23 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3794
3828
|
var button=this.ChartCorssCursor.PtInButton(x,y);
|
|
3795
3829
|
if (!button) return false;
|
|
3796
3830
|
|
|
3797
|
-
|
|
3798
|
-
if (event && event.Callback)
|
|
3831
|
+
if (button.Type==1)
|
|
3799
3832
|
{
|
|
3800
|
-
var
|
|
3801
|
-
event.Callback
|
|
3833
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_CROSSCURSOR_RIGHT);
|
|
3834
|
+
if (event && event.Callback)
|
|
3835
|
+
{
|
|
3836
|
+
var sendData={ Button:button, e };
|
|
3837
|
+
event.Callback(event,sendData,this);
|
|
3838
|
+
}
|
|
3839
|
+
}
|
|
3840
|
+
else if (button.Type==2)
|
|
3841
|
+
{
|
|
3842
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_CROSSCURSOR_BOTTOM);
|
|
3843
|
+
if (event && event.Callback)
|
|
3844
|
+
{
|
|
3845
|
+
var sendData={ Button:button, e };
|
|
3846
|
+
event.Callback(event,sendData,this);
|
|
3847
|
+
}
|
|
3802
3848
|
}
|
|
3803
3849
|
|
|
3804
3850
|
return true;
|
|
@@ -5308,6 +5354,11 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
5308
5354
|
return true;
|
|
5309
5355
|
}
|
|
5310
5356
|
|
|
5357
|
+
if (this.TryClickCrossCursor(x,y))
|
|
5358
|
+
{
|
|
5359
|
+
return true;
|
|
5360
|
+
}
|
|
5361
|
+
|
|
5311
5362
|
return false;
|
|
5312
5363
|
}
|
|
5313
5364
|
|
|
@@ -5320,6 +5371,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
5320
5371
|
this.TouchDrawCount=0;
|
|
5321
5372
|
this.PhonePinch=null;
|
|
5322
5373
|
this.TouchDrag=null;
|
|
5374
|
+
if (this.ClickModel) this.ClickModel.PreventHide=false;
|
|
5323
5375
|
this.StopDragTimer();
|
|
5324
5376
|
|
|
5325
5377
|
var isSingleTouch=this.IsSingleTouch(e);
|
|
@@ -5334,7 +5386,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
5334
5386
|
var touches = this.GetToucheData(e, this.IsForceLandscape);
|
|
5335
5387
|
var pt=this.PointAbsoluteToRelative(touches[0].clientX, touches[0].clientY, true);
|
|
5336
5388
|
|
|
5337
|
-
if (this.TryPhoneClickButton(pt.X, pt.Y, e))
|
|
5389
|
+
if (this.TryPhoneClickButton(pt.X, pt.Y, e))
|
|
5390
|
+
return;
|
|
5338
5391
|
|
|
5339
5392
|
if (this.EnableVerticalDrag )
|
|
5340
5393
|
{
|
|
@@ -6706,6 +6759,10 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
6706
6759
|
{
|
|
6707
6760
|
if (this.TouchStatus.CorssCursorShow==true) this.ChartCorssCursor.Draw();
|
|
6708
6761
|
}
|
|
6762
|
+
else if (this.EnableClickModel)
|
|
6763
|
+
{
|
|
6764
|
+
if (this.ClickModel.IsShowCorssCursor===true) this.ChartCorssCursor.Draw();
|
|
6765
|
+
}
|
|
6709
6766
|
else if (this.IsOnTouch===false && this.CurrentChartDrawPicture && this.CurrentChartDrawPicture.IsShowCorssCursor===true) //开始绘图
|
|
6710
6767
|
{
|
|
6711
6768
|
this.ChartCorssCursor.Draw();
|
|
@@ -11571,11 +11628,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
11571
11628
|
{
|
|
11572
11629
|
if (!this.TouchDrag) return false;
|
|
11573
11630
|
if (!this.FastSlideConfig) return false;
|
|
11631
|
+
var config=this.FastSlideConfig;
|
|
11632
|
+
if (!config.Enable) return false;
|
|
11574
11633
|
|
|
11575
11634
|
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_TOUCH_FAST_SLIDE);
|
|
11576
11635
|
if (!event || !event.Callback) return false;
|
|
11577
11636
|
|
|
11578
|
-
|
|
11637
|
+
|
|
11579
11638
|
var drag=this.TouchDrag;
|
|
11580
11639
|
var time=Date.now();
|
|
11581
11640
|
var spanTime=time-drag.StartTime;
|
|
@@ -40158,7 +40217,7 @@ function ChartMinuteBuySellBar()
|
|
|
40158
40217
|
this.BuyColor=g_JSChartResource.Minute.BuySellBar.BuyColor;
|
|
40159
40218
|
this.SellColor=g_JSChartResource.Minute.BuySellBar.SellColor;
|
|
40160
40219
|
this.BarWidth=g_JSChartResource.Minute.BuySellBar.BarWidth;
|
|
40161
|
-
this.
|
|
40220
|
+
this.AryBarRange=g_JSChartResource.Minute.BuySellBar.AryBarRange;
|
|
40162
40221
|
this.YOffset=g_JSChartResource.Minute.BuySellBar.YOffset;
|
|
40163
40222
|
this.Font=g_JSChartResource.Minute.BuySellBar.Font;
|
|
40164
40223
|
this.TextColor=g_JSChartResource.Minute.BuySellBar.TextColor;
|
|
@@ -40173,7 +40232,7 @@ function ChartMinuteBuySellBar()
|
|
|
40173
40232
|
this.BuyColor=g_JSChartResource.Minute.BuySellBar.BuyColor;
|
|
40174
40233
|
this.SellColor=g_JSChartResource.Minute.BuySellBar.SellColor;
|
|
40175
40234
|
this.BarWidth=g_JSChartResource.Minute.BuySellBar.BarWidth;
|
|
40176
|
-
this.
|
|
40235
|
+
this.AryBarRange=g_JSChartResource.Minute.BuySellBar.AryBarRange;
|
|
40177
40236
|
this.YOffset=g_JSChartResource.Minute.BuySellBar.YOffset;
|
|
40178
40237
|
this.Font=g_JSChartResource.Minute.BuySellBar.Font;
|
|
40179
40238
|
this.TextColor=g_JSChartResource.Minute.BuySellBar.TextColor;
|
|
@@ -40189,11 +40248,29 @@ function ChartMinuteBuySellBar()
|
|
|
40189
40248
|
var volRange=this.GetVolRange();
|
|
40190
40249
|
if (!volRange) return;
|
|
40191
40250
|
|
|
40251
|
+
var minData=this.HQChart.GetKData();
|
|
40252
|
+
if (!minData || !IFrameSplitOperator.IsNonEmptyArray(minData.Data)) return;
|
|
40253
|
+
|
|
40192
40254
|
var bHScreen=(this.ChartFrame.IsHScreen===true);
|
|
40193
40255
|
var xPointCount=this.ChartFrame.XPointCount;
|
|
40256
|
+
var minuteCount=this.ChartFrame.MinuteCount;
|
|
40257
|
+
var minIndex=(minData.Data.length-1)%minuteCount;
|
|
40194
40258
|
|
|
40195
|
-
var
|
|
40196
|
-
var
|
|
40259
|
+
var startIndex=xPointCount-1-120;
|
|
40260
|
+
var endIndex=xPointCount-1;
|
|
40261
|
+
for(var i=0;i<this.AryBarRange.length;++i)
|
|
40262
|
+
{
|
|
40263
|
+
var item=this.AryBarRange[i];
|
|
40264
|
+
if (minIndex<(minuteCount-1-item.End))
|
|
40265
|
+
{
|
|
40266
|
+
startIndex=xPointCount-1-item.Start;
|
|
40267
|
+
endIndex=xPointCount-1-item.End;
|
|
40268
|
+
break;
|
|
40269
|
+
}
|
|
40270
|
+
}
|
|
40271
|
+
|
|
40272
|
+
var xStart=this.ChartFrame.GetXFromIndex(startIndex);
|
|
40273
|
+
var xEnd=this.ChartFrame.GetXFromIndex(endIndex);
|
|
40197
40274
|
|
|
40198
40275
|
function _Temp_GetXFromData(value)
|
|
40199
40276
|
{
|
|
@@ -55789,6 +55866,12 @@ function ChartCorssCursor()
|
|
|
55789
55866
|
Icon:g_JSChartResource.CorssCursor.RightButton.Icon
|
|
55790
55867
|
};
|
|
55791
55868
|
|
|
55869
|
+
//底部按钮
|
|
55870
|
+
this.BottomButton=
|
|
55871
|
+
{
|
|
55872
|
+
Enable:false, Rect:null,
|
|
55873
|
+
}
|
|
55874
|
+
|
|
55792
55875
|
this.RightMargin=CloneData(g_JSChartResource.CorssCursor.RightMargin);
|
|
55793
55876
|
this.BottomConfig=CloneData(g_JSChartResource.CorssCursor.BottomText); //底部输出配置
|
|
55794
55877
|
this.LeftConfig=CloneData(g_JSChartResource.CorssCursor.LeftText);
|
|
@@ -55992,6 +56075,7 @@ function ChartCorssCursor()
|
|
|
55992
56075
|
{
|
|
55993
56076
|
this.Status=0;
|
|
55994
56077
|
this.RightButton.Rect=null;
|
|
56078
|
+
this.BottomButton.Rect=null;
|
|
55995
56079
|
this.LastValue=null;
|
|
55996
56080
|
|
|
55997
56081
|
if (!this.LastPoint) return;
|
|
@@ -56397,6 +56481,11 @@ function ChartCorssCursor()
|
|
|
56397
56481
|
this.Canvas.textBaseline="bottom";
|
|
56398
56482
|
this.Canvas.fillStyle=this.TextColor;
|
|
56399
56483
|
this.Canvas.fillText(text,rtBG.Left+textOffset.X,rtBG.Bottom+textOffset.Y,textWidth);
|
|
56484
|
+
|
|
56485
|
+
var buttonData={X:x, Y:y, XValue:xValue, FrameID:yValueExtend.FrameID };
|
|
56486
|
+
if (this.StringFormatX.KItem) buttonData.KItem=this.StringFormatX.KItem;
|
|
56487
|
+
this.BottomButton.Rect=rtBG;
|
|
56488
|
+
this.BottomButton.Data=buttonData;
|
|
56400
56489
|
}
|
|
56401
56490
|
}
|
|
56402
56491
|
|
|
@@ -56616,17 +56705,42 @@ function ChartCorssCursor()
|
|
|
56616
56705
|
}
|
|
56617
56706
|
|
|
56618
56707
|
this.PtInButton=function(x,y)
|
|
56708
|
+
{
|
|
56709
|
+
var item=this.PtInRightButton(x,y);
|
|
56710
|
+
if (item) return item;
|
|
56711
|
+
|
|
56712
|
+
item=this.PtInButtomButton(x,y);
|
|
56713
|
+
if (item) return item;
|
|
56714
|
+
|
|
56715
|
+
return null;
|
|
56716
|
+
}
|
|
56717
|
+
|
|
56718
|
+
this.PtInRightButton=function(x,y)
|
|
56619
56719
|
{
|
|
56620
56720
|
if (!this.RightButton.Enable) return null;
|
|
56621
56721
|
if (!this.RightButton.Rect) return null;
|
|
56622
56722
|
|
|
56623
56723
|
var rect=this.RightButton.Rect;
|
|
56624
|
-
|
|
56625
|
-
this.Canvas.rect(rect.Left,rect.Top,rect.Width,rect.Height);
|
|
56626
|
-
if (this.Canvas.isPointInPath(x,y))
|
|
56724
|
+
if (x>=rect.Left && x<=rect.Right && y>=rect.Top && y<=rect.Bottom)
|
|
56627
56725
|
{
|
|
56628
|
-
return { Data:this.RightButton.Data, Rect:rect };
|
|
56726
|
+
return { Data:this.RightButton.Data, Rect:rect, Type:1 }; //Type:1=右侧 2=底部
|
|
56629
56727
|
}
|
|
56728
|
+
|
|
56729
|
+
return null;
|
|
56730
|
+
}
|
|
56731
|
+
|
|
56732
|
+
this.PtInButtomButton=function(x,y)
|
|
56733
|
+
{
|
|
56734
|
+
if (!this.BottomButton.Enable) return null;
|
|
56735
|
+
if (!this.BottomButton.Rect) return null;
|
|
56736
|
+
|
|
56737
|
+
var rect=this.BottomButton.Rect;
|
|
56738
|
+
if (x>=rect.Left && x<=rect.Right && y>=rect.Top && y<=rect.Bottom)
|
|
56739
|
+
{
|
|
56740
|
+
return { Data:this.BottomButton.Data, Rect:rect , Type:2 }; //Type:1=右侧 2=底部
|
|
56741
|
+
}
|
|
56742
|
+
|
|
56743
|
+
return null;
|
|
56630
56744
|
}
|
|
56631
56745
|
|
|
56632
56746
|
this.DrawTextBGRect=function(x,y, height, width)
|
|
@@ -57674,9 +57788,11 @@ function HQDateStringFormat()
|
|
|
57674
57788
|
|
|
57675
57789
|
this.DateFormatType=0; //0=YYYY-MM-DD 1=YYYY/MM/DD 2=YYYY/MM/DD/W 3=DD/MM/YYYY
|
|
57676
57790
|
this.LanguageID=0;
|
|
57791
|
+
this.KItem=null; //缓存当前的K线
|
|
57677
57792
|
|
|
57678
57793
|
this.Operator=function()
|
|
57679
57794
|
{
|
|
57795
|
+
this.KItem=null;
|
|
57680
57796
|
if (!IFrameSplitOperator.IsNumber(this.Value)) return false;
|
|
57681
57797
|
if (!this.Data) return false;
|
|
57682
57798
|
|
|
@@ -57684,6 +57800,7 @@ function HQDateStringFormat()
|
|
|
57684
57800
|
index=parseInt(index.toFixed(0));
|
|
57685
57801
|
if (this.Data.DataOffset+index>=this.Data.Data.length) return false;
|
|
57686
57802
|
var currentData = this.Data.Data[this.Data.DataOffset+index];
|
|
57803
|
+
this.KItem=currentData;
|
|
57687
57804
|
var dateFormatString="YYYY-MM-DD";
|
|
57688
57805
|
if (this.DateFormatType==1) dateFormatString="YYYY/MM/DD";
|
|
57689
57806
|
else if (this.DateFormatType==2) dateFormatString="YYYY/MM/DD/W";
|
|
@@ -73863,6 +73980,8 @@ function JSChartResource()
|
|
|
73863
73980
|
YOffset:1,
|
|
73864
73981
|
Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
|
|
73865
73982
|
TextColor:"rgb(128,128,128)",
|
|
73983
|
+
|
|
73984
|
+
AryBarRange:[{ Start:240, End:120 }, { Start:120, End:0}],
|
|
73866
73985
|
}
|
|
73867
73986
|
|
|
73868
73987
|
this.DefaultTextColor="rgb(43,54,69)"; //图形中默认的字体颜色
|
|
@@ -75413,7 +75532,7 @@ function JSChartResource()
|
|
|
75413
75532
|
if (item.Font) dest.Font=item.Font;
|
|
75414
75533
|
if (item.TextColor) dest.TextColor=item.TextColor;
|
|
75415
75534
|
if (IFrameSplitOperator.IsNumber(item.BarWidth)) dest.BarWidth=item.BarWidth;
|
|
75416
|
-
if (IFrameSplitOperator.
|
|
75535
|
+
if (IFrameSplitOperator.IsNonEmptyArray(item.AryBarRange)) dest.AryBarRange=item.AryBarRange;
|
|
75417
75536
|
if (IFrameSplitOperator.IsNumber(item.YOffset)) dest.YOffset=item.YOffset;
|
|
75418
75537
|
}
|
|
75419
75538
|
}
|
|
@@ -78626,33 +78745,179 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
78626
78745
|
return;
|
|
78627
78746
|
}
|
|
78628
78747
|
|
|
78748
|
+
return this.ChartOperator_Temp_SetChartCorssCursor(findIndex, item);
|
|
78749
|
+
}
|
|
78750
|
+
else if (id==JSCHART_OPERATOR_ID.OP_MOVE_CORSSCURSOR) //移动十字光标 { Step, Start:{ Date, Time }}
|
|
78751
|
+
{
|
|
78752
|
+
if (!IFrameSplitOperator.IsNumber(obj.Step)) return false;
|
|
78753
|
+
if (obj.Step==0) return false;
|
|
78754
|
+
var step=obj.Step;
|
|
78755
|
+
|
|
78629
78756
|
if (!this.Frame || !this.Frame.SubFrame[0] || !this.Frame.SubFrame[0].Frame) return false;
|
|
78630
|
-
var
|
|
78757
|
+
var showCount=this.Frame.SubFrame[0].Frame.XPointCount; //一屏显示个数
|
|
78631
78758
|
|
|
78632
|
-
var
|
|
78633
|
-
|
|
78759
|
+
var kData=this.GetKData();
|
|
78760
|
+
if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return false; //数据还没有到达
|
|
78634
78761
|
|
|
78635
|
-
|
|
78636
|
-
var
|
|
78637
|
-
|
|
78638
|
-
|
|
78762
|
+
var start=kData.DataOffset;
|
|
78763
|
+
var bDayPeriod=ChartData.IsDayPeriod(this.Period,true);
|
|
78764
|
+
var findItem=null, dataIndex=-1;
|
|
78765
|
+
for(var i=0; i<kData.Data.length; ++i)
|
|
78766
|
+
{
|
|
78767
|
+
var item=kData.Data[i];
|
|
78768
|
+
if (!item) continue;
|
|
78639
78769
|
|
|
78640
|
-
|
|
78641
|
-
|
|
78642
|
-
|
|
78770
|
+
if (bDayPeriod)
|
|
78771
|
+
{
|
|
78772
|
+
if (item.Date==obj.Start.Date)
|
|
78773
|
+
{
|
|
78774
|
+
findItem=item;
|
|
78775
|
+
dataIndex=i;
|
|
78776
|
+
break;
|
|
78777
|
+
}
|
|
78778
|
+
}
|
|
78779
|
+
else
|
|
78780
|
+
{
|
|
78781
|
+
if (item.Date==obj.Start.Date && item.Time==obj.Start.Time)
|
|
78782
|
+
{
|
|
78783
|
+
findItem=item;
|
|
78784
|
+
dataIndex=i;
|
|
78785
|
+
break;
|
|
78786
|
+
}
|
|
78787
|
+
}
|
|
78788
|
+
}
|
|
78643
78789
|
|
|
78644
|
-
|
|
78790
|
+
if (!findItem) return false;
|
|
78645
78791
|
|
|
78646
|
-
var
|
|
78647
|
-
|
|
78648
|
-
|
|
78649
|
-
|
|
78650
|
-
|
|
78651
|
-
|
|
78652
|
-
|
|
78792
|
+
var index=-1;
|
|
78793
|
+
var dataOffset=kData.DataOffset;
|
|
78794
|
+
if (dataIndex>=start && dataIndex<=start+(showCount-1))
|
|
78795
|
+
{
|
|
78796
|
+
index=dataIndex-start;
|
|
78797
|
+
}
|
|
78798
|
+
else //需要调整当前屏范围
|
|
78799
|
+
{
|
|
78800
|
+
if (step>0)
|
|
78801
|
+
{
|
|
78802
|
+
if (dataIndex+showCount>=kData.Data.length)
|
|
78803
|
+
{
|
|
78804
|
+
dataOffset=kData.Data.length-showCount;
|
|
78805
|
+
index=dataIndex-dataOffset;
|
|
78806
|
+
}
|
|
78807
|
+
else
|
|
78808
|
+
{
|
|
78809
|
+
index=0;
|
|
78810
|
+
dataOffset=dataIndex;
|
|
78811
|
+
}
|
|
78812
|
+
}
|
|
78813
|
+
else
|
|
78814
|
+
{
|
|
78815
|
+
if (dataIndex-showCount<0)
|
|
78816
|
+
{
|
|
78817
|
+
dataOffset=0;
|
|
78818
|
+
index=dataIndex;
|
|
78819
|
+
}
|
|
78820
|
+
else if (dataIndex+showCount>=kData.Data.length)
|
|
78821
|
+
{
|
|
78822
|
+
dataOffset=kData.Data.length-showCount;
|
|
78823
|
+
index=dataIndex-dataOffset;
|
|
78824
|
+
}
|
|
78825
|
+
else
|
|
78826
|
+
{
|
|
78827
|
+
index=showCount;
|
|
78828
|
+
dataOffset=dataIndex-showCount;
|
|
78829
|
+
}
|
|
78830
|
+
}
|
|
78831
|
+
}
|
|
78832
|
+
|
|
78833
|
+
var kItem=findItem;
|
|
78834
|
+
if (step>0)
|
|
78835
|
+
{
|
|
78836
|
+
for(var i=dataIndex+1, j=0; i<kData.Data.length && j<step; ++i, ++j)
|
|
78837
|
+
{
|
|
78838
|
+
++index;
|
|
78839
|
+
dataIndex=i;
|
|
78840
|
+
if (index>=(showCount-1))
|
|
78841
|
+
{
|
|
78842
|
+
index=showCount-1;
|
|
78843
|
+
dataOffset+=1;
|
|
78844
|
+
}
|
|
78845
|
+
|
|
78846
|
+
var item=kData.Data[i];
|
|
78847
|
+
if (!item) continue;
|
|
78848
|
+
|
|
78849
|
+
var kItem=item;
|
|
78850
|
+
}
|
|
78851
|
+
}
|
|
78852
|
+
else if (step<0)
|
|
78853
|
+
{
|
|
78854
|
+
for(var i=dataIndex-1, j=0;i>=0 && j<Math.abs(step);--i, ++j)
|
|
78855
|
+
{
|
|
78856
|
+
--index
|
|
78857
|
+
dataIndex=i;
|
|
78858
|
+
if (index<=0)
|
|
78859
|
+
{
|
|
78860
|
+
index=0;
|
|
78861
|
+
dataOffset-=1;
|
|
78862
|
+
}
|
|
78863
|
+
|
|
78864
|
+
var item=kData.Data[i];
|
|
78865
|
+
if (!item) continue;
|
|
78866
|
+
var kItem=item;
|
|
78867
|
+
}
|
|
78868
|
+
}
|
|
78869
|
+
|
|
78870
|
+
if (!kItem) return false;
|
|
78871
|
+
|
|
78872
|
+
obj.KItem=kItem;
|
|
78873
|
+
if (kData.DataOffset==dataOffset)
|
|
78874
|
+
{
|
|
78875
|
+
return this.ChartOperator_Temp_SetChartCorssCursor(index, kItem);
|
|
78876
|
+
}
|
|
78877
|
+
else
|
|
78878
|
+
{
|
|
78879
|
+
kData.DataOffset=dataOffset
|
|
78880
|
+
this.UpdataDataoffset(); //更新数据偏移
|
|
78881
|
+
this.UpdateFrameMaxMin(); //调整坐标最大 最小值
|
|
78882
|
+
this.ResetFrameXSplit();
|
|
78883
|
+
this.Frame.SetSizeChage(true);
|
|
78884
|
+
this.Draw();
|
|
78885
|
+
this.ChartOperator_Temp_SetChartCorssCursor(index, kItem);
|
|
78886
|
+
return true;
|
|
78887
|
+
}
|
|
78653
78888
|
}
|
|
78654
78889
|
}
|
|
78655
78890
|
|
|
78891
|
+
|
|
78892
|
+
this.ChartOperator_Temp_SetChartCorssCursor=function(index, kItem)
|
|
78893
|
+
{
|
|
78894
|
+
if (!this.Frame || !this.Frame.SubFrame[0] || !this.Frame.SubFrame[0].Frame) return false;
|
|
78895
|
+
var frame=this.Frame.SubFrame[0].Frame;
|
|
78896
|
+
|
|
78897
|
+
var x=frame.GetXFromIndex(index);
|
|
78898
|
+
var y=frame.GetYFromData(kItem.Close);
|
|
78899
|
+
|
|
78900
|
+
//保存最后一次鼠标移动信息
|
|
78901
|
+
var MoveStatus={ X:x, Y:y, IsInClient: this.IsMouseOnClient(x,y) };
|
|
78902
|
+
this.LastMouseStatus.OnMouseMove=MoveStatus;
|
|
78903
|
+
this.LastMouseStatus.MoveOnPoint={X:x, Y:y}; //鼠标移动的位置
|
|
78904
|
+
|
|
78905
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_MOUSE_MOVE);
|
|
78906
|
+
var titleChart=this.TitlePaint[0];
|
|
78907
|
+
if (event && titleChart) titleChart.OnMouseMoveEvent=event;
|
|
78908
|
+
|
|
78909
|
+
var pixelTatio = GetDevicePixelRatio();
|
|
78910
|
+
var e={ };
|
|
78911
|
+
e.clientX=(x/pixelTatio)+this.UIElement.getBoundingClientRect().left;
|
|
78912
|
+
e.clientY=(y/pixelTatio)+this.UIElement.getBoundingClientRect().top;
|
|
78913
|
+
this.MoveOnPoint={X:x, Y:y};
|
|
78914
|
+
this.OnMouseMove(x,y,e);
|
|
78915
|
+
this.LastMouseStatus.MoveOnPoint=null;
|
|
78916
|
+
if (titleChart) titleChart.OnMouseMoveEvent=null;
|
|
78917
|
+
|
|
78918
|
+
return true;
|
|
78919
|
+
}
|
|
78920
|
+
|
|
78656
78921
|
//内部函数
|
|
78657
78922
|
this.ChartOperator_Temp_GetHistoryData=function()
|
|
78658
78923
|
{
|
|
@@ -82836,7 +83101,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
82836
83101
|
{
|
|
82837
83102
|
if (this.DragMode==JSCHART_DRAG_ID.CLICK_TOUCH_MODE_ID)
|
|
82838
83103
|
{
|
|
82839
|
-
if (this.
|
|
83104
|
+
if (this.ClickModel.IsShowCorssCursor==true && this.ClickModel.PreventHide) return;
|
|
83105
|
+
if (this.ClickModel.IsShowCorssCursor==true && this.TouchDrawCount>0 ) return;
|
|
82840
83106
|
|
|
82841
83107
|
this.TouchStatus.CorssCursorShow=false;
|
|
82842
83108
|
this.DrawDynamicInfo();
|
|
@@ -82845,7 +83111,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
82845
83111
|
|
|
82846
83112
|
if (this.EnableClickModel===true)
|
|
82847
83113
|
{
|
|
82848
|
-
if (this.ClickModel.IsShowCorssCursor==true && this.
|
|
83114
|
+
if (this.ClickModel.IsShowCorssCursor==true && this.ClickModel.PreventHide) return; //阻止隐藏
|
|
83115
|
+
if (this.ClickModel.IsShowCorssCursor==true && this.TouchDrawCount>0 ) return;
|
|
82849
83116
|
|
|
82850
83117
|
this.ClickModel.IsShowCorssCursor=false;
|
|
82851
83118
|
this.DrawDynamicInfo();
|
|
@@ -87647,6 +87914,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
87647
87914
|
this.TouchDrawCount=0;
|
|
87648
87915
|
this.PhonePinch=null;
|
|
87649
87916
|
this.TouchDrag=null;
|
|
87917
|
+
if (this.ClickModel) this.ClickModel.PreventHide=false;
|
|
87650
87918
|
this.StopDragTimer();
|
|
87651
87919
|
|
|
87652
87920
|
if (this.EnableScrollUpDown==false) e.preventDefault(); //上下拖动图形不能阻止事件
|
|
@@ -89115,6 +89383,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
89115
89383
|
buySellBar.Name="Minute-BuySell-Bar";
|
|
89116
89384
|
buySellBar.Identify="Minute-BuySell-Bar";
|
|
89117
89385
|
buySellBar.BuySellData=this.BuySellData;
|
|
89386
|
+
buySellBar.HQChart=this;
|
|
89118
89387
|
this.ChartPaint[3]=buySellBar;
|
|
89119
89388
|
|
|
89120
89389
|
|
|
@@ -91715,6 +91984,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
91715
91984
|
{
|
|
91716
91985
|
if (this.EnableClickModel===true)
|
|
91717
91986
|
{
|
|
91987
|
+
if (this.ClickModel.IsShowCorssCursor==true && this.ClickModel.PreventHide) return; //阻止隐藏
|
|
91718
91988
|
if (this.ClickModel.IsShowCorssCursor==true && this.TouchDrawCount>0) return;
|
|
91719
91989
|
|
|
91720
91990
|
this.ClickModel.IsShowCorssCursor=false;
|