hqchart 1.1.14425 → 1.1.14439

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.
@@ -25,7 +25,6 @@ if (!JSConsole)
25
25
  function JSChart(divElement, bOffscreen, bCacheCanvas)
26
26
  {
27
27
  this.DivElement=divElement;
28
- this.DivToolElement=null; //工具条
29
28
  this.JSChartContainer; //画图控件
30
29
  this.ResizeListener;
31
30
 
@@ -121,6 +120,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
121
120
  //画布大小通过div获取 如果有style里的大小 使用style里的
122
121
  var height=this.DivElement.offsetHeight;
123
122
  var width=this.DivElement.offsetWidth;
123
+ var pixelTatio = GetDevicePixelRatio(); //获取设备的分辨率s
124
124
  if (this.DivElement.style.height && this.DivElement.style.width)
125
125
  {
126
126
  if (this.DivElement.style.height.includes("px"))
@@ -128,21 +128,12 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
128
128
  if (this.DivElement.style.width.includes("px"))
129
129
  width=parseInt(this.DivElement.style.width.replace("px",""));
130
130
  }
131
-
132
- if (this.ToolElement)
133
- {
134
- //TODO调整工具条大小
135
- height-=this.ToolElement.style.height.replace("px",""); //减去工具条的高度
136
- }
137
131
 
138
- this.CanvasElement.height=height;
139
- this.CanvasElement.width=width;
140
- this.CanvasElement.style.width=this.CanvasElement.width+'px';
141
- this.CanvasElement.style.height=this.CanvasElement.height+'px';
132
+ this.CanvasElement.style.width=`${width}px`;
133
+ this.CanvasElement.style.height=`${height}px`;
142
134
 
143
- var pixelTatio = GetDevicePixelRatio(); //获取设备的分辨率
144
- this.CanvasElement.height*=pixelTatio;
145
- this.CanvasElement.width*=pixelTatio;
135
+ this.CanvasElement.height=parseInt(pixelTatio*height); //根据分辨率缩放
136
+ this.CanvasElement.width=parseInt(pixelTatio*width);
146
137
 
147
138
  if (this.OffscreenCanvasElement)
148
139
  {
@@ -5945,6 +5936,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
5945
5936
  for(var i=0;i<this.ExtendChartPaint.length;++i)
5946
5937
  {
5947
5938
  var item=this.ExtendChartPaint[i];
5939
+
5948
5940
  if (item.IsCallbackDraw)
5949
5941
  {
5950
5942
  if (["KLineYAxisBGPaint","DepthMapPaint","BackgroundPaint","MinuteBackgroundPaint", "SessionBreaksPaint"].includes(item.ClassName))
@@ -44446,6 +44438,25 @@ function IExtendChartPainting()
44446
44438
  {
44447
44439
  return GetFontHeight(this.Canvas, font, "擎");
44448
44440
  }
44441
+
44442
+ this.SetFillStyle=function(color, x0, y0, x1, y1)
44443
+ {
44444
+ if (Array.isArray(color))
44445
+ {
44446
+ let gradient = this.Canvas.createLinearGradient(x0, y0, x1, y1);
44447
+ var offset=1/(color.length-1);
44448
+ for(var i=0; i<color.length; ++i)
44449
+ {
44450
+ var value=i*offset;
44451
+ gradient.addColorStop(value, color[i]);
44452
+ }
44453
+ this.Canvas.fillStyle=gradient;
44454
+ }
44455
+ else
44456
+ {
44457
+ this.Canvas.fillStyle=color;
44458
+ }
44459
+ }
44449
44460
  }
44450
44461
 
44451
44462
  //K线Tooltip, 显示在左边或右边
@@ -48615,7 +48626,7 @@ function KLineYAxisBGPaint()
48615
48626
  }
48616
48627
 
48617
48628
 
48618
- //背景图 支持横屏
48629
+ //背景图 支持横屏 新版本
48619
48630
  function BackgroundPaint()
48620
48631
  {
48621
48632
  this.newMethod=IExtendChartPainting; //派生
@@ -48627,327 +48638,210 @@ function BackgroundPaint()
48627
48638
  this.IsDynamic=false;
48628
48639
  this.IsCallbackDraw=true; //在回调函数里绘制, 不在Draw()中绘制
48629
48640
 
48641
+ this.IsDrawAllFrame=false; //全部的指标框都画
48642
+ this.SetDrawFrameID=new Set([0]); //指定几个指标框画
48643
+
48630
48644
  this.FrameID=0;
48631
- this.Data; //背景数据 { Start:, End:, Color:[] }
48645
+ this.Data; //背景数据[ { Start:{ Date:, Time: }, End:{ Date:, Time }, Color:['rgb(44,55,255)','rgb(200,55,255)'] }]
48646
+ this.IsShow=true;
48647
+ this.SubFrame=null;
48648
+
48632
48649
  this.ID=Guid(); //唯一的ID
48633
-
48634
- /*
48635
- this.Data=
48636
- [
48637
- { Start:{ Date:20181201 }, End:{ Date:20181230 }, Color:'rgb(44,55,44)' } ,
48638
- { Start:{ Date:20190308 }, End:{ Date:20190404 }, Color:['rgb(44,55,255)','rgb(200,55,255)'] }
48639
- ]
48640
- */
48641
-
48642
- this.ChartSubFrame;
48643
- this.ChartBorder;
48644
- this.KData;
48645
- this.Period;
48646
- this.XPointCount=0;
48650
+ this.HQChart;
48647
48651
 
48648
48652
  this.SetOption=function(option) //设置
48649
48653
  {
48650
- if (option.FrameID>0) this.FrameID=option.FrameID;
48654
+ if (!option) return;
48655
+
48656
+ if (IFrameSplitOperator.IsNumber(option.FrameID)) this.FrameID=option.FrameID;
48651
48657
  if (IFrameSplitOperator.IsObjectExist(option.ID)) this.ID=option.ID;
48658
+ if (IFrameSplitOperator.IsBool(option.IsDrawAllFrame)) this.IsDrawAllFrame=option.IsDrawAllFrame;
48659
+ if (IFrameSplitOperator.IsNonEmptyArray(option.AryFrameID)) this.SetDrawFrameID=new Set(option.AryFrameID);
48652
48660
  }
48653
48661
 
48654
48662
  this.Draw=function()
48655
48663
  {
48656
- if (!this.Data || !this.HQChart) return;
48657
- if (!this.ChartFrame || !this.ChartFrame.SubFrame || this.ChartFrame.SubFrame.length<=this.FrameID) return;
48658
- var klineChart=this.HQChart.ChartPaint[0];
48659
- if (!klineChart || !klineChart.Data) return;
48660
-
48661
- this.ChartSubFrame=this.ChartFrame.SubFrame[this.FrameID].Frame;
48662
- this.ChartBorder=this.ChartSubFrame.ChartBorder;
48663
- this.KData=klineChart.Data;
48664
- this.Period=this.HQChart.Period;
48665
- if (!this.KData || this.KData.Data.length<=0) return;
48666
-
48667
- var isHScreen=(this.ChartSubFrame.IsHScreen===true);
48668
- this.XPointCount=this.ChartSubFrame.XPointCount;
48669
- var xPointCount=this.ChartSubFrame.XPointCount;
48670
-
48671
- var firstKItem=this.KData.Data[this.KData.DataOffset];
48672
- var endIndex=this.KData.DataOffset+xPointCount-1;
48673
- if (endIndex>=this.KData.Data.length) endIndex=this.KData.Data.length-1;
48674
- var endKItem=this.KData.Data[endIndex];
48675
- var showData=this.GetShowData(firstKItem,endKItem);
48676
- if (!showData || showData.length<=0) return;
48677
-
48678
- var kLineMap=this.BuildKLineMap();
48679
- var bottom=this.ChartBorder.GetBottomEx();
48680
- var top=this.ChartBorder.GetTopEx();
48681
- var height=this.ChartBorder.GetHeightEx();
48682
- if (isHScreen)
48664
+ this.SubFrame=null;
48665
+
48666
+ if (this.FrameID<0) return;
48667
+ if (!this.HQChart) return;
48668
+ if (!this.ChartFrame || !IFrameSplitOperator.IsNonEmptyArray(this.ChartFrame.SubFrame)) return;
48669
+ if (!this.IsShow) return;
48670
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.Data)) return;
48671
+ if (!this.ChartFrame.SubFrame[this.FrameID]) return;
48672
+ this.SubFrame=this.ChartFrame.SubFrame[this.FrameID].Frame;
48673
+ if (!this.SubFrame) return;
48674
+
48675
+ var kData=this.HQChart.GetKData();
48676
+ if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return;
48677
+
48678
+ var bHScreen=(this.SubFrame.IsHScreen===true);
48679
+ this.IsHScreen=bHScreen;
48680
+ var isMinute=this.SubFrame.IsMinuteFrame();
48681
+ var dataWidth=this.SubFrame.DataWidth;
48682
+ var distanceWidth=this.SubFrame.DistanceWidth;
48683
+ var xPointCount=this.SubFrame.XPointCount;
48684
+
48685
+ var border=this.SubFrame.GetBorder();
48686
+ if (bHScreen)
48683
48687
  {
48684
- top=this.ChartBorder.GetRightEx();
48685
- bottom=this.ChartBorder.GetLeftEx();
48686
- height=this.ChartBorder.GetWidthEx();
48688
+ var chartright=border.BottomEx;
48689
+ var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
48690
+ }
48691
+ else
48692
+ {
48693
+ var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
48694
+ var chartright=border.RightEx;
48687
48695
  }
48688
48696
 
48689
- for(var i in showData)
48697
+ var mapBG=new Map(); //key= index, Value={ Start:{Left, Center, Right, Item:}, End:{ Left, Center, Right, Item:} }
48698
+ var startIndex=kData.DataOffset;
48699
+ for(var i=startIndex,j=0;i<kData.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth))
48690
48700
  {
48691
- var item=showData[i];
48692
- var rt=this.GetBGCoordinate(item,kLineMap);
48693
- if (!rt) continue;
48701
+ var kItem=kData.Data[i];
48702
+ var aryFind=this.FindMatchData(kItem);
48703
+ if (!aryFind) continue;
48694
48704
 
48695
- if (Array.isArray(item.Color))
48705
+ if (isMinute)
48696
48706
  {
48697
- var gradient;
48698
- if (isHScreen) gradient = this.Canvas.createLinearGradient(bottom,rt.Left, top, rt.Left);
48699
- else gradient = this.Canvas.createLinearGradient(rt.Left,top, rt.Left,bottom);
48700
- var offset=1/item.Color.length;
48701
- for(var i in item.Color)
48702
- {
48703
- gradient.addColorStop(i*offset, item.Color[i]);
48704
- }
48705
- this.Canvas.fillStyle=gradient;
48707
+ var x=this.ChartFrame.GetXFromIndex(j);
48708
+ var left=x;
48709
+ var right=x;
48706
48710
  }
48707
48711
  else
48708
48712
  {
48709
- this.Canvas.fillStyle=item.Color;
48713
+ var left=xOffset;
48714
+ var right=xOffset+dataWidth;
48715
+ var x=left+(right-left)/2;
48716
+ }
48717
+
48718
+ for(var k=0;k<aryFind.length;++k)
48719
+ {
48720
+ var findItem=aryFind[k];
48721
+ if (mapBG.has(findItem.Index))
48722
+ {
48723
+ var bgItem=mapBG.get(findItem.Index);
48724
+ bgItem.End.Left=left;
48725
+ bgItem.End.Right=right;
48726
+ bgItem.End.Item=findItem.Item;
48727
+ }
48728
+ else
48729
+ {
48730
+ mapBG.set(findItem.Index, { Item:findItem.Item, Start:{ Left:left, Right:right, Item:findItem.Item }, End:{ Left:left, Right:right, Item:findItem.Item }})
48731
+ }
48710
48732
  }
48733
+ }
48711
48734
 
48712
- if (isHScreen) this.Canvas.fillRect(ToFixedRect(bottom),ToFixedRect(rt.Left),ToFixedRect(height),ToFixedRect(rt.Width));
48713
- else this.Canvas.fillRect(ToFixedRect(rt.Left),ToFixedRect(top),ToFixedRect(rt.Width),ToFixedRect(height));
48735
+ if (mapBG.size>0)
48736
+ {
48737
+ this.Canvas.save();
48738
+ //this.ClipClient(bHScreen);
48739
+
48740
+ this.DrawBG(mapBG);
48741
+
48742
+ this.Canvas.restore();
48714
48743
  }
48715
48744
  }
48716
48745
 
48717
- this.GetShowData=function(first, end)
48746
+ this.FindMatchData=function(kItem)
48718
48747
  {
48719
- if (!IFrameSplitOperator.IsNonEmptyArray(this.Data)) return null;
48720
-
48721
- var aryData=[];
48748
+ var aryFind=[];
48722
48749
  for(var i=0;i<this.Data.length;++i)
48723
48750
  {
48724
48751
  var item=this.Data[i];
48725
- var showItem={ };
48726
- if (item.Start.Date>=first.Date && item.Start.Date<=end.Date) showItem.Start=item.Start;
48727
- if (item.End.Date>=first.Date && item.End.Date<=end.Date) showItem.End=item.End;
48728
-
48729
- if (item.Start.Date<first.Date && item.End.Date>end.Date)
48752
+ var start=item.Start;
48753
+ var end=item.End;
48754
+ var bMatch=false;
48755
+ if (IFrameSplitOperator.IsNumber(kItem.Date) && IFrameSplitOperator.IsNumber(kItem.Time))
48730
48756
  {
48731
- showItem.Start=first;
48732
- showItem.End=end;
48757
+ if (kItem.Date>start.Date && kItem.Date<end.Date)
48758
+ {
48759
+ bMatch=true;
48760
+ }
48761
+ else if (kItem.Date==start.Date && kItem.Date==end.Date)
48762
+ {
48763
+ if (kItem.Time>=start.Time && kItem.Time<=end.Time)bMatch=true;
48764
+ }
48765
+ else if (kItem.Date==start.Date)
48766
+ {
48767
+ if (kItem.Time>=start.Time) bMatch=true;
48768
+ }
48769
+ else if (kItem.Date==end.Date)
48770
+ {
48771
+ if ((kItem.Time<=end.Time)) bMatch=true;
48772
+ }
48733
48773
  }
48734
-
48735
-
48736
- if (showItem.Start || showItem.End)
48774
+ else if (IFrameSplitOperator.IsNumber(kItem.Date) && !IFrameSplitOperator.IsNumber(kItem.Time))
48737
48775
  {
48738
- showItem.Color=item.Color;
48739
- aryData.push(showItem);
48776
+ if (kItem.Date>=start.Date && kItem.Date<=end.Date) bMatch=true;
48740
48777
  }
48778
+
48779
+ if (bMatch) aryFind.push({ Index:i, Item:item });
48741
48780
  }
48742
48781
 
48743
- //JSConsole.Chart.Log('[BackgroundPaint::GetShowData] aryData ', aryData);
48744
- return aryData;
48782
+ if (aryFind.Length<=0) return null;
48783
+
48784
+ return aryFind;
48745
48785
  }
48746
48786
 
48747
- this.BuildKLineMap=function()
48787
+ this.DrawBG=function(mapBG)
48748
48788
  {
48749
- var isHScreen=(this.ChartSubFrame.IsHScreen===true);
48750
- var dataWidth=this.ChartSubFrame.DataWidth;
48751
- var distanceWidth=this.ChartSubFrame.DistanceWidth;
48752
- var xOffset=this.ChartBorder.GetLeft()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
48753
- if (isHScreen) xOffset=this.ChartBorder.GetTop()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
48754
- var chartright=this.ChartBorder.GetRight();
48755
- if (isHScreen) chartright=this.ChartBorder.GetBottom();
48756
-
48757
- var mapKLine={ Data:new Map() ,Start:null, End:null } ; //Key: date / date time, Value:索引
48758
- for(var i=this.KData.DataOffset,j=0; i<this.KData.Data.length && j<this.XPointCount; ++i,++j,xOffset+=(dataWidth+distanceWidth))
48789
+ for(var mapItem of mapBG)
48759
48790
  {
48760
- var kItem=this.KData.Data[i];
48761
- var left=xOffset;
48762
- var right=xOffset+dataWidth;
48763
- if (right>chartright) break;
48764
- var x=left+(right-left)/2;
48765
-
48766
- if (j==0) mapKLine.XLeft=left;
48767
- mapKLine.XRight=right;
48768
-
48769
- var value={ Index:i, ShowIndex:j , X:x, Right:right, Left:left, Date:kItem.Date };
48770
- if (ChartData.IsMinutePeriod(this.Period,true))
48771
- {
48772
- var key=`Date:${kItem.Date} Time:${kItem.Time}`;
48773
- value.Time=kItem.Time;
48774
- }
48775
- else
48791
+ var bgItem=mapItem[1];
48792
+ //this.DrawBGItem(this.SubFrame, bgItem);
48793
+
48794
+ for(var i=0;i<this.ChartFrame.SubFrame.length;++i)
48776
48795
  {
48777
- var key=`Date:${kItem.Date}`;
48796
+ var subFrame=this.ChartFrame.SubFrame[i].Frame;
48797
+ if (this.IsDrawAllFrame || this.SetDrawFrameID.has(i))
48798
+ {
48799
+ this.DrawBGItem(subFrame, bgItem);
48800
+ }
48778
48801
  }
48779
-
48780
- mapKLine.Data.set(key,value);
48781
-
48782
- //保存下起始和结束位置
48783
- if (j==0) mapKLine.Start=value;
48784
- mapKLine.End=value;
48785
48802
  }
48786
-
48787
- return mapKLine;
48788
48803
  }
48789
48804
 
48790
- this.GetBGCoordinate=function(item,kLineMap)
48805
+ this.DrawBGItem=function(frame, bgItem)
48791
48806
  {
48792
- var xLeft=null, xRight=null;
48793
- var isMinutePeriod=ChartData.IsMinutePeriod(this.Period,true);
48794
- var bSingleDate=false;
48795
- //JSConsole.Chart.Log('[BackgroundPaint::GetBGCoordinate] item ', item);
48796
- if (isMinutePeriod)
48797
- {
48798
- if (item.Start && item.End && item.Start.Date==item.End.Date && item.Start.Time==item.End.Time) bSingleDate=true;
48799
- }
48800
- else
48801
- {
48802
- if (item.Start && item.End && item.Start.Date==item.End.Date) bSingleDate=true;
48803
- }
48804
-
48805
- if (bSingleDate)
48806
- {
48807
- if (isMinutePeriod)
48808
- var key=`Date:${item.Start.Date} Time:${item.Start.Time}`;
48809
- else
48810
- var key=`Date:${item.Start.Date}`;
48811
-
48812
- if (!kLineMap.Data.has(key)) return null;
48813
- var findItem=kLineMap.Data.get(key);
48814
- xLeft=findItem.Left;
48815
- xRight=findItem.Right;
48816
- return { Left:xLeft, Right:xRight, Width:xRight-xLeft };
48817
- }
48818
-
48819
- if (item.Start)
48807
+ var border=frame.GetBorder();
48808
+ if (this.IsHScreen)
48820
48809
  {
48821
- if (isMinutePeriod)
48822
- var key=`Date:${item.Start.Date} Time:${item.Start.Time}`;
48823
- else
48824
- var key=`Date:${item.Start.Date}`;
48825
-
48826
- if (kLineMap.Data.has(key))
48827
- {
48828
- var findItem=kLineMap.Data.get(key);
48829
- xLeft=findItem.Left;
48830
- }
48831
- else
48832
- {
48833
- if (isMinutePeriod)
48834
- {
48835
- if (item.Start.Date<kLineMap.Start.Date || (item.Start.Date==kLineMap.Start.Date && item.Start.Time<=kLineMap.Start.Time) )
48836
- {
48837
- xLeft=kLineMap.Start.Left;
48838
- }
48839
- else
48840
- {
48841
- for(var kItem of kLineMap.Data)
48842
- {
48843
- var value=kItem[1];
48844
- if (value.Date>item.Start.Date || (value.Date==item.Start.Date && value.Time>item.Start.Time))
48845
- {
48846
- xLeft=value.Left;
48847
- break;
48848
- }
48849
- }
48850
- }
48851
- }
48852
- else
48853
- {
48854
- if (item.Start.Date<=kLineMap.Start.Date)
48855
- {
48856
- xLeft=kLineMap.Start.Left;
48857
- }
48858
- else
48859
- {
48860
- for(var kItem of kLineMap.Data)
48861
- {
48862
- var value=kItem[1];
48863
- if (value.Date>item.Start.Date)
48864
- {
48865
- xLeft=value.Left;
48866
- break;
48867
- }
48868
- }
48869
- }
48870
- }
48871
- }
48810
+ var top=border.RightEx;
48811
+ var bottom=border.LeftEx;
48812
+ var left=border.Top;
48872
48813
  }
48873
48814
  else
48874
48815
  {
48875
- xLeft=kLineMap.XLeft;
48816
+ var top=border.TopEx;
48817
+ var bottom=border.BottomEx;
48818
+ var left=border.Left;
48876
48819
  }
48877
48820
 
48878
- if (item.End)
48821
+ if (this.IsHScreen)
48879
48822
  {
48880
- if (isMinutePeriod)
48881
- var key=`Date:${item.End.Date} Time:${item.End.Time}`;
48882
- else
48883
- var key=`Date:${item.End.Date}`;
48884
-
48885
- if (kLineMap.Data.has(key))
48886
- {
48887
- var findItem=kLineMap.Data.get(key);
48888
- xRight=findItem.Right;
48889
- }
48890
- else
48891
- {
48892
- if (isMinutePeriod)
48893
- {
48894
- if (item.End.Date<kLineMap.Start.Date || (item.End.Date==kLineMap.Start.Date && item.End.Time<kLineMap.Start.Time)) return null;
48895
-
48896
- if (item.End.Date<kLineMap.End.Date || (item.End.Date==kLineMap.End.Date && item.End.Time>=kLineMap.End.Time) )
48897
- {
48898
- xRight=kLineMap.End.Right;
48899
- }
48900
- else
48901
- {
48902
- var previousX=null;
48903
- for(var kItem of kLineMap.Data)
48904
- {
48905
- var value=kItem[1];
48906
- if (value.Date>item.End.Date || (value.Date==item.End.Date && value.Time>item.End.Time) )
48907
- {
48908
- xRight=previousX;
48909
- break;
48910
- }
48911
- previousX=value.Right;
48912
- }
48913
- }
48914
- }
48915
- else
48916
- {
48917
- if (item.End.Date<kLineMap.Start.Date) return null;
48918
-
48919
- if (item.End.Date<=kLineMap.End.Date)
48920
- {
48921
- xRight=kLineMap.End.Right;
48922
- }
48923
- else
48924
- {
48925
- var previousX=null;
48926
- for(var kItem of kLineMap.Data)
48927
- {
48928
- var value=kItem[1];
48929
- if (value.Date>item.End.Date)
48930
- {
48931
- xRight=previousX;
48932
- break;
48933
- }
48934
- previousX=value.Right;
48935
- }
48936
- }
48937
- }
48938
- }
48823
+ this.SetFillStyle(bgItem.Item.Color,top,left,bottom,left);
48824
+ var start=bgItem.Start;
48825
+ var end=bgItem.End;
48826
+ var rtBG={ Left:bottom, Right:top, Top:start.Left, Bottom:end.Right };
48827
+ rtBG.Width=rtBG.Right-rtBG.Left;
48828
+ rtBG.Height=rtBG.Bottom-rtBG.Top;
48829
+ this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));
48939
48830
  }
48940
48831
  else
48941
48832
  {
48942
- xRight=kLineMap.XRight;
48833
+ this.SetFillStyle(bgItem.Item.Color, left,top, left,bottom);
48834
+ var start=bgItem.Start;
48835
+ var end=bgItem.End;
48836
+ var rtBG={ Left:start.Left, Right:end.Right, Top:top, Bottom:bottom };
48837
+ rtBG.Width=rtBG.Right-rtBG.Left;
48838
+ rtBG.Height=rtBG.Bottom-rtBG.Top;
48839
+ this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));
48943
48840
  }
48944
-
48945
- if (xLeft==null || xRight==null) return null;
48946
-
48947
- return { Left:xLeft, Right:xRight, Width:xRight-xLeft };
48948
48841
  }
48949
48842
  }
48950
48843
 
48844
+
48951
48845
  function MinuteBackgroundPaint()
48952
48846
  {
48953
48847
  this.newMethod=IExtendChartPainting; //派生
@@ -58547,7 +58441,7 @@ function DynamicChartTitlePainting()
58547
58441
  var left=positionInfo.Left;
58548
58442
  var right=positionInfo.Right;
58549
58443
  var bottom=positionInfo.Bottom;
58550
-
58444
+ var pixelRatio=GetDevicePixelRatio();
58551
58445
  for(var i=0; i<this.Data.length; ++i)
58552
58446
  {
58553
58447
  var item=this.Data[i];
@@ -58566,7 +58460,9 @@ function DynamicChartTitlePainting()
58566
58460
  if (titleItem.Name) text=titleItem.Name+":"+titleItem.Text;
58567
58461
  else text=titleItem.Text;
58568
58462
 
58569
- var space=this.ParamSpace*GetDevicePixelRatio();
58463
+ if (IFrameSplitOperator.IsNumber(titleItem.LeftSpace)) left+=titleItem.LeftSpace*pixelRatio;
58464
+
58465
+ var space=this.ParamSpace*pixelRatio;
58570
58466
  var indexTextWidth=this.Canvas.measureText(text).width; //标题+数值长度
58571
58467
  var textWidth=indexTextWidth;
58572
58468
 
@@ -58642,7 +58538,7 @@ function DynamicChartTitlePainting()
58642
58538
  if (dyTitle) text=dyTitle+":"+valueText;
58643
58539
  else text=item.Name+":"+valueText;
58644
58540
  }
58645
- var space=this.ParamSpace*GetDevicePixelRatio();
58541
+ var space=this.ParamSpace*pixelRatio;
58646
58542
  var textWidth=this.Canvas.measureText(text).width+space;
58647
58543
  if ((left+textWidth)>right) break;
58648
58544
 
@@ -76218,12 +76114,14 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
76218
76114
  var item=option.PopMinuteChart;
76219
76115
  this.PopMinuteChart=new JSPopMinuteChart();
76220
76116
  this.PopMinuteChart.Inital(this, item);
76117
+ this.PopMinuteChart.Create();
76221
76118
  return true;
76222
76119
  }
76223
76120
  else if (option.KLine && option.KLine.KLineDoubleClick===true) //旧的格式 不要使用了
76224
76121
  {
76225
76122
  this.PopMinuteChart=new JSPopMinuteChart();
76226
76123
  this.PopMinuteChart.Inital(this);
76124
+ this.PopMinuteChart.Create();
76227
76125
  return true;
76228
76126
  }
76229
76127
 
@@ -79805,6 +79703,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
79805
79703
  chart.SetOption(option);
79806
79704
  this.ExtendChartPaint.push(chart);
79807
79705
  return chart;
79706
+ case "BackgroundPaint":
79808
79707
  case '背景图':
79809
79708
  chart=new BackgroundPaint();
79810
79709
  chart.Canvas=this.Canvas;
@@ -88405,6 +88304,16 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
88405
88304
  chart.SetOption(option);
88406
88305
  this.ExtendChartPaint.push(chart);
88407
88306
  return chart;
88307
+ case "BackgroundPaint":
88308
+ case "背景图":
88309
+ chart=new BackgroundPaint();
88310
+ chart.Canvas=this.Canvas;
88311
+ chart.ChartBorder=this.Frame.ChartBorder;
88312
+ chart.ChartFrame=this.Frame;
88313
+ chart.HQChart=this;
88314
+ chart.SetOption(option);
88315
+ this.ExtendChartPaint.push(chart);
88316
+ return chart;
88408
88317
  default:
88409
88318
  chart=g_ExtendChartPaintFactory.Create(name);
88410
88319
  if (!chart) return null;