hqchart 1.1.15808 → 1.1.15821

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.
@@ -7017,6 +7017,12 @@ var JSCHART_EVENT_ID=
7017
7017
 
7018
7018
  ON_CLICK_UP_SCROLL_TEXT_ITEM:383,
7019
7019
  ON_RCLICK_UP_SCROLL_TEXT_ITEM:384,
7020
+
7021
+ //价格列表
7022
+ ON_CLICK_ORDER_CELL:401,
7023
+ ON_RCLICK_ORDER_CELL:402,
7024
+ ON_DBCLICK_ORDER_ROW:403,
7025
+ ON_MOVEON_ORDER_CELL:404, //鼠标在单元格
7020
7026
  }
7021
7027
 
7022
7028
  var JSCHART_OPERATOR_ID=
@@ -28828,6 +28834,10 @@ var KLINE_INFO_TYPE=
28828
28834
  //扩展信息
28829
28835
  EXTEND_INFO_START:301,
28830
28836
  EXTEND_INFO_END:399,
28837
+
28838
+ //龙虎榜预留类型
28839
+ DRAGON_TIGER_EX_START:401,
28840
+ DRAGON_TIGER_EX_END:499,
28831
28841
  }
28832
28842
 
28833
28843
  function KLineInfoData()
@@ -36025,7 +36035,7 @@ function ChartKLine()
36025
36035
  var iconTop=item.YMax+1*pixelTatio;
36026
36036
  var iconBottom=item.YMin+1*pixelTatio+iconSize;
36027
36037
  var drawTop=true;
36028
- var yOffset=0;
36038
+ var yOffset=0, yTopOffset=0;
36029
36039
  for(var i in infoData.Data)
36030
36040
  {
36031
36041
  var infoItem=infoData.Data[i];
@@ -36061,35 +36071,41 @@ function ChartKLine()
36061
36071
  if (infoPosition===1) //底部
36062
36072
  {
36063
36073
  var yBottom=bottom+yOffset;
36064
- this.Canvas.fillText(icon.Text,item.XCenter,yBottom,iconSize);
36065
36074
  var iconRect=new Rect(item.XCenter-iconSize/2,yBottom-iconSize,iconSize,iconSize);
36075
+ this.DrawInfoIcon(item, icon, iconRect);
36076
+
36066
36077
  var infoCache={ Data:new Array(infoItem), Rect:iconRect, Type:infoItem.InfoType, TextRect:{X:item.XCenter, Y:yBottom}, IsShowNumber:bShowNumber };
36067
36078
  mapImage.set(infoItem.InfoType,infoCache);
36068
36079
  yOffset-=iconSize;
36069
36080
  }
36070
36081
  else if (infoPosition===2) //顶部
36071
36082
  {
36072
- var yBottom=topTitle+iconSize+1;
36073
- this.Canvas.fillText(icon.Text,item.XCenter,yBottom,iconSize);
36083
+ var yBottom=topTitle+iconSize+1+yTopOffset;
36074
36084
  var iconRect=new Rect(item.XCenter-iconSize/2,yBottom-iconSize,iconSize,iconSize);
36085
+ this.DrawInfoIcon(item, icon, iconRect);
36086
+
36075
36087
  var infoCache={ Data:new Array(infoItem), Rect:iconRect, Type:infoItem.InfoType, TextRect:{X:item.XCenter, Y:yBottom}, IsShowNumber:bShowNumber };
36076
36088
  mapImage.set(infoItem.InfoType,infoCache);
36089
+
36090
+ yTopOffset+=iconSize;
36077
36091
  }
36078
36092
  else
36079
36093
  {
36080
- if (drawTop)
36094
+ if (drawTop) //K线上面
36081
36095
  {
36082
- this.Canvas.fillText(icon.Text,item.XCenter,iconTop,iconSize);
36083
36096
  var iconRect=new Rect(item.XCenter-iconSize/2,iconTop-iconSize,iconSize,iconSize);
36097
+ this.DrawInfoIcon(item, icon, iconRect);
36098
+
36084
36099
  var infoCache={ Data:new Array(infoItem), Rect:iconRect, Type:infoItem.InfoType, TextRect:{X:item.XCenter, Y:iconTop}, IsShowNumber:bShowNumber };
36085
36100
  mapImage.set(infoItem.InfoType,infoCache);
36086
36101
  iconTop-=iconSize;
36087
36102
  if (iconTop-iconSize<top ) drawTop=false;
36088
36103
  }
36089
- else //上面显示不下,就显示在下面
36104
+ else //上面显示不下,就显示在K线下面
36090
36105
  {
36091
- this.Canvas.fillText(icon.Text,item.XCenter,iconBottom,iconSize);
36092
36106
  var iconRect=new Rect(item.XCenter-iconSize/2,iconBottom-iconSize,iconSize,iconSize);
36107
+ this.DrawInfoIcon(item, icon, iconRect);
36108
+
36093
36109
  var infoCache={ Data:new Array(infoItem), Rect:iconRect, Type:infoItem.InfoType, TextRect:{X:item.XCenter, Y:iconBottom} , IsShowNumber:bShowNumber};
36094
36110
  mapImage.set(infoItem.InfoType,infoCache);
36095
36111
  iconBottom+=iconSize;
@@ -36129,6 +36145,18 @@ function ChartKLine()
36129
36145
  this.ClipClient(isHScreen);
36130
36146
  }
36131
36147
 
36148
+ this.DrawInfoIcon=function(item, iconItem, rtIcon)
36149
+ {
36150
+ if (iconItem.BGColor)
36151
+ {
36152
+ this.Canvas.fillStyle=iconItem.BGColor;
36153
+ this.Canvas.fillRect(rtIcon.X, rtIcon.Y, rtIcon.Width, rtIcon.Height);
36154
+ }
36155
+
36156
+ this.Canvas.fillStyle=iconItem.Color;
36157
+ this.Canvas.fillText(iconItem.Text,item.XCenter,rtIcon.Y+rtIcon.Height, rtIcon.Width);
36158
+ }
36159
+
36132
36160
  //画交易图标
36133
36161
  this.DrawTradeIcon=function()
36134
36162
  {
@@ -84858,7 +84886,15 @@ function JSChartResource()
84858
84886
  },
84859
84887
  DragonTiger: //龙虎榜
84860
84888
  {
84861
- IconFont: { Family:'iconfont', Text:'\ue62f', HScreenText:'\ue68a' ,Color:'#b22626' } //SVG 文本
84889
+ //默认值
84890
+ IconFont: { Family:'iconfont', Text:'\ue62f', HScreenText:'\ue68a' ,Color:'#b22626' }, //SVG 文本
84891
+
84892
+ //自定义值
84893
+ AryIconFont:
84894
+ [
84895
+ { Family:'iconfont', Text:'\ue6c3', HScreenText:'\ue6c3' ,Color:'rgb(255,165,0)'},
84896
+ { Family:'iconfont', Text:'\ue6c5', HScreenText:'\ue6c5' ,Color:'rgb(0,191,255)'},
84897
+ ]
84862
84898
  },
84863
84899
  News: //新闻
84864
84900
  {
@@ -86352,6 +86388,52 @@ function JSChartResource()
86352
86388
  }
86353
86389
  }
86354
86390
 
86391
+ this.OrderList=
86392
+ {
86393
+ BorderColor:'rgba(192,192,192, 0.3)', //边框线
86394
+
86395
+ Header:
86396
+ {
86397
+ Color:"RGB(60,60,60)",
86398
+ Margin:{ Left:5, Right:5, Top:2, Bottom:4 },
86399
+ Font:{ Size:14, Name:"微软雅黑" }
86400
+ },
86401
+
86402
+ Item:
86403
+ {
86404
+ Margin:{ Top:2, Bottom:4,Left:5, Right:5 }, //单元格四周间距
86405
+ Font:{ Size:15, Name:"微软雅黑"},
86406
+ },
86407
+
86408
+ FieldColor:
86409
+ {
86410
+ Text:"rgb(60,60,60)", //默认文本
86411
+ },
86412
+
86413
+ UpTextColor:"rgb(238,21,21)", //上涨文字颜色
86414
+ DownTextColor:"rgb(25,158,0)", //下跌文字颜色
86415
+ UnchagneTextColor:"rgb(0,0,0)", //平盘文字颜色
86416
+
86417
+ Selected:
86418
+ {
86419
+ BGColor:"rgb(180,240,240)",
86420
+ LineColor:"rgb(128,128,128)",
86421
+ LineWidth:2,
86422
+ },
86423
+
86424
+ MoveOn:
86425
+ {
86426
+ LineColor:"rgb(55, 131, 250)",
86427
+ LineWidth:2,
86428
+ },
86429
+
86430
+ //自定义颜色
86431
+ AryColor:
86432
+ [
86433
+
86434
+ ]
86435
+ }
86436
+
86355
86437
 
86356
86438
  //自定义风格
86357
86439
  this.SetStyle=function(style)
@@ -87315,9 +87397,70 @@ function JSChartResource()
87315
87397
  if (style.StatusBar) this.SetStatusBar(style.StatusBar);
87316
87398
  if (style.ScrollText) this.SetScrollText(style.ScrollText);
87317
87399
  if (style.MinuteInfo) this.SetMinuteInfo(style.MinuteInfo);
87400
+ if (style.OrderList) this.SetOrderList(style.OrderList);
87318
87401
 
87319
87402
  }
87320
87403
 
87404
+ this.SetOrderList=function(style)
87405
+ {
87406
+ var dest=this.OrderList;
87407
+ if (style.BorderColor) dest.BorderColor=style.BorderColor;
87408
+
87409
+ if (style.UpTextColor) dest.UpTextColor=style.UpTextColor;
87410
+ if (style.DownTextColor) dest.DownTextColor=style.DownTextColor;
87411
+ if (style.UnchangeTextColor) dest.UnchangeTextColor=style.UnchangeTextColor;
87412
+
87413
+ if (style.Header)
87414
+ {
87415
+ var subItem=style.Header;
87416
+ var subDest=this.OrderList.Header;
87417
+ if (subItem.Color) subDest.Color=subItem.Color;
87418
+ if (subItem.Margin) CopyMarginConfig(subDest.Margin,subItem.Margin);
87419
+ if (subItem.Font)
87420
+ {
87421
+ if (IFrameSplitOperator.IsNumber(subItem.Font.Size)) subDest.Font.Size=subItem.Font.Size;
87422
+ if (subItem.Font.Name) subDest.Font.Name=subItem.Font.Name;
87423
+ }
87424
+ }
87425
+
87426
+ if (style.Item)
87427
+ {
87428
+ var subItem=style.Item;
87429
+ var subDest=this.OrderList.Item;
87430
+ if (subItem.Margin) CopyMarginConfig(subDest.Margin,subItem.Margin);
87431
+ if (subItem.Font)
87432
+ {
87433
+ if (IFrameSplitOperator.IsNumber(subItem.Font.Size)) subDest.Font.Size=subItem.Font.Size;
87434
+ if (subItem.Font.Name) subDest.Font.Name=subItem.Font.Name;
87435
+ }
87436
+ }
87437
+
87438
+ if (style.FieldColor)
87439
+ {
87440
+ var subItem=style.Item;
87441
+ var subDest=this.OrderList.Item;
87442
+ if (subItem.Text) subDest.Text=subItem.Text;
87443
+ }
87444
+
87445
+ if (style.Selected)
87446
+ {
87447
+ var subItem=style.Selected;
87448
+ var subDest=this.OrderList.Selected;
87449
+ if (subItem.BGColor) subDest.BGColor=subItem.BGColor;
87450
+
87451
+ if (subItem.LineColor) subDest.LineColor=subItem.LineColor;
87452
+ if (IFrameSplitOperator.IsNumber(subItem.LineWidth)) subDest.LineWidth=subItem.LineWidth;
87453
+ }
87454
+
87455
+ if (style.MoveOn)
87456
+ {
87457
+ var subItem=style.MoveOn;
87458
+ var subDest=this.OrderList.MoveOn;
87459
+ if (subItem.LineColor) subDest.LineColor=subItem.LineColor;
87460
+ if (IFrameSplitOperator.IsNumber(subItem.LineWidth)) subDest.LineWidth=subItem.LineWidth;
87461
+ }
87462
+ }
87463
+
87321
87464
  this.SetMinuteInfo=function(style)
87322
87465
  {
87323
87466
  var dest=this.MinuteInfo;
@@ -94866,25 +95009,44 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
94866
95009
  if (bUpdate==true) this.ReqeustKLineInfoData({ FunctionName:"SetKLineInfo" });
94867
95010
  }
94868
95011
 
94869
- //添加信息地雷
94870
- this.AddKLineInfo=function(infoName,bUpdate)
95012
+
95013
+ //option={ ClassName:, Name: }
95014
+ this.GetKLineInfo=function(option)
94871
95015
  {
94872
- var classInfo=JSKLineInfoMap.GetClassInfo(infoName);
94873
- if (!classInfo)
95016
+ if (!option) return null;
95017
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.ChartInfo)) return null;
95018
+
95019
+ var className=null;
95020
+ if (option.Name)
94874
95021
  {
94875
- console.warn("[KLineChartContainer::AddKLineInfo] can't find infoname=", infoName);
94876
- return;
95022
+ var classInfo=JSKLineInfoMap.GetClassInfo(option.Name);
95023
+ if (classInfo) className=classInfo.ClassName;
94877
95024
  }
94878
95025
 
94879
- for(var i in this.ChartInfo)
95026
+ if (!className) return null;
95027
+
95028
+ for(var i=0; i<this.ChartInfo.length; ++i)
94880
95029
  {
94881
95030
  var item=this.ChartInfo[i];
94882
- if (item.ClassName==classInfo.ClassName) //已经存在
94883
- return;
95031
+ if (item.ClassName==className) //已经存在
95032
+ return item;
94884
95033
  }
94885
95034
 
95035
+ return null;
95036
+ }
95037
+
95038
+ //添加信息地雷
95039
+ this.AddKLineInfo=function(infoName,bUpdate)
95040
+ {
95041
+ var item=this.GetKLineInfo({ Name:infoName });
95042
+ if (item) return;
95043
+
94886
95044
  var infoItem=JSKLineInfoMap.Get(infoName);
94887
- if (!infoItem) return;
95045
+ if (!infoItem)
95046
+ {
95047
+ console.warn(`[KLineChartContainer::AddKLineInfo] can't find infoName=${infoName}`);
95048
+ return;
95049
+ }
94888
95050
 
94889
95051
  var item=infoItem.Create();
94890
95052
  item.MaxRequestDataCount=this.MaxRequestDataCount;
@@ -94896,39 +95058,28 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
94896
95058
  }
94897
95059
  }
94898
95060
 
94899
- //更新信息地雷数据 Option :{ InsertNew:, 如果没有找到对应的地雷,是否插入新的地雷, Update:是否立即请求数据 }
95061
+ //更新信息地雷列表 Option :{ InsertNew:, 如果没有找到对应的地雷,是否插入新的地雷, Update:是否立即请求数据 }
94900
95062
  this.UpdateKLineInfo=function(infoName, option)
94901
95063
  {
94902
- var classInfo=JSKLineInfoMap.GetClassInfo(infoName);
94903
- if (!classInfo)
94904
- {
94905
- console.warn("[KLineChartContainer::UpdateKLineInfo] can't find infoname=", infoName);
94906
- return;
94907
- }
94908
-
94909
95064
  var bInsertNew=false, bUpdate=false;
94910
95065
  if (option)
94911
95066
  {
94912
95067
  if (IFrameSplitOperator.IsBoolean(option.InsertNew)) bInsertNew=option.InsertNew;
94913
95068
  if (IFrameSplitOperator.IsBoolean(option.Update)) bUpdate=option.Update;
94914
95069
  }
94915
- var finder=null;
94916
- for(var i=0;i<this.ChartInfo.length; ++i)
94917
- {
94918
- var item=this.ChartInfo[i];
94919
- if (item.ClassName==classInfo.ClassName)
94920
- {
94921
- finder=item;
94922
- break;
94923
- }
94924
- }
94925
95070
 
95071
+ var finder=this.GetKLineInfo({ Name:infoName });
95072
+
94926
95073
  if (!finder)
94927
95074
  {
94928
95075
  if (bInsertNew===true)
94929
95076
  {
94930
95077
  var infoItem=JSKLineInfoMap.Get(infoName);
94931
- if (!infoItem) return;
95078
+ if (!infoItem)
95079
+ {
95080
+ console.warn(`[KLineChartContainer::UpdateKLineInfo] can't find infoname=${infoName}`);
95081
+ return;
95082
+ }
94932
95083
 
94933
95084
  var item=infoItem.Create();
94934
95085
  item.MaxRequestDataCount=this.MaxRequestDataCount;
@@ -105275,7 +105426,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
105275
105426
  strDescription+="5. High:这一分钟内最高价\r\n";
105276
105427
  strDescription+="6. Low:这一分钟内最低价\r\n";
105277
105428
  strDescription+="7. Amount:这一分钟内总的成交金额\r\n";
105278
- strDescription+="8. Vol:这一分钟内总的成交量\r\n";
105429
+ strDescription+="8. Vol:这一分钟内总的成交量(股)\r\n";
105279
105430
  strDescription+="9. AvPrice:均价\r\n";
105280
105431
  strDescription+="10. YClose:昨收价\r\n";
105281
105432
  strDescription+="11. YClearing:昨结算价\r\n";
@@ -109126,7 +109277,7 @@ JSKLineInfoMap.GetClassInfo=function(id)
109126
109277
  return JSKLineInfoMap.Get(id);
109127
109278
  }
109128
109279
 
109129
- JSKLineInfoMap.GetIconUrl=function(type)
109280
+ JSKLineInfoMap.GetIconUrl=function(type, item)
109130
109281
  {
109131
109282
  switch(type)
109132
109283
  {
@@ -109181,6 +109332,16 @@ JSKLineInfoMap.GetIconFont=function(type)
109181
109332
  return value;
109182
109333
  }
109183
109334
 
109335
+ if (type>=KLINE_INFO_TYPE.DRAGON_TIGER_EX_START && type<=KLINE_INFO_TYPE.DRAGON_TIGER_EX_END)
109336
+ {
109337
+ var index=type-KLINE_INFO_TYPE.DRAGON_TIGER_EX_START;
109338
+ var value=g_JSChartResource.KLine.Info.DragonTiger.IconFont;
109339
+ var aryData=g_JSChartResource.KLine.Info.DragonTiger.AryIconFont;
109340
+ if (IFrameSplitOperator.IsNonEmptyArray(aryData) && aryData[index]) value=aryData[index];
109341
+
109342
+ return value;
109343
+ }
109344
+
109184
109345
  switch(type)
109185
109346
  {
109186
109347
  case KLINE_INFO_TYPE.INVESTOR:
@@ -109626,7 +109787,15 @@ function DragonTigerInfo()
109626
109787
  var infoData=new KLineInfoData();
109627
109788
  infoData.Date= item.date;
109628
109789
  infoData.Title=item.title;
109629
- infoData.InfoType=KLINE_INFO_TYPE.DRAGON_TIGER;
109790
+ var infoType=KLINE_INFO_TYPE.DRAGON_TIGER;
109791
+ if (IFrameSplitOperator.IsNumber(item.infoType))
109792
+ {
109793
+ infoType=KLINE_INFO_TYPE.DRAGON_TIGER_EX_START+item.infoType;
109794
+ if (infoType>KLINE_INFO_TYPE.DRAGON_TIGER_EX_END) infoType=KLINE_INFO_TYPE.DRAGON_TIGER_EX_END;
109795
+ }
109796
+ infoData.InfoType=infoType;
109797
+ if (item.color) infoData.Color=item.color; //图标颜色
109798
+
109630
109799
  infoData.ExtendData=
109631
109800
  {
109632
109801
  BuyAmount:item.buyAmount, //机构买入总额
@@ -114705,6 +114874,8 @@ function JSDivFrameToolbar()
114705
114874
 
114706
114875
  this.Destroy=function()
114707
114876
  {
114877
+ this.HideTooltip();
114878
+
114708
114879
  if (this.DivToolbar)
114709
114880
  {
114710
114881
  if (this.DivHQChart.removeChild) this.DivHQChart.removeChild(this.DivToolbar);
@@ -143013,7 +143184,13 @@ function GetBlackStyle()
143013
143184
  },
143014
143185
  DragonTiger: //龙虎榜
143015
143186
  {
143016
- IconFont: { Family:'iconfont', Text:'\ue62f', HScreenText:'\ue68a' ,Color:'#b22626' } //SVG 文本
143187
+ IconFont: { Family:'iconfont', Text:'\ue62f', HScreenText:'\ue68a' ,Color:'#b22626' }, //SVG 文本
143188
+
143189
+ AryIconFont:
143190
+ [
143191
+ { Family:'iconfont', Text:'\ue6c3', HScreenText:'\ue6c3' ,Color:'rgb(255,165,0)'},
143192
+ { Family:'iconfont', Text:'\ue6c5', HScreenText:'\ue6c5' ,Color:'rgb(0,191,255)'},
143193
+ ]
143017
143194
  },
143018
143195
  News: //新闻
143019
143196
  {
@@ -143928,7 +144105,17 @@ function GetBlackStyle()
143928
144105
  {
143929
144106
  Color:"rgb(220,220,220)",
143930
144107
  }
143931
- }
144108
+ },
144109
+
144110
+ OrderList:
144111
+ {
144112
+ BorderColor:'rgba(192,192,192,0.45)', //边框线
144113
+
144114
+ Header:
144115
+ {
144116
+ Color:"RGB(120,120,120)",
144117
+ },
144118
+ },
143932
144119
 
143933
144120
  };
143934
144121
 
@@ -169689,7 +169876,10 @@ function JSFloatTooltip()
169689
169876
  this.FormatPerformanceForecastText(item,aryText);
169690
169877
  break;
169691
169878
  default:
169692
- this.FormatDefaultKLineInfoText(item, aryText);
169879
+ if (infoType>=KLINE_INFO_TYPE.DRAGON_TIGER_EX_START && infoType<=KLINE_INFO_TYPE.DRAGON_TIGER_EX_END)
169880
+ this.FormatDragonTigerText(item,defaultfloatPrecision,aryText);
169881
+ else
169882
+ this.FormatDefaultKLineInfoText(item, aryText);
169693
169883
  break;
169694
169884
  }
169695
169885
  }
@@ -174133,9 +174323,9 @@ function ChartStatusBarStockData()
174133
174323
  break;
174134
174324
  }
174135
174325
  }
174136
- }
174137
174326
 
174138
- if (column.StringFormat && text) text=column.StringFormat.replace('{Value}',text);
174327
+ if (column.StringFormat && text) text=column.StringFormat.replace('{Value}',text);
174328
+ }
174139
174329
 
174140
174330
  return text;
174141
174331
  }
@@ -177137,7 +177327,7 @@ function ChartScrollText()
177137
177327
 
177138
177328
 
177139
177329
 
177140
- var HQCHART_VERSION="1.1.15805";
177330
+ var HQCHART_VERSION="1.1.15820";
177141
177331
 
177142
177332
  function PrintHQChartVersion()
177143
177333
  {