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.
@@ -7029,6 +7029,9 @@ var JSCHART_EVENT_ID=
7029
7029
  ON_BEFORE_DRAW_HLINE:180, //画图工具-水平线(ChartDrawPictureHorizontalLine) 绘图前
7030
7030
 
7031
7031
  ON_HIDE_ALL_POP_DIV:181, //隐藏所有弹框div
7032
+
7033
+ //工具条
7034
+ ON_CLICK_STATUSBAR_ITEM:301,
7032
7035
  }
7033
7036
 
7034
7037
  var JSCHART_OPERATOR_ID=
@@ -55180,6 +55183,9 @@ function StockChip()
55180
55183
  if (recvData && recvData.PreventDefault)
55181
55184
  return recvData.Result;
55182
55185
 
55186
+ if (MARKET_SUFFIX_NAME.IsIncludes(symbol, ARRAY_CHINA_FUTURES_SUFFIX))
55187
+ return this.CalculateChip_Futrues();
55188
+
55183
55189
  if (MARKET_SUFFIX_NAME.IsSHSZIndex(symbol)) return false; //指数暂时不支持移动筹码
55184
55190
 
55185
55191
  var bindData=this.HQChart.ChartPaint[0].Data;
@@ -55309,6 +55315,142 @@ function StockChip()
55309
55315
  return true;
55310
55316
  }
55311
55317
 
55318
+ this.CalculateChip_Futrues=function() //计算期货筹码 (持仓和量计算的)
55319
+ {
55320
+ if (!this.HQChart) return false;
55321
+ var symbol=this.HQChart.Symbol;
55322
+ if (!symbol) return false;
55323
+ var upperSymbol=symbol.toUpperCase();
55324
+
55325
+ if (!MARKET_SUFFIX_NAME.IsIncludes(symbol, ARRAY_CHINA_FUTURES_SUFFIX)) return false;
55326
+
55327
+ var bindData=this.HQChart.GetKData();
55328
+ //if (bindData.Period>=4) return false; //分钟K线不支持, 没时间做,以后再做吧
55329
+ var count=bindData.DataOffset+parseInt(this.HQChart.CursorIndex);
55330
+ if (count>=bindData.Data.length) count=bindData.Data.length-1;
55331
+ var selData=bindData.Data[count];
55332
+ var yPrice=selData.Close;
55333
+
55334
+ var mouseY=this.HQChart.LastPoint.Y;
55335
+ if (mouseY) yPrice=this.HQChart.Frame.SubFrame[0].Frame.GetYData(mouseY);
55336
+
55337
+ //JSConsole.Chart.Log("[StockChip::CalculateChip]",count,this.HQChart.CursorIndex,selData);
55338
+ const rate=1;
55339
+ var aryVol=[];
55340
+ var seed=1,vol,maxPrice,minPrice;
55341
+ for(let i=count;i>=0;--i)
55342
+ {
55343
+ var item=bindData.Data[i];
55344
+ var changeRate=1; //换手率
55345
+ if (item.Position>0) changeRate=item.Vol/item.Position;
55346
+ if (i==count) vol=item.Vol*changeRate;
55347
+ else vol=item.Vol*seed;
55348
+ var dataItem={Vol:vol,High:item.High,Low:item.Low};
55349
+ aryVol.push(dataItem);
55350
+ seed*=(1-changeRate*rate);
55351
+
55352
+ if (!maxPrice || maxPrice<item.High) maxPrice=item.High;
55353
+ if (!minPrice || minPrice>item.Low) minPrice=item.Low;
55354
+ }
55355
+
55356
+ //JSConsole.Chart.Log("[StockChip::CalculateChip]",maxPrice,minPrice);
55357
+ if (!maxPrice || !minPrice) return true;
55358
+
55359
+ var priceZoom=this.PriceZoom;
55360
+
55361
+ maxPrice=parseInt(maxPrice*priceZoom);
55362
+ minPrice=parseInt(minPrice*priceZoom);
55363
+
55364
+ var dataCount=maxPrice-minPrice;
55365
+ var aryChip=new Array()
55366
+ for(let i=0;i<=dataCount;++i)
55367
+ {
55368
+ aryChip.push(0);
55369
+ }
55370
+
55371
+ var dayChip=[];
55372
+ var distributeData;
55373
+ if (this.ShowType==2)
55374
+ {
55375
+ var dayChip=
55376
+ [
55377
+ {Day:100, Color:this.DAY_COLOR[1][5]}, {Day:60, Color:this.DAY_COLOR[1][4]}, {Day:30, Color:this.DAY_COLOR[1][3]},
55378
+ {Day:20, Color:this.DAY_COLOR[1][2]}, {Day:10, Color:this.DAY_COLOR[1][1]}, {Day:5, Color:this.DAY_COLOR[1][0]}
55379
+ ];
55380
+ for(let i in aryVol)
55381
+ {
55382
+ var item=aryVol[i];
55383
+ var high=parseInt(item.High*priceZoom);
55384
+ var low=parseInt(item.Low*priceZoom);
55385
+ var averageVol=item.Vol;
55386
+ if (high-low>0) averageVol=item.Vol/(high-low);
55387
+ if (averageVol<=0.000000001) continue;
55388
+
55389
+ for(var k=0;k<dayChip.length;++k)
55390
+ {
55391
+ if (i==dayChip[k].Day)
55392
+ {
55393
+ dayChip[k].Chip=aryChip.slice(0);
55394
+ break;
55395
+ }
55396
+ }
55397
+
55398
+ distributeData={Low:low, High:high, Vol:item.Vol, MaxPrice:maxPrice, MinPrice:minPrice};
55399
+ this.CalculateDistribute(aryChip, distributeData );
55400
+ }
55401
+ }
55402
+ else if (this.ShowType==1)
55403
+ {
55404
+ var dayChip=
55405
+ [
55406
+ {Day:5, Color:this.DAY_COLOR[0][0]},{Day:10, Color:this.DAY_COLOR[0][1]},{Day:20, Color:this.DAY_COLOR[0][2]},
55407
+ {Day:30, Color:this.DAY_COLOR[0][3]},{Day:60, Color:this.DAY_COLOR[0][4]},{Day:100, Color:this.DAY_COLOR[0][5]}
55408
+ ];
55409
+
55410
+ for(let i=aryVol.length-1;i>=0;--i)
55411
+ {
55412
+ var item=aryVol[i];
55413
+ var high=parseInt(item.High*priceZoom);
55414
+ var low=parseInt(item.Low*priceZoom);
55415
+ var averageVol=item.Vol;
55416
+ if (high-low>0) averageVol=item.Vol/(high-low);
55417
+ if (averageVol<=0.000000001) continue;
55418
+
55419
+ for(var k=0;k<dayChip.length;++k)
55420
+ {
55421
+ if (i==dayChip[k].Day)
55422
+ {
55423
+ dayChip[k].Chip=aryChip.slice(0);
55424
+ break;
55425
+ }
55426
+ }
55427
+
55428
+ distributeData={Low:low, High:high, Vol:item.Vol, MaxPrice:maxPrice, MinPrice:minPrice};
55429
+ this.CalculateDistribute(aryChip, distributeData);
55430
+ }
55431
+ }
55432
+ else
55433
+ {
55434
+ for(let i in aryVol)
55435
+ {
55436
+ var item=aryVol[i];
55437
+ var high=parseInt(item.High*priceZoom);
55438
+ var low=parseInt(item.Low*priceZoom);
55439
+ var averageVol=item.Vol;
55440
+ if (high-low>0) averageVol=item.Vol/(high-low);
55441
+ if (averageVol<=0.000000001) continue;
55442
+
55443
+ distributeData={Low:low, High:high, Vol:item.Vol, MaxPrice:maxPrice, MinPrice:minPrice};
55444
+ this.CalculateDistribute(aryChip, distributeData);
55445
+ }
55446
+ }
55447
+
55448
+ if (!distributeData) return false;
55449
+
55450
+ this.Data={AllChip:aryChip, MaxVol:distributeData.MaxVol, MaxPrice:maxPrice, MinPrice:minPrice,SelectData:selData, DayChip:dayChip, YPrice:yPrice};
55451
+ return true;
55452
+ }
55453
+
55312
55454
  this.DrawFrame=function() //X轴成交量坐标
55313
55455
  {
55314
55456
  if (this.IsShowX==false) return;
@@ -83909,6 +84051,57 @@ function JSChartResource()
83909
84051
  BorderColor:"rgb(192,192,192)"
83910
84052
  }
83911
84053
 
84054
+ this.StatusBar=
84055
+ {
84056
+ Table:
84057
+ {
84058
+ Font:14*GetDevicePixelRatio() +'px 微软雅黑',
84059
+ TitleColor:"rgb(90,90,90)",
84060
+ AryTextColor:["rgb(90,90,90)","rgb(192,192,0)"],
84061
+ Margin:{ Left:1*GetDevicePixelRatio(), Top:0, Bottom:0, Right:0 },
84062
+ CellMargin:
84063
+ {
84064
+ Top:5*GetDevicePixelRatio(),
84065
+ Bottom:5*GetDevicePixelRatio(),
84066
+ Left:5*GetDevicePixelRatio(),
84067
+ Right:5*GetDevicePixelRatio(),
84068
+ YOffset:1* GetDevicePixelRatio(),
84069
+ },
84070
+
84071
+ Separator: { Left:10, Right:10, Line:{ Width:1, Color:"rgb(192,192,192)", Top:2, Bottom:2 } }
84072
+ },
84073
+
84074
+ DateTime:
84075
+ {
84076
+ Font:14*GetDevicePixelRatio() +'px 微软雅黑',
84077
+ TitleColor:"rgb(90,90,90)",
84078
+ Format:"HH:MM:SS",
84079
+ MaxText:"99:99:99",
84080
+ Margin:{ Left:2*GetDevicePixelRatio(), Top:5*GetDevicePixelRatio(), Bottom:5*GetDevicePixelRatio(), Right:5*GetDevicePixelRatio(), YOffset:1*GetDevicePixelRatio() },
84081
+ },
84082
+
84083
+ RightToolbar:
84084
+ {
84085
+ Icon:{ Family:"iconfont", Size:14*GetDevicePixelRatio() },
84086
+
84087
+ Margin:{ Left:1*GetDevicePixelRatio(), Top:0, Bottom:0, Right:2*GetDevicePixelRatio() },
84088
+ CellMargin:
84089
+ {
84090
+ Top:5*GetDevicePixelRatio(),
84091
+ Bottom:5*GetDevicePixelRatio(),
84092
+ Left:2*GetDevicePixelRatio(),
84093
+ Right:2*GetDevicePixelRatio(),
84094
+ YOffset:0,
84095
+ },
84096
+ },
84097
+
84098
+ UpTextColor:"rgb(238,21,21)", //上涨文字颜色
84099
+ DownTextColor:"rgb(25,158,0)", //下跌文字颜色
84100
+ UnchangeTextColor:"rgb(90,90,90)", //平盘文字颜色
84101
+
84102
+ BorderColor:"rgb(192,192,192)"
84103
+ }
84104
+
83912
84105
 
83913
84106
  //自定义风格
83914
84107
  this.SetStyle=function(style)
@@ -84878,7 +85071,64 @@ function JSChartResource()
84878
85071
 
84879
85072
  if (style.SmallFloatTooltipV2) this.SetSmallFloatTooltipV2(style.SmallFloatTooltipV2);
84880
85073
  if (style.StockInfo) this.SetStockInfo(style.StockInfo);
85074
+ if (style.StatusBar) this.SetStatusBar(style.StatusBar);
85075
+
85076
+ }
85077
+
85078
+ this.SetStatusBar=function(style)
85079
+ {
85080
+ var dest=this.StatusBar;
85081
+
85082
+ if (style.Table)
85083
+ {
85084
+ var item=style.Table;
85085
+ if (item.Font) dest.Table.Font=item.Font;
85086
+ if (item.TitleColor) dest.Table.TitleColor=item.TitleColor;
85087
+ if (IFrameSplitOperator.IsNonEmptyArray(item.AryTextColor)) dest.Table.AryTextColor=item.AryTextColor.slice();
85088
+ CopyMarginConfig(dest.Table.Margin, item.Margin);
85089
+ if (item.CellMargin)
85090
+ {
85091
+ var subItem=item.CellMargin;
85092
+ CopyMarginConfig(dest.Table.CellMargin, subItem);
85093
+ if (IFrameSplitOperator.IsNumber(subItem.YOffset)) dest.Table.CellMargin.YOffset=subItem.YOffset
85094
+ }
85095
+
85096
+ if (item.Separator)
85097
+ {
85098
+ var subItem=item.Separator;
85099
+ var subDest=dest.Table.Separator;
85100
+ if (IFrameSplitOperator.IsNumber(subItem.Left)) subDest.Left=subItem.Left;
85101
+ if (IFrameSplitOperator.IsNumber(subItem.Right)) subDest.Left=subItem.Right;
85102
+
85103
+ if (subItem.Line)
85104
+ {
85105
+ if (IFrameSplitOperator.IsNumber(subItem.Line.Width)) subDest.Line.Width=subItem.Line.Width;
85106
+ if (IFrameSplitOperator.IsNumber(subItem.Line.Top)) subDest.Line.Top=subItem.Line.Top;
85107
+ if (IFrameSplitOperator.IsNumber(subItem.Line.Bottom)) subDest.Line.Bottom=subItem.Line.Bottom;
85108
+ if (subItem.Line.Color) subDest.Line.Color=subItem.Line.Color;
85109
+ }
85110
+ }
85111
+ }
85112
+
85113
+ if (style.DateTime)
85114
+ {
85115
+ var item=style.DateTime;
85116
+ if (item.Font) dest.DateTime.Font=item.Font;
85117
+ if (item.TitleColor) dest.DateTime.TitleColor=item.TitleColor;
85118
+ if (item.Format) dest.DateTime.Format=item.Format;
85119
+ if (item.MaxText) dest.DateTime.MaxText=item.MaxText;
85120
+ if (item.Margin)
85121
+ {
85122
+ var subItem=item.Margin;
85123
+ CopyMarginConfig(dest.DateTime.Margin, subItem);
85124
+ if (IFrameSplitOperator.IsNumber(subItem.YOffset)) dest.DateTime.Margin.YOffset=subItem.YOffset;
85125
+ }
85126
+ }
84881
85127
 
85128
+ if (style.UpTextColor) dest.UpTextColor=style.UpTextColor;
85129
+ if (style.DownTextColor) dest.DownTextColor=style.DownTextColor;
85130
+ if (style.UnchangeTextColor) dest.UnchangeTextColor=style.UnchangeTextColor;
85131
+ if (style.BorderColor) dest.BorderColor=style.BorderColor;
84882
85132
  }
84883
85133
 
84884
85134
  this.SetStockInfo=function(style)
@@ -106849,13 +107099,55 @@ var MARKET_SUFFIX_NAME=
106849
107099
  return upperSymbol.indexOf(this.INE) > 0;
106850
107100
  },
106851
107101
 
107102
+ //是否包含某一个市场的
107103
+ IsIncludes:function(symbol, arySuffix)
107104
+ {
107105
+ if (!symbol) return false;
107106
+ if (!IFrameSplitOperator.IsNonEmptyArray(arySuffix)) return false;
107107
+ var upperSymbol=symbol.toUpperCase();
107108
+
107109
+ var bMatch=false;
107110
+ for(var i=0;i<arySuffix.length;++i)
107111
+ {
107112
+ var item=arySuffix[i];
107113
+ switch(item)
107114
+ {
107115
+ case this.SHFE:
107116
+ case this.SHFE2:
107117
+ if (this.IsSHFE(upperSymbol)) bMatch=true;
107118
+ break;
107119
+ case this.CFFEX2:
107120
+ case this.CFFEX:
107121
+ case this.CFFEX3:
107122
+ if (this.IsCFFEX(upperSymbol)) bMatch=true;
107123
+ break;
107124
+ case this.DCE:
107125
+ if (this.IsDCE(upperSymbol)) bMatch=true;
107126
+ break;
107127
+ case this.CZCE:
107128
+ if (this.IsCZCE(upperSymbol)) bMatch=true;
107129
+ break;
107130
+ case this.GZFE:
107131
+ if (this.IsGZFE(upperSymbol)) bMatch=true;
107132
+ break;
107133
+ case this.INE:
107134
+ if (this.IsINE(upperSymbol)) bMatch=true;
107135
+ break;
107136
+ }
107137
+
107138
+ if (bMatch) return true;
107139
+ }
107140
+
107141
+ return false;
107142
+ },
107143
+
106852
107144
  IsChinaFutures:function(upperSymbol) //是否是国内期货 /期权
106853
107145
  {
106854
107146
  if (!upperSymbol) return false;
106855
107147
 
106856
107148
  return this.IsSHO(upperSymbol) || this.IsSZO(upperSymbol) ||
106857
- this.IsGZFE(upperSymbol) || this.IsINE(upperSymbol) ||
106858
- this.IsCFFEX(upperSymbol) || this.IsCZCE(upperSymbol) || this.IsDCE(upperSymbol) || this.IsSHFE(upperSymbol);
107149
+ this.IsGZFE(upperSymbol) || this.IsINE(upperSymbol) ||
107150
+ this.IsCFFEX(upperSymbol) || this.IsCZCE(upperSymbol) || this.IsDCE(upperSymbol) || this.IsSHFE(upperSymbol);
106859
107151
  },
106860
107152
 
106861
107153
  IsFutures:function(upperSymbol) //是否是期货 包含国外的
@@ -107364,6 +107656,16 @@ var MARKET_SUFFIX_NAME=
107364
107656
 
107365
107657
  }
107366
107658
 
107659
+ //国内期货市场
107660
+ const ARRAY_CHINA_FUTURES_SUFFIX=
107661
+ [
107662
+ MARKET_SUFFIX_NAME.SHFE,
107663
+ MARKET_SUFFIX_NAME.CFFEX,
107664
+ MARKET_SUFFIX_NAME.DCE,
107665
+ MARKET_SUFFIX_NAME.CZCE,
107666
+ MARKET_SUFFIX_NAME.GZFE,
107667
+ MARKET_SUFFIX_NAME.INE
107668
+ ];
107367
107669
 
107368
107670
  //走势图分钟数据对应的时间
107369
107671
  function MinuteTimeStringData()
@@ -139771,6 +140073,48 @@ function GetBlackStyle()
139771
140073
  UpTextColor:"rgb(238,21,21)", //上涨文字颜色
139772
140074
  DownTextColor:"rgb(25,158,0)", //下跌文字颜色
139773
140075
  UnchangeTextColor:"rgb(90,90,90)", //平盘文字颜色
140076
+ BorderColor:'rgb(38,38,41)', //边框线
140077
+ },
140078
+
140079
+
140080
+ StatusBar:
140081
+ {
140082
+ Table:
140083
+ {
140084
+ //Font:14*GetDevicePixelRatio() +'px 微软雅黑',
140085
+ TitleColor:"rgb(250,250,250)",
140086
+ AryTextColor:["rgb(250,250,250)", "rgb(255, 185, 15)"],
140087
+ //Margin:{ Left:0, Top:0, Bottom:0, Right:0 },
140088
+ //CellMargin:{ Top:5, Bottom:5, Left:5, Right:5, YOffset:0 },
140089
+ //ItemSpace:20,
140090
+
140091
+ Separator:
140092
+ {
140093
+ //Left:20,
140094
+ // Right:20,
140095
+ Line:
140096
+ {
140097
+ //Width:1,
140098
+ Color:"rgb(38,38,41)",
140099
+ //Top:2,
140100
+ //Bottom:2
140101
+ }
140102
+ }
140103
+ },
140104
+
140105
+ DateTime:
140106
+ {
140107
+ //Font:14*GetDevicePixelRatio() +'px 微软雅黑',
140108
+ TitleColor:"rgb(250,250,250)",
140109
+ //Format:"HH:MM:SS",
140110
+ //MaxText:"99:99:99",
140111
+ //Margin:{ Left:2*GetDevicePixelRatio(), Top:5*GetDevicePixelRatio(), Bottom:5*GetDevicePixelRatio(), Right:5*GetDevicePixelRatio(), YOffset:1*GetDevicePixelRatio() },
140112
+ },
140113
+
140114
+ UpTextColor:"rgb(238,21,21)", //上涨文字颜色
140115
+ DownTextColor:"rgb(25,158,0)", //下跌文字颜色
140116
+ UnchangeTextColor:"rgb(90,90,90)", //平盘文字颜色
140117
+
139774
140118
  BorderColor:'rgb(38,38,41)', //边框线
139775
140119
  }
139776
140120
 
@@ -156170,7 +156514,7 @@ function ScrollBarBGChart()
156170
156514
 
156171
156515
 
156172
156516
 
156173
- var HQCHART_VERSION="1.1.15437";
156517
+ var HQCHART_VERSION="1.1.15448";
156174
156518
 
156175
156519
  function PrintHQChartVersion()
156176
156520
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.15437";
8
+ var HQCHART_VERSION="1.1.15448";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {