hqchart 1.1.13976 → 1.1.13983
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/lib/umychart.vue.js +91 -77
- package/package.json +1 -1
- package/src/jscommon/umychart.DialogSelectRect.js +864 -0
- package/src/jscommon/umychart.DialogTooltip.js +13 -12
- package/src/jscommon/umychart.PopKeyboard.js +37 -8
- package/src/jscommon/umychart.TReport.js +3 -2
- package/src/jscommon/umychart.js +199 -456
- package/src/jscommon/umychart.resource/css/tools.css +119 -0
- package/src/jscommon/umychart.style.js +13 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +213 -457
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +1131 -480
|
@@ -4855,10 +4855,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4855
4855
|
if (IFrameSplitOperator.IsNumber(item.DelayTime)) chart.DrawDynamicInfoOption.DelayTime=item.DelayTime;
|
|
4856
4856
|
}
|
|
4857
4857
|
|
|
4858
|
-
|
|
4859
|
-
chart.SelectRectDialog=new MinuteSelectRectDialog(this.DivElement);
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
4858
|
if (option.Minute) //分钟走势图属性设置
|
|
4863
4859
|
{
|
|
4864
4860
|
if (option.Minute.IsShowTooltip==false) chart.IsShowTooltip=false;
|
|
@@ -5699,6 +5695,11 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5699
5695
|
if (option.TooltipDialog && option.TooltipDialog.Enable)
|
|
5700
5696
|
chart.InitalTooltipDialog(option.TooltipDialog);
|
|
5701
5697
|
|
|
5698
|
+
if (option.SelectRectDialog && option.SelectRectDialog.Enable)
|
|
5699
|
+
{
|
|
5700
|
+
chart.InitalSelectRectDialog(option.SelectRectDialog);
|
|
5701
|
+
}
|
|
5702
|
+
|
|
5702
5703
|
//注册事件
|
|
5703
5704
|
if (option.EventCallback)
|
|
5704
5705
|
{
|
|
@@ -7007,6 +7008,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7007
7008
|
this.DialogModifyDraw; //画图修改
|
|
7008
7009
|
|
|
7009
7010
|
this.DialogTooltip; //tooltip信息
|
|
7011
|
+
this.DialogSelectRect; //区间统计
|
|
7010
7012
|
|
|
7011
7013
|
|
|
7012
7014
|
this.ClearStockCache=function()
|
|
@@ -7049,6 +7051,27 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7049
7051
|
this.DialogModifyDraw.Create();
|
|
7050
7052
|
}
|
|
7051
7053
|
|
|
7054
|
+
this.InitalSelectRectDialog=function(option)
|
|
7055
|
+
{
|
|
7056
|
+
if (this.DialogSelectRect) return;
|
|
7057
|
+
|
|
7058
|
+
this.DialogSelectRect=new JSDialogSelectRect();
|
|
7059
|
+
this.DialogSelectRect.Inital(this, option);
|
|
7060
|
+
this.DialogSelectRect.Create();
|
|
7061
|
+
}
|
|
7062
|
+
|
|
7063
|
+
this.DrawSelectRectDialog=function()
|
|
7064
|
+
{
|
|
7065
|
+
|
|
7066
|
+
}
|
|
7067
|
+
|
|
7068
|
+
this.IsShowSelectRectDialog=function()
|
|
7069
|
+
{
|
|
7070
|
+
if (!this.DialogSelectRect) return false;
|
|
7071
|
+
|
|
7072
|
+
return this.DialogSelectRect.IsShow();
|
|
7073
|
+
}
|
|
7074
|
+
|
|
7052
7075
|
this.ShowDrawToolDialog=function(x,y)
|
|
7053
7076
|
{
|
|
7054
7077
|
if (!this.DialogDrawTool) return;
|
|
@@ -7570,8 +7593,11 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7570
7593
|
}
|
|
7571
7594
|
}
|
|
7572
7595
|
}
|
|
7573
|
-
|
|
7574
|
-
if (!this.
|
|
7596
|
+
|
|
7597
|
+
if (!this.IsShowSelectRectDialog()) //区间统计框存在,不清空区间背景色
|
|
7598
|
+
{
|
|
7599
|
+
if (!this.RectSelectDrag && this.ClearRectSelect(false)) this.Draw();
|
|
7600
|
+
}
|
|
7575
7601
|
|
|
7576
7602
|
if (this.EnableBorderDrag && this.Frame)
|
|
7577
7603
|
{
|
|
@@ -12048,6 +12074,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
12048
12074
|
|
|
12049
12075
|
if (this.PopMinuteChart) this.PopMinuteChart.ReloadResource(option);
|
|
12050
12076
|
if (this.DialogTooltip) this.DialogTooltip.ReloadResource(option);
|
|
12077
|
+
if (this.DialogSelectRect) this.DialogSelectRect.ReloadResource(option);
|
|
12051
12078
|
}
|
|
12052
12079
|
|
|
12053
12080
|
this.ReloadBorder=function(option) //根据页面缩放调整对应边框的尺长
|
|
@@ -12798,6 +12825,20 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
12798
12825
|
event.Callback(event,data,this);
|
|
12799
12826
|
}
|
|
12800
12827
|
|
|
12828
|
+
if (this.IsShowSelectRectDialog()) //区间统计
|
|
12829
|
+
{
|
|
12830
|
+
var selectData=paint.GetSelectRectData();
|
|
12831
|
+
|
|
12832
|
+
var data=
|
|
12833
|
+
{
|
|
12834
|
+
Chart:this, X:obj.X, Y:obj.Y,
|
|
12835
|
+
SelectData:selectData, //区间选择的数据
|
|
12836
|
+
RectSelectPaint:paint //区间选择背景
|
|
12837
|
+
};
|
|
12838
|
+
var e={ data:data }
|
|
12839
|
+
this.DrawSelectRectDialog(e);
|
|
12840
|
+
}
|
|
12841
|
+
|
|
12801
12842
|
return true;
|
|
12802
12843
|
}
|
|
12803
12844
|
|
|
@@ -13623,10 +13664,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
13623
13664
|
if (this.ShowSelectData && srcParam) this.ShowSelectData(srcParam);
|
|
13624
13665
|
break;
|
|
13625
13666
|
case JSCHART_MENU_ID.CMD_SELECTED_SUMMARY_ID:
|
|
13626
|
-
|
|
13627
|
-
dlg.DoModal(srcParam);
|
|
13667
|
+
if (this.DialogSelectRect && srcParam) this.DrawSelectRectDialog(srcParam);
|
|
13628
13668
|
break;
|
|
13629
|
-
|
|
13630
13669
|
case JSCHART_MENU_ID.CMD_SHOW_INDEX_ID: //显示隐藏指标 [0]=windowIndex [1]=0=自动 1=隐藏 2=显示
|
|
13631
13670
|
if (param==null || !IFrameSplitOperator.IsNumber(aryArgs[1])) return false;
|
|
13632
13671
|
var windowIndex=param, showType=aryArgs[1];
|
|
@@ -73147,6 +73186,21 @@ function JSChartResource()
|
|
|
73147
73186
|
DateTimeColor:'rgb(60,60,60)',
|
|
73148
73187
|
TurnoverRateColor:'rgb(43,54,69)', //换手率
|
|
73149
73188
|
PositionColor:"rgb(255,0,255)" //持仓
|
|
73189
|
+
},
|
|
73190
|
+
|
|
73191
|
+
//区间统计
|
|
73192
|
+
this.DialogSelectRect=
|
|
73193
|
+
{
|
|
73194
|
+
BGColor:'rgb(250,250,250)', //背景色
|
|
73195
|
+
BorderColor:'rgb(20,20,20)', //边框颜色
|
|
73196
|
+
TitleColor:'rgb(0,0,0)', //对话框标题颜色
|
|
73197
|
+
|
|
73198
|
+
TextColor:"rgb(0,0,0)", //数值名称
|
|
73199
|
+
ValueColor:"rgb(0,0,0)", //数值
|
|
73200
|
+
VolColor:"rgb(255, 185, 15)", //标题成交量
|
|
73201
|
+
AmountColor:"rgb(79, 79, 79)", //成交金额
|
|
73202
|
+
TurnoverRateColor:'rgb(43,54,69)', //换手率
|
|
73203
|
+
PositionColor:"rgb(255,0,255)" //持仓
|
|
73150
73204
|
}
|
|
73151
73205
|
|
|
73152
73206
|
//弹幕
|
|
@@ -74156,6 +74210,22 @@ function JSChartResource()
|
|
|
74156
74210
|
|
|
74157
74211
|
}
|
|
74158
74212
|
|
|
74213
|
+
if (style.DialogSelectRect)
|
|
74214
|
+
{
|
|
74215
|
+
var item=style.DialogSelectRect;
|
|
74216
|
+
if (item.BGColor) this.DialogSelectRect.BGColor=item.BGColor;
|
|
74217
|
+
if (item.BorderColor) this.DialogSelectRect.BorderColor=item.BorderColor;
|
|
74218
|
+
if (item.TitleColor) this.DialogSelectRect.TitleColor=item.TitleColor;
|
|
74219
|
+
|
|
74220
|
+
if (item.TextColor) this.DialogSelectRect.TextColor=item.TextColor;
|
|
74221
|
+
if (item.ValueColor) this.DialogSelectRect.ValueColor=item.ValueColor;
|
|
74222
|
+
if (item.VolColor) this.DialogSelectRect.VolColor=item.VolColor;
|
|
74223
|
+
if (item.AmountColor) this.DialogSelectRect.AmountColor=item.AmountColor;
|
|
74224
|
+
if (item.TurnoverRateColor) this.DialogSelectRect.TurnoverRateColor=item.TurnoverRateColor;
|
|
74225
|
+
if (item.PositionColor) this.DialogSelectRect.PositionColor=item.PositionColor;
|
|
74226
|
+
|
|
74227
|
+
}
|
|
74228
|
+
|
|
74159
74229
|
if (style.MinuteInfo)
|
|
74160
74230
|
{
|
|
74161
74231
|
var item=style.MinuteInfo;
|
|
@@ -75134,13 +75204,28 @@ function JSChartLocalization()
|
|
|
75134
75204
|
['DialogTooltip-Price', {CN:'价格', EN:'Price', TC:'價格'}],
|
|
75135
75205
|
['DialogTooltip-AvPrice', {CN:'均价', EN:'AVPrice:', TC:'均價'}],
|
|
75136
75206
|
['DialogTooltip-FClose', {CN:"结算价", EN:'Settlement', TC:'結算價'}],
|
|
75137
|
-
['DialogTooltip-Amplitude', {CN:'振幅', EN:'amplitude', TC:'
|
|
75207
|
+
['DialogTooltip-Amplitude', {CN:'振幅', EN:'amplitude', TC:'振幅'}],
|
|
75138
75208
|
['DialogTooltip-AC-Price', {CN:'匹配价', EN:'Price', TC:'匹配價'}],
|
|
75139
75209
|
['DialogTooltip-AC-AvPrice', {CN:'匹配均价', EN:'AVPrice', TC:'匹配均價'}],
|
|
75140
75210
|
['DialogTooltip-AC-Increase', {CN:'竞价涨幅', EN:'Increase', TC:'競價漲幅'}],
|
|
75141
75211
|
['DialogTooltip-AC-Vol', {CN:'匹配量', EN:'Vol', TC:'匹配量'}],
|
|
75142
75212
|
['DialogTooltip-Value', {CN:'数值', EN:'Value', TC:'数值'}],
|
|
75143
75213
|
|
|
75214
|
+
|
|
75215
|
+
['DialogSelectRect-StartPrice', {CN:'起始价:', EN:'Start Price:', TC:'起始價'}],
|
|
75216
|
+
['DialogSelectRect-EndPrice', {CN:'最终价:', EN:"End Price:", TC:'最终價'}],
|
|
75217
|
+
['DialogSelectRect-High', {CN:'最高价:', EN:'High:', TC:'最高價'}],
|
|
75218
|
+
['DialogSelectRect-Low', {CN:'最低价:', EN:"Low:", TC:'最低價'}],
|
|
75219
|
+
['DialogSelectRect-Increase', {CN:'区间涨幅:', EN:'Increase', TC:'漲幅'}],
|
|
75220
|
+
['DialogSelectRect-Amplitude', {CN:'区间振幅:', EN:'amplitude', TC:'振幅'}],
|
|
75221
|
+
['DialogSelectRect-Vol', {CN:'成交量:', EN:'Volume', TC:'數量'}],
|
|
75222
|
+
['DialogSelectRect-Amount', {CN:'成交额:', EN:'Amount', TC:'金額'}],
|
|
75223
|
+
['DialogSelectRect-Up', {CN:'阳线:', EN:'Up', TC:'阳线'}],
|
|
75224
|
+
['DialogSelectRect-Down', {CN:'阴线:', EN:'Down', TC:'阴线'}],
|
|
75225
|
+
['DialogSelectRect-Unchanged', {CN:'平线:', EN:'Unchanged', TC:'平线'}],
|
|
75226
|
+
['DialogSelectRect-DataCount', {CN:'数据个数:', EN:'Data Count:', TC:'数据个数'}],
|
|
75227
|
+
|
|
75228
|
+
|
|
75144
75229
|
//走势图PC tooltip
|
|
75145
75230
|
['PCTooltip-Date', {CN:'日期', EN:'Date', TC:"日期"}],
|
|
75146
75231
|
['PCTooltip-Time', {CN:'时间', EN:'Time', TC:"時間"}],
|
|
@@ -77488,8 +77573,20 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
77488
77573
|
event.Callback(event,data,this);
|
|
77489
77574
|
isShowMenu=data.IsShowMenu;
|
|
77490
77575
|
}
|
|
77491
|
-
|
|
77492
|
-
if (
|
|
77576
|
+
|
|
77577
|
+
if (this.IsShowSelectRectDialog()) //区间统计
|
|
77578
|
+
{
|
|
77579
|
+
var data=
|
|
77580
|
+
{
|
|
77581
|
+
Chart:this,X:x,Y:y,
|
|
77582
|
+
SelectData:selectData, //区间选择的数据
|
|
77583
|
+
RectSelectPaint:paint //区间选择背景
|
|
77584
|
+
};
|
|
77585
|
+
e.data=data;
|
|
77586
|
+
|
|
77587
|
+
this.DrawSelectRectDialog(e);
|
|
77588
|
+
}
|
|
77589
|
+
else if (isShowMenu)
|
|
77493
77590
|
{
|
|
77494
77591
|
var data=
|
|
77495
77592
|
{
|
|
@@ -83486,6 +83583,42 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
83486
83583
|
|
|
83487
83584
|
return true;
|
|
83488
83585
|
}
|
|
83586
|
+
|
|
83587
|
+
this.DrawSelectRectDialog=function(e)
|
|
83588
|
+
{
|
|
83589
|
+
if (!this.DialogSelectRect) return;
|
|
83590
|
+
|
|
83591
|
+
this.UpdateSelectRectDialog(e);
|
|
83592
|
+
}
|
|
83593
|
+
|
|
83594
|
+
this.UpdateSelectRectDialog=function(e)
|
|
83595
|
+
{
|
|
83596
|
+
if (!this.DialogSelectRect) return false;
|
|
83597
|
+
|
|
83598
|
+
var data=e.data; //区间统计数据
|
|
83599
|
+
var x,y;
|
|
83600
|
+
if (data && IFrameSplitOperator.IsNumber(data.X) && IFrameSplitOperator.IsNumber(data.Y))
|
|
83601
|
+
{
|
|
83602
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
83603
|
+
var rtClient=this.UIElement.getBoundingClientRect();
|
|
83604
|
+
var rtScroll=GetScrollPosition();
|
|
83605
|
+
|
|
83606
|
+
x=data.X
|
|
83607
|
+
y=data.Y;
|
|
83608
|
+
x+=(rtClient.left+rtScroll.Left);
|
|
83609
|
+
y+=(rtClient.top+rtScroll.Top);
|
|
83610
|
+
}
|
|
83611
|
+
|
|
83612
|
+
var sendData=
|
|
83613
|
+
{
|
|
83614
|
+
Symbol:this.Symbol, Name:this.Name,
|
|
83615
|
+
SelectData:data.SelectData,
|
|
83616
|
+
X:x, Y:y,
|
|
83617
|
+
e:e
|
|
83618
|
+
}
|
|
83619
|
+
|
|
83620
|
+
this.DialogSelectRect.Update(sendData);
|
|
83621
|
+
}
|
|
83489
83622
|
}
|
|
83490
83623
|
|
|
83491
83624
|
//API 返回数据 转化为array[]
|
|
@@ -83913,7 +84046,6 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
83913
84046
|
|
|
83914
84047
|
this.ColorLineData; //主图价格线颜色自定义配置
|
|
83915
84048
|
this.EnableSelectRect=false; //是否可以区间选择
|
|
83916
|
-
this.SelectRectDialog=null; //区间选择对话框
|
|
83917
84049
|
|
|
83918
84050
|
this.CorssCursorIndex={ DayIndex:-1, DataIndex:-1, Point:{X:-1, Y:-1} ,Type:-1 };
|
|
83919
84051
|
this.EnableNewIndex=false //是否使用新的索引版本
|
|
@@ -84316,7 +84448,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
84316
84448
|
isShowDialog=false; //外部调用了区间选择事件,不弹框
|
|
84317
84449
|
}
|
|
84318
84450
|
|
|
84319
|
-
if (isShowDialog && this.
|
|
84451
|
+
if (isShowDialog && this.DialogSelectRect)
|
|
84320
84452
|
{
|
|
84321
84453
|
e.data=
|
|
84322
84454
|
{
|
|
@@ -84327,7 +84459,9 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
84327
84459
|
RectSelectPaint:paint //区间选择背景
|
|
84328
84460
|
};
|
|
84329
84461
|
|
|
84330
|
-
this.
|
|
84462
|
+
this.HideSelectRect();
|
|
84463
|
+
this.UpdateSelectRect(selectData.Start,selectData.End);
|
|
84464
|
+
this.DrawSelectRectDialog(e);
|
|
84331
84465
|
}
|
|
84332
84466
|
else
|
|
84333
84467
|
{
|
|
@@ -84371,9 +84505,9 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
84371
84505
|
isShowDialog=data.IsShowDialog;
|
|
84372
84506
|
}
|
|
84373
84507
|
|
|
84374
|
-
if (isShowDialog
|
|
84508
|
+
if (isShowDialog)
|
|
84375
84509
|
{
|
|
84376
|
-
|
|
84510
|
+
var data =
|
|
84377
84511
|
{
|
|
84378
84512
|
Chart:this,
|
|
84379
84513
|
X:x,
|
|
@@ -84381,10 +84515,10 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
84381
84515
|
SelectData:selectData, //区间选择的数据
|
|
84382
84516
|
RectSelectPaint:paint //区间选择背景
|
|
84383
84517
|
};
|
|
84518
|
+
e.data=data;
|
|
84384
84519
|
|
|
84385
|
-
this.
|
|
84520
|
+
this.UpdateSelectRectDialog(e);
|
|
84386
84521
|
}
|
|
84387
|
-
|
|
84388
84522
|
}
|
|
84389
84523
|
|
|
84390
84524
|
this.UpdateSelectRect=function(start,end)
|
|
@@ -84441,6 +84575,14 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
84441
84575
|
event.Callback(event,data,this);
|
|
84442
84576
|
}
|
|
84443
84577
|
|
|
84578
|
+
if (this.IsShowSelectRectDialog()) //区间统计
|
|
84579
|
+
{
|
|
84580
|
+
var selectData=paint.GetSelectRectData();
|
|
84581
|
+
var data={ X:obj.X, Y:obj.Y, SelectData:selectData, RectSelectPaint:paint };
|
|
84582
|
+
var e={ data:data };
|
|
84583
|
+
this.DrawSelectRectDialog(e);
|
|
84584
|
+
}
|
|
84585
|
+
|
|
84444
84586
|
return true;
|
|
84445
84587
|
}
|
|
84446
84588
|
|
|
@@ -85389,7 +85531,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
85389
85531
|
event.Callback(event,data,this);
|
|
85390
85532
|
}
|
|
85391
85533
|
|
|
85392
|
-
if (this.
|
|
85534
|
+
if (this.DialogSelectRect)
|
|
85393
85535
|
{
|
|
85394
85536
|
e.data=
|
|
85395
85537
|
{
|
|
@@ -85399,7 +85541,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
85399
85541
|
SelectData:selectData, //区间选择的数据
|
|
85400
85542
|
RectSelectPaint:paint //区间选择背景
|
|
85401
85543
|
};
|
|
85402
|
-
this.
|
|
85544
|
+
this.DrawSelectRectDialog(e);
|
|
85403
85545
|
}
|
|
85404
85546
|
}
|
|
85405
85547
|
|
|
@@ -89339,6 +89481,42 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
89339
89481
|
|
|
89340
89482
|
return true;
|
|
89341
89483
|
}
|
|
89484
|
+
|
|
89485
|
+
this.DrawSelectRectDialog=function(e)
|
|
89486
|
+
{
|
|
89487
|
+
if (!this.DialogSelectRect) return;
|
|
89488
|
+
|
|
89489
|
+
this.UpdateSelectRectDialog(e);
|
|
89490
|
+
}
|
|
89491
|
+
|
|
89492
|
+
this.UpdateSelectRectDialog=function(e)
|
|
89493
|
+
{
|
|
89494
|
+
if (!this.DialogSelectRect) return false;
|
|
89495
|
+
|
|
89496
|
+
var data=e.data; //区间统计数据
|
|
89497
|
+
var x,y;
|
|
89498
|
+
if (data && IFrameSplitOperator.IsNumber(data.X) && IFrameSplitOperator.IsNumber(data.Y))
|
|
89499
|
+
{
|
|
89500
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
89501
|
+
var rtClient=this.UIElement.getBoundingClientRect();
|
|
89502
|
+
var rtScroll=GetScrollPosition();
|
|
89503
|
+
|
|
89504
|
+
x=data.X
|
|
89505
|
+
y=data.Y;
|
|
89506
|
+
x+=(rtClient.left+rtScroll.Left);
|
|
89507
|
+
y+=(rtClient.top+rtScroll.Top);
|
|
89508
|
+
}
|
|
89509
|
+
|
|
89510
|
+
var sendData=
|
|
89511
|
+
{
|
|
89512
|
+
Symbol:this.Symbol, Name:this.Name,
|
|
89513
|
+
SelectData:data.SelectData,
|
|
89514
|
+
X:x, Y:y,
|
|
89515
|
+
e:e
|
|
89516
|
+
}
|
|
89517
|
+
|
|
89518
|
+
this.DialogSelectRect.Update(sendData);
|
|
89519
|
+
}
|
|
89342
89520
|
}
|
|
89343
89521
|
|
|
89344
89522
|
//盘前数据
|
|
@@ -94504,441 +94682,6 @@ function ChangeIndexDialog(divElement)
|
|
|
94504
94682
|
}
|
|
94505
94683
|
}
|
|
94506
94684
|
|
|
94507
|
-
function MinuteSelectRectDialog(divElement)
|
|
94508
|
-
{
|
|
94509
|
-
this.newMethod=IDivDialog; //派生
|
|
94510
|
-
this.newMethod(divElement);
|
|
94511
|
-
delete this.newMethod;
|
|
94512
|
-
|
|
94513
|
-
this.SelectData;
|
|
94514
|
-
this.Dialog;
|
|
94515
|
-
this.HQChart;
|
|
94516
|
-
this.RectSelectPaint;
|
|
94517
|
-
|
|
94518
|
-
//隐藏窗口
|
|
94519
|
-
this.Close=function()
|
|
94520
|
-
{
|
|
94521
|
-
if (this.Dialog)
|
|
94522
|
-
{
|
|
94523
|
-
this.DivElement.removeChild(this.Dialog);
|
|
94524
|
-
this.Dialog=null;
|
|
94525
|
-
this.ID=null;
|
|
94526
|
-
}
|
|
94527
|
-
|
|
94528
|
-
if (this.RectSelectPaint) this.RectSelectPaint.PreventClose=false;
|
|
94529
|
-
}
|
|
94530
|
-
|
|
94531
|
-
//创建
|
|
94532
|
-
this.Create=function()
|
|
94533
|
-
{
|
|
94534
|
-
this.ID=Guid();
|
|
94535
|
-
var div=document.createElement('div');
|
|
94536
|
-
div.className='jchart-select-statistics-box';
|
|
94537
|
-
div.id=this.ID;
|
|
94538
|
-
div.innerHTML=
|
|
94539
|
-
"<div class='parameter jchart-select-section'>\
|
|
94540
|
-
<div class='parameter-header'>\
|
|
94541
|
-
<span>分时图区间统计</span>\
|
|
94542
|
-
<strong id='close' class='icon iconfont icon-close'></strong>\
|
|
94543
|
-
</div>\
|
|
94544
|
-
<div class='parameter-content'>统计数据</div>\
|
|
94545
|
-
<div class='parameter-footer'>\
|
|
94546
|
-
<button id='close' class='submit' >确定</button>\
|
|
94547
|
-
</div>\
|
|
94548
|
-
</div>";
|
|
94549
|
-
|
|
94550
|
-
this.DivElement.appendChild(div);
|
|
94551
|
-
this.Dialog=div;
|
|
94552
|
-
|
|
94553
|
-
//关闭按钮
|
|
94554
|
-
$("#"+this.ID+" #close").click(
|
|
94555
|
-
{
|
|
94556
|
-
divBox:this,
|
|
94557
|
-
},
|
|
94558
|
-
function(event)
|
|
94559
|
-
{
|
|
94560
|
-
event.data.divBox.Close();
|
|
94561
|
-
});
|
|
94562
|
-
}
|
|
94563
|
-
|
|
94564
|
-
this.BindData=function()
|
|
94565
|
-
{
|
|
94566
|
-
var hqData=this.SelectData.Data;
|
|
94567
|
-
var start=this.SelectData.Start;
|
|
94568
|
-
var end=this.SelectData.End;
|
|
94569
|
-
this.HQChart.UpdateSelectRect(start,end);
|
|
94570
|
-
if (this.RectSelectPaint) this.RectSelectPaint.PreventClose=true;
|
|
94571
|
-
|
|
94572
|
-
var showData=
|
|
94573
|
-
{
|
|
94574
|
-
Open:0,Close:0,High:0,Low:0, //起始价格, 结束价格, 最高, 最低
|
|
94575
|
-
Vol:0, Amount:0,
|
|
94576
|
-
Date:
|
|
94577
|
-
{
|
|
94578
|
-
Start:{Time:null, Date:null },
|
|
94579
|
-
End:{ Time:null, Date:null }
|
|
94580
|
-
},
|
|
94581
|
-
Count:0,
|
|
94582
|
-
}
|
|
94583
|
-
|
|
94584
|
-
for(var i=start; i<=end && i<hqData.Data.length; ++i)
|
|
94585
|
-
{
|
|
94586
|
-
var item=hqData.Data[i];
|
|
94587
|
-
if (i==start)
|
|
94588
|
-
{
|
|
94589
|
-
showData.Date.Start.Date=item.Date;
|
|
94590
|
-
showData.Date.Start.Time=item.Time;
|
|
94591
|
-
showData.Open=item.Close;
|
|
94592
|
-
showData.High=item.High;
|
|
94593
|
-
showData.Low=item.Low;
|
|
94594
|
-
}
|
|
94595
|
-
|
|
94596
|
-
showData.Date.End.Date=item.Date;
|
|
94597
|
-
showData.Date.End.Time=item.Time;
|
|
94598
|
-
showData.Close=item.Close;
|
|
94599
|
-
showData.Vol+=item.Vol;
|
|
94600
|
-
showData.Amount+=item.Amount;
|
|
94601
|
-
++showData.Count;
|
|
94602
|
-
if (showData.High<item.High) showData.High=item.High;
|
|
94603
|
-
if(showData.Low>item.Low) showData.Low=item.Low;
|
|
94604
|
-
}
|
|
94605
|
-
|
|
94606
|
-
if (showData.Count<=0) return false;
|
|
94607
|
-
|
|
94608
|
-
if (showData.Vol>0) showData.AvPrice=showData.Amount/showData.Vol; //均价
|
|
94609
|
-
if (showData.Open>0)
|
|
94610
|
-
{
|
|
94611
|
-
showData.Increase = (showData.Close - showData.Open) / showData.Open *100; //区间涨幅
|
|
94612
|
-
showData.Amplitude = (showData.High - showData.Low) / showData.Open * 100; //区间振幅
|
|
94613
|
-
}
|
|
94614
|
-
|
|
94615
|
-
// JSConsole.Chart.Log('[KLineSelectRectDialog::BindData]', showData);
|
|
94616
|
-
var defaultfloatPrecision=GetfloatPrecision(this.SelectData.Symbol);
|
|
94617
|
-
var startDate=IFrameSplitOperator.FormatDateString(showData.Date.Start.Date);
|
|
94618
|
-
var endDate=IFrameSplitOperator.FormatDateString(showData.Date.End.Date);
|
|
94619
|
-
startDate+=' '+IFrameSplitOperator.FormatTimeString(showData.Date.Start.Time,"HH:MM");
|
|
94620
|
-
endDate+=" "+IFrameSplitOperator.FormatTimeString(showData.Date.End.Time,"HH:MM");
|
|
94621
|
-
|
|
94622
|
-
var startLeftClass="",startRightClass="",endLeftClass="",endRightClass="";
|
|
94623
|
-
if(start<=0) startLeftClass = "BtnBackground";
|
|
94624
|
-
if(start >= end) {
|
|
94625
|
-
startRightClass = "BtnBackground";
|
|
94626
|
-
endLeftClass = "BtnBackground";
|
|
94627
|
-
}
|
|
94628
|
-
if(end >= hqData.Data.length - 1) endRightClass = "BtnBackground";
|
|
94629
|
-
|
|
94630
|
-
var div=document.createElement('div');
|
|
94631
|
-
div.className='jchart-select-table-right';
|
|
94632
|
-
div.innerHTML=
|
|
94633
|
-
'<div class="jchart-select-date">\n' +
|
|
94634
|
-
' <span>开始: '+ startDate +'<i class="start-date-left '+ startLeftClass +'"><</i><i class="start-date-right '+ startRightClass +'">></i></span>\n' +
|
|
94635
|
-
' <span>结束: '+ endDate +'<i class="end-date-left '+ endLeftClass +'"><</i><i class="end-date-right '+ endRightClass +'">></i></span>\n' +
|
|
94636
|
-
' <span>总个数: '+ showData.Count +'</span>\n' +
|
|
94637
|
-
' </div>\n' +
|
|
94638
|
-
' <table>\n' +
|
|
94639
|
-
' <tr><td><strong>起始价: </strong><span>'+ showData.Open.toFixed(defaultfloatPrecision) +'</span></td>' +
|
|
94640
|
-
' <td><strong>终止价: </strong><span>'+ showData.Close.toFixed(defaultfloatPrecision) +'</span></td>' +
|
|
94641
|
-
' <td><strong>均价: </strong><span>'+ (IFrameSplitOperator.IsNumber(showData.AvPrice) ? showData.AvPrice.toFixed(defaultfloatPrecision):"--.--") +'</span></td></tr>\n' +
|
|
94642
|
-
' <tr><td><strong>最低价: </strong><span>'+ showData.Low.toFixed(defaultfloatPrecision) +'</span></td>' +
|
|
94643
|
-
' <td><strong>最高价: </strong><span>'+ showData.High.toFixed(defaultfloatPrecision) +'</span></td>' +
|
|
94644
|
-
' <td><strong>涨跌幅: </strong><span class="'+ IFrameSplitOperator.FormatValueColor(showData.Increase) +'">'+ showData.Increase.toFixed(2) +'%</span></td></tr>\n' +
|
|
94645
|
-
' <tr><td><strong>振幅: </strong><span>'+ showData.Amplitude.toFixed(2) +'%</span></td>' +
|
|
94646
|
-
' <td><strong>成交量: </strong><span>'+ IFrameSplitOperator.FormatValueString(showData.Vol,2) +'股</span></td>' +
|
|
94647
|
-
' <td><strong>金额: </strong><span>'+ IFrameSplitOperator.FormatValueString(showData.Amount,2) +'元</span></td></tr>\n' +
|
|
94648
|
-
' </table>';
|
|
94649
|
-
|
|
94650
|
-
$(".parameter-content").html(div);
|
|
94651
|
-
this.BindEvent();
|
|
94652
|
-
|
|
94653
|
-
return true;
|
|
94654
|
-
}
|
|
94655
|
-
|
|
94656
|
-
this.BindEvent = function ()
|
|
94657
|
-
{
|
|
94658
|
-
var _self = this;
|
|
94659
|
-
if(_self.SelectData.Start > 0){
|
|
94660
|
-
$(".jchart-select-date .start-date-left").click(function () {
|
|
94661
|
-
_self.SelectData.Start--;
|
|
94662
|
-
_self.BindData();
|
|
94663
|
-
_self.HQChart.UpdateSelectRect(_self.SelectData.Start,_self.SelectData.End);
|
|
94664
|
-
})
|
|
94665
|
-
}
|
|
94666
|
-
if(_self.SelectData.Start < _self.SelectData.End){
|
|
94667
|
-
$(".jchart-select-date .start-date-right").click(function () {
|
|
94668
|
-
_self.SelectData.Start++;
|
|
94669
|
-
_self.BindData();
|
|
94670
|
-
_self.HQChart.UpdateSelectRect(_self.SelectData.Start,_self.SelectData.End);
|
|
94671
|
-
})
|
|
94672
|
-
$(".jchart-select-date .end-date-left").click(function () {
|
|
94673
|
-
_self.SelectData.End--;
|
|
94674
|
-
_self.BindData();
|
|
94675
|
-
_self.HQChart.UpdateSelectRect(_self.SelectData.Start,_self.SelectData.End);
|
|
94676
|
-
})
|
|
94677
|
-
}
|
|
94678
|
-
if(_self.SelectData.End < _self.SelectData.Data.Data.length - 1){
|
|
94679
|
-
$(".jchart-select-date .end-date-right").click(function () {
|
|
94680
|
-
_self.SelectData.End++;
|
|
94681
|
-
_self.BindData();
|
|
94682
|
-
_self.HQChart.UpdateSelectRect(_self.SelectData.Start,_self.SelectData.End);
|
|
94683
|
-
})
|
|
94684
|
-
}
|
|
94685
|
-
}
|
|
94686
|
-
|
|
94687
|
-
|
|
94688
|
-
//显示
|
|
94689
|
-
this.DoModal=function(event)
|
|
94690
|
-
{
|
|
94691
|
-
var chart=event.data.Chart;
|
|
94692
|
-
if (this.ID==null) this.Create(); //第1次 需要创建div
|
|
94693
|
-
this.SelectData=event.data.SelectData;
|
|
94694
|
-
this.RectSelectPaint=event.data.RectSelectPaint;
|
|
94695
|
-
this.HQChart=chart;
|
|
94696
|
-
this.HQChart.HideSelectRect();
|
|
94697
|
-
if (!this.BindData()) return;
|
|
94698
|
-
|
|
94699
|
-
this.Show(); //通过CSS居中显示
|
|
94700
|
-
}
|
|
94701
|
-
|
|
94702
|
-
|
|
94703
|
-
}
|
|
94704
|
-
|
|
94705
|
-
//区间统计
|
|
94706
|
-
function KLineSelectRectDialog(divElement)
|
|
94707
|
-
{
|
|
94708
|
-
this.newMethod=IDivDialog; //派生
|
|
94709
|
-
this.newMethod(divElement);
|
|
94710
|
-
delete this.newMethod;
|
|
94711
|
-
|
|
94712
|
-
this.SelectData;
|
|
94713
|
-
this.Dialog;
|
|
94714
|
-
this.HQChart;
|
|
94715
|
-
this.RectSelectPaint;
|
|
94716
|
-
|
|
94717
|
-
//隐藏窗口
|
|
94718
|
-
this.Close=function()
|
|
94719
|
-
{
|
|
94720
|
-
if (this.Dialog)
|
|
94721
|
-
{
|
|
94722
|
-
this.DivElement.removeChild(this.Dialog);
|
|
94723
|
-
this.Dialog=null;
|
|
94724
|
-
}
|
|
94725
|
-
|
|
94726
|
-
if (this.RectSelectPaint) this.RectSelectPaint.PreventClose=false;
|
|
94727
|
-
}
|
|
94728
|
-
|
|
94729
|
-
//创建
|
|
94730
|
-
this.Create=function()
|
|
94731
|
-
{
|
|
94732
|
-
this.ID=Guid();
|
|
94733
|
-
var div=document.createElement('div');
|
|
94734
|
-
div.className='jchart-select-statistics-box';
|
|
94735
|
-
div.id=this.ID;
|
|
94736
|
-
div.innerHTML=
|
|
94737
|
-
"<div class='parameter jchart-select-section'>\
|
|
94738
|
-
<div class='parameter-header'>\
|
|
94739
|
-
<span>区间统计</span>\
|
|
94740
|
-
<strong id='close' class='icon iconfont icon-close'></strong>\
|
|
94741
|
-
</div>\
|
|
94742
|
-
<div class='parameter-content'>统计数据</div>\
|
|
94743
|
-
<div class='parameter-footer'>\
|
|
94744
|
-
<button id='close' class='submit' >确定</button>\
|
|
94745
|
-
<button id='match' class='submit' >形态匹配</button>\
|
|
94746
|
-
</div>\
|
|
94747
|
-
</div>";
|
|
94748
|
-
|
|
94749
|
-
this.DivElement.appendChild(div);
|
|
94750
|
-
this.Dialog=div;
|
|
94751
|
-
|
|
94752
|
-
//关闭按钮
|
|
94753
|
-
$("#"+this.ID+" #close").click(
|
|
94754
|
-
{
|
|
94755
|
-
divBox:this,
|
|
94756
|
-
},
|
|
94757
|
-
function(event)
|
|
94758
|
-
{
|
|
94759
|
-
event.data.divBox.Close();
|
|
94760
|
-
});
|
|
94761
|
-
|
|
94762
|
-
//形态匹配
|
|
94763
|
-
$("#"+this.ID+" #match").click(
|
|
94764
|
-
{
|
|
94765
|
-
divBox:this,
|
|
94766
|
-
},
|
|
94767
|
-
function(event)
|
|
94768
|
-
{
|
|
94769
|
-
event.data.divBox.KLineMatch();
|
|
94770
|
-
});
|
|
94771
|
-
}
|
|
94772
|
-
|
|
94773
|
-
this.BindData=function()
|
|
94774
|
-
{
|
|
94775
|
-
var hqData=this.SelectData.Data;
|
|
94776
|
-
var start=this.SelectData.Start;
|
|
94777
|
-
var end=this.SelectData.End;
|
|
94778
|
-
this.HQChart.UpdateSelectRect(start,end);
|
|
94779
|
-
if (this.RectSelectPaint) this.RectSelectPaint.PreventClose=true;
|
|
94780
|
-
|
|
94781
|
-
var showData=
|
|
94782
|
-
{
|
|
94783
|
-
Open:0,Close:0,High:0,Low:0, YClose:0,
|
|
94784
|
-
Vol:0, Amount:0,
|
|
94785
|
-
Date:
|
|
94786
|
-
{
|
|
94787
|
-
Start:{Time:null, Date:null },
|
|
94788
|
-
End:{ Time:null, Date:null }
|
|
94789
|
-
},
|
|
94790
|
-
Count:0,
|
|
94791
|
-
KLine:{ Up:0,Down:0,Unchanged:0 } //阳线|阴线|平线
|
|
94792
|
-
}
|
|
94793
|
-
|
|
94794
|
-
for(var i=start; i<=end && i<hqData.Data.length; ++i)
|
|
94795
|
-
{
|
|
94796
|
-
var item=hqData.Data[i];
|
|
94797
|
-
if (i==start)
|
|
94798
|
-
{
|
|
94799
|
-
showData.Date.Start.Date=item.Date;
|
|
94800
|
-
showData.Date.Start.Time=item.Time;
|
|
94801
|
-
showData.Open=item.Open;
|
|
94802
|
-
showData.High=item.High;
|
|
94803
|
-
showData.Low=item.Low;
|
|
94804
|
-
showData.YClose=item.YClose;
|
|
94805
|
-
}
|
|
94806
|
-
|
|
94807
|
-
showData.Date.End.Date=item.Date;
|
|
94808
|
-
showData.Date.End.Time=item.Time;
|
|
94809
|
-
showData.Close=item.Close;
|
|
94810
|
-
showData.Vol+=item.Vol;
|
|
94811
|
-
showData.Amount+=item.Amount;
|
|
94812
|
-
++showData.Count;
|
|
94813
|
-
if (showData.High<item.High) showData.High=item.High;
|
|
94814
|
-
if(showData.Low>item.Low) showData.Low=item.Low;
|
|
94815
|
-
if (item.Close>item.Open) ++showData.KLine.Up;
|
|
94816
|
-
else if (item.Close<item.Open) ++showData.KLine.Down;
|
|
94817
|
-
else ++showData.KLine.Unchanged;
|
|
94818
|
-
}
|
|
94819
|
-
|
|
94820
|
-
if (showData.Vol>0) showData.AvPrice=showData.Amount/showData.Vol; //均价
|
|
94821
|
-
if (item.YClose>0)
|
|
94822
|
-
{
|
|
94823
|
-
showData.Increase = (showData.Close - showData.YClose) / showData.YClose *100; //涨幅
|
|
94824
|
-
showData.Amplitude = (showData.High - showData.Low) / showData.YClose * 100; //振幅
|
|
94825
|
-
}
|
|
94826
|
-
|
|
94827
|
-
// JSConsole.Chart.Log('[KLineSelectRectDialog::BindData]', showData);
|
|
94828
|
-
var defaultfloatPrecision=GetfloatPrecision(this.SelectData.Symbol);
|
|
94829
|
-
var startDate=IFrameSplitOperator.FormatDateString(showData.Date.Start.Date);
|
|
94830
|
-
var endDate=IFrameSplitOperator.FormatDateString(showData.Date.End.Date);
|
|
94831
|
-
if (ChartData.IsMinutePeriod(this.HQChart.Period))
|
|
94832
|
-
{
|
|
94833
|
-
startDate+=' '+IFrameSplitOperator.FormatTimeString(showData.Date.Start.Time,"HH:MM");
|
|
94834
|
-
endDate+=" "+IFrameSplitOperator.FormatTimeString(showData.Date.End.Time,"HH:MM");
|
|
94835
|
-
}
|
|
94836
|
-
else if (ChartData.IsSecondPeriod(this.HQChart.Period) || ChartData.IsTickPeriod(this.HQChart.Period))
|
|
94837
|
-
{
|
|
94838
|
-
startDate+=' '+IFrameSplitOperator.FormatTimeString(showData.Date.Start.Time,"HH:MM:SS");
|
|
94839
|
-
endDate+=" "+IFrameSplitOperator.FormatTimeString(showData.Date.End.Time,"HH:MM:SS");
|
|
94840
|
-
}
|
|
94841
|
-
|
|
94842
|
-
var startLeftClass="",startRightClass="",endLeftClass="",endRightClass="";
|
|
94843
|
-
if(start<=0) startLeftClass = "BtnBackground";
|
|
94844
|
-
if(start >= end) {
|
|
94845
|
-
startRightClass = "BtnBackground";
|
|
94846
|
-
endLeftClass = "BtnBackground";
|
|
94847
|
-
}
|
|
94848
|
-
if(end >= hqData.Data.length - 1) endRightClass = "BtnBackground";
|
|
94849
|
-
|
|
94850
|
-
var div=document.createElement('div');
|
|
94851
|
-
div.className='jchart-select-table-right';
|
|
94852
|
-
div.innerHTML=
|
|
94853
|
-
'<div class="jchart-select-date">\n' +
|
|
94854
|
-
' <span>开始: '+ startDate +'<i class="start-date-left '+ startLeftClass +'"><</i><i class="start-date-right '+ startRightClass +'">></i></span>\n' +
|
|
94855
|
-
' <span>结束: '+ endDate +'<i class="end-date-left '+ endLeftClass +'"><</i><i class="end-date-right '+ endRightClass +'">></i></span>\n' +
|
|
94856
|
-
' <span>总个数: '+ showData.Count +'</span>\n' +
|
|
94857
|
-
' </div>\n' +
|
|
94858
|
-
' <table>\n' +
|
|
94859
|
-
' <tr><td><strong>起始价: </strong><span>'+ showData.YClose.toFixed(defaultfloatPrecision) +'</span></td>' +
|
|
94860
|
-
' <td><strong>最终价: </strong><span>'+ showData.Close.toFixed(defaultfloatPrecision) +'</span></td>' +
|
|
94861
|
-
' <td><strong>均价: </strong><span>'+ (IFrameSplitOperator.IsNumber(showData.AvPrice) ? showData.AvPrice.toFixed(defaultfloatPrecision):"--.--") +'</span></td></tr>\n' +
|
|
94862
|
-
' <tr><td><strong>最低价: </strong><span>'+ showData.Low.toFixed(defaultfloatPrecision) +'</span></td>' +
|
|
94863
|
-
' <td><strong>最高价: </strong><span>'+ showData.High.toFixed(defaultfloatPrecision) +'</span></td>' +
|
|
94864
|
-
' <td><strong>涨跌幅: </strong><span class="'+ IFrameSplitOperator.FormatValueColor(showData.Increase) +'">'+ showData.Increase.toFixed(2) +'%</span></td></tr>\n' +
|
|
94865
|
-
' <tr><td><strong>振幅: </strong><span>'+ showData.Amplitude.toFixed(2) +'%</span></td>' +
|
|
94866
|
-
' <td><strong>成交量: </strong><span>'+ IFrameSplitOperator.FormatValueString(showData.Vol,2) +'股</span></td>' +
|
|
94867
|
-
' <td><strong>金额: </strong><span>'+ IFrameSplitOperator.FormatValueString(showData.Amount,2) +'元</span></td></tr>\n' +
|
|
94868
|
-
' <tr><td><strong>阴线: </strong><span>'+ showData.KLine.Up +'</span></td>' +
|
|
94869
|
-
' <td><strong>阳线: </strong><span>'+ showData.KLine.Down +'</span></td>' +
|
|
94870
|
-
' <td><strong>平线: </strong><span>'+ showData.KLine.Unchanged +'</span></td></tr>\n' +
|
|
94871
|
-
' </table>';
|
|
94872
|
-
|
|
94873
|
-
$(".parameter-content").html(div);
|
|
94874
|
-
this.BindEvent();
|
|
94875
|
-
}
|
|
94876
|
-
|
|
94877
|
-
this.BindEvent = function () {
|
|
94878
|
-
var _self = this;
|
|
94879
|
-
if(_self.SelectData.Start > 0){
|
|
94880
|
-
$(".jchart-select-date .start-date-left").click(function () {
|
|
94881
|
-
_self.SelectData.Start--;
|
|
94882
|
-
_self.BindData();
|
|
94883
|
-
_self.HQChart.UpdateSelectRect(_self.SelectData.Start,_self.SelectData.End);
|
|
94884
|
-
})
|
|
94885
|
-
}
|
|
94886
|
-
if(_self.SelectData.Start < _self.SelectData.End){
|
|
94887
|
-
$(".jchart-select-date .start-date-right").click(function () {
|
|
94888
|
-
_self.SelectData.Start++;
|
|
94889
|
-
_self.BindData();
|
|
94890
|
-
_self.HQChart.UpdateSelectRect(_self.SelectData.Start,_self.SelectData.End);
|
|
94891
|
-
})
|
|
94892
|
-
$(".jchart-select-date .end-date-left").click(function () {
|
|
94893
|
-
_self.SelectData.End--;
|
|
94894
|
-
_self.BindData();
|
|
94895
|
-
_self.HQChart.UpdateSelectRect(_self.SelectData.Start,_self.SelectData.End);
|
|
94896
|
-
})
|
|
94897
|
-
}
|
|
94898
|
-
if(_self.SelectData.End < _self.SelectData.Data.Data.length - 1){
|
|
94899
|
-
$(".jchart-select-date .end-date-right").click(function () {
|
|
94900
|
-
_self.SelectData.End++;
|
|
94901
|
-
_self.BindData();
|
|
94902
|
-
_self.HQChart.UpdateSelectRect(_self.SelectData.Start,_self.SelectData.End);
|
|
94903
|
-
})
|
|
94904
|
-
}
|
|
94905
|
-
}
|
|
94906
|
-
|
|
94907
|
-
//显示
|
|
94908
|
-
this.DoModal=function(event)
|
|
94909
|
-
{
|
|
94910
|
-
var chart=event.data.Chart;
|
|
94911
|
-
if (this.ID==null) this.Create(); //第1次 需要创建div
|
|
94912
|
-
this.SelectData=event.data.SelectData;
|
|
94913
|
-
this.RectSelectPaint=event.data.RectSelectPaint;
|
|
94914
|
-
this.HQChart=chart;
|
|
94915
|
-
this.HQChart.HideSelectRect();
|
|
94916
|
-
this.BindData();
|
|
94917
|
-
|
|
94918
|
-
this.Show(); //通过CSS居中显示
|
|
94919
|
-
}
|
|
94920
|
-
|
|
94921
|
-
//形态匹配
|
|
94922
|
-
this.KLineMatch=function(data)
|
|
94923
|
-
{
|
|
94924
|
-
var waitDialog=new WaitDialog(this.DivElement);
|
|
94925
|
-
waitDialog.DoModal(
|
|
94926
|
-
{
|
|
94927
|
-
data:
|
|
94928
|
-
{
|
|
94929
|
-
Title:'计算中......',
|
|
94930
|
-
Chart:this.HQChart
|
|
94931
|
-
}
|
|
94932
|
-
});
|
|
94933
|
-
|
|
94934
|
-
this.Close(); //关闭窗口
|
|
94935
|
-
|
|
94936
|
-
var hqChart=this.HQChart;
|
|
94937
|
-
var param= { Scope: { Plate:["CNA.ci"],Minsimilar:0.90 }, WaitDialog:waitDialog } //沪深A股, 相似度>=90%
|
|
94938
|
-
hqChart.RequestKLineMatch(this.SelectData, param);
|
|
94939
|
-
}
|
|
94940
|
-
}
|
|
94941
|
-
|
|
94942
94685
|
//形态选股
|
|
94943
94686
|
function KLineMatchDialog(divElement)
|
|
94944
94687
|
{
|
|
@@ -125671,6 +125414,19 @@ function GetBlackStyle()
|
|
|
125671
125414
|
TurnoverRateColor:'rgb(43,54,69)', //换手率
|
|
125672
125415
|
PositionColor:"rgb(255,0,255)" //持仓
|
|
125673
125416
|
},
|
|
125417
|
+
|
|
125418
|
+
DialogSelectRect:
|
|
125419
|
+
{
|
|
125420
|
+
BGColor:'rgb(20,20,20)', //背景色
|
|
125421
|
+
BorderColor:'rgb(170,170,170)', //边框颜色
|
|
125422
|
+
TitleColor:'rgb(210,210,210)', //标题颜色
|
|
125423
|
+
VolColor:"rgb(255, 185, 15)", //标题成交量
|
|
125424
|
+
AmountColor:"rgb(210,210,210)", //成交金额
|
|
125425
|
+
TextColor:"rgb(210,210,210)", //数值名称
|
|
125426
|
+
ValueColor:"rgb(210,210,210)", //数值
|
|
125427
|
+
TurnoverRateColor:'rgb(43,54,69)', //换手率
|
|
125428
|
+
PositionColor:"rgb(255,0,255)" //持仓
|
|
125429
|
+
},
|
|
125674
125430
|
|
|
125675
125431
|
//走势图 信息地雷
|
|
125676
125432
|
MinuteInfo:
|
|
@@ -136619,10 +136375,11 @@ function JSTReportChartContainer(uielement)
|
|
|
136619
136375
|
|
|
136620
136376
|
this.RecvStockListData=function(data)
|
|
136621
136377
|
{
|
|
136378
|
+
this.MapExePriceData=new Map();
|
|
136379
|
+
this.MapStockData=new Map();
|
|
136380
|
+
|
|
136622
136381
|
if (IFrameSplitOperator.IsNonEmptyArray(data.data))
|
|
136623
136382
|
{
|
|
136624
|
-
this.MapExePriceData=new Map();
|
|
136625
|
-
this.MapStockData=new Map();
|
|
136626
136383
|
//0=行权价格 1=左边期权代码 2=右侧期权代码 3=左侧期权名称 4=右侧期权名称
|
|
136627
136384
|
for(var i=0;i<data.data.length;++i)
|
|
136628
136385
|
{
|
|
@@ -143577,6 +143334,7 @@ function JSPopKeyboard()
|
|
|
143577
143334
|
this.Title="HQChart 键盘精灵"
|
|
143578
143335
|
this.ID=Guid();
|
|
143579
143336
|
this.ActiveDOM=null; //启动键盘精灵是的控件
|
|
143337
|
+
this.InputStatus=0; //0=空闲 1=输入中
|
|
143580
143338
|
|
|
143581
143339
|
this.Keyboard=
|
|
143582
143340
|
{
|
|
@@ -143633,6 +143391,10 @@ function JSPopKeyboard()
|
|
|
143633
143391
|
input.addEventListener("keydown", (event)=>{ this.OnKeydown(event); });
|
|
143634
143392
|
input.addEventListener("keyup", (event)=>{ this.OnKeyup(event); });
|
|
143635
143393
|
|
|
143394
|
+
input.addEventListener("compositionstart", (event)=>{ this.OnCompositionStart(event); });
|
|
143395
|
+
input.addEventListener("compositionupdate", (event)=>{ this.OnCompositionUpdate(event);} );
|
|
143396
|
+
input.addEventListener("compositionend", (event)=>{ this.OnCompositionEnd(event);} );
|
|
143397
|
+
|
|
143636
143398
|
divInput.appendChild(input);
|
|
143637
143399
|
|
|
143638
143400
|
var divChart=document.createElement("div");
|
|
@@ -143663,8 +143425,26 @@ function JSPopKeyboard()
|
|
|
143663
143425
|
|
|
143664
143426
|
}
|
|
143665
143427
|
|
|
143428
|
+
|
|
143429
|
+
this.OnCompositionStart=function(event)
|
|
143430
|
+
{
|
|
143431
|
+
this.InputStatus=1;
|
|
143432
|
+
}
|
|
143433
|
+
|
|
143434
|
+
this.OnCompositionUpdate=function(event)
|
|
143435
|
+
{
|
|
143436
|
+
|
|
143437
|
+
}
|
|
143438
|
+
|
|
143439
|
+
this.OnCompositionEnd=function(event)
|
|
143440
|
+
{
|
|
143441
|
+
this.InputStatus=0;
|
|
143442
|
+
}
|
|
143443
|
+
|
|
143666
143444
|
this.OnKeydown=function(event)
|
|
143667
143445
|
{
|
|
143446
|
+
if (this.InputStatus!=0) return;
|
|
143447
|
+
|
|
143668
143448
|
var aryKey=new Set([
|
|
143669
143449
|
40,
|
|
143670
143450
|
38,
|
|
@@ -143686,20 +143466,26 @@ function JSPopKeyboard()
|
|
|
143686
143466
|
|
|
143687
143467
|
this.OnKeyup=function(event)
|
|
143688
143468
|
{
|
|
143469
|
+
if (this.InputStatus!=0) return;
|
|
143470
|
+
|
|
143689
143471
|
var code=event.keyCode;
|
|
143690
|
-
|
|
143472
|
+
|
|
143473
|
+
if (code==8) //删除
|
|
143691
143474
|
{
|
|
143692
143475
|
var strText=this.InputDOM.value;
|
|
143693
|
-
strText
|
|
143694
|
-
if (strText.length==0)
|
|
143476
|
+
if (strText.length==0)
|
|
143695
143477
|
{
|
|
143696
|
-
this.Hide();
|
|
143697
|
-
|
|
143698
|
-
else
|
|
143699
|
-
{
|
|
143700
|
-
this.Keyboard.JSChart.Search(strText);
|
|
143478
|
+
this.Hide(); //只有按了删除 才能隐藏
|
|
143479
|
+
return;
|
|
143701
143480
|
}
|
|
143702
143481
|
}
|
|
143482
|
+
|
|
143483
|
+
if ((code>=48 && code<=57) || (code>=65 && code<=90) || (code>=97 && code<=122) || code==8)
|
|
143484
|
+
{
|
|
143485
|
+
var strText=this.InputDOM.value;
|
|
143486
|
+
strText=strText.toUpperCase();
|
|
143487
|
+
this.Keyboard.JSChart.Search(strText);
|
|
143488
|
+
}
|
|
143703
143489
|
}
|
|
143704
143490
|
|
|
143705
143491
|
|
|
@@ -144198,22 +143984,23 @@ function JSDialogTooltip()
|
|
|
144198
143984
|
this.onmouseup = null;
|
|
144199
143985
|
}
|
|
144200
143986
|
|
|
144201
|
-
this.Show=function()
|
|
143987
|
+
this.Show=function(x, y)
|
|
144202
143988
|
{
|
|
143989
|
+
if (this.IsShow()) return;
|
|
143990
|
+
|
|
144203
143991
|
if (!this.DivDialog) return;
|
|
144204
143992
|
if (!this.HQChart) return;
|
|
144205
143993
|
|
|
144206
|
-
|
|
144207
|
-
|
|
144208
|
-
|
|
144209
|
-
|
|
144210
|
-
|
|
144211
|
-
|
|
144212
|
-
|
|
144213
|
-
|
|
144214
|
-
|
|
144215
|
-
|
|
144216
|
-
}
|
|
143994
|
+
|
|
143995
|
+
var top=this.HQChart.Frame.ChartBorder.GetTop();
|
|
143996
|
+
var left=this.HQChart.Frame.ChartBorder.GetLeft();
|
|
143997
|
+
var rtClient=this.HQChart.UIElement.getBoundingClientRect();
|
|
143998
|
+
|
|
143999
|
+
var x=left+rtClient.left+5;
|
|
144000
|
+
var y=top+rtClient.top+10;
|
|
144001
|
+
this.DivDialog.style.top = y + "px";
|
|
144002
|
+
this.DivDialog.style.left = x + "px";
|
|
144003
|
+
|
|
144217
144004
|
|
|
144218
144005
|
this.DivDialog.style.visibility='visible';
|
|
144219
144006
|
}
|
|
@@ -144674,7 +144461,871 @@ function JSDialogTooltip()
|
|
|
144674
144461
|
}
|
|
144675
144462
|
|
|
144676
144463
|
|
|
144677
|
-
}
|
|
144464
|
+
}
|
|
144465
|
+
/*
|
|
144466
|
+
Copyright (c) 2018 jones
|
|
144467
|
+
|
|
144468
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
144469
|
+
|
|
144470
|
+
开源项目 https://github.com/jones2000/HQChart
|
|
144471
|
+
|
|
144472
|
+
jones_2000@163.com
|
|
144473
|
+
|
|
144474
|
+
内置区间统计框 设置框
|
|
144475
|
+
*/
|
|
144476
|
+
|
|
144477
|
+
|
|
144478
|
+
|
|
144479
|
+
function JSDialogSelectRect()
|
|
144480
|
+
{
|
|
144481
|
+
this.DivDialog=null;
|
|
144482
|
+
this.DragTitle=null;
|
|
144483
|
+
this.HQChart=null;
|
|
144484
|
+
|
|
144485
|
+
this.UpColor=g_JSChartResource.UpTextColor;
|
|
144486
|
+
this.DownColor=g_JSChartResource.DownTextColor;
|
|
144487
|
+
this.UnchangeColor=g_JSChartResource.UnchagneTextColor;
|
|
144488
|
+
|
|
144489
|
+
this.TitleColor=g_JSChartResource.DialogSelectRect.TitleColor;
|
|
144490
|
+
this.TitleBGColor=g_JSChartResource.DialogSelectRect.TitleBGColor;
|
|
144491
|
+
this.BGColor=g_JSChartResource.DialogSelectRect.BGColor;
|
|
144492
|
+
|
|
144493
|
+
this.TextColor=g_JSChartResource.DialogSelectRect.TextColor;
|
|
144494
|
+
this.ValueColor=g_JSChartResource.DialogSelectRect.ValueColor;
|
|
144495
|
+
|
|
144496
|
+
this.VolColor=g_JSChartResource.DialogSelectRect.VolColor;
|
|
144497
|
+
this.AmountColor=g_JSChartResource.DialogSelectRect.AmountColor;
|
|
144498
|
+
this.TurnoverRateColor=g_JSChartResource.DialogSelectRect.TurnoverRateColor;
|
|
144499
|
+
this.PositionColor=g_JSChartResource.DialogSelectRect.PositionColor;
|
|
144500
|
+
|
|
144501
|
+
|
|
144502
|
+
this.MaxRowCount=10;
|
|
144503
|
+
this.AryData=[];
|
|
144504
|
+
this.DateTimeBox={ Start:{ SpanText:null, SpanValue:null }, End:{ SpanText:null, SpanValue:null } };
|
|
144505
|
+
this.ShowData;
|
|
144506
|
+
this.SelectData;
|
|
144507
|
+
|
|
144508
|
+
this.Inital=function(hqchart, option)
|
|
144509
|
+
{
|
|
144510
|
+
this.HQChart=hqchart;
|
|
144511
|
+
if (option)
|
|
144512
|
+
{
|
|
144513
|
+
|
|
144514
|
+
}
|
|
144515
|
+
}
|
|
144516
|
+
|
|
144517
|
+
this.Destroy=function()
|
|
144518
|
+
{
|
|
144519
|
+
this.AryData=[];
|
|
144520
|
+
this.ShowData=null;
|
|
144521
|
+
this.DateTimeBox={ Start:{ SpanText:null, SpanValue:null }, End:{ SpanText:null, SpanValue:null } };
|
|
144522
|
+
|
|
144523
|
+
if (this.DivDialog)
|
|
144524
|
+
{
|
|
144525
|
+
document.body.removeChild(this.DivDialog);
|
|
144526
|
+
this.DivDialog=null;
|
|
144527
|
+
}
|
|
144528
|
+
}
|
|
144529
|
+
|
|
144530
|
+
this.Create=function()
|
|
144531
|
+
{
|
|
144532
|
+
var divDom=document.createElement("div");
|
|
144533
|
+
divDom.className='UMyChart_SelectRect_Dialog_Div';
|
|
144534
|
+
|
|
144535
|
+
var divTitle=document.createElement("div");
|
|
144536
|
+
divTitle.className='UMyChart_SelectRect_Title_Div';
|
|
144537
|
+
divTitle.onmousedown=(e)=>{ this.OnMouseDownTitle(e);}
|
|
144538
|
+
|
|
144539
|
+
var divName=document.createElement("div");
|
|
144540
|
+
divName.className='UMyChart_SelectRect_Name_Div';
|
|
144541
|
+
divName.innerText="区间统计";
|
|
144542
|
+
divTitle.appendChild(divName);
|
|
144543
|
+
|
|
144544
|
+
var divClose=document.createElement("div");
|
|
144545
|
+
divClose.className='UMyChart_SelectRect_Close_Div';
|
|
144546
|
+
divClose.innerText="x";
|
|
144547
|
+
divClose.onmousedown=(e)=>{ this.Close(e); }
|
|
144548
|
+
divTitle.appendChild(divClose);
|
|
144549
|
+
|
|
144550
|
+
divDom.appendChild(divTitle);
|
|
144551
|
+
|
|
144552
|
+
var divDateTime=document.createElement("div");
|
|
144553
|
+
divDateTime.className='UMyChart_SelectRect_DateTime_Div';
|
|
144554
|
+
|
|
144555
|
+
//起始日期
|
|
144556
|
+
var divStartDate=document.createElement("div");
|
|
144557
|
+
divDateTime.append(divStartDate);
|
|
144558
|
+
var spanText=document.createElement("span");
|
|
144559
|
+
spanText.className="UMyChart_SelectRect_DateTitle_Span";
|
|
144560
|
+
spanText.innerText="开始:";
|
|
144561
|
+
divStartDate.appendChild(spanText);
|
|
144562
|
+
this.DateTimeBox.Start.SpanText=spanText;
|
|
144563
|
+
|
|
144564
|
+
var spanDate=document.createElement("span");
|
|
144565
|
+
spanDate.className="UMyChart_SelectRect_DateValue_Span";
|
|
144566
|
+
spanDate.innerText="--/--";
|
|
144567
|
+
divStartDate.appendChild(spanDate);
|
|
144568
|
+
this.DateTimeBox.Start.SpanValue=spanDate;
|
|
144569
|
+
|
|
144570
|
+
var spanArrow=document.createElement("span");
|
|
144571
|
+
spanArrow.className="UMyChart_SelectRect_ArrowButton_Span";
|
|
144572
|
+
spanArrow.innerText="<";
|
|
144573
|
+
spanArrow.onmousedown=(e)=>{ this.MoveStartDate(-1); }
|
|
144574
|
+
divStartDate.appendChild(spanArrow);
|
|
144575
|
+
|
|
144576
|
+
var spanArrow=document.createElement("span");
|
|
144577
|
+
spanArrow.className="UMyChart_SelectRect_ArrowButton_Span";
|
|
144578
|
+
spanArrow.innerText=">";
|
|
144579
|
+
spanArrow.onmousedown=(e)=>{ this.MoveStartDate(1); }
|
|
144580
|
+
divStartDate.appendChild(spanArrow);
|
|
144581
|
+
|
|
144582
|
+
//结束日期
|
|
144583
|
+
var divEndDate=document.createElement("div");
|
|
144584
|
+
divDateTime.append(divEndDate);
|
|
144585
|
+
var spanText=document.createElement("span");
|
|
144586
|
+
spanText.className="UMyChart_SelectRect_DateTitle_Span";
|
|
144587
|
+
spanText.innerText="结束:";
|
|
144588
|
+
divEndDate.appendChild(spanText);
|
|
144589
|
+
this.DateTimeBox.End.SpanText=spanText;
|
|
144590
|
+
|
|
144591
|
+
var spanDate=document.createElement("span");
|
|
144592
|
+
spanDate.className="UMyChart_SelectRect_DateValue_Span";
|
|
144593
|
+
spanDate.innerText="--/--";
|
|
144594
|
+
divEndDate.appendChild(spanDate);
|
|
144595
|
+
this.DateTimeBox.SpanEnd=spanDate;
|
|
144596
|
+
this.DateTimeBox.End.SpanValue=spanDate;
|
|
144597
|
+
|
|
144598
|
+
var spanArrow=document.createElement("span");
|
|
144599
|
+
spanArrow.className="UMyChart_SelectRect_ArrowButton_Span";
|
|
144600
|
+
spanArrow.innerText="<";
|
|
144601
|
+
spanArrow.onmousedown=(e)=>{ this.MoveEndDate(-1); }
|
|
144602
|
+
divEndDate.appendChild(spanArrow);
|
|
144603
|
+
|
|
144604
|
+
var spanArrow=document.createElement("span");
|
|
144605
|
+
spanArrow.className="UMyChart_SelectRect_ArrowButton_Span";
|
|
144606
|
+
spanArrow.innerText=">";
|
|
144607
|
+
spanArrow.onmousedown=(e)=>{ this.MoveEndDate(1); }
|
|
144608
|
+
divEndDate.appendChild(spanArrow);
|
|
144609
|
+
|
|
144610
|
+
divDom.appendChild(divDateTime);
|
|
144611
|
+
|
|
144612
|
+
|
|
144613
|
+
var table=document.createElement("table");
|
|
144614
|
+
table.className="UMyChart_SelectRect_Table";
|
|
144615
|
+
divDom.appendChild(table);
|
|
144616
|
+
|
|
144617
|
+
var tbody=document.createElement("tbody");
|
|
144618
|
+
tbody.className="UMyChart_SelectRect_Tbody";
|
|
144619
|
+
table.appendChild(tbody);
|
|
144620
|
+
|
|
144621
|
+
|
|
144622
|
+
for(var i=0;i<this.MaxRowCount;++i)
|
|
144623
|
+
{
|
|
144624
|
+
var rowItem={ Tr:null, AryItem:[] };
|
|
144625
|
+
|
|
144626
|
+
var trDom=document.createElement("tr");
|
|
144627
|
+
trDom.className='UMyChart_SelectRect_Tr';
|
|
144628
|
+
tbody.appendChild(trDom);
|
|
144629
|
+
rowItem.Tr=trDom;
|
|
144630
|
+
|
|
144631
|
+
for(var j=0;j<3;++j)
|
|
144632
|
+
{
|
|
144633
|
+
var item={ Td:null, LeftSpan:null, RightSpan:null };
|
|
144634
|
+
var tdDom=document.createElement("td");
|
|
144635
|
+
tdDom.className="UMyChart_SelectRect_Td"; //标题+数值
|
|
144636
|
+
item.Td=tdDom;
|
|
144637
|
+
trDom.appendChild(tdDom);
|
|
144638
|
+
|
|
144639
|
+
var spanDom=document.createElement("span");
|
|
144640
|
+
spanDom.className='UMyChart_SelectRect_Item_Left_Span';
|
|
144641
|
+
spanDom.innerText='数值';
|
|
144642
|
+
item.LeftSpan=spanDom;
|
|
144643
|
+
tdDom.appendChild(spanDom);
|
|
144644
|
+
|
|
144645
|
+
|
|
144646
|
+
var spanDom=document.createElement("span");
|
|
144647
|
+
spanDom.className='UMyChart_SelectRect_Item_Right_Span';
|
|
144648
|
+
spanDom.innerText='--';
|
|
144649
|
+
item.RightSpan=spanDom;
|
|
144650
|
+
tdDom.appendChild(spanDom);
|
|
144651
|
+
|
|
144652
|
+
rowItem.AryItem.push(item);
|
|
144653
|
+
}
|
|
144654
|
+
|
|
144655
|
+
this.AryData.push(rowItem);
|
|
144656
|
+
}
|
|
144657
|
+
|
|
144658
|
+
document.body.appendChild(divDom);
|
|
144659
|
+
|
|
144660
|
+
this.DivDialog=divDom;
|
|
144661
|
+
|
|
144662
|
+
this.UpdateStyle();
|
|
144663
|
+
}
|
|
144664
|
+
|
|
144665
|
+
this.Close=function(e)
|
|
144666
|
+
{
|
|
144667
|
+
if (!this.DivDialog) return;
|
|
144668
|
+
|
|
144669
|
+
this.DivDialog.style.visibility='hidden';
|
|
144670
|
+
this.ShowData=null;
|
|
144671
|
+
this.SelectData=null;
|
|
144672
|
+
}
|
|
144673
|
+
|
|
144674
|
+
this.MoveStartDate=function(step)
|
|
144675
|
+
{
|
|
144676
|
+
if (!this.DivDialog || !this.HQChart) return;
|
|
144677
|
+
if (step==0) return;
|
|
144678
|
+
if (!this.SelectData) return;
|
|
144679
|
+
|
|
144680
|
+
var selectData=this.SelectData;
|
|
144681
|
+
var bUpdate=false;
|
|
144682
|
+
if (step>0)
|
|
144683
|
+
{
|
|
144684
|
+
var index=selectData.Start;
|
|
144685
|
+
var endIndex=selectData.End;
|
|
144686
|
+
for(i=0; i<step && index<endIndex; ++i)
|
|
144687
|
+
{
|
|
144688
|
+
++index;
|
|
144689
|
+
}
|
|
144690
|
+
|
|
144691
|
+
if (selectData.Start!=index)
|
|
144692
|
+
{
|
|
144693
|
+
selectData.Start=index;
|
|
144694
|
+
bUpdate=true;
|
|
144695
|
+
}
|
|
144696
|
+
}
|
|
144697
|
+
else
|
|
144698
|
+
{
|
|
144699
|
+
step=Math.abs(step);
|
|
144700
|
+
var index=selectData.Start
|
|
144701
|
+
var endIndex=selectData.End;
|
|
144702
|
+
for(var i=0;i<step && index>0;++i)
|
|
144703
|
+
{
|
|
144704
|
+
--index;
|
|
144705
|
+
}
|
|
144706
|
+
|
|
144707
|
+
if (selectData.Start!=index)
|
|
144708
|
+
{
|
|
144709
|
+
selectData.Start=index;
|
|
144710
|
+
bUpdate=true;
|
|
144711
|
+
}
|
|
144712
|
+
}
|
|
144713
|
+
|
|
144714
|
+
if (bUpdate) this.UpdateSelectRect(selectData);
|
|
144715
|
+
}
|
|
144716
|
+
|
|
144717
|
+
this.MoveEndDate=function(step)
|
|
144718
|
+
{
|
|
144719
|
+
if (!this.DivDialog) return;
|
|
144720
|
+
if (step==0) return;
|
|
144721
|
+
if (!this.SelectData) return;
|
|
144722
|
+
|
|
144723
|
+
var selectData=this.SelectData;
|
|
144724
|
+
var bUpdate=false;
|
|
144725
|
+
|
|
144726
|
+
if (step>0)
|
|
144727
|
+
{
|
|
144728
|
+
var index=selectData.End;
|
|
144729
|
+
var startIndex=selectData.Start;
|
|
144730
|
+
for(i=0; i<step && index<this.ShowData.DataCount; ++i)
|
|
144731
|
+
{
|
|
144732
|
+
++index;
|
|
144733
|
+
}
|
|
144734
|
+
|
|
144735
|
+
if (selectData.End!=index)
|
|
144736
|
+
{
|
|
144737
|
+
selectData.End=index;
|
|
144738
|
+
bUpdate=true;
|
|
144739
|
+
}
|
|
144740
|
+
}
|
|
144741
|
+
else
|
|
144742
|
+
{
|
|
144743
|
+
step=Math.abs(step);
|
|
144744
|
+
var index=selectData.End;
|
|
144745
|
+
var startIndex=selectData.Start;
|
|
144746
|
+
for(var i=0;i<step && index>startIndex;++i)
|
|
144747
|
+
{
|
|
144748
|
+
--index;
|
|
144749
|
+
}
|
|
144750
|
+
|
|
144751
|
+
if (selectData.End!=index)
|
|
144752
|
+
{
|
|
144753
|
+
selectData.End=index;
|
|
144754
|
+
bUpdate=true;
|
|
144755
|
+
}
|
|
144756
|
+
}
|
|
144757
|
+
|
|
144758
|
+
if (bUpdate) this.UpdateSelectRect(selectData);
|
|
144759
|
+
}
|
|
144760
|
+
|
|
144761
|
+
this.Show=function(x,y)
|
|
144762
|
+
{
|
|
144763
|
+
if (!this.DivDialog) return;
|
|
144764
|
+
if (!this.HQChart) return;
|
|
144765
|
+
|
|
144766
|
+
/*
|
|
144767
|
+
if (!this.DivDialog.style.top || !this.DivDialog.style.left) //上一次显示的位置
|
|
144768
|
+
{
|
|
144769
|
+
var top=this.HQChart.Frame.ChartBorder.GetTop();
|
|
144770
|
+
var left=this.HQChart.Frame.ChartBorder.GetLeft();
|
|
144771
|
+
|
|
144772
|
+
|
|
144773
|
+
var x=left+rtClient.left+5;
|
|
144774
|
+
var y=top+rtClient.top+10;
|
|
144775
|
+
this.DivDialog.style.top = y + "px";
|
|
144776
|
+
this.DivDialog.style.left = x + "px";
|
|
144777
|
+
}
|
|
144778
|
+
*/
|
|
144779
|
+
|
|
144780
|
+
var top=this.HQChart.Frame.ChartBorder.GetTop();
|
|
144781
|
+
var left=this.HQChart.Frame.ChartBorder.GetLeft();
|
|
144782
|
+
var rtClient=this.HQChart.UIElement.getBoundingClientRect();
|
|
144783
|
+
|
|
144784
|
+
left=left+rtClient.left+5;
|
|
144785
|
+
top=top+rtClient.top+10;
|
|
144786
|
+
if (IFrameSplitOperator.IsNumber(x) && IFrameSplitOperator.IsNumber(y))
|
|
144787
|
+
{
|
|
144788
|
+
left=x;
|
|
144789
|
+
top=y;
|
|
144790
|
+
}
|
|
144791
|
+
|
|
144792
|
+
var right=x+this.DivDialog.offsetWidth;
|
|
144793
|
+
var bottom=y+ this.DivDialog.offsetHeight;
|
|
144794
|
+
|
|
144795
|
+
if ((right+5)>=window.innerWidth) left=window.innerWidth-this.DivDialog.offsetWidth-5;
|
|
144796
|
+
if ((bottom+5)>=window.innerHeight) top=window.innerHeight-this.DivDialog.offsetHeight-5;
|
|
144797
|
+
|
|
144798
|
+
this.DivDialog.style.top = top + "px";
|
|
144799
|
+
this.DivDialog.style.left = left + "px";
|
|
144800
|
+
this.DivDialog.style.visibility='visible';
|
|
144801
|
+
}
|
|
144802
|
+
|
|
144803
|
+
this.IsShow=function()
|
|
144804
|
+
{
|
|
144805
|
+
if (!this.DivDialog) return false;
|
|
144806
|
+
|
|
144807
|
+
return this.DivDialog.style.visibility==='visible';
|
|
144808
|
+
}
|
|
144809
|
+
|
|
144810
|
+
this.OnMouseDownTitle=function(e)
|
|
144811
|
+
{
|
|
144812
|
+
if (!this.DivDialog) return;
|
|
144813
|
+
|
|
144814
|
+
var dragData={ X:e.clientX, Y:e.clientY };
|
|
144815
|
+
dragData.YOffset=e.clientX - this.DivDialog.offsetLeft;
|
|
144816
|
+
dragData.XOffset=e.clientY - this.DivDialog.offsetTop;
|
|
144817
|
+
this.DragTitle=dragData;
|
|
144818
|
+
|
|
144819
|
+
document.onmousemove=(e)=>{ this.DocOnMouseMoveTitle(e); }
|
|
144820
|
+
document.onmouseup=(e)=>{ this.DocOnMouseUpTitle(e); }
|
|
144821
|
+
}
|
|
144822
|
+
|
|
144823
|
+
this.DocOnMouseMoveTitle=function(e)
|
|
144824
|
+
{
|
|
144825
|
+
if (!this.DragTitle) return;
|
|
144826
|
+
|
|
144827
|
+
var left = e.clientX - this.DragTitle.YOffset;
|
|
144828
|
+
var top = e.clientY - this.DragTitle.XOffset;
|
|
144829
|
+
|
|
144830
|
+
var right=left+this.DivDialog.offsetWidth;
|
|
144831
|
+
var bottom=top+ this.DivDialog.offsetHeight;
|
|
144832
|
+
|
|
144833
|
+
if ((right+5)>=window.innerWidth) left=window.innerWidth-this.DivDialog.offsetWidth-5;
|
|
144834
|
+
if ((bottom+5)>=window.innerHeight) top=window.innerHeight-this.DivDialog.offsetHeight-5;
|
|
144835
|
+
|
|
144836
|
+
this.DivDialog.style.left = left + 'px';
|
|
144837
|
+
this.DivDialog.style.top = top + 'px';
|
|
144838
|
+
|
|
144839
|
+
if(e.preventDefault) e.preventDefault();
|
|
144840
|
+
}
|
|
144841
|
+
|
|
144842
|
+
this.DocOnMouseUpTitle=function(e)
|
|
144843
|
+
{
|
|
144844
|
+
this.DragTitle=null;
|
|
144845
|
+
this.onmousemove = null;
|
|
144846
|
+
this.onmouseup = null;
|
|
144847
|
+
}
|
|
144848
|
+
|
|
144849
|
+
|
|
144850
|
+
//配色修改
|
|
144851
|
+
this.ReloadResource=function(option)
|
|
144852
|
+
{
|
|
144853
|
+
this.UpColor=g_JSChartResource.UpTextColor;
|
|
144854
|
+
this.DownColor=g_JSChartResource.DownTextColor;
|
|
144855
|
+
this.UnchangeColor=g_JSChartResource.UnchagneTextColor;
|
|
144856
|
+
|
|
144857
|
+
this.TitleColor=g_JSChartResource.DialogSelectRect.TitleColor;
|
|
144858
|
+
this.TitleBGColor=g_JSChartResource.DialogSelectRect.TitleBGColor;
|
|
144859
|
+
this.BGColor=g_JSChartResource.DialogSelectRect.BGColor;
|
|
144860
|
+
this.BorderColor=g_JSChartResource.DialogSelectRect.BorderColor;
|
|
144861
|
+
|
|
144862
|
+
this.TextColor=g_JSChartResource.DialogSelectRect.TextColor;
|
|
144863
|
+
this.ValueColor=g_JSChartResource.DialogSelectRect.ValueColor;
|
|
144864
|
+
|
|
144865
|
+
this.VolColor=g_JSChartResource.DialogSelectRect.VolColor;
|
|
144866
|
+
this.AmountColor=g_JSChartResource.DialogSelectRect.AmountColor;
|
|
144867
|
+
this.TurnoverRateColor=g_JSChartResource.DialogSelectRect.TurnoverRateColor;
|
|
144868
|
+
this.PositionColor=g_JSChartResource.DialogSelectRect.PositionColor;
|
|
144869
|
+
|
|
144870
|
+
if (!this.DivDialog) return;
|
|
144871
|
+
|
|
144872
|
+
this.UpdateStyle();
|
|
144873
|
+
|
|
144874
|
+
if (this.SelectData)
|
|
144875
|
+
{
|
|
144876
|
+
var selectData=this.SelectData;
|
|
144877
|
+
this.HQChart.UpdateSelectRect(selectData.Start,selectData.End);
|
|
144878
|
+
var showData=this.CalculateKLineData({ SelectData:selectData });
|
|
144879
|
+
this.FormatKLineText(showData);
|
|
144880
|
+
this.ShowData=showData;
|
|
144881
|
+
this.UpdateTableDOM(showData);
|
|
144882
|
+
}
|
|
144883
|
+
|
|
144884
|
+
}
|
|
144885
|
+
|
|
144886
|
+
this.UpdateStyle=function()
|
|
144887
|
+
{
|
|
144888
|
+
if (!this.DivDialog) return;
|
|
144889
|
+
|
|
144890
|
+
if (this.BGColor) this.DivDialog.style['background-color']=this.BGColor;
|
|
144891
|
+
if (this.BorderColor) this.DivDialog.style['border-color']=this.BorderColor;
|
|
144892
|
+
|
|
144893
|
+
if (this.DateTimeBox.Start)
|
|
144894
|
+
{
|
|
144895
|
+
var item=this.DateTimeBox.Start;
|
|
144896
|
+
item.SpanText.style["color"]=this.TextColor;
|
|
144897
|
+
item.SpanValue.style["color"]=this.ValueColor;
|
|
144898
|
+
}
|
|
144899
|
+
|
|
144900
|
+
if (this.DateTimeBox.End)
|
|
144901
|
+
{
|
|
144902
|
+
var item=this.DateTimeBox.End;
|
|
144903
|
+
item.SpanText.style["color"]=this.TextColor;
|
|
144904
|
+
item.SpanValue.style["color"]=this.ValueColor;
|
|
144905
|
+
}
|
|
144906
|
+
|
|
144907
|
+
//if (this.TitleBGColor) this.TitleBox.DivTitle.style['background-color']=this.TitleBGColor;
|
|
144908
|
+
}
|
|
144909
|
+
|
|
144910
|
+
|
|
144911
|
+
this.UpdateTableDOM=function(showData)
|
|
144912
|
+
{
|
|
144913
|
+
var index=0;
|
|
144914
|
+
for(var index=0,j=0, dataIndex=0;index<this.AryData.length && dataIndex<showData.AryText.length;++index)
|
|
144915
|
+
{
|
|
144916
|
+
var rowItem=this.AryData[index];
|
|
144917
|
+
for(j=0;j<rowItem.AryItem.length;++j, ++dataIndex)
|
|
144918
|
+
{
|
|
144919
|
+
if (dataIndex>=showData.AryText.length) break;
|
|
144920
|
+
|
|
144921
|
+
var item=rowItem.AryItem[j]
|
|
144922
|
+
var outItem=showData.AryText[dataIndex];
|
|
144923
|
+
|
|
144924
|
+
item.LeftSpan.innerText=outItem.Title;
|
|
144925
|
+
item.LeftSpan.style.color=this.TextColor;
|
|
144926
|
+
|
|
144927
|
+
item.RightSpan.innerText=outItem.Text;
|
|
144928
|
+
item.RightSpan.style.color=outItem.Color;
|
|
144929
|
+
}
|
|
144930
|
+
rowItem.Tr.style.display="";
|
|
144931
|
+
}
|
|
144932
|
+
|
|
144933
|
+
for(; index<this.AryData.length;++index)
|
|
144934
|
+
{
|
|
144935
|
+
var rowItem=this.AryData[index];
|
|
144936
|
+
rowItem.Tr.style.display="none";
|
|
144937
|
+
}
|
|
144938
|
+
|
|
144939
|
+
if (this.DateTimeBox.Start.SpanValue) this.DateTimeBox.Start.SpanValue.innerText=showData.Date.Start.Text;
|
|
144940
|
+
if (this.DateTimeBox.End.SpanValue) this.DateTimeBox.End.SpanValue.innerText=showData.Date.End.Text;
|
|
144941
|
+
}
|
|
144942
|
+
|
|
144943
|
+
this.UpdateSelectRect=function(selectData)
|
|
144944
|
+
{
|
|
144945
|
+
this.HQChart.UpdateSelectRect(selectData.Start,selectData.End);
|
|
144946
|
+
var showData=null;
|
|
144947
|
+
if (this.HQChart.ClassName=='KLineChartContainer')
|
|
144948
|
+
{
|
|
144949
|
+
showData=this.CalculateKLineData({ SelectData:selectData });
|
|
144950
|
+
this.FormatKLineText(showData);
|
|
144951
|
+
}
|
|
144952
|
+
else if (this.HQChart.ClassName=='MinuteChartContainer')
|
|
144953
|
+
{
|
|
144954
|
+
showData=this.CalculateMinuteData({ SelectData:selectData });
|
|
144955
|
+
this.FormatMinuteText(showData);
|
|
144956
|
+
}
|
|
144957
|
+
|
|
144958
|
+
if (showData)
|
|
144959
|
+
{
|
|
144960
|
+
this.ShowData=showData;
|
|
144961
|
+
this.UpdateTableDOM(showData);
|
|
144962
|
+
}
|
|
144963
|
+
}
|
|
144964
|
+
|
|
144965
|
+
|
|
144966
|
+
this.Update=function(data)
|
|
144967
|
+
{
|
|
144968
|
+
if (!this.DivDialog) return;
|
|
144969
|
+
|
|
144970
|
+
var showData;
|
|
144971
|
+
if (this.HQChart.ClassName=='KLineChartContainer')
|
|
144972
|
+
{
|
|
144973
|
+
showData=this.CalculateKLineData(data);
|
|
144974
|
+
this.FormatKLineText(showData);
|
|
144975
|
+
}
|
|
144976
|
+
else if (this.HQChart.ClassName=='MinuteChartContainer')
|
|
144977
|
+
{
|
|
144978
|
+
showData=this.CalculateMinuteData(data);
|
|
144979
|
+
this.FormatMinuteText(showData);
|
|
144980
|
+
}
|
|
144981
|
+
|
|
144982
|
+
if (!showData) return;
|
|
144983
|
+
|
|
144984
|
+
this.ShowData=showData;
|
|
144985
|
+
this.SelectData=data.SelectData;
|
|
144986
|
+
this.UpdateTableDOM(showData);
|
|
144987
|
+
|
|
144988
|
+
if (!this.IsShow()) this.Show(data.X, data.Y);
|
|
144989
|
+
}
|
|
144990
|
+
|
|
144991
|
+
this.CreateEmptyShowData=function()
|
|
144992
|
+
{
|
|
144993
|
+
var showData=
|
|
144994
|
+
{
|
|
144995
|
+
Open:null,Close:null,High:null,Low:null, YClose:null,
|
|
144996
|
+
Vol:0, Amount:0,
|
|
144997
|
+
Date:
|
|
144998
|
+
{
|
|
144999
|
+
Start:{ Time:null, Date:null, Text:"" },
|
|
145000
|
+
End:{ Time:null, Date:null, Text:"" }
|
|
145001
|
+
},
|
|
145002
|
+
Count:0,
|
|
145003
|
+
KLine:{ Up:0,Down:0,Unchanged:0 }, //阳线|阴线|平线
|
|
145004
|
+
|
|
145005
|
+
AryText:[],
|
|
145006
|
+
|
|
145007
|
+
DataCount:0,
|
|
145008
|
+
};
|
|
145009
|
+
|
|
145010
|
+
return showData;
|
|
145011
|
+
}
|
|
145012
|
+
|
|
145013
|
+
this.CalculateKLineData=function(data)
|
|
145014
|
+
{
|
|
145015
|
+
var selectData=data.SelectData;
|
|
145016
|
+
var hisData=selectData.Data;
|
|
145017
|
+
var start=selectData.Start;
|
|
145018
|
+
var end=selectData.End;
|
|
145019
|
+
|
|
145020
|
+
var showData=this.CreateEmptyShowData();
|
|
145021
|
+
showData.DataCount=hisData.Data.length;
|
|
145022
|
+
|
|
145023
|
+
for(var i=start;i<hisData.Data.length && i<=end;++i)
|
|
145024
|
+
{
|
|
145025
|
+
var item=hisData.Data[i];
|
|
145026
|
+
++showData.Count;
|
|
145027
|
+
|
|
145028
|
+
if (!IFrameSplitOperator.IsNumber(showData.Open) && IFrameSplitOperator.IsNumber(item.Open)) showData.Open=item.Open;
|
|
145029
|
+
if (IFrameSplitOperator.IsNumber(item.Close)) showData.Close=item.Close;
|
|
145030
|
+
|
|
145031
|
+
if (IFrameSplitOperator.IsNumber(item.Vol)) showData.Vol+=item.Vol;
|
|
145032
|
+
if (IFrameSplitOperator.IsNumber(item.Amount)) showData.Amount+=item.Amount;
|
|
145033
|
+
|
|
145034
|
+
if (IFrameSplitOperator.IsNumber(item.High))
|
|
145035
|
+
{
|
|
145036
|
+
if (!IFrameSplitOperator.IsNumber(showData.High) || showData.High<item.High)
|
|
145037
|
+
showData.High=item.High;
|
|
145038
|
+
}
|
|
145039
|
+
|
|
145040
|
+
if (IFrameSplitOperator.IsNumber(item.Low))
|
|
145041
|
+
{
|
|
145042
|
+
if (!IFrameSplitOperator.IsNumber(showData.Low) || showData.Low>item.Low)
|
|
145043
|
+
showData.Low=item.Low;
|
|
145044
|
+
}
|
|
145045
|
+
|
|
145046
|
+
if (IFrameSplitOperator.IsNumber(item.Open) && IFrameSplitOperator.IsNumber(item.Close))
|
|
145047
|
+
{
|
|
145048
|
+
if (item.Close>item.Open) ++showData.KLine.Up;
|
|
145049
|
+
else if (item.Close<item.Open) ++showData.KLine.Down;
|
|
145050
|
+
else ++showData.KLine.Unchanged;
|
|
145051
|
+
}
|
|
145052
|
+
|
|
145053
|
+
if (IFrameSplitOperator.IsNumber(item.Date))
|
|
145054
|
+
{
|
|
145055
|
+
showData.Date.End.Date=item.Date;
|
|
145056
|
+
if (!IFrameSplitOperator.IsNumber(showData.Date.Start.Date)) showData.Date.Start.Date=item.Date;
|
|
145057
|
+
}
|
|
145058
|
+
|
|
145059
|
+
if (IFrameSplitOperator.IsNumber(item.Time))
|
|
145060
|
+
{
|
|
145061
|
+
showData.Date.End.Time=item.Time;
|
|
145062
|
+
if (!IFrameSplitOperator.IsNumber(showData.Date.Start.Time)) showData.Date.Start.Time=item.Time;
|
|
145063
|
+
}
|
|
145064
|
+
}
|
|
145065
|
+
|
|
145066
|
+
return showData;
|
|
145067
|
+
}
|
|
145068
|
+
|
|
145069
|
+
//格式化K线数据
|
|
145070
|
+
this.FormatKLineText=function(showData)
|
|
145071
|
+
{
|
|
145072
|
+
if (!showData) return;
|
|
145073
|
+
|
|
145074
|
+
var defaultfloatPrecision=GetfloatPrecision(this.HQChart.Symbol);
|
|
145075
|
+
|
|
145076
|
+
if (ChartData.IsMinutePeriod(this.HQChart.Period,true))
|
|
145077
|
+
{
|
|
145078
|
+
showData.Date.Start.Text=`${IFrameSplitOperator.FormatDateString(showData.Date.Start.Date)} ${IFrameSplitOperator.FormatTimeString(showData.Date.Start.Time,"HH:MM")}`;
|
|
145079
|
+
showData.Date.End.Text=`${IFrameSplitOperator.FormatDateString(showData.Date.End.Date)} ${IFrameSplitOperator.FormatTimeString(showData.Date.End.Time,"HH:MM")}`;
|
|
145080
|
+
}
|
|
145081
|
+
else if (ChartData.IsSecondPeriod(this.HQChart.Period) || ChartData.IsTickPeriod(this.HQChart.Period))
|
|
145082
|
+
{
|
|
145083
|
+
showData.Date.Start.Text=`${IFrameSplitOperator.FormatDateString(showData.Date.Start.Date)} ${IFrameSplitOperator.FormatTimeString(showData.Date.Start.Time,"HH:MM:SS")}`;
|
|
145084
|
+
showData.Date.End.Text=`${IFrameSplitOperator.FormatDateString(showData.Date.End.Date)} ${IFrameSplitOperator.FormatTimeString(showData.Date.End.Time,"HH:MM:SS")}`;
|
|
145085
|
+
}
|
|
145086
|
+
else
|
|
145087
|
+
{
|
|
145088
|
+
showData.Date.Start.Text=IFrameSplitOperator.FormatDateString(showData.Date.Start.Date);
|
|
145089
|
+
showData.Date.End.Text=IFrameSplitOperator.FormatDateString(showData.Date.End.Date);
|
|
145090
|
+
}
|
|
145091
|
+
|
|
145092
|
+
showData.AryText.push(this.ForamtPrice(showData.Open, showData.Open,defaultfloatPrecision, 'DialogSelectRect-StartPrice'));
|
|
145093
|
+
showData.AryText.push(this.ForamtPrice(showData.Close, showData.Open,defaultfloatPrecision, 'DialogSelectRect-EndPrice'));
|
|
145094
|
+
showData.AryText.push(this.FormatIncrease(showData.Close, showData.Open, 'DialogSelectRect-Increase'));
|
|
145095
|
+
|
|
145096
|
+
showData.AryText.push(this.ForamtPrice(showData.High, showData.Open,defaultfloatPrecision, 'DialogSelectRect-High'));
|
|
145097
|
+
showData.AryText.push(this.ForamtPrice(showData.Low, showData.Open,defaultfloatPrecision, 'DialogSelectRect-Low'));
|
|
145098
|
+
showData.AryText.push(this.FormatAmplitude(showData.High, showData.Low, showData.Open, 'DialogSelectRect-Amplitude'));
|
|
145099
|
+
|
|
145100
|
+
showData.AryText.push(this.FormatVol(showData.Vol, 'DialogSelectRect-Vol'));
|
|
145101
|
+
showData.AryText.push(this.FormatAmount(showData.Amount, 'DialogSelectRect-Amount'));
|
|
145102
|
+
showData.AryText.push(this.FormatNumber(showData.Count, null, 0, "DialogSelectRect-DataCount"));
|
|
145103
|
+
|
|
145104
|
+
showData.AryText.push(this.FormatNumber(showData.KLine.Up, this.UpColor, 0, 'DialogSelectRect-Up'));
|
|
145105
|
+
showData.AryText.push(this.FormatNumber(showData.KLine.Down, this.DownColor, 0, 'DialogSelectRect-Down'));
|
|
145106
|
+
showData.AryText.push(this.FormatNumber(showData.KLine.Unchanged, this.UnchangeColor, 0, 'DialogSelectRect-Unchanged'));
|
|
145107
|
+
}
|
|
145108
|
+
|
|
145109
|
+
|
|
145110
|
+
this.CalculateMinuteData=function(data)
|
|
145111
|
+
{
|
|
145112
|
+
var selectData=data.SelectData;
|
|
145113
|
+
var hisData=selectData.Data;
|
|
145114
|
+
var start=selectData.Start;
|
|
145115
|
+
var end=selectData.End;
|
|
145116
|
+
|
|
145117
|
+
var showData=this.CreateEmptyShowData();
|
|
145118
|
+
showData.DataCount=hisData.Data.length;
|
|
145119
|
+
|
|
145120
|
+
for(var i=start;i<hisData.Data.length && i<=end;++i)
|
|
145121
|
+
{
|
|
145122
|
+
var item=hisData.Data[i];
|
|
145123
|
+
++showData.Count;
|
|
145124
|
+
|
|
145125
|
+
if (!IFrameSplitOperator.IsNumber(showData.Open) && IFrameSplitOperator.IsNumber(item.Open)) showData.Open=item.Open;
|
|
145126
|
+
if (IFrameSplitOperator.IsNumber(item.Close)) showData.Close=item.Close;
|
|
145127
|
+
|
|
145128
|
+
if (IFrameSplitOperator.IsNumber(item.Vol)) showData.Vol+=item.Vol;
|
|
145129
|
+
if (IFrameSplitOperator.IsNumber(item.Amount)) showData.Amount+=item.Amount;
|
|
145130
|
+
|
|
145131
|
+
if (IFrameSplitOperator.IsNumber(item.High))
|
|
145132
|
+
{
|
|
145133
|
+
if (!IFrameSplitOperator.IsNumber(showData.High) || showData.High<item.High)
|
|
145134
|
+
showData.High=item.High;
|
|
145135
|
+
}
|
|
145136
|
+
|
|
145137
|
+
if (IFrameSplitOperator.IsNumber(item.Low))
|
|
145138
|
+
{
|
|
145139
|
+
if (!IFrameSplitOperator.IsNumber(showData.Low) || showData.Low>item.Low)
|
|
145140
|
+
showData.Low=item.Low;
|
|
145141
|
+
}
|
|
145142
|
+
|
|
145143
|
+
if (IFrameSplitOperator.IsNumber(item.Open) && IFrameSplitOperator.IsNumber(item.Close))
|
|
145144
|
+
{
|
|
145145
|
+
if (item.Close>item.Open) ++showData.KLine.Up;
|
|
145146
|
+
else if (item.Close<item.Open) ++showData.KLine.Down;
|
|
145147
|
+
else ++showData.KLine.Unchanged;
|
|
145148
|
+
}
|
|
145149
|
+
|
|
145150
|
+
if (IFrameSplitOperator.IsNumber(item.Date))
|
|
145151
|
+
{
|
|
145152
|
+
showData.Date.End.Date=item.Date;
|
|
145153
|
+
if (!IFrameSplitOperator.IsNumber(showData.Date.Start.Date)) showData.Date.Start.Date=item.Date;
|
|
145154
|
+
}
|
|
145155
|
+
|
|
145156
|
+
if (IFrameSplitOperator.IsNumber(item.Time))
|
|
145157
|
+
{
|
|
145158
|
+
showData.Date.End.Time=item.Time;
|
|
145159
|
+
if (!IFrameSplitOperator.IsNumber(showData.Date.Start.Time)) showData.Date.Start.Time=item.Time;
|
|
145160
|
+
}
|
|
145161
|
+
}
|
|
145162
|
+
|
|
145163
|
+
return showData;
|
|
145164
|
+
}
|
|
145165
|
+
|
|
145166
|
+
this.FormatMinuteText=function(showData)
|
|
145167
|
+
{
|
|
145168
|
+
if (!showData) return;
|
|
145169
|
+
|
|
145170
|
+
var defaultfloatPrecision=GetfloatPrecision(this.HQChart.Symbol);
|
|
145171
|
+
|
|
145172
|
+
showData.Date.Start.Text=`${IFrameSplitOperator.FormatDateString(showData.Date.Start.Date)} ${IFrameSplitOperator.FormatTimeString(showData.Date.Start.Time,"HH:MM")}`;
|
|
145173
|
+
showData.Date.End.Text=`${IFrameSplitOperator.FormatDateString(showData.Date.End.Date)} ${IFrameSplitOperator.FormatTimeString(showData.Date.End.Time,"HH:MM")}`;
|
|
145174
|
+
|
|
145175
|
+
showData.AryText.push(this.ForamtPrice(showData.Open, showData.Open,defaultfloatPrecision, 'DialogSelectRect-StartPrice'));
|
|
145176
|
+
showData.AryText.push(this.ForamtPrice(showData.Close, showData.Open,defaultfloatPrecision, 'DialogSelectRect-EndPrice'));
|
|
145177
|
+
showData.AryText.push(this.FormatIncrease(showData.Close, showData.Open, 'DialogSelectRect-Increase'));
|
|
145178
|
+
|
|
145179
|
+
showData.AryText.push(this.ForamtPrice(showData.High, showData.Open,defaultfloatPrecision, 'DialogSelectRect-High'));
|
|
145180
|
+
showData.AryText.push(this.ForamtPrice(showData.Low, showData.Open,defaultfloatPrecision, 'DialogSelectRect-Low'));
|
|
145181
|
+
showData.AryText.push(this.FormatAmplitude(showData.High, showData.Low, showData.Open, 'DialogSelectRect-Amplitude'));
|
|
145182
|
+
|
|
145183
|
+
showData.AryText.push(this.FormatVol(showData.Vol, 'DialogSelectRect-Vol'));
|
|
145184
|
+
showData.AryText.push(this.FormatAmount(showData.Amount, 'DialogSelectRect-Amount'));
|
|
145185
|
+
showData.AryText.push(this.FormatNumber(showData.Count, null, 0, "DialogSelectRect-DataCount"));
|
|
145186
|
+
}
|
|
145187
|
+
|
|
145188
|
+
|
|
145189
|
+
this.GetColor=function(price,yClose)
|
|
145190
|
+
{
|
|
145191
|
+
if(price>yClose) return this.UpColor;
|
|
145192
|
+
else if (price<yClose) return this.DownColor;
|
|
145193
|
+
else return this.UnchangeColor;
|
|
145194
|
+
}
|
|
145195
|
+
|
|
145196
|
+
this.GetPriceColor=function(price, yClose)
|
|
145197
|
+
{
|
|
145198
|
+
var color=this.GetColor(price, yClose);
|
|
145199
|
+
return color;
|
|
145200
|
+
}
|
|
145201
|
+
|
|
145202
|
+
this.FormatEmpty=function()
|
|
145203
|
+
{
|
|
145204
|
+
var item=
|
|
145205
|
+
{
|
|
145206
|
+
Title:"",
|
|
145207
|
+
Text:"",
|
|
145208
|
+
Color:this.ValueColor
|
|
145209
|
+
};
|
|
145210
|
+
|
|
145211
|
+
return item;
|
|
145212
|
+
}
|
|
145213
|
+
|
|
145214
|
+
this.FormatNumber=function(value, color, defaultfloatPrecision, TitleID, format)
|
|
145215
|
+
{
|
|
145216
|
+
var item=
|
|
145217
|
+
{
|
|
145218
|
+
Title:g_JSChartLocalization.GetText(TitleID, this.LanguageID),
|
|
145219
|
+
Text:"----",
|
|
145220
|
+
Color:this.ValueColor
|
|
145221
|
+
};
|
|
145222
|
+
|
|
145223
|
+
if (!IFrameSplitOperator.IsNumber(value)) return item;
|
|
145224
|
+
|
|
145225
|
+
item.Text=value.toFixed(defaultfloatPrecision);
|
|
145226
|
+
if (color) item.Color=color;
|
|
145227
|
+
|
|
145228
|
+
return item;
|
|
145229
|
+
}
|
|
145230
|
+
|
|
145231
|
+
|
|
145232
|
+
this.ForamtPrice=function(price, yClose, defaultfloatPrecision, TitleID)
|
|
145233
|
+
{
|
|
145234
|
+
var item=
|
|
145235
|
+
{
|
|
145236
|
+
Title:g_JSChartLocalization.GetText(TitleID, this.LanguageID),
|
|
145237
|
+
Text:"--.--",
|
|
145238
|
+
Color:this.ValueColor
|
|
145239
|
+
};
|
|
145240
|
+
|
|
145241
|
+
if (!IFrameSplitOperator.IsNumber(price)) return item;
|
|
145242
|
+
|
|
145243
|
+
item.Text=price.toFixed(defaultfloatPrecision);
|
|
145244
|
+
item.Color=this.GetColor(price, yClose);
|
|
145245
|
+
|
|
145246
|
+
return item;
|
|
145247
|
+
}
|
|
145248
|
+
|
|
145249
|
+
this.FormatIncrease=function(price, yClose, TitleID,)
|
|
145250
|
+
{
|
|
145251
|
+
//涨幅
|
|
145252
|
+
var item=
|
|
145253
|
+
{
|
|
145254
|
+
Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
|
|
145255
|
+
Text:"--.--",
|
|
145256
|
+
Color:this.ValueColor
|
|
145257
|
+
};
|
|
145258
|
+
|
|
145259
|
+
if (!IFrameSplitOperator.IsNumber(price) || !IFrameSplitOperator.IsNumber(yClose)) return item;
|
|
145260
|
+
|
|
145261
|
+
var diffValue=price-yClose;
|
|
145262
|
+
var value=(diffValue)/yClose;
|
|
145263
|
+
item.Text=`${(value*100).toFixed(2)}%`;
|
|
145264
|
+
|
|
145265
|
+
item.Color=this.GetColor(value,0);
|
|
145266
|
+
|
|
145267
|
+
return item;
|
|
145268
|
+
}
|
|
145269
|
+
|
|
145270
|
+
this.FormatAmplitude=function(high, low, yClose, TitleID)
|
|
145271
|
+
{
|
|
145272
|
+
//振幅
|
|
145273
|
+
var item=
|
|
145274
|
+
{
|
|
145275
|
+
Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
|
|
145276
|
+
Text:"--.--",
|
|
145277
|
+
Color:this.ValueColor
|
|
145278
|
+
};
|
|
145279
|
+
|
|
145280
|
+
|
|
145281
|
+
if (!IFrameSplitOperator.IsNumber(high) || !IFrameSplitOperator.IsNumber(low) || !IFrameSplitOperator.IsNumber(yClose)) return item;
|
|
145282
|
+
|
|
145283
|
+
var diffValue=high-low;
|
|
145284
|
+
var value=(diffValue)/yClose;
|
|
145285
|
+
item.Text=`${(value*100).toFixed(2)}%`;
|
|
145286
|
+
item.Color=this.GetColor(value,0);
|
|
145287
|
+
|
|
145288
|
+
return item;
|
|
145289
|
+
}
|
|
145290
|
+
|
|
145291
|
+
this.FormatVol=function(vol, TitleID)
|
|
145292
|
+
{
|
|
145293
|
+
var item=
|
|
145294
|
+
{
|
|
145295
|
+
Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
|
|
145296
|
+
Text:'--',
|
|
145297
|
+
Color:this.VolColor
|
|
145298
|
+
};
|
|
145299
|
+
|
|
145300
|
+
if (!IFrameSplitOperator.IsNumber(vol)) return item;
|
|
145301
|
+
|
|
145302
|
+
item.Text=IFrameSplitOperator.FormatValueStringV2(vol,0,2,this.LanguageID);
|
|
145303
|
+
|
|
145304
|
+
return item;
|
|
145305
|
+
}
|
|
145306
|
+
|
|
145307
|
+
this.FormatAmount=function(amount, TitleID)
|
|
145308
|
+
{
|
|
145309
|
+
var item=
|
|
145310
|
+
{
|
|
145311
|
+
Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
|
|
145312
|
+
Text:'--',
|
|
145313
|
+
Color:this.AmountColor
|
|
145314
|
+
};
|
|
145315
|
+
|
|
145316
|
+
if (!IFrameSplitOperator.IsNumber(amount)) return item;
|
|
145317
|
+
|
|
145318
|
+
item.Text=IFrameSplitOperator.FormatValueString(amount,2,this.LanguageID);
|
|
145319
|
+
|
|
145320
|
+
return item;
|
|
145321
|
+
}
|
|
145322
|
+
|
|
145323
|
+
}
|
|
145324
|
+
|
|
145325
|
+
|
|
145326
|
+
|
|
145327
|
+
|
|
145328
|
+
///////////////////////////////////////////////////////////////////////////////////
|
|
144678
145329
|
// 工作线程计算指标示例
|
|
144679
145330
|
//
|
|
144680
145331
|
//
|
|
@@ -144795,7 +145446,7 @@ function HQChartScriptWorker()
|
|
|
144795
145446
|
|
|
144796
145447
|
|
|
144797
145448
|
|
|
144798
|
-
var HQCHART_VERSION="1.1.
|
|
145449
|
+
var HQCHART_VERSION="1.1.13982";
|
|
144799
145450
|
|
|
144800
145451
|
function PrintHQChartVersion()
|
|
144801
145452
|
{
|