hqchart 1.1.14274 → 1.1.14280

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.
@@ -57368,6 +57368,8 @@ HQData.Report_APIIndex=function(data, callback)
57368
57368
  HQData.APIIndex_MULTI_LINE(data, callback);
57369
57369
  else if (request.Data.indexname=="API-MULTI_SVGICON")
57370
57370
  HQData.APIIndex_MULTI_SVGICON(data, callback);
57371
+ else if (request.Data.indexname=="API-DRAWTEXT_LINE")
57372
+ HQData.APIIndex_DRAWTEXT_LINE(data, callback);
57371
57373
  }
57372
57374
 
57373
57375
 
@@ -57754,3 +57756,40 @@ HQData.APIIndex_MULTI_SVGICON=function(data, callback)
57754
57756
  }
57755
57757
 
57756
57758
 
57759
+ HQData.APIIndex_DRAWTEXT_LINE=function(data, callback)
57760
+ {
57761
+ data.PreventDefault=true;
57762
+ var hqchart=data.HQChart;
57763
+ var kData=hqchart.GetKData();
57764
+
57765
+ var lastItem=kData.Data[kData.Data.length-1];
57766
+ var price=(lastItem.High+lastItem.Low)/2;
57767
+
57768
+ var lineData=
57769
+ {
57770
+ name:'DRAWTEXT_LINE', type:1,
57771
+ Draw:
57772
+ {
57773
+ DrawType:'DRAWTEXT_LINE',
57774
+ DrawData:
57775
+ {
57776
+ Price:price,
57777
+ Text:{ Title:`价格:${price.toFixed(2)}`, Color:"rgb(255, 165, 0)" },
57778
+ Line:{ Type:1, Color:"rgb(200,200,0)" }, //Type 0=不画 1=直线 2=虚线
57779
+ }
57780
+ }
57781
+ };
57782
+
57783
+ var apiData=
57784
+ {
57785
+ code:0,
57786
+ stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
57787
+ outdata: { date:kData.GetDate() , outvar:[lineData] }
57788
+ };
57789
+
57790
+
57791
+ console.log('[HQData.APIIndex_DRAWTEXT_LINE] apiData ', apiData);
57792
+ callback(apiData);
57793
+ }
57794
+
57795
+
@@ -24775,6 +24775,19 @@ function APIScriptIndex(name,script,args,option, isOverlay)
24775
24775
 
24776
24776
  result.push(outVarItem);
24777
24777
  }
24778
+ else if (draw.DrawType=="DRAWTEXT_LINE")
24779
+ {
24780
+ drawItem.Name=draw.Name;
24781
+ drawItem.Type=draw.Type;
24782
+
24783
+ drawItem.DrawType=draw.DrawType;
24784
+ drawItem.DrawData=draw.DrawData; //{ Price:, Text:{ Title:text, Color:textcolor }, Line:{ Type:linetype, Color:linecolor } };
24785
+
24786
+ outVarItem.Draw=drawItem;
24787
+ if (draw.Font) outVarItem.Font=draw.Font;
24788
+
24789
+ result.push(outVarItem);
24790
+ }
24778
24791
  else
24779
24792
  {
24780
24793
  var find=g_ScriptIndexChartFactory.Get(draw.DrawType); //外部挂接
@@ -70633,9 +70633,9 @@ function JSChartResource()
70633
70633
  SortIcon:
70634
70634
  {
70635
70635
  Size:12, Family:"iconfont",
70636
- Arrow:[null, "\ue6b2", "\ue6b1"], //[0]=默认排序的图标背景色
70637
- Color:[null, "rgb(255,0,0)", "rgb(255,0,0)"],
70638
- Margin:{ Left:0, Bottom:2, Right:0,}
70636
+ Arrow:["\ue704", "\ue81b", "\uf0c9"], //[0]=默认排序的图标背景色
70637
+ Color:['rgb(169,169,169)', "rgb(51,51,51)", "rgb(51,51,51)"],
70638
+ Margin:{ Left:1*GetDevicePixelRatio(), Bottom:2, Right:0,}
70639
70639
  },
70640
70640
 
70641
70641
  Item:
@@ -71897,6 +71897,23 @@ function JSChartResource()
71897
71897
  }
71898
71898
  }
71899
71899
 
71900
+ if (item.SortIcon)
71901
+ {
71902
+ var sort=item.SortIcon;
71903
+ if (IFrameSplitOperator.IsNonEmptyArray(sort.Color)) this.Report.SortIcon.Color=sort.Color.slice();
71904
+ if (IFrameSplitOperator.IsNumber(sort.Size)) this.Report.SortIcon.Size=sort.Size;
71905
+ if (sort.Family) this.Report.SortIcon.Family=sort.Family;
71906
+ if (IFrameSplitOperator.IsNonEmptyArray(sort.Arrow)) this.Report.SortIcon.Arrow=sort.Arrow.slice();
71907
+ if (sort.Margin)
71908
+ {
71909
+ var margin=sort.Margin;
71910
+ if (IFrameSplitOperator.IsNumber(margin.Left)) this.Report.SortIcon.Margin.Left=margin.Left;
71911
+ if (IFrameSplitOperator.IsNumber(margin.Right)) this.Report.SortIcon.Margin.Right=margin.Right;
71912
+ if (IFrameSplitOperator.IsNumber(margin.Top)) this.Report.SortIcon.Margin.Top=margin.Top;
71913
+ if (IFrameSplitOperator.IsNumber(margin.Bottom)) this.Report.SortIcon.Margin.Bottom=margin.Bottom;
71914
+ }
71915
+ }
71916
+
71900
71917
  if (item.Item)
71901
71918
  {
71902
71919
  var row=item.Item;
@@ -4383,6 +4383,8 @@ var REPORT_COLUMN_ID=
4383
4383
  CUSTOM_PROGRESS_ID:106, //进度条
4384
4384
  CUSTOM_LINK_ID:107, //链接
4385
4385
 
4386
+ MULTI_LINE_CONTAINER:108, //多行组合输出
4387
+
4386
4388
 
4387
4389
  //预留数值类型 10个
4388
4390
  RESERVE_NUMBER1_ID:201, //ReserveNumber1:
@@ -4944,6 +4946,10 @@ function ChartReport()
4944
4946
  {
4945
4947
  if (IFrameSplitOperator.IsNumber(item.FormatType)) colItem.FormatType=item.FormatType;
4946
4948
  }
4949
+ else if (item.Type==REPORT_COLUMN_ID.MULTI_LINE_CONTAINER)
4950
+ {
4951
+ if (IFrameSplitOperator.IsNonEmptyArray(item.AryField)) colItem.AryField=item.AryField.slice();
4952
+ }
4947
4953
 
4948
4954
  return colItem;
4949
4955
  }
@@ -5096,6 +5102,12 @@ function ChartReport()
5096
5102
  { Type:REPORT_COLUMN_ID.RISING_SPEED_10M_ID, Title:"10分涨速%", TextAlign:"right", Width:null, MaxText:"-888.88" },
5097
5103
  { Type:REPORT_COLUMN_ID.RISING_SPEED_15M_ID, Title:"15分涨速%", TextAlign:"right", Width:null, MaxText:"-888.88" },
5098
5104
 
5105
+ //组合多行字段
5106
+ {
5107
+ Type:REPORT_COLUMN_ID.MULTI_LINE_CONTAINER, Title:"涨幅",TextAlign:"right", MaxText:"1000.00%",
5108
+ AryField:[ { Type:REPORT_COLUMN_ID.PRICE_ID},{ Type:REPORT_COLUMN_ID.INCREASE_ID, DynamicFormat:"{Value}%"} ]
5109
+ },
5110
+
5099
5111
  { Type:REPORT_COLUMN_ID.RESERVE_NUMBER1_ID, Title:"数值1", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
5100
5112
  { Type:REPORT_COLUMN_ID.RESERVE_NUMBER2_ID, Title:"数值2", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
5101
5113
  { Type:REPORT_COLUMN_ID.RESERVE_NUMBER3_ID, Title:"数值3", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
@@ -5307,6 +5319,17 @@ function ChartReport()
5307
5319
  if (rowHeight>this.RowHeight) this.RowHeight=rowHeight;
5308
5320
  if (rowHeight>this.FixedRowHeight) this.FixedRowHeight=rowHeight;
5309
5321
  }
5322
+ else if (item.Type==REPORT_COLUMN_ID.MULTI_LINE_CONTAINER)
5323
+ {
5324
+ if (IFrameSplitOperator.IsNumber(item.FixedWidth)) itemWidth=item.FixedWidth;
5325
+ else itemWidth=this.Canvas.measureText(item.MaxText).width;
5326
+
5327
+ item.Width=itemWidth+4+this.ItemMergin.Left+this.ItemMergin.Right;
5328
+ this.ItemTextLines=item.AryField.length;
5329
+ var rowHeight=(this.ItemFontHeight*item.AryField.length)+this.ItemMergin.Top+ this.ItemMergin.Bottom;
5330
+ if (rowHeight>this.RowHeight) this.RowHeight=rowHeight;
5331
+ if (rowHeight>this.FixedRowHeight) this.FixedRowHeight=rowHeight;
5332
+ }
5310
5333
  else if (item.Type==REPORT_COLUMN_ID.SYMBOL_NAME_V2_ID) //单行显示
5311
5334
  {
5312
5335
  this.Canvas.font==this.NameSymbolFont.Name;
@@ -5424,7 +5447,7 @@ function ChartReport()
5424
5447
  //排序
5425
5448
  var bDrawSortBG=this.IsDrawSortBGIcon();
5426
5449
  if (this.SortInfo && this.SortInfo.Field==index && this.SortInfo.Sort>0) lastItem.Sort={ Type:this.SortInfo.Sort };
5427
- else if (column.Sort>0 && bDrawSortBG) lastItem.Sort={ Type:0 };
5450
+ else if (column.Sort>0 && bDrawSortBG && IFrameSplitOperator.IsNonEmptyArray(column.SortType) && column.SortType.length>=2) lastItem.Sort={ Type:0 };
5428
5451
 
5429
5452
  //图标
5430
5453
  if (column.Icon) lastItem.Icon=column.Icon;
@@ -5439,9 +5462,7 @@ function ChartReport()
5439
5462
 
5440
5463
  var pixelRatio=GetDevicePixelRatio();
5441
5464
  var cellWidth=drawInfo.Rect.Width;
5442
-
5443
- if (drawInfo.AryText.length>1)
5444
- var nnnn=10;
5465
+ var bDrawSortBG=this.IsDrawSortBGIcon();
5445
5466
 
5446
5467
  var y=drawInfo.YText;
5447
5468
  for(var i=0;i<drawInfo.AryText.length;++i)
@@ -5495,11 +5516,21 @@ function ChartReport()
5495
5516
 
5496
5517
  if (sortWidth>1) //排序
5497
5518
  {
5519
+ this.Canvas.font=this.SortFont;
5520
+ var xSort=x;
5521
+ if (this.SortConfig.Margin && IFrameSplitOperator.IsNumber(this.SortConfig.Margin.Left)) xSort+=this.SortConfig.Margin.Left;
5522
+ if (item.Sort.Type!=0 && bDrawSortBG) //背景
5523
+ {
5524
+ var sortText=this.SortConfig.Arrow[0];
5525
+ var sortColor=this.SortConfig.Color[0];
5526
+ this.Canvas.fillStyle=sortColor;
5527
+ this.Canvas.fillText(sortText,xSort,y-this.SortConfig.Margin.Bottom);
5528
+ }
5529
+
5498
5530
  var sortText=this.SortConfig.Arrow[item.Sort.Type];
5499
5531
  var sortColor=this.SortConfig.Color[item.Sort.Type];
5500
- this.Canvas.font=this.SortFont;
5501
5532
  this.Canvas.fillStyle=sortColor;
5502
- this.Canvas.fillText(sortText,x,y-this.SortConfig.Margin.Bottom);
5533
+ this.Canvas.fillText(sortText,xSort,y-this.SortConfig.Margin.Bottom);
5503
5534
  x+=sortWidth;
5504
5535
  }
5505
5536
 
@@ -5892,6 +5923,87 @@ function ChartReport()
5892
5923
  }
5893
5924
  }
5894
5925
 
5926
+ this.BuildSubCellTextData=function(subItem, column, stock, drawInfo, data, option)
5927
+ {
5928
+ switch(subItem.Type)
5929
+ {
5930
+ case REPORT_COLUMN_ID.NAME_ID:
5931
+ if (stock && stock.Name) drawInfo.Text=stock.Name;
5932
+ else drawInfo.Text=data.Name;
5933
+ break;
5934
+ case REPORT_COLUMN_ID.SYMBOL_ID:
5935
+ if (stock && stock.Symbol) drawInfo.Text=stock.Symbol;
5936
+ else drawInfo.Text=data.Symbol;
5937
+ break;
5938
+
5939
+ case REPORT_COLUMN_ID.PRICE_ID:
5940
+ case REPORT_COLUMN_ID.OPEN_ID:
5941
+ case REPORT_COLUMN_ID.HIGH_ID:
5942
+ case REPORT_COLUMN_ID.LOW_ID:
5943
+ case REPORT_COLUMN_ID.YCLOSE_ID:
5944
+ case REPORT_COLUMN_ID.BUY_PRICE_ID:
5945
+ case REPORT_COLUMN_ID.SELL_PRICE_ID:
5946
+ case REPORT_COLUMN_ID.AVERAGE_PRICE_ID:
5947
+ case REPORT_COLUMN_ID.FUTURES_CLOSE_ID:
5948
+ case REPORT_COLUMN_ID.FUTURES_YCLOSE_ID:
5949
+ var fieldName=MAP_COLUMN_FIELD.get(subItem.Type);
5950
+ if (stock && IFrameSplitOperator.IsNumber(stock[fieldName])) this.GetPriceDrawInfo(stock[fieldName], stock, data, drawInfo, option);
5951
+ break;
5952
+
5953
+ case REPORT_COLUMN_ID.INCREASE_ID:
5954
+ case REPORT_COLUMN_ID.AMPLITUDE_ID:
5955
+ case REPORT_COLUMN_ID.UPDOWN_ID:
5956
+ case REPORT_COLUMN_ID.RISING_SPEED_1M_ID:
5957
+ case REPORT_COLUMN_ID.RISING_SPEED_3M_ID:
5958
+ case REPORT_COLUMN_ID.RISING_SPEED_5M_ID:
5959
+ case REPORT_COLUMN_ID.RISING_SPEED_10M_ID:
5960
+ case REPORT_COLUMN_ID.RISING_SPEED_15M_ID:
5961
+ var fieldName=MAP_COLUMN_FIELD.get(subItem.Type);
5962
+ if (stock && IFrameSplitOperator.IsNumber(stock[fieldName]))
5963
+ {
5964
+ var value=stock[fieldName];
5965
+ var text=value.toFixed(2);
5966
+ if (subItem.DynamicFormat)
5967
+ text=subItem.DynamicFormat.replace('{Value}',text);
5968
+
5969
+ drawInfo.Text=text
5970
+ drawInfo.TextColor=this.GetUpDownColor(value,0);
5971
+ }
5972
+ break;
5973
+ }
5974
+ }
5975
+
5976
+ this.DrawSubCellText=function(drawInfo, column, rtText)
5977
+ {
5978
+ if (!drawInfo.Text) return;
5979
+
5980
+ var text=drawInfo.Text;
5981
+ var x=rtText.Left;
5982
+ if (drawInfo.TextAlign=='center')
5983
+ {
5984
+ x=rtText.Left+rtText.Width/2;
5985
+ this.Canvas.textAlign="center";
5986
+ }
5987
+ else if (drawInfo.TextAlign=='right')
5988
+ {
5989
+ x=rtText.Left+rtText.Width-2;
5990
+ this.Canvas.textAlign="right";
5991
+ }
5992
+ else
5993
+ {
5994
+ x+=2;
5995
+ this.Canvas.textAlign="left";
5996
+ }
5997
+
5998
+ var bClip=false;
5999
+
6000
+ this.Canvas.textBaseline="bottom";
6001
+ this.Canvas.fillStyle=drawInfo.TextColor;
6002
+ this.Canvas.fillText(text,x,rtText.Bottom);
6003
+
6004
+ if (bClip) this.Canvas.restore();
6005
+ }
6006
+
5895
6007
  this.DrawItem=function(index, data, column, left, top, rowType, columnIndex)
5896
6008
  {
5897
6009
  var itemWidth=column.Width;
@@ -6217,6 +6329,26 @@ function ChartReport()
6217
6329
  {
6218
6330
  this.FormatReserveButton(column, stock, drawInfo);
6219
6331
  }
6332
+ else if (column.Type==REPORT_COLUMN_ID.MULTI_LINE_CONTAINER)
6333
+ {
6334
+ if (IFrameSplitOperator.IsNonEmptyArray(column.AryField))
6335
+ {
6336
+ var yBottom=rtItem.Bottom-this.ItemMergin.Bottom-(column.AryField.length-1)*this.ItemFontHeight;
6337
+ var rtText={ Left:left+this.ItemMergin.Left, Width:textWidth, Height:this.ItemFontHeight, Bottom:yBottom };
6338
+ rtText.Right=rtText.Left+rtText.Width;
6339
+ rtText.Top=rtText.Bottom-rtText.Height;
6340
+ for(var k=0;k<column.AryField.length;++k)
6341
+ {
6342
+ drawInfo.Text=null;
6343
+ var subItem=column.AryField[k];
6344
+ this.BuildSubCellTextData(subItem, column, stock, drawInfo, data);
6345
+ this.DrawSubCellText(drawInfo, column, rtText);
6346
+
6347
+ rtText.Bottom+=this.ItemFontHeight;
6348
+ rtText.Top+=this.ItemFontHeight;
6349
+ }
6350
+ }
6351
+ }
6220
6352
 
6221
6353
 
6222
6354
  //拖拽行颜色
@@ -6246,6 +6378,10 @@ function ChartReport()
6246
6378
  else if (column.Type==REPORT_COLUMN_ID.CUSTOM_LINK_ID)
6247
6379
  {
6248
6380
  this.DrawLinkText(drawInfo, x, top, textWidth);
6381
+ }
6382
+ else if (column.Type==REPORT_COLUMN_ID.MULTI_LINE_CONTAINER)
6383
+ {
6384
+
6249
6385
  }
6250
6386
  else
6251
6387
  {
@@ -1,8 +1,8 @@
1
1
  @font-face {
2
2
  font-family: "iconfont"; /* Project id 1040563 */
3
- src: url('iconfont.woff2?t=1732508423204') format('woff2'),
4
- url('iconfont.woff?t=1732508423204') format('woff'),
5
- url('iconfont.ttf?t=1732508423204') format('truetype');
3
+ src: url('iconfont.woff2?t=1734955349527') format('woff2'),
4
+ url('iconfont.woff?t=1734955349527') format('woff'),
5
+ url('iconfont.ttf?t=1734955349527') format('truetype');
6
6
  }
7
7
 
8
8
  .iconfont {
@@ -13,6 +13,18 @@
13
13
  -moz-osx-font-smoothing: grayscale;
14
14
  }
15
15
 
16
+ .icon-sortup:before {
17
+ content: "\e81b";
18
+ }
19
+
20
+ .icon-sort1:before {
21
+ content: "\e704";
22
+ }
23
+
24
+ .icon-sort-down:before {
25
+ content: "\f0c9";
26
+ }
27
+
16
28
  .icon-chicangzuheicon:before {
17
29
  content: "\e6b6";
18
30
  }
@@ -630,6 +630,12 @@ function GetBlackStyle()
630
630
  //Mergin:{ Left:5, Right:5, Top:4, Bottom:2 },
631
631
  Font:{ Size:12, Name:"微软雅黑" }
632
632
  },
633
+
634
+ //排序图标
635
+ SortIcon:
636
+ {
637
+ Color:['rgb(105,105,105)', "rgb(255,255,255)", "rgb(255,255,255)"],
638
+ },
633
639
 
634
640
  Item:
635
641
  {
@@ -1854,6 +1854,8 @@ HQData.Report_APIIndex=function(data, callback)
1854
1854
  HQData.APIIndex_MULTI_LINE(data, callback);
1855
1855
  else if (request.Data.indexname=="API-MULTI_SVGICON")
1856
1856
  HQData.APIIndex_MULTI_SVGICON(data, callback);
1857
+ else if (request.Data.indexname=="API-DRAWTEXT_LINE")
1858
+ HQData.APIIndex_DRAWTEXT_LINE(data, callback);
1857
1859
  }
1858
1860
 
1859
1861
 
@@ -2240,3 +2242,40 @@ HQData.APIIndex_MULTI_SVGICON=function(data, callback)
2240
2242
  }
2241
2243
 
2242
2244
 
2245
+ HQData.APIIndex_DRAWTEXT_LINE=function(data, callback)
2246
+ {
2247
+ data.PreventDefault=true;
2248
+ var hqchart=data.HQChart;
2249
+ var kData=hqchart.GetKData();
2250
+
2251
+ var lastItem=kData.Data[kData.Data.length-1];
2252
+ var price=(lastItem.High+lastItem.Low)/2;
2253
+
2254
+ var lineData=
2255
+ {
2256
+ name:'DRAWTEXT_LINE', type:1,
2257
+ Draw:
2258
+ {
2259
+ DrawType:'DRAWTEXT_LINE',
2260
+ DrawData:
2261
+ {
2262
+ Price:price,
2263
+ Text:{ Title:`价格:${price.toFixed(2)}`, Color:"rgb(255, 165, 0)" },
2264
+ Line:{ Type:1, Color:"rgb(200,200,0)" }, //Type 0=不画 1=直线 2=虚线
2265
+ }
2266
+ }
2267
+ };
2268
+
2269
+ var apiData=
2270
+ {
2271
+ code:0,
2272
+ stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
2273
+ outdata: { date:kData.GetDate() , outvar:[lineData] }
2274
+ };
2275
+
2276
+
2277
+ console.log('[HQData.APIIndex_DRAWTEXT_LINE] apiData ', apiData);
2278
+ callback(apiData);
2279
+ }
2280
+
2281
+