hqchart 1.1.15138 → 1.1.15152

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.
@@ -6571,6 +6571,13 @@ JSChart.SetStyle=function(option)
6571
6571
  if (option) g_JSChartResource.SetStyle(option);
6572
6572
  }
6573
6573
 
6574
+
6575
+ //CSS风格
6576
+ JSChart.SetCSSStyle=function(styleID)
6577
+ {
6578
+ document.documentElement.setAttribute('hqchart_style', styleID);
6579
+ }
6580
+
6574
6581
  //value { EN:'', CH:'' }
6575
6582
  JSChart.SetTextResource=function(key,value)
6576
6583
  {
@@ -6996,6 +7003,8 @@ var JSCHART_EVENT_ID=
6996
7003
  ON_FORMAT_COUNTDOWN_TEXT:177, //倒计时
6997
7004
  ON_CLICK_INDEX_LOCK:178, //点击指标锁
6998
7005
  ON_CORSSCURSOR_STATUS_CHANGE:179, //十字光标状态改变
7006
+
7007
+ ON_FORMAT_DRAW_HLINE_LABEL:180, //画图工具-水平线(ChartDrawPictureHorizontalLine)格式化标签文字
6999
7008
  }
7000
7009
 
7001
7010
  var JSCHART_OPERATOR_ID=
@@ -10535,6 +10544,11 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10535
10544
  chartItem.Canvas=canvas; //叠加图形
10536
10545
  }
10537
10546
  }
10547
+
10548
+ if (item.Frame.LockPaint)
10549
+ {
10550
+ item.Frame.LockPaint.Canvas=canvas;
10551
+ }
10538
10552
  }
10539
10553
  }
10540
10554
 
@@ -68660,7 +68674,7 @@ function IChartDrawPicture()
68660
68674
  this.PointType=g_JSChartResource.DrawPicture.PointType; // 0=圆点 1=方框 2= 空心圆
68661
68675
  this.IsShowPoint=g_JSChartResource.DrawPicture.IsShowPoint; //是否始终显示点
68662
68676
  this.LimitFrameID; //限制在指定窗口绘图
68663
-
68677
+ this.CacheData; //数据缓存
68664
68678
 
68665
68679
  //接口函数
68666
68680
  this.SetLastPoint=null; //this.SetLastPoint=function(obj) obj={X:,Y:}
@@ -71012,9 +71026,9 @@ function ChartDrawPictureHorizontalLine()
71012
71026
 
71013
71027
  this.LabelConfig=
71014
71028
  {
71015
- Left:{ IsShow:true, Margin:{ Left:5, Top:4, Bottom:2, Right:5 } },
71016
- Right:{ IsShow:true, Margin:{ Left:5, Top:4, Bottom:2, Right:5 } },
71017
- Font:`${12*GetDevicePixelRatio()}px 微软雅黑`, TextColor:"rgb(255,255,255)", BGColor:null
71029
+ Left:{ IsShow:true, Margin:{ Left:5, Top:4, Bottom:2, Right:5 }, LineOffset:null, Text:null },
71030
+ Right:{ IsShow:true, Margin:{ Left:5, Top:4, Bottom:2, Right:5 }, LineOffset:null, Text:null },
71031
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`, TextColor:"rgb(255,255,255)", BGColor:null,
71018
71032
  };
71019
71033
 
71020
71034
  this.InsideLabelConfig=
@@ -71113,6 +71127,9 @@ function ChartDrawPictureHorizontalLine()
71113
71127
  left=this.Frame.ChartBorder.GetTop();
71114
71128
  right=this.Frame.ChartBorder.GetBottom();
71115
71129
  }
71130
+
71131
+
71132
+
71116
71133
  this.ClipFrame();
71117
71134
 
71118
71135
  this.Canvas.strokeStyle=this.LineColor;
@@ -71152,6 +71169,8 @@ function ChartDrawPictureHorizontalLine()
71152
71169
  //画点
71153
71170
  this.DrawPoint(drawPoint);
71154
71171
 
71172
+ this.FormatLabelTextEvent(drawPoint);
71173
+
71155
71174
  //显示价格
71156
71175
  this.DrawInsideLabel(drawPoint[0])
71157
71176
 
@@ -71159,6 +71178,16 @@ function ChartDrawPictureHorizontalLine()
71159
71178
 
71160
71179
  this.DrawValueLabel(drawPoint[0]);
71161
71180
  }
71181
+
71182
+ this.FormatLabelTextEvent=function(point)
71183
+ {
71184
+ if (!this.HQChart) return;
71185
+ var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_DRAW_HLINE_LABEL);
71186
+ if (!event || !event.Callback) return;
71187
+
71188
+ var sendData={ ID:this.Guid, LabelConfig:this.LabelConfig, InsideLabelConfig:this.InsideLabelConfig };
71189
+ event.Callback(event, sendData, this);
71190
+ }
71162
71191
 
71163
71192
  this.DrawValueLabel=function(point)
71164
71193
  {
@@ -71166,6 +71195,8 @@ function ChartDrawPictureHorizontalLine()
71166
71195
  if (this.Frame.IsHScreen) return; //不支持横屏
71167
71196
 
71168
71197
  var y=point.Y;
71198
+ var yFixed=ToFixedPoint2(this.LineWidth,y);
71199
+
71169
71200
  var yValue=this.Frame.GetYData(y);
71170
71201
  var text=yValue.toFixed(2);
71171
71202
 
@@ -71174,12 +71205,27 @@ function ChartDrawPictureHorizontalLine()
71174
71205
 
71175
71206
  this.Canvas.font=config.Font;
71176
71207
  var textHeight=this.Canvas.measureText("擎").width;
71177
- var textWidth=this.Canvas.measureText(text).width;
71178
71208
 
71179
71209
  if (config.Left.IsShow && this.Frame.ChartBorder.Left>5)
71180
71210
  {
71211
+ var leftText=text;
71212
+ if (config.Left.Text) leftText=config.Left.Text;
71213
+ var textWidth=this.Canvas.measureText(leftText).width;
71214
+ var left=border.Left;
71215
+ if (IFrameSplitOperator.IsNumber(config.Left.LineOffset)&& config.Left.LineOffset!==0)
71216
+ {
71217
+ left-=config.Left.LineOffset;
71218
+ this.Canvas.strokeStyle=this.LineColor;
71219
+ this.SetLineWidth();
71220
+ this.Canvas.beginPath();
71221
+ this.Canvas.moveTo(border.Left,yFixed);
71222
+ this.Canvas.lineTo(left,yFixed);
71223
+ this.Canvas.stroke();
71224
+ this.RestoreLineWidth();
71225
+ }
71226
+
71181
71227
  var margin=config.Left.Margin;
71182
- var rtBG={ Right:border.Left-1, Height:textHeight+margin.Top+margin.Bottom, Width:textWidth+margin.Left+margin.Right };
71228
+ var rtBG={ Right:left+1, Height:textHeight+margin.Top+margin.Bottom, Width:textWidth+margin.Left+margin.Right };
71183
71229
  rtBG.Top=y-textHeight/2-margin.Top;
71184
71230
  rtBG.Bottom=rtBG.Top+rtBG.Height;
71185
71231
  rtBG.Left=rtBG.Right-rtBG.Width;
@@ -71193,13 +71239,30 @@ function ChartDrawPictureHorizontalLine()
71193
71239
  var xText=rtBG.Left+margin.Left;
71194
71240
  var yText=rtBG.Top+margin.Top;
71195
71241
  this.Canvas.fillStyle=config.TextColor;
71196
- this.Canvas.fillText(text,xText,yText);
71242
+ this.Canvas.fillText(leftText,xText,yText);
71197
71243
  }
71198
71244
 
71199
71245
  if (config.Right.IsShow && this.Frame.ChartBorder.Right>5)
71200
71246
  {
71247
+ var rightText=text;
71248
+ if (config.Right.Text) rightText=config.Right.Text;
71249
+ var textWidth=this.Canvas.measureText(rightText).width;
71250
+
71251
+ var left=border.Right;
71252
+ if (IFrameSplitOperator.IsNumber(config.Right.LineOffset)&& config.Right.LineOffset!==0)
71253
+ {
71254
+ left+=config.Right.LineOffset;
71255
+ this.Canvas.strokeStyle=this.LineColor;
71256
+ this.SetLineWidth();
71257
+ this.Canvas.beginPath();
71258
+ this.Canvas.moveTo(border.Right,yFixed);
71259
+ this.Canvas.lineTo(left,yFixed);
71260
+ this.Canvas.stroke();
71261
+ this.RestoreLineWidth();
71262
+ }
71263
+
71201
71264
  var margin=config.Right.Margin;
71202
- var rtBG={ Left:border.Right+1, Height:textHeight+margin.Top+margin.Bottom, Width:textWidth+margin.Left+margin.Right };
71265
+ var rtBG={ Left:left-1, Height:textHeight+margin.Top+margin.Bottom, Width:textWidth+margin.Left+margin.Right };
71203
71266
  rtBG.Top=y-textHeight/2-margin.Top;
71204
71267
  rtBG.Bottom=rtBG.Top+rtBG.Height;
71205
71268
  rtBG.Right=rtBG.Left+rtBG.Width;
@@ -71213,7 +71276,7 @@ function ChartDrawPictureHorizontalLine()
71213
71276
  var xText=rtBG.Left+margin.Left;
71214
71277
  var yText=rtBG.Top+margin.Top;
71215
71278
  this.Canvas.fillStyle=config.TextColor;
71216
- this.Canvas.fillText(text,xText,yText);
71279
+ this.Canvas.fillText(rightText,xText,yText);
71217
71280
  }
71218
71281
  }
71219
71282
 
@@ -82003,30 +82066,6 @@ function JSChartResource()
82003
82066
  }
82004
82067
  };
82005
82068
 
82006
- //指标搜索
82007
- this.DialogSearchIndex=
82008
- {
82009
- BGColor:'rgb(250,250,250)', //背景色
82010
- BorderColor:'rgb(20,20,20)', //边框颜色
82011
- TitleColor:'rgb(250,250,250)', //标题颜色
82012
- TitleBGColor:"rgb(200, 66, 69)", //标题背景颜色
82013
-
82014
- IndexNameColor:"rgb(0,0,0)", //数值名称
82015
- GroupNameColor:"rgb(0,0,0)",
82016
- InputTextColor:"rgb(0,0,0)"
82017
- };
82018
-
82019
- this.DialogModifyIndexParam=
82020
- {
82021
- BGColor:'rgb(250,250,250)', //背景色
82022
- BorderColor:'rgb(20,20,20)', //边框颜色
82023
- TitleColor:'rgb(250,250,250)', //标题颜色
82024
- TitleBGColor:"rgb(200, 66, 69)", //标题背景颜色
82025
-
82026
- ParamNameColor:"rgb(0,0,0)", //数值名称
82027
- InputTextColor:"rgb(0,0,0)"
82028
- };
82029
-
82030
82069
  //弹幕
82031
82070
  this.Barrage= {
82032
82071
  Font:16*GetDevicePixelRatio() +'px 微软雅黑', //字体
@@ -83251,20 +83290,6 @@ function JSChartResource()
83251
83290
  }
83252
83291
  }
83253
83292
 
83254
- if (style.DialogSearchIndex)
83255
- {
83256
- var item=style.DialogSearchIndex;
83257
-
83258
- if (item.BGColor) this.DialogSearchIndex.BGColor=item.BGColor;
83259
- if (item.BorderColor) this.DialogSearchIndex.BorderColor=item.BorderColor;
83260
- if (item.TitleColor) this.DialogSearchIndex.TitleColor=item.TitleColor;
83261
- if (item.TitleBGColor) this.DialogSearchIndex.TitleBGColor=item.TitleBGColor;
83262
-
83263
- if (item.IndexNameColor) this.DialogSearchIndex.IndexNameColor=item.IndexNameColor;
83264
- if (item.GroupNameColor) this.DialogSearchIndex.GroupNameColor=item.GroupNameColor;
83265
- if (item.InputTextColor) this.DialogSearchIndex.InputTextColor=item.InputTextColor;
83266
- }
83267
-
83268
83293
  if (style.MinuteInfo)
83269
83294
  {
83270
83295
  var item=style.MinuteInfo;
@@ -91575,7 +91600,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
91575
91600
  if (item)
91576
91601
  {
91577
91602
  drawPicture=item.Create();
91578
- drawPicture.HQChart=this;
91579
91603
  }
91580
91604
 
91581
91605
  if (!drawPicture) //iconfont图标
@@ -91598,6 +91622,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
91598
91622
  drawPicture.Period=this.Period;
91599
91623
  drawPicture.Right=this.Right;
91600
91624
  drawPicture.Option=this.ChartDrawOption;
91625
+ drawPicture.HQChart=this;
91601
91626
 
91602
91627
  if (callback) drawPicture.FinishedCallback=callback; //完成通知上层回调
91603
91628
  if (option) drawPicture.SetOption(option);
@@ -91628,8 +91653,10 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
91628
91653
  drawPicture.Period=this.Period;
91629
91654
  drawPicture.Right=this.Right;
91630
91655
  drawPicture.Option=this.ChartDrawOption;
91656
+ drawPicture.HQChart=this;
91631
91657
  if (obj.Value) drawPicture.Value=obj.Value;
91632
91658
  if (obj.Guid) drawPicture.Guid=obj.Guid;
91659
+ if (obj.CacheData) drawPicture.CacheData=obj.CacheData; //缓存数据
91633
91660
 
91634
91661
  if (drawPicture.ImportStorageData) drawPicture.ImportStorageData(obj);
91635
91662
  drawPicture.SetOption(obj);
@@ -92245,6 +92272,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
92245
92272
  drawPicture.Status=10;
92246
92273
  drawPicture.Frame=this.Frame.SubFrame[item.FrameID].Frame; //绑定框架坐标
92247
92274
  drawPicture.Option=this.ChartDrawOption;
92275
+ drawPicture.HQChart=this;
92248
92276
 
92249
92277
  if (drawPicture.ImportStorageData) drawPicture.ImportStorageData(item);
92250
92278
  if (drawPicture.Period!=this.Period)
@@ -100007,6 +100035,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
100007
100035
  drawPicture.Symbol=this.Symbol;
100008
100036
  drawPicture.Period=888888888;
100009
100037
  drawPicture.Option=this.ChartDrawOption;
100038
+ drawPicture.HQChart=this;
100010
100039
 
100011
100040
  if (callback) drawPicture.FinishedCallback=callback; //完成通知上层回调
100012
100041
  if (option) drawPicture.SetOption(option);
@@ -100037,8 +100066,10 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
100037
100066
  drawPicture.Frame=this.Frame.SubFrame[obj.FrameID].Frame; //绑定框架坐标
100038
100067
  drawPicture.Symbol=this.Symbol;
100039
100068
  drawPicture.Period=888888888;
100069
+ drawPicture.HQChart=this;
100040
100070
  if (obj.Value) drawPicture.Value=obj.Value;
100041
100071
  if (obj.Guid) drawPicture.Guid=obj.Guid;
100072
+ if (obj.CacheData) drawPicture.CacheData=obj.CacheData; //缓存数据
100042
100073
 
100043
100074
  if (drawPicture.ImportStorageData) drawPicture.ImportStorageData(obj);
100044
100075
  drawPicture.SetOption(obj);
@@ -100084,6 +100115,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
100084
100115
 
100085
100116
  drawPicture.Canvas=this.Canvas;
100086
100117
  drawPicture.Status=10;
100118
+ drawPicture.HQChart=this;
100087
100119
  drawPicture.Frame=this.Frame.SubFrame[item.FrameID].Frame; //绑定框架坐标
100088
100120
  if (drawPicture.ImportStorageData) drawPicture.ImportStorageData(item);
100089
100121
  drawPicture.ResetXValue();
@@ -137131,17 +137163,6 @@ function GetBlackStyle()
137131
137163
  PositionColor:"rgb(255,0,255)" //持仓
137132
137164
  },
137133
137165
 
137134
- DialogSearchIndex:
137135
- {
137136
- BGColor:'rgb(20,20,20)', //背景色
137137
- BorderColor:'rgb(170,170,170)', //边框颜色
137138
- TitleColor:'rgb(230,230,230)', //标题颜色
137139
-
137140
- IndexNameColor:"rgb(210,210,210)",
137141
- GroupNameColor:"rgb(210,210,210)",
137142
- InputTextColor:"rgb(210,210,210)",
137143
- },
137144
-
137145
137166
  DialogPopKeyboard:
137146
137167
  {
137147
137168
  BGColor:'rgb(20,20,20)', //背景色
@@ -153775,7 +153796,7 @@ function ScrollBarBGChart()
153775
153796
 
153776
153797
 
153777
153798
 
153778
- var HQCHART_VERSION="1.1.15137";
153799
+ var HQCHART_VERSION="1.1.15151";
153779
153800
 
153780
153801
  function PrintHQChartVersion()
153781
153802
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.15137";
8
+ var HQCHART_VERSION="1.1.15151";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {