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.
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;
|
|
@@ -598,7 +613,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
598
613
|
if(option.KLineTitle.IsShowName==false) chart.TitlePaint[0].IsShowName=false;
|
|
599
614
|
if(option.KLineTitle.IsShowSettingInfo==false) chart.TitlePaint[0].IsShowSettingInfo=false;
|
|
600
615
|
if(option.KLineTitle.IsShow == false) chart.TitlePaint[0].IsShow = false;
|
|
601
|
-
if(IFrameSplitOperator.IsBool(item.
|
|
616
|
+
if (IFrameSplitOperator.IsBool(item.IsShowDateTime)) chartTitle.IsShowDateTime=item.IsShowDateTime;
|
|
617
|
+
if (IFrameSplitOperator.IsBool(item.IsTitleShowLatestData)) chart.IsTitleShowLatestData=item.IsTitleShowLatestData;
|
|
602
618
|
|
|
603
619
|
if (item.ShowPosition || item.ShowPostion) //显示位置高级配置
|
|
604
620
|
{
|
|
@@ -981,6 +997,15 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
981
997
|
if (IFrameSplitOperator.IsNumber(item.WheelYMove)) chart.EnableYDrag.WheelYMove=item.WheelYMove;
|
|
982
998
|
}
|
|
983
999
|
|
|
1000
|
+
if (option.FastSlide)
|
|
1001
|
+
{
|
|
1002
|
+
var item=option.FastSlide;
|
|
1003
|
+
if (IFrameSplitOperator.IsNumber(item.MinDistance)) chart.FastSlideConfig.MinDistance=item.MinDistance;
|
|
1004
|
+
if (IFrameSplitOperator.IsNumber(item.MinSpeed)) chart.FastSlideConfig.MinSpeed=item.MinSpeed;
|
|
1005
|
+
if (IFrameSplitOperator.IsNumber(item.MaxTime)) chart.FastSlideConfig.MaxTime=item.MaxTime;
|
|
1006
|
+
if (IFrameSplitOperator.IsBool(item.Enable)) chart.FastSlideConfig.Enable=item.Enable;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
984
1009
|
//分页
|
|
985
1010
|
if (option.PageInfo) chart.SetPageInfo(option.PageInfo);
|
|
986
1011
|
|
|
@@ -1002,6 +1027,12 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
1002
1027
|
if (IFrameSplitOperator.IsBool(item.RightButton.Enable)) chart.ChartCorssCursor.RightButton.Enable=item.RightButton.Enable;
|
|
1003
1028
|
}
|
|
1004
1029
|
|
|
1030
|
+
if (item.BottomButton)
|
|
1031
|
+
{
|
|
1032
|
+
var subItem=item.BottomButton;
|
|
1033
|
+
if (IFrameSplitOperator.IsBool(subItem.Enable)) chart.ChartCorssCursor.BottomButton.Enable=subItem.Enable;
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1005
1036
|
if (IFrameSplitOperator.IsNumber(item.PriceFormatType)) chart.ChartCorssCursor.StringFormatY.PriceFormatType=item.PriceFormatType;
|
|
1006
1037
|
if (IFrameSplitOperator.IsNumber(item.DataFormatType)) chart.ChartCorssCursor.StringFormatY.DataFormatType=item.DataFormatType;
|
|
1007
1038
|
|
|
@@ -2739,7 +2770,9 @@ var JSCHART_EVENT_ID=
|
|
|
2739
2770
|
|
|
2740
2771
|
ON_FORMAT_OVERLAY_INDEX_OUT_TEXT:168, //格式化叠指标标题
|
|
2741
2772
|
|
|
2742
|
-
ON_TOUCH_FAST_SLIDE:169 //快速滑动
|
|
2773
|
+
ON_TOUCH_FAST_SLIDE:169, //快速滑动
|
|
2774
|
+
|
|
2775
|
+
ON_CLICK_CROSSCURSOR_BOTTOM:170, //十字光标底部文字点击
|
|
2743
2776
|
}
|
|
2744
2777
|
|
|
2745
2778
|
var JSCHART_OPERATOR_ID=
|
|
@@ -2768,6 +2801,8 @@ var JSCHART_OPERATOR_ID=
|
|
|
2768
2801
|
|
|
2769
2802
|
OP_GOTO:16, //移动到某一个天或某一个分钟
|
|
2770
2803
|
OP_GOTO_BY_DATAINDEX:17, //的移动到某一个数据起始位置
|
|
2804
|
+
|
|
2805
|
+
OP_MOVE_CORSSCURSOR:18, //移动十字光标 { Step, Start:{ Date:, Time: } }
|
|
2771
2806
|
}
|
|
2772
2807
|
|
|
2773
2808
|
var JSCHART_DRAG_ID=
|
|
@@ -3169,7 +3204,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3169
3204
|
this.EnableVerticalDrag=false;
|
|
3170
3205
|
|
|
3171
3206
|
//十字光标长留(手势才有)
|
|
3172
|
-
this.ClickModel={ IsShowCorssCursor:false };
|
|
3207
|
+
this.ClickModel={ IsShowCorssCursor:false, PreventHide:false }; //PreventHide 阻止隐藏十字光标
|
|
3173
3208
|
this.EnableClickModel=false;
|
|
3174
3209
|
|
|
3175
3210
|
//标题栏显示最新数据
|
|
@@ -3200,7 +3235,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3200
3235
|
//SecondKeyID 1=shiftKey 2=ctrlKey 3=altKey
|
|
3201
3236
|
this.AryHotKey=[]; //热键 { KeyID:87, SecondKeyID:1, CMD:JSCHART_MENU_ID.CMD_FULLSCREEN_SUMMARY_ID, Args:null, Description:"Alt+W 全屏区间统计" },
|
|
3202
3237
|
|
|
3203
|
-
this.FastSlideConfig={ MinDistance:500, MinSpeed:3, MaxTime:250 }; //快速滑动配置 MinDistance=最小的距离 MinSpeed=最小速度 MaxTime=最大间隔时间(ms)
|
|
3238
|
+
this.FastSlideConfig={ MinDistance:500, MinSpeed:3, MaxTime:250, Enable:false }; //快速滑动配置 MinDistance=最小的距离 MinSpeed=最小速度 MaxTime=最大间隔时间(ms)
|
|
3204
3239
|
|
|
3205
3240
|
this.RestoreFocus=function(delay)
|
|
3206
3241
|
{
|
|
@@ -3794,11 +3829,23 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3794
3829
|
var button=this.ChartCorssCursor.PtInButton(x,y);
|
|
3795
3830
|
if (!button) return false;
|
|
3796
3831
|
|
|
3797
|
-
|
|
3798
|
-
if (event && event.Callback)
|
|
3832
|
+
if (button.Type==1)
|
|
3799
3833
|
{
|
|
3800
|
-
var
|
|
3801
|
-
event.Callback
|
|
3834
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_CROSSCURSOR_RIGHT);
|
|
3835
|
+
if (event && event.Callback)
|
|
3836
|
+
{
|
|
3837
|
+
var sendData={ Button:button, e };
|
|
3838
|
+
event.Callback(event,sendData,this);
|
|
3839
|
+
}
|
|
3840
|
+
}
|
|
3841
|
+
else if (button.Type==2)
|
|
3842
|
+
{
|
|
3843
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_CROSSCURSOR_BOTTOM);
|
|
3844
|
+
if (event && event.Callback)
|
|
3845
|
+
{
|
|
3846
|
+
var sendData={ Button:button, e };
|
|
3847
|
+
event.Callback(event,sendData,this);
|
|
3848
|
+
}
|
|
3802
3849
|
}
|
|
3803
3850
|
|
|
3804
3851
|
return true;
|
|
@@ -5308,6 +5355,11 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
5308
5355
|
return true;
|
|
5309
5356
|
}
|
|
5310
5357
|
|
|
5358
|
+
if (this.TryClickCrossCursor(x,y))
|
|
5359
|
+
{
|
|
5360
|
+
return true;
|
|
5361
|
+
}
|
|
5362
|
+
|
|
5311
5363
|
return false;
|
|
5312
5364
|
}
|
|
5313
5365
|
|
|
@@ -5320,6 +5372,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
5320
5372
|
this.TouchDrawCount=0;
|
|
5321
5373
|
this.PhonePinch=null;
|
|
5322
5374
|
this.TouchDrag=null;
|
|
5375
|
+
if (this.ClickModel) this.ClickModel.PreventHide=false;
|
|
5323
5376
|
this.StopDragTimer();
|
|
5324
5377
|
|
|
5325
5378
|
var isSingleTouch=this.IsSingleTouch(e);
|
|
@@ -5334,7 +5387,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
5334
5387
|
var touches = this.GetToucheData(e, this.IsForceLandscape);
|
|
5335
5388
|
var pt=this.PointAbsoluteToRelative(touches[0].clientX, touches[0].clientY, true);
|
|
5336
5389
|
|
|
5337
|
-
if (this.TryPhoneClickButton(pt.X, pt.Y, e))
|
|
5390
|
+
if (this.TryPhoneClickButton(pt.X, pt.Y, e))
|
|
5391
|
+
return;
|
|
5338
5392
|
|
|
5339
5393
|
if (this.EnableVerticalDrag )
|
|
5340
5394
|
{
|
|
@@ -6706,6 +6760,10 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
6706
6760
|
{
|
|
6707
6761
|
if (this.TouchStatus.CorssCursorShow==true) this.ChartCorssCursor.Draw();
|
|
6708
6762
|
}
|
|
6763
|
+
else if (this.EnableClickModel)
|
|
6764
|
+
{
|
|
6765
|
+
if (this.ClickModel.IsShowCorssCursor===true) this.ChartCorssCursor.Draw();
|
|
6766
|
+
}
|
|
6709
6767
|
else if (this.IsOnTouch===false && this.CurrentChartDrawPicture && this.CurrentChartDrawPicture.IsShowCorssCursor===true) //开始绘图
|
|
6710
6768
|
{
|
|
6711
6769
|
this.ChartCorssCursor.Draw();
|
|
@@ -9711,6 +9769,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
9711
9769
|
titlePaint.Canvas=this.Canvas;
|
|
9712
9770
|
titlePaint.LanguageID=this.LanguageID;
|
|
9713
9771
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
9772
|
+
titlePaint.HQChart=this;
|
|
9714
9773
|
this.TitlePaint[index+1]=titlePaint;
|
|
9715
9774
|
|
|
9716
9775
|
this.SetSubFrameOption(subFrame,option);
|
|
@@ -10204,6 +10263,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
10204
10263
|
titlePaint.LanguageID=this.LanguageID;
|
|
10205
10264
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
10206
10265
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
10266
|
+
titlePaint.HQChart=this;
|
|
10207
10267
|
this.TitlePaint[index+1]=titlePaint;
|
|
10208
10268
|
|
|
10209
10269
|
this.SetSubFrameOption(subFrame, option);
|
|
@@ -11571,11 +11631,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
11571
11631
|
{
|
|
11572
11632
|
if (!this.TouchDrag) return false;
|
|
11573
11633
|
if (!this.FastSlideConfig) return false;
|
|
11634
|
+
var config=this.FastSlideConfig;
|
|
11635
|
+
if (!config.Enable) return false;
|
|
11574
11636
|
|
|
11575
11637
|
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_TOUCH_FAST_SLIDE);
|
|
11576
11638
|
if (!event || !event.Callback) return false;
|
|
11577
11639
|
|
|
11578
|
-
|
|
11640
|
+
|
|
11579
11641
|
var drag=this.TouchDrag;
|
|
11580
11642
|
var time=Date.now();
|
|
11581
11643
|
var spanTime=time-drag.StartTime;
|
|
@@ -40158,7 +40220,7 @@ function ChartMinuteBuySellBar()
|
|
|
40158
40220
|
this.BuyColor=g_JSChartResource.Minute.BuySellBar.BuyColor;
|
|
40159
40221
|
this.SellColor=g_JSChartResource.Minute.BuySellBar.SellColor;
|
|
40160
40222
|
this.BarWidth=g_JSChartResource.Minute.BuySellBar.BarWidth;
|
|
40161
|
-
this.
|
|
40223
|
+
this.AryBarRange=g_JSChartResource.Minute.BuySellBar.AryBarRange;
|
|
40162
40224
|
this.YOffset=g_JSChartResource.Minute.BuySellBar.YOffset;
|
|
40163
40225
|
this.Font=g_JSChartResource.Minute.BuySellBar.Font;
|
|
40164
40226
|
this.TextColor=g_JSChartResource.Minute.BuySellBar.TextColor;
|
|
@@ -40173,7 +40235,7 @@ function ChartMinuteBuySellBar()
|
|
|
40173
40235
|
this.BuyColor=g_JSChartResource.Minute.BuySellBar.BuyColor;
|
|
40174
40236
|
this.SellColor=g_JSChartResource.Minute.BuySellBar.SellColor;
|
|
40175
40237
|
this.BarWidth=g_JSChartResource.Minute.BuySellBar.BarWidth;
|
|
40176
|
-
this.
|
|
40238
|
+
this.AryBarRange=g_JSChartResource.Minute.BuySellBar.AryBarRange;
|
|
40177
40239
|
this.YOffset=g_JSChartResource.Minute.BuySellBar.YOffset;
|
|
40178
40240
|
this.Font=g_JSChartResource.Minute.BuySellBar.Font;
|
|
40179
40241
|
this.TextColor=g_JSChartResource.Minute.BuySellBar.TextColor;
|
|
@@ -40189,11 +40251,29 @@ function ChartMinuteBuySellBar()
|
|
|
40189
40251
|
var volRange=this.GetVolRange();
|
|
40190
40252
|
if (!volRange) return;
|
|
40191
40253
|
|
|
40254
|
+
var minData=this.HQChart.GetKData();
|
|
40255
|
+
if (!minData || !IFrameSplitOperator.IsNonEmptyArray(minData.Data)) return;
|
|
40256
|
+
|
|
40192
40257
|
var bHScreen=(this.ChartFrame.IsHScreen===true);
|
|
40193
40258
|
var xPointCount=this.ChartFrame.XPointCount;
|
|
40259
|
+
var minuteCount=this.ChartFrame.MinuteCount;
|
|
40260
|
+
var minIndex=(minData.Data.length-1)%minuteCount;
|
|
40261
|
+
|
|
40262
|
+
var startIndex=xPointCount-1-120;
|
|
40263
|
+
var endIndex=xPointCount-1;
|
|
40264
|
+
for(var i=0;i<this.AryBarRange.length;++i)
|
|
40265
|
+
{
|
|
40266
|
+
var item=this.AryBarRange[i];
|
|
40267
|
+
if (minIndex<(minuteCount-1-item.End))
|
|
40268
|
+
{
|
|
40269
|
+
startIndex=xPointCount-1-item.Start;
|
|
40270
|
+
endIndex=xPointCount-1-item.End;
|
|
40271
|
+
break;
|
|
40272
|
+
}
|
|
40273
|
+
}
|
|
40194
40274
|
|
|
40195
|
-
var xStart=this.ChartFrame.GetXFromIndex(
|
|
40196
|
-
var xEnd=this.ChartFrame.GetXFromIndex(
|
|
40275
|
+
var xStart=this.ChartFrame.GetXFromIndex(startIndex);
|
|
40276
|
+
var xEnd=this.ChartFrame.GetXFromIndex(endIndex);
|
|
40197
40277
|
|
|
40198
40278
|
function _Temp_GetXFromData(value)
|
|
40199
40279
|
{
|
|
@@ -55789,6 +55869,12 @@ function ChartCorssCursor()
|
|
|
55789
55869
|
Icon:g_JSChartResource.CorssCursor.RightButton.Icon
|
|
55790
55870
|
};
|
|
55791
55871
|
|
|
55872
|
+
//底部按钮
|
|
55873
|
+
this.BottomButton=
|
|
55874
|
+
{
|
|
55875
|
+
Enable:false, Rect:null,
|
|
55876
|
+
}
|
|
55877
|
+
|
|
55792
55878
|
this.RightMargin=CloneData(g_JSChartResource.CorssCursor.RightMargin);
|
|
55793
55879
|
this.BottomConfig=CloneData(g_JSChartResource.CorssCursor.BottomText); //底部输出配置
|
|
55794
55880
|
this.LeftConfig=CloneData(g_JSChartResource.CorssCursor.LeftText);
|
|
@@ -55992,6 +56078,7 @@ function ChartCorssCursor()
|
|
|
55992
56078
|
{
|
|
55993
56079
|
this.Status=0;
|
|
55994
56080
|
this.RightButton.Rect=null;
|
|
56081
|
+
this.BottomButton.Rect=null;
|
|
55995
56082
|
this.LastValue=null;
|
|
55996
56083
|
|
|
55997
56084
|
if (!this.LastPoint) return;
|
|
@@ -56397,6 +56484,11 @@ function ChartCorssCursor()
|
|
|
56397
56484
|
this.Canvas.textBaseline="bottom";
|
|
56398
56485
|
this.Canvas.fillStyle=this.TextColor;
|
|
56399
56486
|
this.Canvas.fillText(text,rtBG.Left+textOffset.X,rtBG.Bottom+textOffset.Y,textWidth);
|
|
56487
|
+
|
|
56488
|
+
var buttonData={X:x, Y:y, XValue:xValue, FrameID:yValueExtend.FrameID };
|
|
56489
|
+
if (this.StringFormatX.KItem) buttonData.KItem=this.StringFormatX.KItem;
|
|
56490
|
+
this.BottomButton.Rect=rtBG;
|
|
56491
|
+
this.BottomButton.Data=buttonData;
|
|
56400
56492
|
}
|
|
56401
56493
|
}
|
|
56402
56494
|
|
|
@@ -56616,17 +56708,42 @@ function ChartCorssCursor()
|
|
|
56616
56708
|
}
|
|
56617
56709
|
|
|
56618
56710
|
this.PtInButton=function(x,y)
|
|
56711
|
+
{
|
|
56712
|
+
var item=this.PtInRightButton(x,y);
|
|
56713
|
+
if (item) return item;
|
|
56714
|
+
|
|
56715
|
+
item=this.PtInButtomButton(x,y);
|
|
56716
|
+
if (item) return item;
|
|
56717
|
+
|
|
56718
|
+
return null;
|
|
56719
|
+
}
|
|
56720
|
+
|
|
56721
|
+
this.PtInRightButton=function(x,y)
|
|
56619
56722
|
{
|
|
56620
56723
|
if (!this.RightButton.Enable) return null;
|
|
56621
56724
|
if (!this.RightButton.Rect) return null;
|
|
56622
56725
|
|
|
56623
56726
|
var rect=this.RightButton.Rect;
|
|
56624
|
-
|
|
56625
|
-
|
|
56626
|
-
|
|
56727
|
+
if (x>=rect.Left && x<=rect.Right && y>=rect.Top && y<=rect.Bottom)
|
|
56728
|
+
{
|
|
56729
|
+
return { Data:this.RightButton.Data, Rect:rect, Type:1 }; //Type:1=右侧 2=底部
|
|
56730
|
+
}
|
|
56731
|
+
|
|
56732
|
+
return null;
|
|
56733
|
+
}
|
|
56734
|
+
|
|
56735
|
+
this.PtInButtomButton=function(x,y)
|
|
56736
|
+
{
|
|
56737
|
+
if (!this.BottomButton.Enable) return null;
|
|
56738
|
+
if (!this.BottomButton.Rect) return null;
|
|
56739
|
+
|
|
56740
|
+
var rect=this.BottomButton.Rect;
|
|
56741
|
+
if (x>=rect.Left && x<=rect.Right && y>=rect.Top && y<=rect.Bottom)
|
|
56627
56742
|
{
|
|
56628
|
-
return { Data:this.
|
|
56743
|
+
return { Data:this.BottomButton.Data, Rect:rect , Type:2 }; //Type:1=右侧 2=底部
|
|
56629
56744
|
}
|
|
56745
|
+
|
|
56746
|
+
return null;
|
|
56630
56747
|
}
|
|
56631
56748
|
|
|
56632
56749
|
this.DrawTextBGRect=function(x,y, height, width)
|
|
@@ -57674,9 +57791,11 @@ function HQDateStringFormat()
|
|
|
57674
57791
|
|
|
57675
57792
|
this.DateFormatType=0; //0=YYYY-MM-DD 1=YYYY/MM/DD 2=YYYY/MM/DD/W 3=DD/MM/YYYY
|
|
57676
57793
|
this.LanguageID=0;
|
|
57794
|
+
this.KItem=null; //缓存当前的K线
|
|
57677
57795
|
|
|
57678
57796
|
this.Operator=function()
|
|
57679
57797
|
{
|
|
57798
|
+
this.KItem=null;
|
|
57680
57799
|
if (!IFrameSplitOperator.IsNumber(this.Value)) return false;
|
|
57681
57800
|
if (!this.Data) return false;
|
|
57682
57801
|
|
|
@@ -57684,6 +57803,7 @@ function HQDateStringFormat()
|
|
|
57684
57803
|
index=parseInt(index.toFixed(0));
|
|
57685
57804
|
if (this.Data.DataOffset+index>=this.Data.Data.length) return false;
|
|
57686
57805
|
var currentData = this.Data.Data[this.Data.DataOffset+index];
|
|
57806
|
+
this.KItem=currentData;
|
|
57687
57807
|
var dateFormatString="YYYY-MM-DD";
|
|
57688
57808
|
if (this.DateFormatType==1) dateFormatString="YYYY/MM/DD";
|
|
57689
57809
|
else if (this.DateFormatType==2) dateFormatString="YYYY/MM/DD/W";
|
|
@@ -59240,7 +59360,14 @@ function DynamicKLineTitlePainting()
|
|
|
59240
59360
|
|
|
59241
59361
|
this.IsShowLastData=function()
|
|
59242
59362
|
{
|
|
59363
|
+
if (this.HQChart && this.HQChart.EnableClickModel && this.HQChart.ClickModel)
|
|
59364
|
+
{
|
|
59365
|
+
var clickModel=this.HQChart.ClickModel;
|
|
59366
|
+
if (clickModel.IsShowCorssCursor) return false;
|
|
59367
|
+
}
|
|
59368
|
+
|
|
59243
59369
|
var isShow=false;
|
|
59370
|
+
|
|
59244
59371
|
if (this.DrawStatus && this.DrawStatus.IsTitleShowLatestData)
|
|
59245
59372
|
{
|
|
59246
59373
|
var status=this.DrawStatus;
|
|
@@ -60585,6 +60712,12 @@ function DynamicChartTitlePainting()
|
|
|
60585
60712
|
|
|
60586
60713
|
this.IsShowLastData=function()
|
|
60587
60714
|
{
|
|
60715
|
+
if (this.HQChart && this.HQChart.EnableClickModel && this.HQChart.ClickModel)
|
|
60716
|
+
{
|
|
60717
|
+
var clickModel=this.HQChart.ClickModel;
|
|
60718
|
+
if (clickModel.IsShowCorssCursor) return false;
|
|
60719
|
+
}
|
|
60720
|
+
|
|
60588
60721
|
var isShowLastData=false;
|
|
60589
60722
|
if (this.DrawStatus && this.DrawStatus.IsTitleShowLatestData)
|
|
60590
60723
|
{
|
|
@@ -73863,6 +73996,8 @@ function JSChartResource()
|
|
|
73863
73996
|
YOffset:1,
|
|
73864
73997
|
Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
|
|
73865
73998
|
TextColor:"rgb(128,128,128)",
|
|
73999
|
+
|
|
74000
|
+
AryBarRange:[{ Start:240, End:120 }, { Start:120, End:0}],
|
|
73866
74001
|
}
|
|
73867
74002
|
|
|
73868
74003
|
this.DefaultTextColor="rgb(43,54,69)"; //图形中默认的字体颜色
|
|
@@ -75413,7 +75548,7 @@ function JSChartResource()
|
|
|
75413
75548
|
if (item.Font) dest.Font=item.Font;
|
|
75414
75549
|
if (item.TextColor) dest.TextColor=item.TextColor;
|
|
75415
75550
|
if (IFrameSplitOperator.IsNumber(item.BarWidth)) dest.BarWidth=item.BarWidth;
|
|
75416
|
-
if (IFrameSplitOperator.
|
|
75551
|
+
if (IFrameSplitOperator.IsNonEmptyArray(item.AryBarRange)) dest.AryBarRange=item.AryBarRange;
|
|
75417
75552
|
if (IFrameSplitOperator.IsNumber(item.YOffset)) dest.YOffset=item.YOffset;
|
|
75418
75553
|
}
|
|
75419
75554
|
}
|
|
@@ -78626,33 +78761,179 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
78626
78761
|
return;
|
|
78627
78762
|
}
|
|
78628
78763
|
|
|
78764
|
+
return this.ChartOperator_Temp_SetChartCorssCursor(findIndex, item);
|
|
78765
|
+
}
|
|
78766
|
+
else if (id==JSCHART_OPERATOR_ID.OP_MOVE_CORSSCURSOR) //移动十字光标 { Step, Start:{ Date, Time }}
|
|
78767
|
+
{
|
|
78768
|
+
if (!IFrameSplitOperator.IsNumber(obj.Step)) return false;
|
|
78769
|
+
if (obj.Step==0) return false;
|
|
78770
|
+
var step=obj.Step;
|
|
78771
|
+
|
|
78629
78772
|
if (!this.Frame || !this.Frame.SubFrame[0] || !this.Frame.SubFrame[0].Frame) return false;
|
|
78630
|
-
var
|
|
78773
|
+
var showCount=this.Frame.SubFrame[0].Frame.XPointCount; //一屏显示个数
|
|
78631
78774
|
|
|
78632
|
-
var
|
|
78633
|
-
|
|
78775
|
+
var kData=this.GetKData();
|
|
78776
|
+
if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return false; //数据还没有到达
|
|
78634
78777
|
|
|
78635
|
-
|
|
78636
|
-
var
|
|
78637
|
-
|
|
78638
|
-
|
|
78778
|
+
var start=kData.DataOffset;
|
|
78779
|
+
var bDayPeriod=ChartData.IsDayPeriod(this.Period,true);
|
|
78780
|
+
var findItem=null, dataIndex=-1;
|
|
78781
|
+
for(var i=0; i<kData.Data.length; ++i)
|
|
78782
|
+
{
|
|
78783
|
+
var item=kData.Data[i];
|
|
78784
|
+
if (!item) continue;
|
|
78639
78785
|
|
|
78640
|
-
|
|
78641
|
-
|
|
78642
|
-
|
|
78786
|
+
if (bDayPeriod)
|
|
78787
|
+
{
|
|
78788
|
+
if (item.Date==obj.Start.Date)
|
|
78789
|
+
{
|
|
78790
|
+
findItem=item;
|
|
78791
|
+
dataIndex=i;
|
|
78792
|
+
break;
|
|
78793
|
+
}
|
|
78794
|
+
}
|
|
78795
|
+
else
|
|
78796
|
+
{
|
|
78797
|
+
if (item.Date==obj.Start.Date && item.Time==obj.Start.Time)
|
|
78798
|
+
{
|
|
78799
|
+
findItem=item;
|
|
78800
|
+
dataIndex=i;
|
|
78801
|
+
break;
|
|
78802
|
+
}
|
|
78803
|
+
}
|
|
78804
|
+
}
|
|
78643
78805
|
|
|
78644
|
-
|
|
78806
|
+
if (!findItem) return false;
|
|
78645
78807
|
|
|
78646
|
-
var
|
|
78647
|
-
|
|
78648
|
-
|
|
78649
|
-
|
|
78650
|
-
|
|
78651
|
-
|
|
78652
|
-
|
|
78808
|
+
var index=-1;
|
|
78809
|
+
var dataOffset=kData.DataOffset;
|
|
78810
|
+
if (dataIndex>=start && dataIndex<=start+(showCount-1))
|
|
78811
|
+
{
|
|
78812
|
+
index=dataIndex-start;
|
|
78813
|
+
}
|
|
78814
|
+
else //需要调整当前屏范围
|
|
78815
|
+
{
|
|
78816
|
+
if (step>0)
|
|
78817
|
+
{
|
|
78818
|
+
if (dataIndex+showCount>=kData.Data.length)
|
|
78819
|
+
{
|
|
78820
|
+
dataOffset=kData.Data.length-showCount;
|
|
78821
|
+
index=dataIndex-dataOffset;
|
|
78822
|
+
}
|
|
78823
|
+
else
|
|
78824
|
+
{
|
|
78825
|
+
index=0;
|
|
78826
|
+
dataOffset=dataIndex;
|
|
78827
|
+
}
|
|
78828
|
+
}
|
|
78829
|
+
else
|
|
78830
|
+
{
|
|
78831
|
+
if (dataIndex-showCount<0)
|
|
78832
|
+
{
|
|
78833
|
+
dataOffset=0;
|
|
78834
|
+
index=dataIndex;
|
|
78835
|
+
}
|
|
78836
|
+
else if (dataIndex+showCount>=kData.Data.length)
|
|
78837
|
+
{
|
|
78838
|
+
dataOffset=kData.Data.length-showCount;
|
|
78839
|
+
index=dataIndex-dataOffset;
|
|
78840
|
+
}
|
|
78841
|
+
else
|
|
78842
|
+
{
|
|
78843
|
+
index=showCount;
|
|
78844
|
+
dataOffset=dataIndex-showCount;
|
|
78845
|
+
}
|
|
78846
|
+
}
|
|
78847
|
+
}
|
|
78848
|
+
|
|
78849
|
+
var kItem=findItem;
|
|
78850
|
+
if (step>0)
|
|
78851
|
+
{
|
|
78852
|
+
for(var i=dataIndex+1, j=0; i<kData.Data.length && j<step; ++i, ++j)
|
|
78853
|
+
{
|
|
78854
|
+
++index;
|
|
78855
|
+
dataIndex=i;
|
|
78856
|
+
if (index>=(showCount-1))
|
|
78857
|
+
{
|
|
78858
|
+
index=showCount-1;
|
|
78859
|
+
dataOffset+=1;
|
|
78860
|
+
}
|
|
78861
|
+
|
|
78862
|
+
var item=kData.Data[i];
|
|
78863
|
+
if (!item) continue;
|
|
78864
|
+
|
|
78865
|
+
var kItem=item;
|
|
78866
|
+
}
|
|
78867
|
+
}
|
|
78868
|
+
else if (step<0)
|
|
78869
|
+
{
|
|
78870
|
+
for(var i=dataIndex-1, j=0;i>=0 && j<Math.abs(step);--i, ++j)
|
|
78871
|
+
{
|
|
78872
|
+
--index
|
|
78873
|
+
dataIndex=i;
|
|
78874
|
+
if (index<=0)
|
|
78875
|
+
{
|
|
78876
|
+
index=0;
|
|
78877
|
+
dataOffset-=1;
|
|
78878
|
+
}
|
|
78879
|
+
|
|
78880
|
+
var item=kData.Data[i];
|
|
78881
|
+
if (!item) continue;
|
|
78882
|
+
var kItem=item;
|
|
78883
|
+
}
|
|
78884
|
+
}
|
|
78885
|
+
|
|
78886
|
+
if (!kItem) return false;
|
|
78887
|
+
|
|
78888
|
+
obj.KItem=kItem;
|
|
78889
|
+
if (kData.DataOffset==dataOffset)
|
|
78890
|
+
{
|
|
78891
|
+
return this.ChartOperator_Temp_SetChartCorssCursor(index, kItem);
|
|
78892
|
+
}
|
|
78893
|
+
else
|
|
78894
|
+
{
|
|
78895
|
+
kData.DataOffset=dataOffset
|
|
78896
|
+
this.UpdataDataoffset(); //更新数据偏移
|
|
78897
|
+
this.UpdateFrameMaxMin(); //调整坐标最大 最小值
|
|
78898
|
+
this.ResetFrameXSplit();
|
|
78899
|
+
this.Frame.SetSizeChage(true);
|
|
78900
|
+
this.Draw();
|
|
78901
|
+
this.ChartOperator_Temp_SetChartCorssCursor(index, kItem);
|
|
78902
|
+
return true;
|
|
78903
|
+
}
|
|
78653
78904
|
}
|
|
78654
78905
|
}
|
|
78655
78906
|
|
|
78907
|
+
|
|
78908
|
+
this.ChartOperator_Temp_SetChartCorssCursor=function(index, kItem)
|
|
78909
|
+
{
|
|
78910
|
+
if (!this.Frame || !this.Frame.SubFrame[0] || !this.Frame.SubFrame[0].Frame) return false;
|
|
78911
|
+
var frame=this.Frame.SubFrame[0].Frame;
|
|
78912
|
+
|
|
78913
|
+
var x=frame.GetXFromIndex(index);
|
|
78914
|
+
var y=frame.GetYFromData(kItem.Close);
|
|
78915
|
+
|
|
78916
|
+
//保存最后一次鼠标移动信息
|
|
78917
|
+
var MoveStatus={ X:x, Y:y, IsInClient: this.IsMouseOnClient(x,y) };
|
|
78918
|
+
this.LastMouseStatus.OnMouseMove=MoveStatus;
|
|
78919
|
+
this.LastMouseStatus.MoveOnPoint={X:x, Y:y}; //鼠标移动的位置
|
|
78920
|
+
|
|
78921
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_MOUSE_MOVE);
|
|
78922
|
+
var titleChart=this.TitlePaint[0];
|
|
78923
|
+
if (event && titleChart) titleChart.OnMouseMoveEvent=event;
|
|
78924
|
+
|
|
78925
|
+
var pixelTatio = GetDevicePixelRatio();
|
|
78926
|
+
var e={ };
|
|
78927
|
+
e.clientX=(x/pixelTatio)+this.UIElement.getBoundingClientRect().left;
|
|
78928
|
+
e.clientY=(y/pixelTatio)+this.UIElement.getBoundingClientRect().top;
|
|
78929
|
+
this.MoveOnPoint={X:x, Y:y};
|
|
78930
|
+
this.OnMouseMove(x,y,e);
|
|
78931
|
+
this.LastMouseStatus.MoveOnPoint=null;
|
|
78932
|
+
if (titleChart) titleChart.OnMouseMoveEvent=null;
|
|
78933
|
+
|
|
78934
|
+
return true;
|
|
78935
|
+
}
|
|
78936
|
+
|
|
78656
78937
|
//内部函数
|
|
78657
78938
|
this.ChartOperator_Temp_GetHistoryData=function()
|
|
78658
78939
|
{
|
|
@@ -78900,7 +79181,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
78900
79181
|
titlePaint.LanguageID=this.LanguageID;
|
|
78901
79182
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
78902
79183
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
78903
|
-
|
|
79184
|
+
titlePaint.HQChart=this;
|
|
78904
79185
|
this.TitlePaint.push(titlePaint);
|
|
78905
79186
|
}
|
|
78906
79187
|
|
|
@@ -82388,6 +82669,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
82388
82669
|
titlePaint.LanguageID=this.LanguageID;
|
|
82389
82670
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
82390
82671
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
82672
|
+
titlePaint.HQChart=this;
|
|
82391
82673
|
this.TitlePaint[i+1]=titlePaint;
|
|
82392
82674
|
}
|
|
82393
82675
|
|
|
@@ -82532,6 +82814,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
82532
82814
|
titlePaint.LanguageID=this.LanguageID;
|
|
82533
82815
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
82534
82816
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
82817
|
+
titlePaint.HQChart=this;
|
|
82535
82818
|
this.TitlePaint[i+1]=titlePaint;
|
|
82536
82819
|
}
|
|
82537
82820
|
}
|
|
@@ -82836,7 +83119,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
82836
83119
|
{
|
|
82837
83120
|
if (this.DragMode==JSCHART_DRAG_ID.CLICK_TOUCH_MODE_ID)
|
|
82838
83121
|
{
|
|
82839
|
-
if (this.
|
|
83122
|
+
if (this.ClickModel.IsShowCorssCursor==true && this.ClickModel.PreventHide) return;
|
|
83123
|
+
if (this.ClickModel.IsShowCorssCursor==true && this.TouchDrawCount>0 ) return;
|
|
82840
83124
|
|
|
82841
83125
|
this.TouchStatus.CorssCursorShow=false;
|
|
82842
83126
|
this.DrawDynamicInfo();
|
|
@@ -82845,7 +83129,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
82845
83129
|
|
|
82846
83130
|
if (this.EnableClickModel===true)
|
|
82847
83131
|
{
|
|
82848
|
-
if (this.ClickModel.IsShowCorssCursor==true && this.
|
|
83132
|
+
if (this.ClickModel.IsShowCorssCursor==true && this.ClickModel.PreventHide) return; //阻止隐藏
|
|
83133
|
+
if (this.ClickModel.IsShowCorssCursor==true && this.TouchDrawCount>0 ) return;
|
|
82849
83134
|
|
|
82850
83135
|
this.ClickModel.IsShowCorssCursor=false;
|
|
82851
83136
|
this.DrawDynamicInfo();
|
|
@@ -87647,6 +87932,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
87647
87932
|
this.TouchDrawCount=0;
|
|
87648
87933
|
this.PhonePinch=null;
|
|
87649
87934
|
this.TouchDrag=null;
|
|
87935
|
+
if (this.ClickModel) this.ClickModel.PreventHide=false;
|
|
87650
87936
|
this.StopDragTimer();
|
|
87651
87937
|
|
|
87652
87938
|
if (this.EnableScrollUpDown==false) e.preventDefault(); //上下拖动图形不能阻止事件
|
|
@@ -88766,6 +89052,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
88766
89052
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
88767
89053
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
88768
89054
|
titlePaint.MainTitlePaint=this.TitlePaint[0];
|
|
89055
|
+
titlePaint.HQChart=this;
|
|
88769
89056
|
this.TitlePaint.push(titlePaint);
|
|
88770
89057
|
}
|
|
88771
89058
|
|
|
@@ -88977,6 +89264,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
88977
89264
|
titlePaint.LanguageID=this.LanguageID;
|
|
88978
89265
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
|
|
88979
89266
|
titlePaint.MainTitlePaint=this.TitlePaint[0];
|
|
89267
|
+
titlePaint.HQChart=this;
|
|
88980
89268
|
this.TitlePaint[index+1]=titlePaint;
|
|
88981
89269
|
|
|
88982
89270
|
this.SetSubFrameOption(subFrame,option);
|
|
@@ -89115,6 +89403,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
89115
89403
|
buySellBar.Name="Minute-BuySell-Bar";
|
|
89116
89404
|
buySellBar.Identify="Minute-BuySell-Bar";
|
|
89117
89405
|
buySellBar.BuySellData=this.BuySellData;
|
|
89406
|
+
buySellBar.HQChart=this;
|
|
89118
89407
|
this.ChartPaint[3]=buySellBar;
|
|
89119
89408
|
|
|
89120
89409
|
|
|
@@ -89226,6 +89515,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
89226
89515
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
89227
89516
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
89228
89517
|
titlePaint.MainTitlePaint=this.TitlePaint[0];
|
|
89518
|
+
titlePaint.HQChart=this;
|
|
89229
89519
|
this.TitlePaint[i+1]=titlePaint;
|
|
89230
89520
|
}
|
|
89231
89521
|
|
|
@@ -89313,6 +89603,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
89313
89603
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
89314
89604
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
89315
89605
|
titlePaint.MainTitlePaint=this.TitlePaint[0];
|
|
89606
|
+
titlePaint.HQChart=this;
|
|
89316
89607
|
this.TitlePaint[i+1]=titlePaint;
|
|
89317
89608
|
}
|
|
89318
89609
|
}
|
|
@@ -91715,6 +92006,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
91715
92006
|
{
|
|
91716
92007
|
if (this.EnableClickModel===true)
|
|
91717
92008
|
{
|
|
92009
|
+
if (this.ClickModel.IsShowCorssCursor==true && this.ClickModel.PreventHide) return; //阻止隐藏
|
|
91718
92010
|
if (this.ClickModel.IsShowCorssCursor==true && this.TouchDrawCount>0) return;
|
|
91719
92011
|
|
|
91720
92012
|
this.ClickModel.IsShowCorssCursor=false;
|
|
@@ -94274,6 +94566,7 @@ function KLineChartHScreenContainer(uielement)
|
|
|
94274
94566
|
titlePaint.LanguageID=this.LanguageID;
|
|
94275
94567
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
94276
94568
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
94569
|
+
titlePaint.HQChart=this;
|
|
94277
94570
|
this.TitlePaint.push(titlePaint);
|
|
94278
94571
|
}
|
|
94279
94572
|
|
|
@@ -94455,6 +94748,7 @@ function MinuteChartHScreenContainer(uielement)
|
|
|
94455
94748
|
titlePaint.LanguageID=this.LanguageID;
|
|
94456
94749
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
94457
94750
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
94751
|
+
titlePaint.HQChart=this;
|
|
94458
94752
|
this.TitlePaint.push(titlePaint);
|
|
94459
94753
|
}
|
|
94460
94754
|
|