hqchart 1.1.14778 → 1.1.14787

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.
@@ -593,7 +593,7 @@ JSIndexScript.prototype.MACD=function()
593
593
  {
594
594
  let data=
595
595
  {
596
- Name:'MACD', Description:'平滑异同平均', IsMainIndex:false,
596
+ Name:'MACD', Description:'平滑异同平均', IsMainIndex:false,FloatPrecision:3,
597
597
  Args:[ { Name:'SHORT', Value:12}, { Name:'LONG', Value:26}, { Name:'MID', Value:9} ],
598
598
  Script: //脚本
599
599
  'DIF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);\n\
@@ -79713,6 +79713,8 @@ function JSChartResource()
79713
79713
  Selected:
79714
79714
  {
79715
79715
  BGColor:"rgb(180,240,240)",
79716
+ LineColor:"rgb(128,128,128)",
79717
+ LineWidth:2,
79716
79718
  }
79717
79719
  },
79718
79720
 
@@ -80832,6 +80834,8 @@ function JSChartResource()
80832
80834
  {
80833
80835
  var subItem=item.Selected;
80834
80836
  if (subItem.BGColor) this.DealList.Selected.BGColor=subItem.BGColor;
80837
+ if (subItem.LineColor) this.DealList.Selected.LineColor=subItem.LineColor;
80838
+ if (IFrameSplitOperator.IsPlusNumber(subItem.LineWidth)) this.DealList.Selected.LineWidth=subItem.LineWidth;
80835
80839
  }
80836
80840
  }
80837
80841
 
@@ -80846,7 +80850,7 @@ function JSChartResource()
80846
80850
  if (IFrameSplitOperator.IsNumber(item.Radius)) this.SelectedChart.Radius=item.Radius;
80847
80851
  if (IFrameSplitOperator.IsNumber(item.MinSpace)) this.SelectedChart.MinSpace=item.MinSpace;
80848
80852
  if (item.LineColor) this.SelectedChart.LineColor=item.LineColor;
80849
- if (item.LineColor) this.SelectedChart.BGColor=item.BGColor;
80853
+ if (item.BGColor) this.SelectedChart.BGColor=item.BGColor;
80850
80854
  }
80851
80855
 
80852
80856
  if (style.DragMovePaint)
@@ -133507,7 +133511,8 @@ function GetBlackStyle()
133507
133511
 
133508
133512
  Selected:
133509
133513
  {
133510
- BGColor:"rgb(49,48,56)",
133514
+ BGColor:"rgba(49,48,56,0.7)",
133515
+ LineColor:"rgb(220,220,220)",
133511
133516
  }
133512
133517
  },
133513
133518
 
@@ -133880,6 +133885,7 @@ function JSDealChart(divElement)
133880
133885
  }
133881
133886
 
133882
133887
  if (option.MinuteChartTooltip && option.MinuteChartTooltip.Enable) chart.InitalMinuteChartTooltip(option.MinuteChartTooltip);
133888
+ if (option.FloatTooltip && option.FloatTooltip.Enable) chart.InitalFloatTooltip(option.FloatTooltip); //提示信息
133883
133889
 
133884
133890
  if (!option.Symbol)
133885
133891
  {
@@ -133908,6 +133914,12 @@ function JSDealChart(divElement)
133908
133914
  if (option.AutoUpdateFrequency>0) chart.AutoUpdateFrequency=option.AutoUpdateFrequency;
133909
133915
  if (IFrameSplitOperator.IsBool(option.EnableFilter)) chart.EnableFilter=option.EnableFilter;
133910
133916
 
133917
+ var dealChart=chart.GetDealChart();
133918
+ if (dealChart)
133919
+ {
133920
+ if (IFrameSplitOperator.IsNumber(option.SelectedStyle)) dealChart.SelectedStyle=option.SelectedStyle;
133921
+ }
133922
+
133911
133923
  //注册事件
133912
133924
  if (option.EventCallback)
133913
133925
  {
@@ -134023,6 +134035,7 @@ function JSDealChartContainer(uielement)
134023
134035
  this.LoadDataSplashTitle="数据加载中"; //下载数据提示信息
134024
134036
 
134025
134037
  this.TooltipMinuteChart; //分时图
134038
+ this.FloatTooltip; //提示浮框
134026
134039
 
134027
134040
  this.UIElement=uielement;
134028
134041
  this.LastPoint=new Point(); //鼠标位置
@@ -134036,6 +134049,9 @@ function JSDealChartContainer(uielement)
134036
134049
  {
134037
134050
  this.IsDestroy=true;
134038
134051
  this.StopAutoUpdate();
134052
+
134053
+ this.DestroyMinuteChartTooltip();
134054
+ this.DestroyFloatTooltip();
134039
134055
  }
134040
134056
 
134041
134057
  this.EnableFilterData=false; //是否启动筛选
@@ -134080,9 +134096,55 @@ function JSDealChartContainer(uielement)
134080
134096
  this.TooltipMinuteChart.Hide();
134081
134097
  }
134082
134098
 
134099
+ this.HideFloatTooltip=function()
134100
+ {
134101
+ if (!this.FloatTooltip) return;
134102
+
134103
+ this.FloatTooltip.Hide();
134104
+ }
134105
+
134106
+ this.DestroyFloatTooltip=function()
134107
+ {
134108
+ if (!this.FloatTooltip) return;
134109
+
134110
+ this.FloatTooltip.Destroy();
134111
+ this.FloatTooltip=null;
134112
+ }
134113
+
134114
+ this.InitalFloatTooltip=function(option)
134115
+ {
134116
+ if (this.FloatTooltip) return;
134117
+
134118
+ this.FloatTooltip=new JSFloatTooltip();
134119
+ this.FloatTooltip.Inital(this, option);
134120
+ this.FloatTooltip.Create();
134121
+ }
134122
+
134123
+ this.DrawFloatTooltip=function(point,toolTip)
134124
+ {
134125
+ if (!this.FloatTooltip) return;
134126
+
134127
+ this.UpdateFloatTooltip(point, toolTip)
134128
+ }
134129
+
134130
+ this.UpdateFloatTooltip=function(point, toolTip)
134131
+ {
134132
+ if (!this.FloatTooltip) return;
134133
+
134134
+ var sendData=
134135
+ {
134136
+ Tooltip:toolTip,
134137
+ Point:point,
134138
+ DataType:5,
134139
+ };
134140
+
134141
+ this.FloatTooltip.Update(sendData);
134142
+ }
134143
+
134083
134144
  this.HideAllTooltip=function()
134084
134145
  {
134085
134146
  this.HideMinuteChartTooltip();
134147
+ this.HideFloatTooltip();
134086
134148
  }
134087
134149
 
134088
134150
  //筛选数据
@@ -134194,6 +134256,8 @@ function JSDealChartContainer(uielement)
134194
134256
  this.UIElement.ondblclick=(e)=>{ this.UIOnDblClick(e); }
134195
134257
  this.UIElement.oncontextmenu=(e)=> { this.UIOnContextMenu(e); }
134196
134258
  this.UIElement.onmousemove=(e)=>{ this.UIOnMouseMove(e);}
134259
+ this.UIElement.onmouseout=(e)=>{ this.UIOnMounseOut(e); }
134260
+ this.UIElement.onmouseleave=(e)=>{ this.UIOnMouseleave(e); }
134197
134261
  }
134198
134262
 
134199
134263
  this.Draw=function()
@@ -134392,12 +134456,17 @@ function JSDealChartContainer(uielement)
134392
134456
  }
134393
134457
  }
134394
134458
 
134459
+ this.GetDealChart=function()
134460
+ {
134461
+ return this.ChartPaint[0];
134462
+ }
134463
+
134395
134464
  this.RecvDealUpdateData=function(data)
134396
134465
  {
134397
134466
  var aryDeal=JSDealChartContainer.JsonDataToDealData(data);
134398
134467
  if (!IFrameSplitOperator.IsNonEmptyArray(aryDeal)) return;
134399
134468
 
134400
- var chart=this.ChartPaint[0];
134469
+ var chart=this.GetDealChart();
134401
134470
  if (!chart) return;
134402
134471
 
134403
134472
  if (data.UpdateType===1) //全量更新
@@ -134468,7 +134537,14 @@ function JSDealChartContainer(uielement)
134468
134537
 
134469
134538
  var self = this;
134470
134539
  var marketStatus=MARKET_SUFFIX_NAME.GetMarketStatus(this.Symbol);
134471
- if (marketStatus==0 || marketStatus==3) return; //闭市,盘后
134540
+ if (marketStatus==0 || marketStatus==3) //闭市,盘后
134541
+ {
134542
+ this.AutoUpdateTimer=setTimeout(function()
134543
+ {
134544
+ self.AutoUpdate();
134545
+ },20000);
134546
+ return;
134547
+ }
134472
134548
 
134473
134549
  var frequency=this.AutoUpdateFrequency;
134474
134550
  if (marketStatus==1) //盘前
@@ -134670,13 +134746,12 @@ function JSDealChartContainer(uielement)
134670
134746
  chartTooltipData={ Symbol:tooltipData.Stock.OriginalSymbol, Rect:tooltipData.Rect };
134671
134747
  }
134672
134748
  }
134749
+ */
134673
134750
  else
134674
134751
  {
134675
134752
  this.LastMouseStatus.TooltipStatus={ X:x, Y:y, Data:tooltipData, ClientX:e.clientX, ClientY:e.clientY };
134676
134753
  bDrawTooltip=true;
134677
134754
  }
134678
- */
134679
-
134680
134755
  }
134681
134756
  }
134682
134757
 
@@ -134684,6 +134759,17 @@ function JSDealChartContainer(uielement)
134684
134759
 
134685
134760
  if (bDraw) this.Draw();
134686
134761
 
134762
+ if (this.LastMouseStatus.TooltipStatus)
134763
+ {
134764
+ var xTooltip = e.clientX-this.UIElement.getBoundingClientRect().left;
134765
+ var yTooltip = e.clientY-this.UIElement.getBoundingClientRect().top;
134766
+ this.DrawFloatTooltip({X:xTooltip, Y:yTooltip, YMove:20/pixelTatio},this.LastMouseStatus.TooltipStatus.Data);
134767
+ }
134768
+ else
134769
+ {
134770
+ this.HideFloatTooltip();
134771
+ }
134772
+
134687
134773
  if (!bShowMinuteTooltip) this.HideMinuteChartTooltip();
134688
134774
  if (bShowMinuteTooltip) this.ShowMinuteChartTooltip(null, null, chartTooltipData);
134689
134775
  }
@@ -134703,6 +134789,16 @@ function JSDealChartContainer(uielement)
134703
134789
  e.preventDefault();
134704
134790
  }
134705
134791
 
134792
+ this.UIOnMounseOut=function(e)
134793
+ {
134794
+ this.HideAllTooltip();
134795
+ }
134796
+
134797
+ this.UIOnMouseleave=function(e)
134798
+ {
134799
+ this.HideAllTooltip();
134800
+ }
134801
+
134706
134802
  this.GotoNextPage=function()
134707
134803
  {
134708
134804
  if (!this.Data || !IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return false;
@@ -134802,8 +134898,9 @@ JSDealChartContainer.JsonDataToDealData=function(data)
134802
134898
  if (item[5]) dealItem.StrTime=item[5];
134803
134899
  if (item[6]) dealItem.ID=item[6];
134804
134900
 
134805
- if (item[11]) dealItem.Symbol=item[11]; //股票代码
134806
- if (item[12]) dealItem.Name=item[12]; //股票名称
134901
+ if (item[11]) dealItem.Symbol=item[11]; //股票代码
134902
+ if (item[12]) dealItem.Name=item[12]; //股票名称
134903
+ if (item[13]) dealItem.BGColor=item[13]; //整行颜色
134807
134904
 
134808
134905
  if (item[100]) dealItem.Guid=item[100];
134809
134906
 
@@ -135019,7 +135116,8 @@ function ChartDealList()
135019
135116
 
135020
135117
  this.BorderColor=g_JSChartResource.DealList.BorderColor; //边框线
135021
135118
 
135022
- this.SelectedConfig={ BGColor:g_JSChartResource.DealList.Selected.BGColor };
135119
+ this.SelectedConfig={ BGColor:g_JSChartResource.DealList.Selected.BGColor, LineColor:g_JSChartResource.DealList.Selected.LineColor, LineWidth:g_JSChartResource.DealList.Selected.LineWidth };
135120
+ this.SelectedStyle=1; //选中行样式 1=整行填充 2=底部绘制直线
135023
135121
 
135024
135122
  //表头配置
135025
135123
  this.HeaderFontConfig={ Size:g_JSChartResource.DealList.Header.Font.Size, Name:g_JSChartResource.DealList.Header.Font.Name };
@@ -135341,6 +135439,7 @@ function ChartDealList()
135341
135439
  var left=this.RectClient.Left+this.HeaderMergin.Left;
135342
135440
  var dataCount=this.Data.Data.length;
135343
135441
  var index=this.Data.DataOffset;
135442
+ var selectedRowData=null;
135344
135443
 
135345
135444
  if (this.ShowOrder==1)
135346
135445
  {
@@ -135355,8 +135454,8 @@ function ChartDealList()
135355
135454
  for(j=0;j<this.RowCount && index>=0;++j, --index)
135356
135455
  {
135357
135456
  var dataItem=this.Data.Data[index];
135358
- this.DrawSelectedRow(dataItem, index, rtRow);
135359
-
135457
+ this.DrawSelectedRow(dataItem, index, rtRow)
135458
+
135360
135459
  this.DrawRow(dataItem, textLeft, textTop, index);
135361
135460
 
135362
135461
  textTop+=this.RowHeight;
@@ -135377,7 +135476,14 @@ function ChartDealList()
135377
135476
  rtRow.Right=rtRow.Left+rtRow.Width;
135378
135477
  rtRow.Bottom=rtRow.Top+rtRow.Height;
135379
135478
 
135380
- this.DrawSelectedRow(dataItem, index, rtRow);
135479
+ if (dataItem.BGColor)
135480
+ {
135481
+ this.Canvas.fillStyle=dataItem.BGColor;
135482
+ this.Canvas.fillRect(rtRow.Left,rtRow.Top, rtRow.Width, rtRow.Height);
135483
+ }
135484
+
135485
+ if (this.DrawSelectedRow(dataItem, index, rtRow))
135486
+ selectedRowData={ Rect:rtRow };
135381
135487
 
135382
135488
  this.DrawRow(dataItem, textLeft, textTop, index);
135383
135489
 
@@ -135386,6 +135492,14 @@ function ChartDealList()
135386
135492
  textTop+=this.RowHeight;
135387
135493
  }
135388
135494
  }
135495
+
135496
+ if (selectedRowData && this.SelectedStyle===2)
135497
+ {
135498
+ var rtBG=selectedRowData.Rect;
135499
+ this.Canvas.fillStyle=this.SelectedConfig.LineColor;
135500
+ var lineWidth=this.SelectedConfig.LineWidth;
135501
+ this.Canvas.fillRect(rtBG.Left,rtBG.Bottom-lineWidth,rtBG.Width,lineWidth);
135502
+ }
135389
135503
  }
135390
135504
  }
135391
135505
 
@@ -135507,14 +135621,22 @@ function ChartDealList()
135507
135621
 
135508
135622
  if (bDrawV2)
135509
135623
  {
135510
- this.DrawItemText(drawInfo.Text, drawInfo.TextColor, drawInfo.TextAlign, rtItem.Left, rtItem.Top, rtItem.Width, drawInfo.BGColor);
135624
+ //this.DrawItemText(drawInfo.Text, drawInfo.TextColor, drawInfo.TextAlign, rtItem.Left, rtItem.Top, rtItem.Width, drawInfo.BGColor);
135625
+ this.DrawItemTextV2(drawInfo, rtItem);
135511
135626
  }
135512
135627
  else
135513
135628
  {
135514
135629
  this.DrawItemText(text, textColor, textAlign, left, top, itemWidth);
135515
135630
  }
135516
135631
 
135517
- if (item.ChartTooltip && item.ChartTooltip.Enable && IFrameSplitOperator.IsNumber(item.ChartTooltip.Type)) //Type 20分时图 21K线图
135632
+
135633
+ if (drawInfo.Tooltip)
135634
+ {
135635
+ //Type:2=数据提示信息
135636
+ var tooltipData={ Rect:rtItem, Data:data, Index:dataIndex, Column:item, Type:drawInfo.Tooltip.Type, Data:drawInfo.Tooltip.Data };
135637
+ this.TooltipRect.push(tooltipData);
135638
+ }
135639
+ else if (item.ChartTooltip && item.ChartTooltip.Enable && IFrameSplitOperator.IsNumber(item.ChartTooltip.Type)) //Type 20分时图 21K线图
135518
135640
  {
135519
135641
  var tooltipData={ Rect:rtItem, Data:data, Index:dataIndex, Column:item, Type:item.ChartTooltip.Type };
135520
135642
  this.TooltipRect.push(tooltipData);
@@ -135587,6 +135709,15 @@ function ChartDealList()
135587
135709
  {
135588
135710
  drawInfo.Text=item;
135589
135711
  }
135712
+
135713
+ if (item && item.Tooltip && IFrameSplitOperator.IsNonEmptyArray(item.Tooltip.AryText))
135714
+ {
135715
+ drawInfo.Tooltip=
135716
+ {
135717
+ Type:2,
135718
+ Data:{ AryText:item.Tooltip.AryText }
135719
+ }
135720
+ }
135590
135721
  }
135591
135722
 
135592
135723
  this.GetUpDownColor=function(price, price2)
@@ -135604,12 +135735,17 @@ function ChartDealList()
135604
135735
 
135605
135736
  this.DrawSelectedRow=function(data, index, rtRow)
135606
135737
  {
135607
- if (!this.SelectedData) return;
135608
- if (!this.SelectedData.Enable) return;
135609
- if (!this.SelectedData.Guid || this.SelectedData.Guid!=data.Guid) return;
135738
+ if (!this.SelectedData) return false;
135739
+ if (!this.SelectedData.Enable) return false;
135740
+ if (!this.SelectedData.Guid || this.SelectedData.Guid!=data.Guid) return false;
135610
135741
 
135611
- this.Canvas.fillStyle=this.SelectedConfig.BGColor;
135612
- this.Canvas.fillRect(rtRow.Left,rtRow.Top, rtRow.Width, rtRow.Height);
135742
+ if ( this.SelectedStyle==1)
135743
+ {
135744
+ this.Canvas.fillStyle=this.SelectedConfig.BGColor;
135745
+ this.Canvas.fillRect(rtRow.Left,rtRow.Top, rtRow.Width, rtRow.Height);
135746
+ }
135747
+
135748
+ return true;
135613
135749
  }
135614
135750
 
135615
135751
  this.DrawItemText=function(text, textColor, textAlign, left, top, width)
@@ -135630,9 +135766,44 @@ function ChartDealList()
135630
135766
  this.Canvas.textAlign="left";
135631
135767
  }
135632
135768
 
135633
- this.Canvas.textBaseline="middle";
135769
+ this.Canvas.textBaseline="bottom";
135634
135770
  this.Canvas.fillStyle=textColor;
135635
- if (text) this.Canvas.fillText(text,x,top+this.RowHeight/2);
135771
+ if (text) this.Canvas.fillText(text,x,top+this.RowHeight-2);
135772
+ }
135773
+
135774
+ this.DrawItemTextV2=function(drawInfo, rtItem)
135775
+ {
135776
+ if (drawInfo.BGColor)
135777
+ {
135778
+ this.Canvas.fillStyle=drawInfo.BGColor;
135779
+ this.Canvas.fillRect(rtItem.Left,rtItem.Top,rtItem.Width,rtItem.Height);
135780
+ }
135781
+
135782
+ if (drawInfo.Text)
135783
+ {
135784
+ var text=drawInfo.Text;
135785
+ var x=rtItem.Left;
135786
+ if (drawInfo.TextAlign=='center')
135787
+ {
135788
+ x=rtItem.Left+rtItem.Width/2;
135789
+ this.Canvas.textAlign="center";
135790
+ }
135791
+ else if (drawInfo.TextAlign=='right')
135792
+ {
135793
+ x=rtItem.Left+rtItem.Width-2;
135794
+ this.Canvas.textAlign="right";
135795
+ }
135796
+ else
135797
+ {
135798
+ x+=2;
135799
+ this.Canvas.textAlign="left";
135800
+ }
135801
+
135802
+ var textWidth=this.Canvas.measureText(text).width+1;
135803
+ this.Canvas.textBaseline="bottom";
135804
+ this.Canvas.fillStyle=drawInfo.TextColor;
135805
+ this.Canvas.fillText(text,x,rtItem.Top+this.RowHeight-2);
135806
+ }
135636
135807
  }
135637
135808
 
135638
135809
  this.DrawMultiBar=function(colunmInfo, data, rtItem)
@@ -136349,6 +136520,7 @@ function JSReportChartContainer(uielement)
136349
136520
  //
136350
136521
  this.TooltipMinuteChart; //分时图
136351
136522
  this.TooltipKLineChart; //分时图
136523
+ this.FloatTooltip; //提示浮框
136352
136524
 
136353
136525
  //MouseOnStatus:{ RowIndex:行, ColumnIndex:列}
136354
136526
  this.LastMouseStatus={ MoveStatus:null, TooltipStatus:null, MouseOnStatus:null };
@@ -148941,7 +149113,7 @@ function ScrollBarBGChart()
148941
149113
 
148942
149114
 
148943
149115
 
148944
- var HQCHART_VERSION="1.1.14777";
149116
+ var HQCHART_VERSION="1.1.14786";
148945
149117
 
148946
149118
  function PrintHQChartVersion()
148947
149119
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.14777";
8
+ var HQCHART_VERSION="1.1.14786";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {