hqchart 1.1.15438 → 1.1.15449

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.
@@ -7073,6 +7073,9 @@ var JSCHART_EVENT_ID=
7073
7073
  ON_BEFORE_DRAW_HLINE:180, //画图工具-水平线(ChartDrawPictureHorizontalLine) 绘图前
7074
7074
 
7075
7075
  ON_HIDE_ALL_POP_DIV:181, //隐藏所有弹框div
7076
+
7077
+ //工具条
7078
+ ON_CLICK_STATUSBAR_ITEM:301,
7076
7079
  }
7077
7080
 
7078
7081
  var JSCHART_OPERATOR_ID=
@@ -55224,6 +55227,9 @@ function StockChip()
55224
55227
  if (recvData && recvData.PreventDefault)
55225
55228
  return recvData.Result;
55226
55229
 
55230
+ if (MARKET_SUFFIX_NAME.IsIncludes(symbol, ARRAY_CHINA_FUTURES_SUFFIX))
55231
+ return this.CalculateChip_Futrues();
55232
+
55227
55233
  if (MARKET_SUFFIX_NAME.IsSHSZIndex(symbol)) return false; //指数暂时不支持移动筹码
55228
55234
 
55229
55235
  var bindData=this.HQChart.ChartPaint[0].Data;
@@ -55353,6 +55359,142 @@ function StockChip()
55353
55359
  return true;
55354
55360
  }
55355
55361
 
55362
+ this.CalculateChip_Futrues=function() //计算期货筹码 (持仓和量计算的)
55363
+ {
55364
+ if (!this.HQChart) return false;
55365
+ var symbol=this.HQChart.Symbol;
55366
+ if (!symbol) return false;
55367
+ var upperSymbol=symbol.toUpperCase();
55368
+
55369
+ if (!MARKET_SUFFIX_NAME.IsIncludes(symbol, ARRAY_CHINA_FUTURES_SUFFIX)) return false;
55370
+
55371
+ var bindData=this.HQChart.GetKData();
55372
+ //if (bindData.Period>=4) return false; //分钟K线不支持, 没时间做,以后再做吧
55373
+ var count=bindData.DataOffset+parseInt(this.HQChart.CursorIndex);
55374
+ if (count>=bindData.Data.length) count=bindData.Data.length-1;
55375
+ var selData=bindData.Data[count];
55376
+ var yPrice=selData.Close;
55377
+
55378
+ var mouseY=this.HQChart.LastPoint.Y;
55379
+ if (mouseY) yPrice=this.HQChart.Frame.SubFrame[0].Frame.GetYData(mouseY);
55380
+
55381
+ //JSConsole.Chart.Log("[StockChip::CalculateChip]",count,this.HQChart.CursorIndex,selData);
55382
+ const rate=1;
55383
+ var aryVol=[];
55384
+ var seed=1,vol,maxPrice,minPrice;
55385
+ for(let i=count;i>=0;--i)
55386
+ {
55387
+ var item=bindData.Data[i];
55388
+ var changeRate=1; //换手率
55389
+ if (item.Position>0) changeRate=item.Vol/item.Position;
55390
+ if (i==count) vol=item.Vol*changeRate;
55391
+ else vol=item.Vol*seed;
55392
+ var dataItem={Vol:vol,High:item.High,Low:item.Low};
55393
+ aryVol.push(dataItem);
55394
+ seed*=(1-changeRate*rate);
55395
+
55396
+ if (!maxPrice || maxPrice<item.High) maxPrice=item.High;
55397
+ if (!minPrice || minPrice>item.Low) minPrice=item.Low;
55398
+ }
55399
+
55400
+ //JSConsole.Chart.Log("[StockChip::CalculateChip]",maxPrice,minPrice);
55401
+ if (!maxPrice || !minPrice) return true;
55402
+
55403
+ var priceZoom=this.PriceZoom;
55404
+
55405
+ maxPrice=parseInt(maxPrice*priceZoom);
55406
+ minPrice=parseInt(minPrice*priceZoom);
55407
+
55408
+ var dataCount=maxPrice-minPrice;
55409
+ var aryChip=new Array()
55410
+ for(let i=0;i<=dataCount;++i)
55411
+ {
55412
+ aryChip.push(0);
55413
+ }
55414
+
55415
+ var dayChip=[];
55416
+ var distributeData;
55417
+ if (this.ShowType==2)
55418
+ {
55419
+ var dayChip=
55420
+ [
55421
+ {Day:100, Color:this.DAY_COLOR[1][5]}, {Day:60, Color:this.DAY_COLOR[1][4]}, {Day:30, Color:this.DAY_COLOR[1][3]},
55422
+ {Day:20, Color:this.DAY_COLOR[1][2]}, {Day:10, Color:this.DAY_COLOR[1][1]}, {Day:5, Color:this.DAY_COLOR[1][0]}
55423
+ ];
55424
+ for(let i in aryVol)
55425
+ {
55426
+ var item=aryVol[i];
55427
+ var high=parseInt(item.High*priceZoom);
55428
+ var low=parseInt(item.Low*priceZoom);
55429
+ var averageVol=item.Vol;
55430
+ if (high-low>0) averageVol=item.Vol/(high-low);
55431
+ if (averageVol<=0.000000001) continue;
55432
+
55433
+ for(var k=0;k<dayChip.length;++k)
55434
+ {
55435
+ if (i==dayChip[k].Day)
55436
+ {
55437
+ dayChip[k].Chip=aryChip.slice(0);
55438
+ break;
55439
+ }
55440
+ }
55441
+
55442
+ distributeData={Low:low, High:high, Vol:item.Vol, MaxPrice:maxPrice, MinPrice:minPrice};
55443
+ this.CalculateDistribute(aryChip, distributeData );
55444
+ }
55445
+ }
55446
+ else if (this.ShowType==1)
55447
+ {
55448
+ var dayChip=
55449
+ [
55450
+ {Day:5, Color:this.DAY_COLOR[0][0]},{Day:10, Color:this.DAY_COLOR[0][1]},{Day:20, Color:this.DAY_COLOR[0][2]},
55451
+ {Day:30, Color:this.DAY_COLOR[0][3]},{Day:60, Color:this.DAY_COLOR[0][4]},{Day:100, Color:this.DAY_COLOR[0][5]}
55452
+ ];
55453
+
55454
+ for(let i=aryVol.length-1;i>=0;--i)
55455
+ {
55456
+ var item=aryVol[i];
55457
+ var high=parseInt(item.High*priceZoom);
55458
+ var low=parseInt(item.Low*priceZoom);
55459
+ var averageVol=item.Vol;
55460
+ if (high-low>0) averageVol=item.Vol/(high-low);
55461
+ if (averageVol<=0.000000001) continue;
55462
+
55463
+ for(var k=0;k<dayChip.length;++k)
55464
+ {
55465
+ if (i==dayChip[k].Day)
55466
+ {
55467
+ dayChip[k].Chip=aryChip.slice(0);
55468
+ break;
55469
+ }
55470
+ }
55471
+
55472
+ distributeData={Low:low, High:high, Vol:item.Vol, MaxPrice:maxPrice, MinPrice:minPrice};
55473
+ this.CalculateDistribute(aryChip, distributeData);
55474
+ }
55475
+ }
55476
+ else
55477
+ {
55478
+ for(let i in aryVol)
55479
+ {
55480
+ var item=aryVol[i];
55481
+ var high=parseInt(item.High*priceZoom);
55482
+ var low=parseInt(item.Low*priceZoom);
55483
+ var averageVol=item.Vol;
55484
+ if (high-low>0) averageVol=item.Vol/(high-low);
55485
+ if (averageVol<=0.000000001) continue;
55486
+
55487
+ distributeData={Low:low, High:high, Vol:item.Vol, MaxPrice:maxPrice, MinPrice:minPrice};
55488
+ this.CalculateDistribute(aryChip, distributeData);
55489
+ }
55490
+ }
55491
+
55492
+ if (!distributeData) return false;
55493
+
55494
+ this.Data={AllChip:aryChip, MaxVol:distributeData.MaxVol, MaxPrice:maxPrice, MinPrice:minPrice,SelectData:selData, DayChip:dayChip, YPrice:yPrice};
55495
+ return true;
55496
+ }
55497
+
55356
55498
  this.DrawFrame=function() //X轴成交量坐标
55357
55499
  {
55358
55500
  if (this.IsShowX==false) return;
@@ -83953,6 +84095,57 @@ function JSChartResource()
83953
84095
  BorderColor:"rgb(192,192,192)"
83954
84096
  }
83955
84097
 
84098
+ this.StatusBar=
84099
+ {
84100
+ Table:
84101
+ {
84102
+ Font:14*GetDevicePixelRatio() +'px 微软雅黑',
84103
+ TitleColor:"rgb(90,90,90)",
84104
+ AryTextColor:["rgb(90,90,90)","rgb(192,192,0)"],
84105
+ Margin:{ Left:1*GetDevicePixelRatio(), Top:0, Bottom:0, Right:0 },
84106
+ CellMargin:
84107
+ {
84108
+ Top:5*GetDevicePixelRatio(),
84109
+ Bottom:5*GetDevicePixelRatio(),
84110
+ Left:5*GetDevicePixelRatio(),
84111
+ Right:5*GetDevicePixelRatio(),
84112
+ YOffset:1* GetDevicePixelRatio(),
84113
+ },
84114
+
84115
+ Separator: { Left:10, Right:10, Line:{ Width:1, Color:"rgb(192,192,192)", Top:2, Bottom:2 } }
84116
+ },
84117
+
84118
+ DateTime:
84119
+ {
84120
+ Font:14*GetDevicePixelRatio() +'px 微软雅黑',
84121
+ TitleColor:"rgb(90,90,90)",
84122
+ Format:"HH:MM:SS",
84123
+ MaxText:"99:99:99",
84124
+ Margin:{ Left:2*GetDevicePixelRatio(), Top:5*GetDevicePixelRatio(), Bottom:5*GetDevicePixelRatio(), Right:5*GetDevicePixelRatio(), YOffset:1*GetDevicePixelRatio() },
84125
+ },
84126
+
84127
+ RightToolbar:
84128
+ {
84129
+ Icon:{ Family:"iconfont", Size:14*GetDevicePixelRatio() },
84130
+
84131
+ Margin:{ Left:1*GetDevicePixelRatio(), Top:0, Bottom:0, Right:2*GetDevicePixelRatio() },
84132
+ CellMargin:
84133
+ {
84134
+ Top:5*GetDevicePixelRatio(),
84135
+ Bottom:5*GetDevicePixelRatio(),
84136
+ Left:2*GetDevicePixelRatio(),
84137
+ Right:2*GetDevicePixelRatio(),
84138
+ YOffset:0,
84139
+ },
84140
+ },
84141
+
84142
+ UpTextColor:"rgb(238,21,21)", //上涨文字颜色
84143
+ DownTextColor:"rgb(25,158,0)", //下跌文字颜色
84144
+ UnchangeTextColor:"rgb(90,90,90)", //平盘文字颜色
84145
+
84146
+ BorderColor:"rgb(192,192,192)"
84147
+ }
84148
+
83956
84149
 
83957
84150
  //自定义风格
83958
84151
  this.SetStyle=function(style)
@@ -84922,7 +85115,64 @@ function JSChartResource()
84922
85115
 
84923
85116
  if (style.SmallFloatTooltipV2) this.SetSmallFloatTooltipV2(style.SmallFloatTooltipV2);
84924
85117
  if (style.StockInfo) this.SetStockInfo(style.StockInfo);
85118
+ if (style.StatusBar) this.SetStatusBar(style.StatusBar);
85119
+
85120
+ }
85121
+
85122
+ this.SetStatusBar=function(style)
85123
+ {
85124
+ var dest=this.StatusBar;
84925
85125
 
85126
+ if (style.Table)
85127
+ {
85128
+ var item=style.Table;
85129
+ if (item.Font) dest.Table.Font=item.Font;
85130
+ if (item.TitleColor) dest.Table.TitleColor=item.TitleColor;
85131
+ if (IFrameSplitOperator.IsNonEmptyArray(item.AryTextColor)) dest.Table.AryTextColor=item.AryTextColor.slice();
85132
+ CopyMarginConfig(dest.Table.Margin, item.Margin);
85133
+ if (item.CellMargin)
85134
+ {
85135
+ var subItem=item.CellMargin;
85136
+ CopyMarginConfig(dest.Table.CellMargin, subItem);
85137
+ if (IFrameSplitOperator.IsNumber(subItem.YOffset)) dest.Table.CellMargin.YOffset=subItem.YOffset
85138
+ }
85139
+
85140
+ if (item.Separator)
85141
+ {
85142
+ var subItem=item.Separator;
85143
+ var subDest=dest.Table.Separator;
85144
+ if (IFrameSplitOperator.IsNumber(subItem.Left)) subDest.Left=subItem.Left;
85145
+ if (IFrameSplitOperator.IsNumber(subItem.Right)) subDest.Left=subItem.Right;
85146
+
85147
+ if (subItem.Line)
85148
+ {
85149
+ if (IFrameSplitOperator.IsNumber(subItem.Line.Width)) subDest.Line.Width=subItem.Line.Width;
85150
+ if (IFrameSplitOperator.IsNumber(subItem.Line.Top)) subDest.Line.Top=subItem.Line.Top;
85151
+ if (IFrameSplitOperator.IsNumber(subItem.Line.Bottom)) subDest.Line.Bottom=subItem.Line.Bottom;
85152
+ if (subItem.Line.Color) subDest.Line.Color=subItem.Line.Color;
85153
+ }
85154
+ }
85155
+ }
85156
+
85157
+ if (style.DateTime)
85158
+ {
85159
+ var item=style.DateTime;
85160
+ if (item.Font) dest.DateTime.Font=item.Font;
85161
+ if (item.TitleColor) dest.DateTime.TitleColor=item.TitleColor;
85162
+ if (item.Format) dest.DateTime.Format=item.Format;
85163
+ if (item.MaxText) dest.DateTime.MaxText=item.MaxText;
85164
+ if (item.Margin)
85165
+ {
85166
+ var subItem=item.Margin;
85167
+ CopyMarginConfig(dest.DateTime.Margin, subItem);
85168
+ if (IFrameSplitOperator.IsNumber(subItem.YOffset)) dest.DateTime.Margin.YOffset=subItem.YOffset;
85169
+ }
85170
+ }
85171
+
85172
+ if (style.UpTextColor) dest.UpTextColor=style.UpTextColor;
85173
+ if (style.DownTextColor) dest.DownTextColor=style.DownTextColor;
85174
+ if (style.UnchangeTextColor) dest.UnchangeTextColor=style.UnchangeTextColor;
85175
+ if (style.BorderColor) dest.BorderColor=style.BorderColor;
84926
85176
  }
84927
85177
 
84928
85178
  this.SetStockInfo=function(style)
@@ -106893,13 +107143,55 @@ var MARKET_SUFFIX_NAME=
106893
107143
  return upperSymbol.indexOf(this.INE) > 0;
106894
107144
  },
106895
107145
 
107146
+ //是否包含某一个市场的
107147
+ IsIncludes:function(symbol, arySuffix)
107148
+ {
107149
+ if (!symbol) return false;
107150
+ if (!IFrameSplitOperator.IsNonEmptyArray(arySuffix)) return false;
107151
+ var upperSymbol=symbol.toUpperCase();
107152
+
107153
+ var bMatch=false;
107154
+ for(var i=0;i<arySuffix.length;++i)
107155
+ {
107156
+ var item=arySuffix[i];
107157
+ switch(item)
107158
+ {
107159
+ case this.SHFE:
107160
+ case this.SHFE2:
107161
+ if (this.IsSHFE(upperSymbol)) bMatch=true;
107162
+ break;
107163
+ case this.CFFEX2:
107164
+ case this.CFFEX:
107165
+ case this.CFFEX3:
107166
+ if (this.IsCFFEX(upperSymbol)) bMatch=true;
107167
+ break;
107168
+ case this.DCE:
107169
+ if (this.IsDCE(upperSymbol)) bMatch=true;
107170
+ break;
107171
+ case this.CZCE:
107172
+ if (this.IsCZCE(upperSymbol)) bMatch=true;
107173
+ break;
107174
+ case this.GZFE:
107175
+ if (this.IsGZFE(upperSymbol)) bMatch=true;
107176
+ break;
107177
+ case this.INE:
107178
+ if (this.IsINE(upperSymbol)) bMatch=true;
107179
+ break;
107180
+ }
107181
+
107182
+ if (bMatch) return true;
107183
+ }
107184
+
107185
+ return false;
107186
+ },
107187
+
106896
107188
  IsChinaFutures:function(upperSymbol) //是否是国内期货 /期权
106897
107189
  {
106898
107190
  if (!upperSymbol) return false;
106899
107191
 
106900
107192
  return this.IsSHO(upperSymbol) || this.IsSZO(upperSymbol) ||
106901
- this.IsGZFE(upperSymbol) || this.IsINE(upperSymbol) ||
106902
- this.IsCFFEX(upperSymbol) || this.IsCZCE(upperSymbol) || this.IsDCE(upperSymbol) || this.IsSHFE(upperSymbol);
107193
+ this.IsGZFE(upperSymbol) || this.IsINE(upperSymbol) ||
107194
+ this.IsCFFEX(upperSymbol) || this.IsCZCE(upperSymbol) || this.IsDCE(upperSymbol) || this.IsSHFE(upperSymbol);
106903
107195
  },
106904
107196
 
106905
107197
  IsFutures:function(upperSymbol) //是否是期货 包含国外的
@@ -107408,6 +107700,16 @@ var MARKET_SUFFIX_NAME=
107408
107700
 
107409
107701
  }
107410
107702
 
107703
+ //国内期货市场
107704
+ const ARRAY_CHINA_FUTURES_SUFFIX=
107705
+ [
107706
+ MARKET_SUFFIX_NAME.SHFE,
107707
+ MARKET_SUFFIX_NAME.CFFEX,
107708
+ MARKET_SUFFIX_NAME.DCE,
107709
+ MARKET_SUFFIX_NAME.CZCE,
107710
+ MARKET_SUFFIX_NAME.GZFE,
107711
+ MARKET_SUFFIX_NAME.INE
107712
+ ];
107411
107713
 
107412
107714
  //走势图分钟数据对应的时间
107413
107715
  function MinuteTimeStringData()
@@ -139815,6 +140117,48 @@ function GetBlackStyle()
139815
140117
  UpTextColor:"rgb(238,21,21)", //上涨文字颜色
139816
140118
  DownTextColor:"rgb(25,158,0)", //下跌文字颜色
139817
140119
  UnchangeTextColor:"rgb(90,90,90)", //平盘文字颜色
140120
+ BorderColor:'rgb(38,38,41)', //边框线
140121
+ },
140122
+
140123
+
140124
+ StatusBar:
140125
+ {
140126
+ Table:
140127
+ {
140128
+ //Font:14*GetDevicePixelRatio() +'px 微软雅黑',
140129
+ TitleColor:"rgb(250,250,250)",
140130
+ AryTextColor:["rgb(250,250,250)", "rgb(255, 185, 15)"],
140131
+ //Margin:{ Left:0, Top:0, Bottom:0, Right:0 },
140132
+ //CellMargin:{ Top:5, Bottom:5, Left:5, Right:5, YOffset:0 },
140133
+ //ItemSpace:20,
140134
+
140135
+ Separator:
140136
+ {
140137
+ //Left:20,
140138
+ // Right:20,
140139
+ Line:
140140
+ {
140141
+ //Width:1,
140142
+ Color:"rgb(38,38,41)",
140143
+ //Top:2,
140144
+ //Bottom:2
140145
+ }
140146
+ }
140147
+ },
140148
+
140149
+ DateTime:
140150
+ {
140151
+ //Font:14*GetDevicePixelRatio() +'px 微软雅黑',
140152
+ TitleColor:"rgb(250,250,250)",
140153
+ //Format:"HH:MM:SS",
140154
+ //MaxText:"99:99:99",
140155
+ //Margin:{ Left:2*GetDevicePixelRatio(), Top:5*GetDevicePixelRatio(), Bottom:5*GetDevicePixelRatio(), Right:5*GetDevicePixelRatio(), YOffset:1*GetDevicePixelRatio() },
140156
+ },
140157
+
140158
+ UpTextColor:"rgb(238,21,21)", //上涨文字颜色
140159
+ DownTextColor:"rgb(25,158,0)", //下跌文字颜色
140160
+ UnchangeTextColor:"rgb(90,90,90)", //平盘文字颜色
140161
+
139818
140162
  BorderColor:'rgb(38,38,41)', //边框线
139819
140163
  }
139820
140164
 
@@ -161366,10 +161710,38 @@ function JSPopMinuteChart()
161366
161710
  {
161367
161711
  data.Request.Data.date=this.Date;
161368
161712
  data.Name="MinuteChartContainer::RequestPopMinuteData";
161369
- data.Explain="指定日期分时数据"
161370
- };
161713
+ data.Explain="指定日期分时数据";
161714
+ this.HQChart.NetworkFilter(data, (recv)=>{ this.OnRecvPopMinuteData(recv, callback); });
161715
+ }
161716
+ else
161717
+ {
161718
+ this.HQChart.NetworkFilter(data, callback);
161719
+ }
161720
+ }
161371
161721
 
161372
- this.HQChart.NetworkFilter(data, callback);
161722
+ this.OnRecvPopMinuteData=function(recv, callback)
161723
+ {
161724
+ var bUpdateTitle=false;
161725
+ if (recv && IFrameSplitOperator.IsNonEmptyArray(recv.stock))
161726
+ {
161727
+ var stockItem=recv.stock[0];
161728
+ if (stockItem)
161729
+ {
161730
+ if (stockItem.Title)
161731
+ {
161732
+ this.Name=stockItem.Title;
161733
+ bUpdateTitle=true;
161734
+ }
161735
+ else if (stockItem.name)
161736
+ {
161737
+ this.Name=stockItem.name;
161738
+ bUpdateTitle=true;
161739
+ }
161740
+ }
161741
+ }
161742
+
161743
+ if (bUpdateTitle) this.UpdateDialogTitle();
161744
+ callback(recv);
161373
161745
  }
161374
161746
 
161375
161747
  this.OnCreateHQChart=function(chart)
@@ -168227,7 +168599,7 @@ function HQChartScriptWorker()
168227
168599
 
168228
168600
 
168229
168601
 
168230
- var HQCHART_VERSION="1.1.15437";
168602
+ var HQCHART_VERSION="1.1.15448";
168231
168603
 
168232
168604
  function PrintHQChartVersion()
168233
168605
  {