hqchart 1.1.14746 → 1.1.14752
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.
|
@@ -71,6 +71,8 @@ function JSDealChart(divElement)
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
if (option.MinuteChartTooltip && option.MinuteChartTooltip.Enable) chart.InitalMinuteChartTooltip(option.MinuteChartTooltip);
|
|
75
|
+
|
|
74
76
|
if (!option.Symbol)
|
|
75
77
|
{
|
|
76
78
|
chart.Draw();
|
|
@@ -211,10 +213,15 @@ function JSDealChartContainer(uielement)
|
|
|
211
213
|
this.AutoUpdateFrequency=15000; //更新频率
|
|
212
214
|
|
|
213
215
|
this.LoadDataSplashTitle="数据加载中"; //下载数据提示信息
|
|
216
|
+
|
|
217
|
+
this.TooltipMinuteChart; //分时图
|
|
214
218
|
|
|
215
219
|
this.UIElement=uielement;
|
|
216
220
|
this.LastPoint=new Point(); //鼠标位置
|
|
217
221
|
|
|
222
|
+
//MouseOnStatus:{ RowIndex:行, ColumnIndex:列}
|
|
223
|
+
this.LastMouseStatus={ MoveStatus:null, TooltipStatus:null, MouseOnStatus:null };
|
|
224
|
+
|
|
218
225
|
this.IsDestroy=false; //是否已经销毁了
|
|
219
226
|
|
|
220
227
|
this.ChartDestroy=function() //销毁
|
|
@@ -225,6 +232,51 @@ function JSDealChartContainer(uielement)
|
|
|
225
232
|
|
|
226
233
|
this.EnableFilterData=false; //是否启动筛选
|
|
227
234
|
|
|
235
|
+
this.InitalMinuteChartTooltip=function(option)
|
|
236
|
+
{
|
|
237
|
+
if (this.TooltipMinuteChart) return;
|
|
238
|
+
|
|
239
|
+
this.TooltipMinuteChart=new JSTooltipMinuteChart();
|
|
240
|
+
this.TooltipMinuteChart.Inital(this, option);
|
|
241
|
+
this.TooltipMinuteChart.Create();
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
this.DestroyMinuteChartTooltip=function()
|
|
245
|
+
{
|
|
246
|
+
if (!this.TooltipMinuteChart) return;
|
|
247
|
+
|
|
248
|
+
this.TooltipMinuteChart.Destroy();
|
|
249
|
+
this.TooltipMinuteChart=null;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
//data={ Symbol }
|
|
253
|
+
this.ShowMinuteChartTooltip=function(x,y, data)
|
|
254
|
+
{
|
|
255
|
+
if (!this.TooltipMinuteChart) return;
|
|
256
|
+
|
|
257
|
+
var rtClient=this.UIElement.getBoundingClientRect();
|
|
258
|
+
var rtScroll=GetScrollPosition();
|
|
259
|
+
|
|
260
|
+
var offsetLeft=rtClient.left+rtScroll.Left;
|
|
261
|
+
var offsetTop=rtClient.top+rtScroll.Top;
|
|
262
|
+
|
|
263
|
+
data.Offset={ Left:offsetLeft, Top:offsetTop };
|
|
264
|
+
|
|
265
|
+
this.TooltipMinuteChart.Show(data, x,y);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
this.HideMinuteChartTooltip=function()
|
|
269
|
+
{
|
|
270
|
+
if (!this.TooltipMinuteChart) return;
|
|
271
|
+
|
|
272
|
+
this.TooltipMinuteChart.Hide();
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
this.HideAllTooltip=function()
|
|
276
|
+
{
|
|
277
|
+
this.HideMinuteChartTooltip();
|
|
278
|
+
}
|
|
279
|
+
|
|
228
280
|
//筛选数据
|
|
229
281
|
this.FilterData=function(aryDeal)
|
|
230
282
|
{
|
|
@@ -333,6 +385,7 @@ function JSDealChartContainer(uielement)
|
|
|
333
385
|
this.UIElement.onmousedown=(e)=> { this.UIOnMouseDown(e); }
|
|
334
386
|
this.UIElement.ondblclick=(e)=>{ this.UIOnDblClick(e); }
|
|
335
387
|
this.UIElement.oncontextmenu=(e)=> { this.UIOnContextMenu(e); }
|
|
388
|
+
this.UIElement.onmousemove=(e)=>{ this.UIOnMouseMove(e);}
|
|
336
389
|
}
|
|
337
390
|
|
|
338
391
|
this.Draw=function()
|
|
@@ -675,10 +728,12 @@ function JSDealChartContainer(uielement)
|
|
|
675
728
|
|
|
676
729
|
if (wheelValue<0) //下一页
|
|
677
730
|
{
|
|
731
|
+
this.HideAllTooltip();
|
|
678
732
|
if (this.GotoNextPage()) this.Draw();
|
|
679
733
|
}
|
|
680
734
|
else if (wheelValue>0) //上一页
|
|
681
735
|
{
|
|
736
|
+
this.HideAllTooltip();
|
|
682
737
|
if (this.GotoPreviousPage()) this.Draw();
|
|
683
738
|
}
|
|
684
739
|
|
|
@@ -694,9 +749,11 @@ function JSDealChartContainer(uielement)
|
|
|
694
749
|
switch(keyID)
|
|
695
750
|
{
|
|
696
751
|
case 38: //up
|
|
752
|
+
this.HideAllTooltip();
|
|
697
753
|
if (this.GotoPreviousPage()) this.Draw();
|
|
698
754
|
break;
|
|
699
755
|
case 40: //down
|
|
756
|
+
this.HideAllTooltip();
|
|
700
757
|
if (this.GotoNextPage()) this.Draw();
|
|
701
758
|
break;
|
|
702
759
|
}
|
|
@@ -706,6 +763,12 @@ function JSDealChartContainer(uielement)
|
|
|
706
763
|
else e.returnValue = false;
|
|
707
764
|
}
|
|
708
765
|
|
|
766
|
+
this.GetReportChart=function()
|
|
767
|
+
{
|
|
768
|
+
var chart=this.ChartPaint[0];
|
|
769
|
+
return chart;
|
|
770
|
+
}
|
|
771
|
+
|
|
709
772
|
this.UIOnMouseDown=function(e)
|
|
710
773
|
{
|
|
711
774
|
var pixelTatio = GetDevicePixelRatio();
|
|
@@ -725,6 +788,67 @@ function JSDealChartContainer(uielement)
|
|
|
725
788
|
}
|
|
726
789
|
}
|
|
727
790
|
|
|
791
|
+
this.UIOnMouseMove=function(e)
|
|
792
|
+
{
|
|
793
|
+
var pixelTatio = GetDevicePixelRatio();
|
|
794
|
+
var x = (e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;
|
|
795
|
+
var y = (e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;
|
|
796
|
+
|
|
797
|
+
var oldMouseOnStatus=this.LastMouseStatus.MouseOnStatus;
|
|
798
|
+
this.LastMouseStatus.OnMouseMove=null;
|
|
799
|
+
|
|
800
|
+
var bDrawTooltip=false;
|
|
801
|
+
if (this.LastMouseStatus.TooltipStatus) bDrawTooltip=true;
|
|
802
|
+
this.LastMouseStatus.TooltipStatus=null;
|
|
803
|
+
|
|
804
|
+
var bShowMinuteTooltip=false;
|
|
805
|
+
var chartTooltipData=null;
|
|
806
|
+
|
|
807
|
+
this.LastMouseStatus.OnMouseMove={ X:x, Y:y };
|
|
808
|
+
var mouseStatus={ Cursor:"default", Name:"Default"};; //鼠标状态
|
|
809
|
+
var report=this.GetReportChart();
|
|
810
|
+
var bDraw=false;
|
|
811
|
+
|
|
812
|
+
if (report)
|
|
813
|
+
{
|
|
814
|
+
var tooltipData=report.GetTooltipData(x,y); //单元格提示信息
|
|
815
|
+
if (tooltipData)
|
|
816
|
+
{
|
|
817
|
+
if (tooltipData.Type==20)
|
|
818
|
+
{
|
|
819
|
+
if (tooltipData.Data && tooltipData.Data.Symbol)
|
|
820
|
+
{
|
|
821
|
+
bShowMinuteTooltip=true;
|
|
822
|
+
chartTooltipData={ Symbol:tooltipData.Data.Symbol, Rect:tooltipData.Rect };
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
/*
|
|
826
|
+
else if (tooltipData.Type==21)
|
|
827
|
+
{
|
|
828
|
+
if (tooltipData.Stock && tooltipData.Stock.Symbol)
|
|
829
|
+
{
|
|
830
|
+
bShowKLineTooltip=true;
|
|
831
|
+
chartTooltipData={ Symbol:tooltipData.Stock.OriginalSymbol, Rect:tooltipData.Rect };
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
else
|
|
835
|
+
{
|
|
836
|
+
this.LastMouseStatus.TooltipStatus={ X:x, Y:y, Data:tooltipData, ClientX:e.clientX, ClientY:e.clientY };
|
|
837
|
+
bDrawTooltip=true;
|
|
838
|
+
}
|
|
839
|
+
*/
|
|
840
|
+
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
if (mouseStatus) this.UIElement.style.cursor=mouseStatus.Cursor;
|
|
845
|
+
|
|
846
|
+
if (bDraw) this.Draw();
|
|
847
|
+
|
|
848
|
+
if (!bShowMinuteTooltip) this.HideMinuteChartTooltip();
|
|
849
|
+
if (bShowMinuteTooltip) this.ShowMinuteChartTooltip(null, null, chartTooltipData);
|
|
850
|
+
}
|
|
851
|
+
|
|
728
852
|
this.UIOnDblClick=function(e)
|
|
729
853
|
{
|
|
730
854
|
var pixelTatio = GetDevicePixelRatio();
|
|
@@ -839,6 +963,33 @@ JSDealChartContainer.JsonDataToDealData=function(data)
|
|
|
839
963
|
if (item[5]) dealItem.StrTime=item[5];
|
|
840
964
|
if (item[6]) dealItem.ID=item[6];
|
|
841
965
|
|
|
966
|
+
if (item[11]) dealItem.Symbol=item[11]; //股票代码
|
|
967
|
+
if (item[12]) dealItem.Name=item[12]; //股票名称
|
|
968
|
+
|
|
969
|
+
//10个数值型 101-199
|
|
970
|
+
if (IFrameSplitOperator.IsNumber(item[101])) dealItem.ReserveNumber1=item[101];
|
|
971
|
+
if (IFrameSplitOperator.IsNumber(item[102])) dealItem.ReserveNumber2=item[102];
|
|
972
|
+
if (IFrameSplitOperator.IsNumber(item[103])) dealItem.ReserveNumber3=item[103];
|
|
973
|
+
if (IFrameSplitOperator.IsNumber(item[104])) dealItem.ReserveNumber4=item[104];
|
|
974
|
+
if (IFrameSplitOperator.IsNumber(item[105])) dealItem.ReserveNumber5=item[105];
|
|
975
|
+
if (IFrameSplitOperator.IsNumber(item[106])) dealItem.ReserveNumber6=item[106];
|
|
976
|
+
if (IFrameSplitOperator.IsNumber(item[107])) dealItem.ReserveNumber7=item[107];
|
|
977
|
+
if (IFrameSplitOperator.IsNumber(item[108])) dealItem.ReserveNumber8=item[108];
|
|
978
|
+
if (IFrameSplitOperator.IsNumber(item[109])) dealItem.ReserveNumber9=item[109];
|
|
979
|
+
if (IFrameSplitOperator.IsNumber(item[110])) dealItem.ReserveNumber10=item[110];
|
|
980
|
+
|
|
981
|
+
//10个字符型 201-299
|
|
982
|
+
if (IFrameSplitOperator.IsString(item[201]) || IFrameSplitOperator.IsObject(item[201])) dealItem.ReserveString1=item[201];
|
|
983
|
+
if (IFrameSplitOperator.IsString(item[202]) || IFrameSplitOperator.IsObject(item[202])) dealItem.ReserveString2=item[202];
|
|
984
|
+
if (IFrameSplitOperator.IsString(item[203]) || IFrameSplitOperator.IsObject(item[203])) dealItem.ReserveString3=item[203];
|
|
985
|
+
if (IFrameSplitOperator.IsString(item[204]) || IFrameSplitOperator.IsObject(item[204])) dealItem.ReserveString4=item[204];
|
|
986
|
+
if (IFrameSplitOperator.IsString(item[205]) || IFrameSplitOperator.IsObject(item[205])) dealItem.ReserveString5=item[205];
|
|
987
|
+
if (IFrameSplitOperator.IsString(item[206]) || IFrameSplitOperator.IsObject(item[206])) dealItem.ReserveString6=item[206];
|
|
988
|
+
if (IFrameSplitOperator.IsString(item[207]) || IFrameSplitOperator.IsObject(item[207])) dealItem.ReserveString7=item[207];
|
|
989
|
+
if (IFrameSplitOperator.IsString(item[208]) || IFrameSplitOperator.IsObject(item[208])) dealItem.ReserveString8=item[208];
|
|
990
|
+
if (IFrameSplitOperator.IsString(item[209]) || IFrameSplitOperator.IsObject(item[209])) dealItem.ReserveString9=item[209];
|
|
991
|
+
if (IFrameSplitOperator.IsString(item[210]) || IFrameSplitOperator.IsObject(item[210])) dealItem.ReserveString10=item[210];
|
|
992
|
+
|
|
842
993
|
result.push(dealItem);
|
|
843
994
|
}
|
|
844
995
|
|
|
@@ -938,9 +1089,66 @@ var DEAL_COLUMN_ID=
|
|
|
938
1089
|
INDEX_ID:7, //序号 从1开始
|
|
939
1090
|
MULTI_BAR_ID:8, //多颜色柱子
|
|
940
1091
|
CENTER_BAR_ID:9, //中心柱子
|
|
941
|
-
CUSTOM_TEXT_ID:10 //自定义文本
|
|
1092
|
+
CUSTOM_TEXT_ID:10, //自定义文本
|
|
1093
|
+
|
|
1094
|
+
SYMBOL_ID:11, //股票代码
|
|
1095
|
+
NAME_ID:12, //股票名称
|
|
1096
|
+
|
|
1097
|
+
|
|
1098
|
+
//预留数值类型 10个
|
|
1099
|
+
RESERVE_NUMBER1_ID:201, //ReserveNumber1:
|
|
1100
|
+
RESERVE_NUMBER2_ID:202,
|
|
1101
|
+
RESERVE_NUMBER3_ID:203,
|
|
1102
|
+
RESERVE_NUMBER4_ID:204,
|
|
1103
|
+
RESERVE_NUMBER5_ID:205,
|
|
1104
|
+
RESERVE_NUMBER6_ID:206,
|
|
1105
|
+
RESERVE_NUMBER7_ID:207,
|
|
1106
|
+
RESERVE_NUMBER8_ID:208,
|
|
1107
|
+
RESERVE_NUMBER9_ID:209,
|
|
1108
|
+
RESERVE_NUMBER10_ID:210,
|
|
1109
|
+
|
|
1110
|
+
//预留字符串类型 10个 301-399
|
|
1111
|
+
RESERVE_STRING1_ID:301, //ReserveString1:
|
|
1112
|
+
RESERVE_STRING2_ID:302,
|
|
1113
|
+
RESERVE_STRING3_ID:303,
|
|
1114
|
+
RESERVE_STRING4_ID:304,
|
|
1115
|
+
RESERVE_STRING5_ID:305,
|
|
1116
|
+
RESERVE_STRING6_ID:306,
|
|
1117
|
+
RESERVE_STRING7_ID:307,
|
|
1118
|
+
RESERVE_STRING8_ID:308,
|
|
1119
|
+
RESERVE_STRING9_ID:309,
|
|
1120
|
+
RESERVE_STRING10_ID:310,
|
|
942
1121
|
}
|
|
943
1122
|
|
|
1123
|
+
var MAP_DEAL_COLUMN_FIELD=new Map(
|
|
1124
|
+
[
|
|
1125
|
+
[DEAL_COLUMN_ID.SYMBOL_ID, "Symbol"],
|
|
1126
|
+
[DEAL_COLUMN_ID.NAME_ID, "Name"],
|
|
1127
|
+
[DEAL_COLUMN_ID.PRICE_ID, "Price"],
|
|
1128
|
+
|
|
1129
|
+
[DEAL_COLUMN_ID.RESERVE_NUMBER1_ID,"ReserveNumber1"],
|
|
1130
|
+
[DEAL_COLUMN_ID.RESERVE_NUMBER2_ID,"ReserveNumber2"],
|
|
1131
|
+
[DEAL_COLUMN_ID.RESERVE_NUMBER3_ID,"ReserveNumber3"],
|
|
1132
|
+
[DEAL_COLUMN_ID.RESERVE_NUMBER4_ID,"ReserveNumber4"],
|
|
1133
|
+
[DEAL_COLUMN_ID.RESERVE_NUMBER5_ID,"ReserveNumber5"],
|
|
1134
|
+
[DEAL_COLUMN_ID.RESERVE_NUMBER6_ID,"ReserveNumber6"],
|
|
1135
|
+
[DEAL_COLUMN_ID.RESERVE_NUMBER7_ID,"ReserveNumber7"],
|
|
1136
|
+
[DEAL_COLUMN_ID.RESERVE_NUMBER8_ID,"ReserveNumber8"],
|
|
1137
|
+
[DEAL_COLUMN_ID.RESERVE_NUMBER9_ID,"ReserveNumber9"],
|
|
1138
|
+
[DEAL_COLUMN_ID.RESERVE_NUMBER10_ID,"ReserveNumber10"],
|
|
1139
|
+
|
|
1140
|
+
[DEAL_COLUMN_ID.RESERVE_STRING1_ID,"ReserveString1"],
|
|
1141
|
+
[DEAL_COLUMN_ID.RESERVE_STRING2_ID,"ReserveString2"],
|
|
1142
|
+
[DEAL_COLUMN_ID.RESERVE_STRING3_ID,"ReserveString3"],
|
|
1143
|
+
[DEAL_COLUMN_ID.RESERVE_STRING4_ID,"ReserveString4"],
|
|
1144
|
+
[DEAL_COLUMN_ID.RESERVE_STRING5_ID,"ReserveString5"],
|
|
1145
|
+
[DEAL_COLUMN_ID.RESERVE_STRING6_ID,"ReserveString6"],
|
|
1146
|
+
[DEAL_COLUMN_ID.RESERVE_STRING7_ID,"ReserveString7"],
|
|
1147
|
+
[DEAL_COLUMN_ID.RESERVE_STRING8_ID,"ReserveString8"],
|
|
1148
|
+
[DEAL_COLUMN_ID.RESERVE_STRING9_ID,"ReserveString9"],
|
|
1149
|
+
[DEAL_COLUMN_ID.RESERVE_STRING10_ID,"ReserveString10"],
|
|
1150
|
+
]);
|
|
1151
|
+
|
|
944
1152
|
function ChartDealList()
|
|
945
1153
|
{
|
|
946
1154
|
this.Canvas; //画布
|
|
@@ -966,7 +1174,7 @@ function ChartDealList()
|
|
|
966
1174
|
//涨跌颜色
|
|
967
1175
|
this.UpColor=g_JSChartResource.DealList.UpTextColor;
|
|
968
1176
|
this.DownColor=g_JSChartResource.DealList.DownTextColor;
|
|
969
|
-
this.
|
|
1177
|
+
this.UnchangeColor=g_JSChartResource.DealList.UnchagneTextColor;
|
|
970
1178
|
|
|
971
1179
|
this.BorderColor=g_JSChartResource.DealList.BorderColor; //边框线
|
|
972
1180
|
|
|
@@ -1013,11 +1221,15 @@ function ChartDealList()
|
|
|
1013
1221
|
this.RectClient={};
|
|
1014
1222
|
this.AryCellRect=[]; //{ Rect:, Type: 1=单行 }
|
|
1015
1223
|
|
|
1224
|
+
//Type:20=分时图
|
|
1225
|
+
//{ Rect, Data, Index, Column, Type }}
|
|
1226
|
+
this.TooltipRect=[];
|
|
1227
|
+
|
|
1016
1228
|
this.ReloadResource=function(resource)
|
|
1017
1229
|
{
|
|
1018
1230
|
this.UpColor=g_JSChartResource.DealList.UpTextColor;
|
|
1019
1231
|
this.DownColor=g_JSChartResource.DealList.DownTextColor;
|
|
1020
|
-
this.
|
|
1232
|
+
this.UnchangeColor=g_JSChartResource.DealList.UnchagneTextColor;
|
|
1021
1233
|
|
|
1022
1234
|
this.BorderColor=g_JSChartResource.DealList.BorderColor; //边框线
|
|
1023
1235
|
|
|
@@ -1067,6 +1279,8 @@ function ChartDealList()
|
|
|
1067
1279
|
if (item.TextColor) colItem.TextColor=item.TextColor;
|
|
1068
1280
|
if (item.MaxText) colItem.MaxText=item.MaxText;
|
|
1069
1281
|
|
|
1282
|
+
if (item.ChartTooltip) colItem.ChartTooltip={ Enable:item.ChartTooltip.Enable, Type:item.ChartTooltip.Type }; //图形提示信息
|
|
1283
|
+
|
|
1070
1284
|
if (item.Type==DEAL_COLUMN_ID.MULTI_BAR_ID || item.Type==DEAL_COLUMN_ID.CENTER_BAR_ID)
|
|
1071
1285
|
{
|
|
1072
1286
|
if (!IFrameSplitOperator.IsNumber(item.DataIndex)) continue;
|
|
@@ -1076,6 +1290,11 @@ function ChartDealList()
|
|
|
1076
1290
|
{
|
|
1077
1291
|
if (IFrameSplitOperator.IsString(item.Foramt)) colItem.Foramt=item.Foramt; //设置时间格式
|
|
1078
1292
|
}
|
|
1293
|
+
else if (this.IsReserveNumber(item.Type))
|
|
1294
|
+
{
|
|
1295
|
+
if (item.Format) colItem.Format=item.Format; //数据格式化设置{ Type:1=原始 2=千分位分割 3=万亿转换, ExFloatPrecision:万亿转换以后的小数位数 }
|
|
1296
|
+
if (IFrameSplitOperator.IsNumber(item.ColorType)) colItem.ColorType=item.ColorType; //0=默认 1=(>0, =0, <0) 2=(>=0, <0)
|
|
1297
|
+
}
|
|
1079
1298
|
|
|
1080
1299
|
this.Column.push(colItem);
|
|
1081
1300
|
}
|
|
@@ -1097,6 +1316,31 @@ function ChartDealList()
|
|
|
1097
1316
|
{ Type:DEAL_COLUMN_ID.MULTI_BAR_ID, Title:"柱子", TextAlign:"center", Width:null, TextColor:g_JSChartResource.DealList.FieldColor.BarTitle, MaxText:"888888" },
|
|
1098
1317
|
{ Type:DEAL_COLUMN_ID.CENTER_BAR_ID, Title:"柱子2", TextAlign:"center", Width:null, TextColor:g_JSChartResource.DealList.FieldColor.BarTitle, MaxText:"888888" },
|
|
1099
1318
|
{ Type:DEAL_COLUMN_ID.CUSTOM_TEXT_ID, Title:"自定义", TextAlign:"center", Width:null, TextColor:g_JSChartResource.DealList.FieldColor.Text, MaxText:"擎擎擎擎擎" },
|
|
1319
|
+
|
|
1320
|
+
{ Type:DEAL_COLUMN_ID.NAME_ID, Title:"股票名称", TextAlign:"center", Width:null, TextColor:g_JSChartResource.DealList.FieldColor.Text, MaxText:"擎擎擎擎*" },
|
|
1321
|
+
|
|
1322
|
+
{ Type:DEAL_COLUMN_ID.RESERVE_NUMBER1_ID, Title:"数值1", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
|
|
1323
|
+
{ Type:DEAL_COLUMN_ID.RESERVE_NUMBER2_ID, Title:"数值2", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
|
|
1324
|
+
{ Type:DEAL_COLUMN_ID.RESERVE_NUMBER3_ID, Title:"数值3", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
|
|
1325
|
+
{ Type:DEAL_COLUMN_ID.RESERVE_NUMBER4_ID, Title:"数值4", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
|
|
1326
|
+
{ Type:DEAL_COLUMN_ID.RESERVE_NUMBER5_ID, Title:"数值5", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
|
|
1327
|
+
{ Type:DEAL_COLUMN_ID.RESERVE_NUMBER6_ID, Title:"数值6", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
|
|
1328
|
+
{ Type:DEAL_COLUMN_ID.RESERVE_NUMBER7_ID, Title:"数值7", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
|
|
1329
|
+
{ Type:DEAL_COLUMN_ID.RESERVE_NUMBER8_ID, Title:"数值8", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
|
|
1330
|
+
{ Type:DEAL_COLUMN_ID.RESERVE_NUMBER9_ID, Title:"数值9", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
|
|
1331
|
+
{ Type:DEAL_COLUMN_ID.RESERVE_NUMBER10_ID, Title:"数值10", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
|
|
1332
|
+
|
|
1333
|
+
|
|
1334
|
+
{ Type:DEAL_COLUMN_ID.RESERVE_STRING1_ID, Title:"文字1", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"擎擎擎擎擎擎" },
|
|
1335
|
+
{ Type:DEAL_COLUMN_ID.RESERVE_STRING2_ID, Title:"文字2", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"擎擎擎擎擎擎" },
|
|
1336
|
+
{ Type:DEAL_COLUMN_ID.RESERVE_STRING3_ID, Title:"文字3", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"擎擎擎擎擎擎" },
|
|
1337
|
+
{ Type:DEAL_COLUMN_ID.RESERVE_STRING4_ID, Title:"文字4", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"擎擎擎擎擎擎" },
|
|
1338
|
+
{ Type:DEAL_COLUMN_ID.RESERVE_STRING5_ID, Title:"文字5", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"擎擎擎擎擎擎" },
|
|
1339
|
+
{ Type:DEAL_COLUMN_ID.RESERVE_STRING6_ID, Title:"文字6", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"擎擎擎擎擎擎" },
|
|
1340
|
+
{ Type:DEAL_COLUMN_ID.RESERVE_STRING7_ID, Title:"文字7", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"擎擎擎擎擎擎" },
|
|
1341
|
+
{ Type:DEAL_COLUMN_ID.RESERVE_STRING8_ID, Title:"文字8", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"擎擎擎擎擎擎" },
|
|
1342
|
+
{ Type:DEAL_COLUMN_ID.RESERVE_STRING9_ID, Title:"文字9", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"擎擎擎擎擎擎" },
|
|
1343
|
+
{ Type:DEAL_COLUMN_ID.RESERVE_STRING10_ID, Title:"文字10", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"擎擎擎擎擎擎" },
|
|
1100
1344
|
|
|
1101
1345
|
];
|
|
1102
1346
|
|
|
@@ -1113,6 +1357,7 @@ function ChartDealList()
|
|
|
1113
1357
|
this.Draw=function()
|
|
1114
1358
|
{
|
|
1115
1359
|
this.AryCellRect=[];
|
|
1360
|
+
this.TooltipRect=[];
|
|
1116
1361
|
if (this.SizeChange) this.CalculateSize();
|
|
1117
1362
|
else this.UpdateCacheData();
|
|
1118
1363
|
|
|
@@ -1318,6 +1563,19 @@ function ChartDealList()
|
|
|
1318
1563
|
|
|
1319
1564
|
if (i==this.Column.length-1) itemWidth=this.TableWidth-(left-tableLeft)-this.HeaderMergin.Right-this.HeaderMergin.Left;
|
|
1320
1565
|
|
|
1566
|
+
var drawInfo=
|
|
1567
|
+
{
|
|
1568
|
+
Text:null, TextColor:item.TextColor , TextAlign:item.TextAlign, Tooltip:null,
|
|
1569
|
+
Index:dataIndex, ColumnIndex:i
|
|
1570
|
+
};
|
|
1571
|
+
|
|
1572
|
+
var rtItem={ Left:left, Top:top, Width:itemWidth, Height:this.RowHeight };
|
|
1573
|
+
rtItem.Right=rtItem.Left+rtItem.Width;
|
|
1574
|
+
rtItem.Bottom=rtItem.Top+rtItem.Height;
|
|
1575
|
+
drawInfo.Rect=rtItem;
|
|
1576
|
+
|
|
1577
|
+
var bDrawV2=false;
|
|
1578
|
+
|
|
1321
1579
|
if (item.Type==DEAL_COLUMN_ID.TIME_ID)
|
|
1322
1580
|
{
|
|
1323
1581
|
text=IFrameSplitOperator.FormatTimeString(data.Time,item.Foramt);
|
|
@@ -1330,7 +1588,7 @@ function ChartDealList()
|
|
|
1330
1588
|
{
|
|
1331
1589
|
if (data.Price>this.YClose) textColor=this.UpColor;
|
|
1332
1590
|
else if (data.Price<this.YClose) textColor=this.DownColor;
|
|
1333
|
-
else textColor=this.
|
|
1591
|
+
else textColor=this.UnchangeColor;
|
|
1334
1592
|
|
|
1335
1593
|
text=data.Price.toFixed(this.Decimal);
|
|
1336
1594
|
}
|
|
@@ -1365,7 +1623,7 @@ function ChartDealList()
|
|
|
1365
1623
|
|
|
1366
1624
|
if (value>0) textColor=this.UpColor;
|
|
1367
1625
|
else if (value<0) textColor=this.DownColor;
|
|
1368
|
-
else textColor=this.
|
|
1626
|
+
else textColor=this.UnchangeColor;
|
|
1369
1627
|
}
|
|
1370
1628
|
}
|
|
1371
1629
|
else if (item.Type==DEAL_COLUMN_ID.INDEX_ID)
|
|
@@ -1393,13 +1651,115 @@ function ChartDealList()
|
|
|
1393
1651
|
if (out.TextAlign) textAlign=out.TextAlign;
|
|
1394
1652
|
}
|
|
1395
1653
|
}
|
|
1396
|
-
|
|
1397
|
-
|
|
1654
|
+
else if (this.IsReserveString(item.Type))
|
|
1655
|
+
{
|
|
1656
|
+
this.FormatReserveString(item, data, drawInfo);
|
|
1657
|
+
bDrawV2=true;
|
|
1658
|
+
}
|
|
1659
|
+
else if (this.IsReserveNumber(item.Type))
|
|
1660
|
+
{
|
|
1661
|
+
this.FormatReserveNumber(item, data, drawInfo);
|
|
1662
|
+
bDrawV2=true;
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
|
|
1666
|
+
if (bDrawV2)
|
|
1667
|
+
{
|
|
1668
|
+
this.DrawItemText(drawInfo.Text, drawInfo.TextColor, drawInfo.TextAlign, rtItem.Left, rtItem.Top, rtItem.Width, drawInfo.BGColor);
|
|
1669
|
+
}
|
|
1670
|
+
else
|
|
1671
|
+
{
|
|
1672
|
+
this.DrawItemText(text, textColor, textAlign, left, top, itemWidth);
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
if (item.ChartTooltip && item.ChartTooltip.Enable && IFrameSplitOperator.IsNumber(item.ChartTooltip.Type)) //Type 20分时图 21K线图
|
|
1676
|
+
{
|
|
1677
|
+
var tooltipData={ Rect:rtItem, Data:data, Index:dataIndex, Column:item, Type:item.ChartTooltip.Type };
|
|
1678
|
+
this.TooltipRect.push(tooltipData);
|
|
1679
|
+
}
|
|
1398
1680
|
|
|
1399
1681
|
left+=item.Width;
|
|
1400
1682
|
}
|
|
1401
1683
|
}
|
|
1402
1684
|
|
|
1685
|
+
this.FormatReserveNumber=function(column, data, drawInfo)
|
|
1686
|
+
{
|
|
1687
|
+
if (column.DefaultText) drawInfo.Text=column.DefaultText;
|
|
1688
|
+
|
|
1689
|
+
var fieldName=MAP_DEAL_COLUMN_FIELD.get(column.Type);
|
|
1690
|
+
if (!data || !fieldName) return;
|
|
1691
|
+
|
|
1692
|
+
var value=data[fieldName];
|
|
1693
|
+
if (!IFrameSplitOperator.IsNumber(value)) return;
|
|
1694
|
+
|
|
1695
|
+
if (IFrameSplitOperator.IsNumber(column.ColorType))
|
|
1696
|
+
{
|
|
1697
|
+
if (column.ColorType==1)
|
|
1698
|
+
{
|
|
1699
|
+
drawInfo.TextColor=this.GetUpDownColor(value,0);
|
|
1700
|
+
}
|
|
1701
|
+
else if (column.ColorType==2)
|
|
1702
|
+
{
|
|
1703
|
+
drawInfo.TextColor=this.GetUpDownColorV2(value,0);
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
var text=value.toFixed(column.FloatPrecision);
|
|
1708
|
+
if (column.Format && IFrameSplitOperator.IsNumber(column.Format.Type))
|
|
1709
|
+
{
|
|
1710
|
+
var format=column.Format;
|
|
1711
|
+
switch(format.Type)
|
|
1712
|
+
{
|
|
1713
|
+
case 1: //原始数据
|
|
1714
|
+
text=value.toFixed(column.FloatPrecision);
|
|
1715
|
+
break;
|
|
1716
|
+
case 2: //千分位分割
|
|
1717
|
+
text=IFrameSplitOperator.FormatValueThousandsString(value, column.FloatPrecision);
|
|
1718
|
+
break;
|
|
1719
|
+
case 3:
|
|
1720
|
+
var exfloatPrecision=1;
|
|
1721
|
+
if (IFrameSplitOperator.IsNumber(format.ExFloatPrecision)) exfloatPrecision=format.ExFloatPrecision;
|
|
1722
|
+
text=IFrameSplitOperator.FormatValueStringV2(value, column.FloatPrecision,exfloatPrecision);
|
|
1723
|
+
break;
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
drawInfo.Text=text;
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
this.FormatReserveString=function(column, data, drawInfo)
|
|
1731
|
+
{
|
|
1732
|
+
if (column.DefaultText) drawInfo.Text=column.DefaultText;
|
|
1733
|
+
|
|
1734
|
+
var fieldName=MAP_DEAL_COLUMN_FIELD.get(column.Type);
|
|
1735
|
+
if (!data || !fieldName) return;
|
|
1736
|
+
|
|
1737
|
+
var item=data[fieldName];
|
|
1738
|
+
if (IFrameSplitOperator.IsObject(item))
|
|
1739
|
+
{
|
|
1740
|
+
if (item.Text) drawInfo.Text=item.Text;
|
|
1741
|
+
if (item.TextColor) drawInfo.TextColor=item.TextColor;
|
|
1742
|
+
if (item.BGColor) drawInfo.BGColor=item.BGColor;
|
|
1743
|
+
}
|
|
1744
|
+
else if (IFrameSplitOperator.IsString(item))
|
|
1745
|
+
{
|
|
1746
|
+
drawInfo.Text=item;
|
|
1747
|
+
}
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
this.GetUpDownColor=function(price, price2)
|
|
1751
|
+
{
|
|
1752
|
+
if (price>price2) return this.UpColor;
|
|
1753
|
+
else if (price<price2) return this.DownColor;
|
|
1754
|
+
else return this.UnchangeColor;
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
this.GetUpDownColorV2=function(price, price2)
|
|
1758
|
+
{
|
|
1759
|
+
if (price>=price2) return this.UpColor;
|
|
1760
|
+
else return this.DownColor;
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1403
1763
|
this.DrawSelectedRow=function(data, index, rtRow)
|
|
1404
1764
|
{
|
|
1405
1765
|
if (!this.SelectedData) return;
|
|
@@ -1611,4 +1971,47 @@ function ChartDealList()
|
|
|
1611
1971
|
event.Callback(event,data,this);
|
|
1612
1972
|
}
|
|
1613
1973
|
}
|
|
1974
|
+
|
|
1975
|
+
this.IsReserveString=function(value)
|
|
1976
|
+
{
|
|
1977
|
+
var ARARY_TYPE=
|
|
1978
|
+
[
|
|
1979
|
+
DEAL_COLUMN_ID.RESERVE_STRING1_ID,DEAL_COLUMN_ID.RESERVE_STRING2_ID,DEAL_COLUMN_ID.RESERVE_STRING3_ID,DEAL_COLUMN_ID.RESERVE_STRING4_ID,
|
|
1980
|
+
DEAL_COLUMN_ID.RESERVE_STRING5_ID,DEAL_COLUMN_ID.RESERVE_STRING6_ID,DEAL_COLUMN_ID.RESERVE_STRING7_ID,DEAL_COLUMN_ID.RESERVE_STRING8_ID,
|
|
1981
|
+
DEAL_COLUMN_ID.RESERVE_STRING9_ID,DEAL_COLUMN_ID.RESERVE_STRING10_ID
|
|
1982
|
+
];
|
|
1983
|
+
|
|
1984
|
+
return ARARY_TYPE.includes(value);
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1987
|
+
this.IsReserveNumber=function(value)
|
|
1988
|
+
{
|
|
1989
|
+
var ARARY_TYPE=
|
|
1990
|
+
[
|
|
1991
|
+
DEAL_COLUMN_ID.RESERVE_NUMBER1_ID,DEAL_COLUMN_ID.RESERVE_NUMBER2_ID,DEAL_COLUMN_ID.RESERVE_NUMBER3_ID,
|
|
1992
|
+
DEAL_COLUMN_ID.RESERVE_NUMBER4_ID,DEAL_COLUMN_ID.RESERVE_NUMBER5_ID,DEAL_COLUMN_ID.RESERVE_NUMBER6_ID,DEAL_COLUMN_ID.RESERVE_NUMBER7_ID,
|
|
1993
|
+
DEAL_COLUMN_ID.RESERVE_NUMBER8_ID,DEAL_COLUMN_ID.RESERVE_NUMBER9_ID,DEAL_COLUMN_ID.RESERVE_NUMBER10_ID
|
|
1994
|
+
];
|
|
1995
|
+
|
|
1996
|
+
return ARARY_TYPE.includes(value);
|
|
1997
|
+
}
|
|
1998
|
+
|
|
1999
|
+
this.GetTooltipData=function(x,y)
|
|
2000
|
+
{
|
|
2001
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.TooltipRect)) return null;
|
|
2002
|
+
|
|
2003
|
+
for(var i=0;i<this.TooltipRect.length;++i)
|
|
2004
|
+
{
|
|
2005
|
+
var item=this.TooltipRect[i];
|
|
2006
|
+
var rt=item.Rect;
|
|
2007
|
+
if (!rt) continue;
|
|
2008
|
+
|
|
2009
|
+
if (x>=rt.Left && x<=rt.Right && y>=rt.Top && y<=rt.Bottom)
|
|
2010
|
+
{
|
|
2011
|
+
return { Rect:item.Rect, Data:item.Data, Column:item.Column, Index:item.Index, Type:item.Type, Data:item.Data };
|
|
2012
|
+
}
|
|
2013
|
+
}
|
|
2014
|
+
|
|
2015
|
+
return null;
|
|
2016
|
+
}
|
|
1614
2017
|
}
|