hqchart 1.1.13409 → 1.1.13441

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.
@@ -55,6 +55,15 @@ HQData.NetworkFilter=function(data, callback)
55
55
  HQData.RequestLatestData(data,callback);
56
56
  break;
57
57
 
58
+
59
+ case "KLineChartContainer::RequestOverlayHistoryData": //叠加股票
60
+ HQData.RequestOverlayHistoryData(data, callback);
61
+ break;
62
+
63
+ case "KLineChartContainer::RequestOverlayHistoryMinuteData":
64
+ HQData.RequestOverlayHistoryMinuteData(data, callback);
65
+ break;
66
+
58
67
 
59
68
 
60
69
 
@@ -376,3 +385,28 @@ HQData.RequestLatestData=function(data,callback)
376
385
 
377
386
  callback(hqchartData);
378
387
  }
388
+
389
+ HQData.RequestOverlayHistoryData=function(data, callback)
390
+ {
391
+ data.PreventDefault=true;
392
+ var symbol=data.Request.Data.symbol;
393
+ var hqchartData={ symbol: symbol,name: symbol };
394
+ if (symbol=="399001.sz")
395
+ hqchartData.data=KLINE_DAY_OVERLAY_DATA2.data
396
+ else
397
+ hqchartData.data=KLINE_DAY_OVERLAY_DATA.data
398
+
399
+ callback(hqchartData);
400
+ }
401
+
402
+ HQData.RequestOverlayHistoryMinuteData=function(data, callback)
403
+ {
404
+ data.PreventDefault=true;
405
+ var symbol=data.Request.Data.symbol;
406
+ var hqchartData={ symbol: symbol,name: symbol };
407
+ hqchartData.data=KLINE_MINUTE_DATA2.data;
408
+
409
+ callback(hqchartData);
410
+ }
411
+
412
+
@@ -125,6 +125,8 @@ function JSIndexScript()
125
125
  ["ICHIMOKU",this.ICHIMOKU],["CDP-STD", this.CDP_STD],["TBP-STD",this.TBP_STD],
126
126
  ["ADX", this.ADX],
127
127
 
128
+ ["持仓量", this.VOL_POSITION], //成交量+持仓量
129
+
128
130
  //通达信特色指标
129
131
  ["散户线", this.ShareholderCount],["NXTS", this.NXTS],["FKX", this.FKX],["两融资金", this.Margin4],
130
132
  ["ZSDB",this.ZSDB],
@@ -3363,6 +3365,20 @@ JSIndexScript.prototype.CJL = function ()
3363
3365
  return data;
3364
3366
  }
3365
3367
 
3368
+ JSIndexScript.prototype.VOL_POSITION=function()
3369
+ {
3370
+ let data =
3371
+ {
3372
+ Name: '持仓量', Description: '持仓量', IsMainIndex: false,
3373
+ Args: [],
3374
+ Script: //脚本
3375
+ "成交量:VOL,VOLSTICK;\n\
3376
+ 持仓量:VOLINSTK,SINGLELINE;"
3377
+ };
3378
+
3379
+ return data;
3380
+ }
3381
+
3366
3382
  JSIndexScript.prototype.ASI = function ()
3367
3383
  {
3368
3384
  let data =
@@ -6488,7 +6504,7 @@ var JSCHART_EVENT_ID=
6488
6504
 
6489
6505
 
6490
6506
  ON_CHANGE_INDEX:150, //切换指标
6491
- ON_MENU_COMMAND:151, //菜单时间回调
6507
+ ON_MENU_COMMAND:151, //菜单事件回调
6492
6508
  ON_CREATE_RIGHT_MENU:152, //创建右键菜单
6493
6509
 
6494
6510
  ON_FORMAT_CALL_AUCTION_INDEX_TITLE:153, //集合竞价指标窗口标题内容
@@ -15124,7 +15140,19 @@ function AverageWidthFrame()
15124
15140
  }
15125
15141
  else //显示第1行
15126
15142
  {
15127
- this.Canvas.fillText(item.Message[1][0],xText+this.YTextPadding[1],yText);
15143
+ var text=item.Message[1][0];
15144
+
15145
+ if (item.TextColor2) this.Canvas.fillStyle=item.TextColor2;
15146
+ if (rightExtendText && rightExtendText.Align===2 && this.YRightTextInfo) //右对齐
15147
+ {
15148
+ this.Canvas.textAlign="right";
15149
+ var xRight=this.YRightTextInfo.MainTextWidth+right-this.YTextPadding[1];
15150
+ this.Canvas.fillText(text,xRight,yText);
15151
+ }
15152
+ else
15153
+ {
15154
+ this.Canvas.fillText(text,xText+this.YTextPadding[1],yText);
15155
+ }
15128
15156
  }
15129
15157
  }
15130
15158
  else
@@ -15134,7 +15162,7 @@ function AverageWidthFrame()
15134
15162
  if (!rtPreRight || (rtRight && !this.IsTextTopBottomOverlap(rtRight,rtPreRight)))
15135
15163
  {
15136
15164
  if (item.TextColor2) this.Canvas.fillStyle=item.TextColor2;
15137
- if (rightExtendText && rightExtendText.Align===2 && this.YRightTextInfo)
15165
+ if (rightExtendText && rightExtendText.Align===2 && this.YRightTextInfo) //右对齐
15138
15166
  {
15139
15167
  this.Canvas.textAlign="right";
15140
15168
  var xRight=this.YRightTextInfo.MainTextWidth+right-this.YTextPadding[1];
@@ -24664,6 +24692,7 @@ function ChartData()
24664
24692
  var yClose=this.Data[index].YClose;
24665
24693
 
24666
24694
  result[index]=HistoryData.Copy(this.Data[index]);
24695
+ result[index].RightSeed=seed;
24667
24696
 
24668
24697
  for(--index; index>=0; --index)
24669
24698
  {
@@ -24694,6 +24723,7 @@ function ChartData()
24694
24723
  var seed=1;
24695
24724
  var close=this.Data[index].Close;
24696
24725
  result[index]=HistoryData.Copy(this.Data[index]);
24726
+ result[index].RightSeed=seed;
24697
24727
 
24698
24728
  for(++index;index<this.Data.length;++index)
24699
24729
  {
@@ -35023,6 +35053,86 @@ function ChartOverlayLine()
35023
35053
  }
35024
35054
  }
35025
35055
 
35056
+ //独立线段
35057
+ function ChartSingleLine()
35058
+ {
35059
+ this.newMethod=ChartLine; //派生
35060
+ this.newMethod();
35061
+ delete this.newMethod;
35062
+
35063
+ this.ClassName='ChartSingleLine'; //类名
35064
+ this.MaxMin=null; //当前的显示范围
35065
+
35066
+ this.Draw=function()
35067
+ {
35068
+ this.MaxMin=null;
35069
+ if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
35070
+ if (this.IsShowIndexTitleOnly()) return;
35071
+ if (this.IsHideScriptIndex()) return;
35072
+
35073
+ if (!this.Data || !this.Data.Data) return;
35074
+
35075
+ this.MaxMin=this.GetCurrentMaxMin();
35076
+ if (!this.MaxMin) return;
35077
+ if (!IFrameSplitOperator.IsNumber(this.MaxMin.Max) || !IFrameSplitOperator.IsNumber(this.MaxMin.Min)) return;
35078
+
35079
+ switch(this.DrawType)
35080
+ {
35081
+
35082
+ default:
35083
+ return this.DrawStraightLine();
35084
+ }
35085
+ }
35086
+
35087
+ //获取当前页的最大最小值
35088
+ this.GetCurrentMaxMin=function()
35089
+ {
35090
+ var xPointCount=this.ChartFrame.XPointCount;
35091
+ var range={ Max:null, Min:null };
35092
+
35093
+ for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j)
35094
+ {
35095
+ var value=this.Data.Data[i];
35096
+ if (!IFrameSplitOperator.IsNumber(value)) continue;
35097
+
35098
+ if (range.Max==null) range.Max=value;
35099
+ if (range.Min==null) range.Min=value;
35100
+
35101
+ if (range.Max<value) range.Max=value;
35102
+ if (range.Min>value) range.Min=value;
35103
+ }
35104
+
35105
+ return range;
35106
+ }
35107
+
35108
+ this.GetMaxMin=function()
35109
+ {
35110
+ return { Max:null, Min:null };
35111
+ }
35112
+
35113
+ this.GetYFromData=function(value)
35114
+ {
35115
+ var bHScreen = (this.ChartFrame.IsHScreen === true);
35116
+
35117
+ if (bHScreen)
35118
+ {
35119
+ if (value <= this.MaxMin.Min) return this.ChartBorder.GetLeftEx();
35120
+ if (value >= this.MaxMin.Max) return this.ChartBorder.GetRightEx();
35121
+
35122
+ var width = this.ChartBorder.GetWidthEx() * (value - this.MaxMin.Min) / (this.MaxMin.Max - this.MaxMin.Min);
35123
+ return this.ChartBorder.GetLeftEx() + width;
35124
+ }
35125
+ else
35126
+ {
35127
+ if(value<=this.MaxMin.Min) return this.ChartBorder.GetBottomEx();
35128
+ if(value>=this.MaxMin.Max) return this.ChartBorder.GetTopEx();
35129
+
35130
+ var height=this.ChartBorder.GetHeightEx()*(value-this.MaxMin.Min)/(this.MaxMin.Max-this.MaxMin.Min);
35131
+ return this.ChartBorder.GetBottomEx()-height;
35132
+ }
35133
+ }
35134
+ }
35135
+
35026
35136
  //彩色线段
35027
35137
  function ChartPartLine()
35028
35138
  {
@@ -35793,6 +35903,8 @@ function ChartVolStick()
35793
35903
 
35794
35904
  var yBottom=this.ChartFrame.GetYFromData(0);
35795
35905
 
35906
+ this.Canvas.save();
35907
+
35796
35908
  if (dataWidth>=4 && !(this.BarWidth===1))
35797
35909
  {
35798
35910
  yBottom=ToFixedRect(yBottom);
@@ -35834,6 +35946,7 @@ function ChartVolStick()
35834
35946
  {
35835
35947
  var preKItem=null;
35836
35948
  var barColor=null;
35949
+ this.Canvas.linewidth=1*GetDevicePixelRatio();
35837
35950
  for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth))
35838
35951
  {
35839
35952
  var value=this.Data.Data[i];
@@ -35868,6 +35981,8 @@ function ChartVolStick()
35868
35981
  preKItem=kItem;
35869
35982
  }
35870
35983
  }
35984
+
35985
+ this.Canvas.restore();
35871
35986
  }
35872
35987
 
35873
35988
  this.HScreenDraw=function() //横屏画法
@@ -37943,8 +38058,8 @@ function ChartMinutePriceLine()
37943
38058
  if (isHScreen===true) chartright=this.ChartBorder.GetBottom();
37944
38059
  var xPointCount=this.ChartFrame.XPointCount;
37945
38060
  var minuteCount=this.ChartFrame.MinuteCount;
37946
- var bottom=this.ChartBorder.GetBottomEx();
37947
- var left=this.ChartBorder.GetLeftEx();
38061
+ var bottom=this.ChartBorder.GetBottom();
38062
+ var left=this.ChartBorder.GetLeft();
37948
38063
  var data=this.Data;
37949
38064
 
37950
38065
  this.DrawBeforeOpen(); //盘前
@@ -113838,6 +113953,7 @@ function JSExecute(ast,option)
113838
113953
  let isExData=false;
113839
113954
  let isDotLine=false;
113840
113955
  let isOverlayLine=false; //叠加线
113956
+ let isSingleLine=false; //独立线段
113841
113957
  var isNoneName=false;
113842
113958
  var isShowTitle=true;
113843
113959
  //显示在位置之上,对于DRAWTEXT和DRAWNUMBER等函数有用,放在语句的最后面(不能与LINETHICK等函数共用),比如:
@@ -113894,9 +114010,11 @@ function JSExecute(ast,option)
113894
114010
  else if (value==="DRAWCENTER") isDrawCenter=true;
113895
114011
  else if (value=="DRAWBELOW") isDrawBelow=true;
113896
114012
  else if (value=="STEPLINE") stepLine=true;
114013
+ else if (value=="SINGLELINE") isSingleLine=true;
113897
114014
  else if (value.indexOf('COLOR')==0) color=value;
113898
114015
  else if (value.indexOf("RGBX")==0 && value.length==10) color=value; //RGBX+“RRGGBB”
113899
114016
  else if (value.indexOf('LINETHICK')==0) lineWidth=value;
114017
+
113900
114018
 
113901
114019
  else if (value=="ALIGN0") drawAlign=0;
113902
114020
  else if (value=="ALIGN1") drawAlign=1;
@@ -114145,6 +114263,7 @@ function JSExecute(ast,option)
114145
114263
  if (isExData==true) value.IsExData = true;
114146
114264
  if (isDotLine==true) value.IsDotLine=true;
114147
114265
  if (isOverlayLine==true) value.IsOverlayLine=true;
114266
+ if (isSingleLine==true) value.IsSingleLine=true;
114148
114267
  if (isNoneName==true) value.NoneName=true;
114149
114268
  if (isShowTitle==false) value.IsShowTitle=false;
114150
114269
  if (stepLine==true) value.Type=7;
@@ -114180,6 +114299,7 @@ function JSExecute(ast,option)
114180
114299
  if (isExData==true) value.IsExData = true;
114181
114300
  if (isDotLine==true) value.IsDotLine=true;
114182
114301
  if (isOverlayLine==true) value.IsOverlayLine=true;
114302
+ if (isSingleLine==true) value.IsSingleLine=true;
114183
114303
  if (isShowTitle==false) value.IsShowTitle=false;
114184
114304
  if (stepLine==true) value.Type=7;
114185
114305
  this.OutVarTable.push(value);
@@ -117007,6 +117127,54 @@ function ScriptIndex(name,script,args,option)
117007
117127
  hqChart.ChartPaint.push(line);
117008
117128
  }
117009
117129
 
117130
+ this.CreateSingleLine=function(hqChart,windowIndex,varItem,id,lineType)
117131
+ {
117132
+ var line=new ChartSingleLine();
117133
+ line.Canvas=hqChart.Canvas;
117134
+ line.DrawType=1;
117135
+ line.Name=varItem.Name;
117136
+ line.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
117137
+ line.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
117138
+ line.Identify=this.Guid;
117139
+ if (varItem.Color) line.Color=this.GetColor(varItem.Color);
117140
+ else line.Color=this.GetDefaultColor(id);
117141
+
117142
+ if (varItem.LineWidth)
117143
+ {
117144
+ let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
117145
+ if (!isNaN(width) && width>0) line.LineWidth=width;
117146
+ }
117147
+
117148
+ if (varItem.IsDotLine) line.IsDotLine=true; //虚线
117149
+ if (varItem.IsShow==false) line.IsShow=false;
117150
+
117151
+ let titleIndex=windowIndex+1;
117152
+ line.Data.Data=varItem.Data;
117153
+
117154
+ this.ReloadChartResource(hqChart,windowIndex,line);
117155
+
117156
+ if (varItem.IsShowTitle===false) //NOTEXT 不绘制标题
117157
+ {
117158
+
117159
+ }
117160
+ else if (IFrameSplitOperator.IsString(varItem.Name) && varItem.Name.indexOf("NOTEXT")==0) //标题中包含NOTEXT不绘制标题
117161
+ {
117162
+
117163
+ }
117164
+ else
117165
+ {
117166
+ if (varItem.NoneName)
117167
+ hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(line.Data,null,line.Color);
117168
+ else
117169
+ hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(line.Data,varItem.Name,line.Color);
117170
+
117171
+ this.SetTitleData(hqChart.TitlePaint[titleIndex].Data[id],line);
117172
+ }
117173
+
117174
+ this.SetChartIndexName(line);
117175
+ hqChart.ChartPaint.push(line);
117176
+ }
117177
+
117010
117178
  //创建柱子
117011
117179
  this.CreateBar=function(hqChart,windowIndex,varItem,id)
117012
117180
  {
@@ -118311,6 +118479,7 @@ function ScriptIndex(name,script,args,option)
118311
118479
  if (item.Type==0)
118312
118480
  {
118313
118481
  if (item.IsOverlayLine) this.CreateOverlayLine(hqChart,windowIndex,item,i,item.Type);
118482
+ else if (item.IsSingleLine) this.CreateSingleLine(hqChart,windowIndex,item,i,item.Type);
118314
118483
  else this.CreateLine(hqChart,windowIndex,item,i,item.Type);
118315
118484
  }
118316
118485
  else if (item.Type==1)
@@ -134033,7 +134202,7 @@ function ScrollBarBGChart()
134033
134202
 
134034
134203
 
134035
134204
 
134036
- var HQCHART_VERSION="1.1.13408";
134205
+ var HQCHART_VERSION="1.1.13440";
134037
134206
 
134038
134207
  function PrintHQChartVersion()
134039
134208
  {
@@ -134138,6 +134307,13 @@ export default {
134138
134307
 
134139
134308
  CoordinateInfo:CoordinateInfo,
134140
134309
 
134310
+ //图形基类导出
134311
+ IChartPainting:IChartPainting, //图形
134312
+ IExtendChartPainting:IExtendChartPainting, //扩展图形
134313
+ IChartTitlePainting:IChartTitlePainting, //标题类
134314
+ IChartDrawPicture:IChartDrawPicture, //画图工具
134315
+ DynamicTitleData:DynamicTitleData, //指标标题数据
134316
+
134141
134317
  //成交明细
134142
134318
  JSDealChart:JSDealChart,
134143
134319
  DEAL_COLUMN_ID:DEAL_COLUMN_ID,
@@ -134146,9 +134322,9 @@ export default {
134146
134322
  JSReportChart:JSReportChart,
134147
134323
  REPORT_COLUMN_ID:REPORT_COLUMN_ID,
134148
134324
 
134149
- //键盘精灵
134150
- JSKeyboardChart:JSKeyboardChart,
134151
- KEYBOARD_COLUMN_ID:KEYBOARD_COLUMN_ID,
134325
+ //键盘精灵
134326
+ JSKeyboardChart:JSKeyboardChart,
134327
+ KEYBOARD_COLUMN_ID:KEYBOARD_COLUMN_ID,
134152
134328
 
134153
134329
  //X轴滚动条
134154
134330
  JSScrollBarChart:JSScrollBarChart,
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.13408";
8
+ var HQCHART_VERSION="1.1.13440";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -48730,6 +48730,15 @@ HQData.NetworkFilter=function(data, callback)
48730
48730
  HQData.RequestLatestData(data,callback);
48731
48731
  break;
48732
48732
 
48733
+
48734
+ case "KLineChartContainer::RequestOverlayHistoryData": //叠加股票
48735
+ HQData.RequestOverlayHistoryData(data, callback);
48736
+ break;
48737
+
48738
+ case "KLineChartContainer::RequestOverlayHistoryMinuteData":
48739
+ HQData.RequestOverlayHistoryMinuteData(data, callback);
48740
+ break;
48741
+
48733
48742
 
48734
48743
 
48735
48744
 
@@ -49052,6 +49061,31 @@ HQData.RequestLatestData=function(data,callback)
49052
49061
  callback(hqchartData);
49053
49062
  }
49054
49063
 
49064
+ HQData.RequestOverlayHistoryData=function(data, callback)
49065
+ {
49066
+ data.PreventDefault=true;
49067
+ var symbol=data.Request.Data.symbol;
49068
+ var hqchartData={ symbol: symbol,name: symbol };
49069
+ if (symbol=="399001.sz")
49070
+ hqchartData.data=KLINE_DAY_OVERLAY_DATA2.data
49071
+ else
49072
+ hqchartData.data=KLINE_DAY_OVERLAY_DATA.data
49073
+
49074
+ callback(hqchartData);
49075
+ }
49076
+
49077
+ HQData.RequestOverlayHistoryMinuteData=function(data, callback)
49078
+ {
49079
+ data.PreventDefault=true;
49080
+ var symbol=data.Request.Data.symbol;
49081
+ var hqchartData={ symbol: symbol,name: symbol };
49082
+ hqchartData.data=KLINE_MINUTE_DATA2.data;
49083
+
49084
+ callback(hqchartData);
49085
+ }
49086
+
49087
+
49088
+
49055
49089
 
49056
49090
  /*暴露外部用的方法*/
49057
49091
  export default