hqchart 1.1.15258 → 1.1.15273
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.
- package/lib/umychart.vue.js +155 -100
- package/package.json +1 -1
- package/src/jscommon/umychart.NetworkFilterTest.js +22 -0
- package/src/jscommon/umychart.complier.js +265 -29
- package/src/jscommon/umychart.js +322 -3
- package/src/jscommon/umychart.testdata.js +22 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +588 -33
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.NetworkFilterTest.vue.js +22 -0
- package/src/jscommon/umychart.vue/umychart.vue.js +588 -33
|
@@ -7489,6 +7489,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7489
7489
|
this.IsPress=false; //是否长按
|
|
7490
7490
|
this.IsPressKeyboard=false; //是否键盘按键
|
|
7491
7491
|
this.PressKeyboardConfig={ PauseUpdate:false, }; //按键以后 是否涨停数据更新
|
|
7492
|
+
this.DrawStatusData={ LatestTime:{ Draw:null, DrawDynamicInfo:null } };
|
|
7492
7493
|
|
|
7493
7494
|
this.NetworkFilter; //网络请求回调 function(data, callback);
|
|
7494
7495
|
this.LastMouseStatus={ MouseOnToolbar:null }; // MouseOnToolbar={ Rect:{}, Title: }
|
|
@@ -7694,6 +7695,24 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7694
7695
|
return unit;
|
|
7695
7696
|
}
|
|
7696
7697
|
|
|
7698
|
+
this.ClearDrawStatusData=function()
|
|
7699
|
+
{
|
|
7700
|
+
this.DrawStatusData.LatestTime.Draw=null;
|
|
7701
|
+
this.DrawStatusData.LatestTime.DrawDynamicInfo=null;
|
|
7702
|
+
}
|
|
7703
|
+
|
|
7704
|
+
this.UpdateDrawStatusData=function(funName)
|
|
7705
|
+
{
|
|
7706
|
+
if (funName=="Draw")
|
|
7707
|
+
{
|
|
7708
|
+
this.DrawStatusData.LatestTime.Draw=new Date();
|
|
7709
|
+
}
|
|
7710
|
+
else if (funName=="DrawDynamicInfo")
|
|
7711
|
+
{
|
|
7712
|
+
this.DrawStatusData.LatestTime.DrawDynamicInfo=new Date();
|
|
7713
|
+
}
|
|
7714
|
+
}
|
|
7715
|
+
|
|
7697
7716
|
this.ClearStockCache=function()
|
|
7698
7717
|
{
|
|
7699
7718
|
this.StockCache.Data=null;
|
|
@@ -11006,6 +11025,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
11006
11025
|
++this.TouchDrawCount;
|
|
11007
11026
|
|
|
11008
11027
|
this.UpdateCorssCursorStatus();
|
|
11028
|
+
this.UpdateDrawStatusData("Draw");
|
|
11009
11029
|
}
|
|
11010
11030
|
|
|
11011
11031
|
this.DrawExtendChartPaint=function(level, option)
|
|
@@ -11234,7 +11254,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
11234
11254
|
IsOnTouch:this.IsOnTouch,
|
|
11235
11255
|
CorssCursorTouchEnd:this.CorssCursorTouchEnd,
|
|
11236
11256
|
IsTitleShowLatestData:this.IsTitleShowLatestData,
|
|
11237
|
-
IsMinuteChart:(this.ClassName=="MinuteChartContainer" || this.ClassName=="MinuteChartHScreenContainer") ? true:false
|
|
11257
|
+
IsMinuteChart:(this.ClassName=="MinuteChartContainer" || this.ClassName=="MinuteChartHScreenContainer") ? true:false,
|
|
11258
|
+
DrawStatusData:this.DrawStatusData,
|
|
11238
11259
|
};
|
|
11239
11260
|
|
|
11240
11261
|
status.FrameID=this.Frame.PtInFrame(this.LastPoint.X, this.LastPoint.Y);
|
|
@@ -11529,6 +11550,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
11529
11550
|
++this.TouchDrawCount;
|
|
11530
11551
|
|
|
11531
11552
|
this.UpdateCorssCursorStatus();
|
|
11553
|
+
this.UpdateDrawStatusData("DrawDynamicInfo");
|
|
11554
|
+
|
|
11532
11555
|
}
|
|
11533
11556
|
|
|
11534
11557
|
this.DrawAnimation=function() //绘制动画 如弹幕
|
|
@@ -43760,6 +43783,294 @@ function ChartSingleText()
|
|
|
43760
43783
|
}
|
|
43761
43784
|
}
|
|
43762
43785
|
|
|
43786
|
+
function ChartDrawText_Fix()
|
|
43787
|
+
{
|
|
43788
|
+
this.newMethod=IChartPainting; //派生
|
|
43789
|
+
this.newMethod();
|
|
43790
|
+
delete this.newMethod;
|
|
43791
|
+
|
|
43792
|
+
this.ClassName='ChartDrawText_Fix'; //类名
|
|
43793
|
+
|
|
43794
|
+
this.Color="rgb(255,193,37)"; //字颜色
|
|
43795
|
+
this.TextFont=g_JSChartResource.DRAWTEXT_FIX.Font;
|
|
43796
|
+
this.PtPercentage=null; //{ X:, Y: } 百分比坐标
|
|
43797
|
+
this.TextBaseline="top";
|
|
43798
|
+
this.TextAlign='center';
|
|
43799
|
+
this.ShowOffset={ X:0, Y:0 }; //显示偏移
|
|
43800
|
+
this.MapCache;
|
|
43801
|
+
this.HQChart;
|
|
43802
|
+
this.AryText;
|
|
43803
|
+
|
|
43804
|
+
this.BuildCacheData=function(kData, data)
|
|
43805
|
+
{
|
|
43806
|
+
var mapData=new Map();
|
|
43807
|
+
this.MapCache=mapData;
|
|
43808
|
+
if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return;
|
|
43809
|
+
if (!data || !IFrameSplitOperator.IsNonEmptyArray(data.Value) || !IFrameSplitOperator.IsNonEmptyArray(data.Text)) return;
|
|
43810
|
+
|
|
43811
|
+
for(var i=0;i<kData.Data.length;++i)
|
|
43812
|
+
{
|
|
43813
|
+
var value=data.Value[i];
|
|
43814
|
+
if (value!==1) continue;
|
|
43815
|
+
|
|
43816
|
+
var text=data.Text[i];
|
|
43817
|
+
if (!text) continue;
|
|
43818
|
+
|
|
43819
|
+
var kItem=kData.Data[i];
|
|
43820
|
+
var item={ Value:value, Text:text, Date:kItem.Date, Time:kItem.Time };
|
|
43821
|
+
var key=this.BuildKey(item);
|
|
43822
|
+
|
|
43823
|
+
/* //测试
|
|
43824
|
+
item.Text=
|
|
43825
|
+
[
|
|
43826
|
+
{ Name:`日期`, Text:`${item.Date}`, Margin:{ Bottom:10 }},
|
|
43827
|
+
{ Name:`日期2`, Text:`${item.Date}-2`},
|
|
43828
|
+
]
|
|
43829
|
+
*/
|
|
43830
|
+
|
|
43831
|
+
mapData.set(key,item);
|
|
43832
|
+
}
|
|
43833
|
+
}
|
|
43834
|
+
|
|
43835
|
+
this.ReloadResource=function(resource)
|
|
43836
|
+
{
|
|
43837
|
+
this.TextFont=g_JSChartResource.DRAWTEXT_FIX.Font;
|
|
43838
|
+
}
|
|
43839
|
+
|
|
43840
|
+
this.Draw=function()
|
|
43841
|
+
{
|
|
43842
|
+
this.AryText=null;
|
|
43843
|
+
if (!this.IsShow || this.ChartFrame.IsMinSize) return;
|
|
43844
|
+
if (this.IsShowIndexTitleOnly()) return;
|
|
43845
|
+
if (this.IsHideScriptIndex()) return;
|
|
43846
|
+
if (!this.MapCache || this.MapCache.size<=0) return;
|
|
43847
|
+
if (!this.PtPercentage || !IFrameSplitOperator.IsNumber(this.PtPercentage.X) || !IFrameSplitOperator.IsNumber(this.PtPercentage.Y)) return;
|
|
43848
|
+
if (!this.IsDrawText()) return;
|
|
43849
|
+
|
|
43850
|
+
var bHScreen=(this.ChartFrame.IsHScreen===true)
|
|
43851
|
+
this.Canvas.save();
|
|
43852
|
+
this.ClipClient(bHScreen);
|
|
43853
|
+
|
|
43854
|
+
this.DrawText();
|
|
43855
|
+
|
|
43856
|
+
this.Canvas.restore();
|
|
43857
|
+
this.AryText=null;
|
|
43858
|
+
}
|
|
43859
|
+
|
|
43860
|
+
//当前屏是否要绘制文字
|
|
43861
|
+
this.IsDrawText=function()
|
|
43862
|
+
{
|
|
43863
|
+
if (!this.HQChart) return false;
|
|
43864
|
+
var kData=this.HQChart.GetKData();
|
|
43865
|
+
if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return false;
|
|
43866
|
+
|
|
43867
|
+
var bHScreen=(this.ChartFrame.IsHScreen===true)
|
|
43868
|
+
var dataWidth=this.ChartFrame.DataWidth;
|
|
43869
|
+
var distanceWidth=this.ChartFrame.DistanceWidth;
|
|
43870
|
+
var xPointCount=this.ChartFrame.XPointCount;
|
|
43871
|
+
var xOffset=this.ChartBorder.GetLeft()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
|
|
43872
|
+
var chartright=this.ChartBorder.GetRight();
|
|
43873
|
+
var top=this.ChartBorder.GetTopEx();
|
|
43874
|
+
var bottom=this.ChartBorder.GetBottomEx();
|
|
43875
|
+
|
|
43876
|
+
if (bHScreen)
|
|
43877
|
+
{
|
|
43878
|
+
chartright=this.ChartBorder.GetBottom();
|
|
43879
|
+
top=this.ChartBorder.GetRightEx();
|
|
43880
|
+
bottom=this.ChartBorder.GetLeftEx();
|
|
43881
|
+
xOffset=this.ChartBorder.GetTop()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
|
|
43882
|
+
}
|
|
43883
|
+
|
|
43884
|
+
for(var i=kData.DataOffset,j=0;i<kData.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth))
|
|
43885
|
+
{
|
|
43886
|
+
var kItem=kData.Data[i];
|
|
43887
|
+
if (kItem==null) continue;
|
|
43888
|
+
|
|
43889
|
+
var key=this.BuildKey(kItem);
|
|
43890
|
+
if (!this.MapCache.has(key)) continue;
|
|
43891
|
+
|
|
43892
|
+
var item=this.MapCache.get(key);
|
|
43893
|
+
if (Array.isArray(item.Text)) this.AryText=item.Text;
|
|
43894
|
+
else this.AryText=[{ Name:item.Text }];
|
|
43895
|
+
return true;
|
|
43896
|
+
}
|
|
43897
|
+
|
|
43898
|
+
return false;
|
|
43899
|
+
}
|
|
43900
|
+
|
|
43901
|
+
this.DrawText=function()
|
|
43902
|
+
{
|
|
43903
|
+
var bHScreen=(this.ChartFrame.IsHScreen===true);
|
|
43904
|
+
if (bHScreen)
|
|
43905
|
+
{
|
|
43906
|
+
var x=this.ChartBorder.GetRightEx()-this.ChartBorder.GetWidthEx()*this.PtPercentage.Y;
|
|
43907
|
+
var y=this.ChartBorder.GetTop()+this.ChartBorder.GetHeight()*this.PtPercentage.X;
|
|
43908
|
+
}
|
|
43909
|
+
else
|
|
43910
|
+
{
|
|
43911
|
+
var x=this.ChartBorder.GetLeft()+this.ChartBorder.GetWidth()*this.PtPercentage.X;
|
|
43912
|
+
var y=this.ChartBorder.GetTopEx()+this.ChartBorder.GetHeightEx()*this.PtPercentage.Y;
|
|
43913
|
+
}
|
|
43914
|
+
|
|
43915
|
+
var drawInfo=this.CalculateComplexTextSize(this.AryText, { Font:this.TextFont, Color:this.Color });
|
|
43916
|
+
if (!drawInfo) return;
|
|
43917
|
+
|
|
43918
|
+
drawInfo.IsHScreen=bHScreen;
|
|
43919
|
+
|
|
43920
|
+
if (bHScreen)
|
|
43921
|
+
{
|
|
43922
|
+
if (this.TextBaseline=="middle") x=x-drawInfo.Height/2; //上下居中
|
|
43923
|
+
else if (this.TextBaseline=="bottom") x=x-drawInfo.Height; //底部
|
|
43924
|
+
|
|
43925
|
+
if (this.TextAlign=="center") y=y-drawInfo.Width/2; //左右居中
|
|
43926
|
+
else if (this.TextAlign=='right') y=y-drawInfo.Width; //右对齐
|
|
43927
|
+
|
|
43928
|
+
this.DrawComplexText(x,y, drawInfo);
|
|
43929
|
+
}
|
|
43930
|
+
else
|
|
43931
|
+
{
|
|
43932
|
+
if (this.TextBaseline=="middle") y=y-drawInfo.Height/2; //上下居中
|
|
43933
|
+
else if (this.TextBaseline=="bottom") y=y-drawInfo.Height; //底部
|
|
43934
|
+
|
|
43935
|
+
if (this.TextAlign=="center") x=x-drawInfo.Width/2; //左右居中
|
|
43936
|
+
else if (this.TextAlign=='right') x=x-drawInfo.Width; //右对齐
|
|
43937
|
+
|
|
43938
|
+
this.DrawComplexText(x,y, drawInfo);
|
|
43939
|
+
}
|
|
43940
|
+
}
|
|
43941
|
+
|
|
43942
|
+
this.DrawComplexText=function(x, y, drawInfo)
|
|
43943
|
+
{
|
|
43944
|
+
var left=x;
|
|
43945
|
+
var lineTop=y;
|
|
43946
|
+
if (drawInfo.IsHScreen)
|
|
43947
|
+
{
|
|
43948
|
+
left=0;
|
|
43949
|
+
lineTop=0;
|
|
43950
|
+
this.Canvas.save();
|
|
43951
|
+
this.Canvas.translate(x, y);
|
|
43952
|
+
this.Canvas.rotate(90 * Math.PI / 180);
|
|
43953
|
+
}
|
|
43954
|
+
|
|
43955
|
+
this.Canvas.textBaseline="bottom";
|
|
43956
|
+
this.Canvas.textAlign="left";
|
|
43957
|
+
for(var i=0;i<drawInfo.AryData.length;++i)
|
|
43958
|
+
{
|
|
43959
|
+
var item=drawInfo.AryData[i];
|
|
43960
|
+
var margin=item.Margin;
|
|
43961
|
+
var xText=left+margin.Left;
|
|
43962
|
+
var yText=lineTop+item.Height-margin.Bottom;
|
|
43963
|
+
|
|
43964
|
+
if (item.Name)
|
|
43965
|
+
{
|
|
43966
|
+
this.Canvas.font=item.Font;
|
|
43967
|
+
this.Canvas.fillStyle=item.NameColor;
|
|
43968
|
+
this.Canvas.fillText(item.Name,xText,yText);
|
|
43969
|
+
xText+=item.NameWidth+item.Space;
|
|
43970
|
+
}
|
|
43971
|
+
|
|
43972
|
+
if (item.Text)
|
|
43973
|
+
{
|
|
43974
|
+
this.Canvas.font=item.Font;
|
|
43975
|
+
this.Canvas.fillStyle=item.TextColor;
|
|
43976
|
+
this.Canvas.fillText(item.Text,xText,yText);
|
|
43977
|
+
xText+=item.TextWidth;
|
|
43978
|
+
}
|
|
43979
|
+
|
|
43980
|
+
lineTop+=item.Height;
|
|
43981
|
+
}
|
|
43982
|
+
|
|
43983
|
+
if (drawInfo.IsHScreen) this.Canvas.restore();
|
|
43984
|
+
}
|
|
43985
|
+
|
|
43986
|
+
//计算复杂文本长度高度 defaultOption:{ Font:, }
|
|
43987
|
+
this.CalculateComplexTextSize=function(aryText, defaultOption)
|
|
43988
|
+
{
|
|
43989
|
+
if (!defaultOption) return null;
|
|
43990
|
+
if (!aryText || !IFrameSplitOperator.IsNonEmptyArray(aryText)) return null;
|
|
43991
|
+
|
|
43992
|
+
this.Canvas.font=defaultOption.Font;
|
|
43993
|
+
var lineHeight=this.Canvas.measureText("擎").width;
|
|
43994
|
+
var maxNameWidth=0, maxTextWidth=0;
|
|
43995
|
+
var result={ AryData:[], Width:0, Height:0 }
|
|
43996
|
+
for(var i=0;i<aryText.length;++i)
|
|
43997
|
+
{
|
|
43998
|
+
var item=aryText[i];
|
|
43999
|
+
var newItem={ NameWidth:0, TextWidth:0, Margin:{ Left:0, Top:0, Right:0, Bottom:0 }, Font:defaultOption.Font, Space:0, YOffset:0, Width:0, Height:0 };
|
|
44000
|
+
if (item.Name)
|
|
44001
|
+
{
|
|
44002
|
+
newItem.NameWidth=this.Canvas.measureText(item.Name).width;
|
|
44003
|
+
newItem.Name=item.Name;
|
|
44004
|
+
if (maxNameWidth<item.NameWidth) maxNameWidth=newItem.NameWidth;
|
|
44005
|
+
if (IFrameSplitOperator.IsNumber(item.Space)) newItem.Space=item.Space;
|
|
44006
|
+
if (item.NameColor) newItem.NameColor=item.NameColor;
|
|
44007
|
+
else newItem.NameColor=defaultOption.Color;
|
|
44008
|
+
}
|
|
44009
|
+
|
|
44010
|
+
if (item.Text)
|
|
44011
|
+
{
|
|
44012
|
+
newItem.TextWidth=this.Canvas.measureText(item.Text).width;
|
|
44013
|
+
newItem.Text=item.Text;
|
|
44014
|
+
if (maxTextWidth<item.TextWidth) maxTextWidth=newItem.TextWidth;
|
|
44015
|
+
if (item.TextColor) newItem.TextColor=item.TextColor;
|
|
44016
|
+
else newItem.TextColor=defaultOption.Color;
|
|
44017
|
+
}
|
|
44018
|
+
|
|
44019
|
+
|
|
44020
|
+
CopyMarginConfig(newItem.Margin, item.Margin);
|
|
44021
|
+
|
|
44022
|
+
if (IFrameSplitOperator.IsNumber(item.YOffset)) newItem.YOffset=item.YOffset;
|
|
44023
|
+
|
|
44024
|
+
newItem.Width=newItem.NameWidth+newItem.TextWidth;
|
|
44025
|
+
newItem.Width+=newItem.Margin.Left+newItem.Margin.Right+newItem.Space;
|
|
44026
|
+
newItem.Height=(lineHeight+newItem.Margin.Top+newItem.Margin.Bottom);
|
|
44027
|
+
|
|
44028
|
+
result.AryData.push(newItem);
|
|
44029
|
+
result.Height+=newItem.Height;
|
|
44030
|
+
if (result.Width<newItem.Width) result.Width=newItem.Width;
|
|
44031
|
+
}
|
|
44032
|
+
|
|
44033
|
+
return result;
|
|
44034
|
+
}
|
|
44035
|
+
|
|
44036
|
+
}
|
|
44037
|
+
|
|
44038
|
+
function ChartDrawNumber_Fix()
|
|
44039
|
+
{
|
|
44040
|
+
this.newMethod=ChartDrawText_Fix; //派生
|
|
44041
|
+
this.newMethod();
|
|
44042
|
+
delete this.newMethod;
|
|
44043
|
+
|
|
44044
|
+
this.ClassName='ChartDrawNumber_Fix'; //类名
|
|
44045
|
+
this.TextFont=g_JSChartResource.DRAWNUMBER_FIX.Font;
|
|
44046
|
+
|
|
44047
|
+
this.BuildCacheData=function(kData, data)
|
|
44048
|
+
{
|
|
44049
|
+
var mapData=new Map();
|
|
44050
|
+
this.MapCache=mapData;
|
|
44051
|
+
if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return;
|
|
44052
|
+
if (!data || !IFrameSplitOperator.IsNonEmptyArray(data.Value) || !IFrameSplitOperator.IsNonEmptyArray(data.Text)) return;
|
|
44053
|
+
|
|
44054
|
+
for(var i=0;i<kData.Data.length;++i)
|
|
44055
|
+
{
|
|
44056
|
+
var value=data.Value[i];
|
|
44057
|
+
var text=data.Text[i];
|
|
44058
|
+
if (!text) continue;
|
|
44059
|
+
|
|
44060
|
+
var kItem=kData.Data[i];
|
|
44061
|
+
var item={ Value:value, Text:text, Date:kItem.Date, Time:kItem.Time };
|
|
44062
|
+
var key=this.BuildKey(item);
|
|
44063
|
+
|
|
44064
|
+
mapData.set(key,item);
|
|
44065
|
+
}
|
|
44066
|
+
}
|
|
44067
|
+
|
|
44068
|
+
this.ReloadResource=function(resource)
|
|
44069
|
+
{
|
|
44070
|
+
this.TextFont=g_JSChartResource.DRAWNUMBER_FIX.Font;
|
|
44071
|
+
}
|
|
44072
|
+
}
|
|
44073
|
+
|
|
43763
44074
|
|
|
43764
44075
|
function ChartTradeIcon()
|
|
43765
44076
|
{
|
|
@@ -43926,6 +44237,12 @@ function ChartDrawText()
|
|
|
43926
44237
|
}
|
|
43927
44238
|
}
|
|
43928
44239
|
|
|
44240
|
+
this.GetMaxMin=function()
|
|
44241
|
+
{
|
|
44242
|
+
var range={ Min:null, Max:null };
|
|
44243
|
+
return range;
|
|
44244
|
+
}
|
|
44245
|
+
|
|
43929
44246
|
this.Draw=function()
|
|
43930
44247
|
{
|
|
43931
44248
|
if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
|
|
@@ -89765,7 +90082,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
89765
90082
|
this.ClearCustomKLine();
|
|
89766
90083
|
this.ClearKLineCaluate();
|
|
89767
90084
|
this.UnlockCorssCursor();
|
|
89768
|
-
|
|
90085
|
+
this.ClearDrawStatusData();
|
|
89769
90086
|
|
|
89770
90087
|
var kLineDrawType=this.GetKLineDrawType();
|
|
89771
90088
|
if (kLineDrawType==10 || kLineDrawType==11 || kLineDrawType==12 || kLineDrawType==16) isDataTypeChange=true;
|
|
@@ -91170,7 +91487,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
91170
91487
|
this.UnlockCorssCursor();
|
|
91171
91488
|
this.Frame.ClearYCoordinateMaxMin();
|
|
91172
91489
|
this.ClosePopMinuteChart();
|
|
91173
|
-
|
|
91490
|
+
this.ClearDrawStatusData();
|
|
91174
91491
|
|
|
91175
91492
|
this.Symbol=symbol;
|
|
91176
91493
|
if (!symbol)
|
|
@@ -97784,6 +98101,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
97784
98101
|
this.ClearStockCache();
|
|
97785
98102
|
this.UnlockCorssCursor();
|
|
97786
98103
|
this.Frame.ClearYCoordinateMaxMin();
|
|
98104
|
+
this.ClearDrawStatusData();
|
|
97787
98105
|
|
|
97788
98106
|
|
|
97789
98107
|
if (option)
|
|
@@ -97952,6 +98270,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
97952
98270
|
this.ClearStockCache();
|
|
97953
98271
|
this.UnlockCorssCursor();
|
|
97954
98272
|
this.Frame.ClearYCoordinateMaxMin();
|
|
98273
|
+
this.ClearDrawStatusData();
|
|
97955
98274
|
|
|
97956
98275
|
if (option && option.PageInfo)
|
|
97957
98276
|
{
|
|
@@ -115205,22 +115524,50 @@ function JSAlgorithm(errorHandler,symbolData)
|
|
|
115205
115524
|
this.FILTERX=function(data, n, node)
|
|
115206
115525
|
{
|
|
115207
115526
|
var result=[];
|
|
115208
|
-
|
|
115527
|
+
if (IFrameSplitOperator.IsNumber(n))
|
|
115209
115528
|
{
|
|
115210
|
-
|
|
115529
|
+
for(var i=data.length-1, j=0; i>=0; --i)
|
|
115211
115530
|
{
|
|
115212
|
-
|
|
115213
|
-
for(j=0;j<n && i-j-1>=0;++j)
|
|
115531
|
+
if (data[i])
|
|
115214
115532
|
{
|
|
115215
|
-
result[i
|
|
115533
|
+
result[i]=1;
|
|
115534
|
+
for(j=0;j<n && i-j-1>=0;++j)
|
|
115535
|
+
{
|
|
115536
|
+
result[i-j-1]=0;
|
|
115537
|
+
}
|
|
115538
|
+
i-=n;
|
|
115539
|
+
}
|
|
115540
|
+
else
|
|
115541
|
+
{
|
|
115542
|
+
result[i]=0;
|
|
115216
115543
|
}
|
|
115217
|
-
i+=n;
|
|
115218
115544
|
}
|
|
115219
|
-
|
|
115545
|
+
}
|
|
115546
|
+
else if (Array.isArray(n))
|
|
115547
|
+
{
|
|
115548
|
+
for(var i=data.length-1, j=0; i>=0; --i)
|
|
115220
115549
|
{
|
|
115221
|
-
|
|
115550
|
+
if (data[i])
|
|
115551
|
+
{
|
|
115552
|
+
result[i]=1;
|
|
115553
|
+
if (!IFrameSplitOperator.IsNumber(n[i])) continue;
|
|
115554
|
+
var period=parseInt(n[i]);
|
|
115555
|
+
if (period<=0) continue;
|
|
115556
|
+
|
|
115557
|
+
for(j=0;j<period && i-j-1>=0;++j)
|
|
115558
|
+
{
|
|
115559
|
+
result[i-j-1]=0;
|
|
115560
|
+
}
|
|
115561
|
+
|
|
115562
|
+
i-=period;
|
|
115563
|
+
}
|
|
115564
|
+
else
|
|
115565
|
+
{
|
|
115566
|
+
result[i]=0;
|
|
115567
|
+
}
|
|
115222
115568
|
}
|
|
115223
115569
|
}
|
|
115570
|
+
|
|
115224
115571
|
|
|
115225
115572
|
return result;
|
|
115226
115573
|
}
|
|
@@ -119658,6 +120005,7 @@ function JSDraw(errorHandler,symbolData)
|
|
|
119658
120005
|
return result;
|
|
119659
120006
|
}
|
|
119660
120007
|
|
|
120008
|
+
//只有条件==1 才显示文字
|
|
119661
120009
|
this.DRAWTEXT=function(condition,price,text)
|
|
119662
120010
|
{
|
|
119663
120011
|
let drawData=[];
|
|
@@ -119675,11 +120023,11 @@ function JSDraw(errorHandler,symbolData)
|
|
|
119675
120023
|
isFixedPosition=true;
|
|
119676
120024
|
}
|
|
119677
120025
|
|
|
119678
|
-
for(var i
|
|
120026
|
+
for(var i=0;i<condition.length;++i)
|
|
119679
120027
|
{
|
|
119680
120028
|
drawData[i]=null;
|
|
119681
120029
|
|
|
119682
|
-
if (
|
|
120030
|
+
if (condition[i]!==1) continue;
|
|
119683
120031
|
|
|
119684
120032
|
if (IsNumber || isFixedPosition)
|
|
119685
120033
|
{
|
|
@@ -119691,7 +120039,7 @@ function JSDraw(errorHandler,symbolData)
|
|
|
119691
120039
|
}
|
|
119692
120040
|
}
|
|
119693
120041
|
}
|
|
119694
|
-
else if (this.IsNumber(condition) && condition)
|
|
120042
|
+
else if (this.IsNumber(condition) && condition===1)
|
|
119695
120043
|
{
|
|
119696
120044
|
var IsNumber=this.IsNumber(price);
|
|
119697
120045
|
var isFixedPosition=false;
|
|
@@ -119717,20 +120065,21 @@ function JSDraw(errorHandler,symbolData)
|
|
|
119717
120065
|
return result;
|
|
119718
120066
|
}
|
|
119719
120067
|
|
|
120068
|
+
//1.固定位置显示文字;2.在指标排序中显示字符串栏目.
|
|
120069
|
+
//用法:DRAWTEXT_FIX(COND,X,Y,TYPE,TEXT),COND中一般需要加ISLASTBAR,当COND条件满足时,在当前指标窗口内(X,Y)位置书写文字TEXT,X,Y为书写点在窗口中相对于左上角的百分比,TYPE:0为左对齐,1为右对齐,2=居中.
|
|
120070
|
+
//例如:DRAWTEXT_FIX(ISLASTBAR AND CLOSE/OPEN>1.08,0.5,0.5,0,'大阳线')表示最后一个交易日实体阳线大于8%时在窗口中间位置显示'大阳线'字样.若文字中含有&,则进行折行.最多只能显示250个字符
|
|
119720
120071
|
this.DRAWTEXT_FIX=function(condition,x,y,type,text)
|
|
119721
120072
|
{
|
|
119722
120073
|
var drawData={ Value:[], Text:[] };
|
|
119723
120074
|
var result={DrawData:drawData, DrawType:'DRAWTEXT_FIX', Text:null, Position:{ X:x, Y:y, Type:type } };
|
|
119724
|
-
|
|
119725
|
-
|
|
120075
|
+
|
|
119726
120076
|
if (Array.isArray(condition))
|
|
119727
120077
|
{
|
|
119728
|
-
|
|
119729
|
-
for(var i in condition)
|
|
120078
|
+
for(var i=0; i<condition.length; ++i)
|
|
119730
120079
|
{
|
|
119731
120080
|
drawData.Text[i]=null;
|
|
119732
120081
|
drawData.Value[i]=0;
|
|
119733
|
-
if (
|
|
120082
|
+
if (condition[i]!==1) continue;
|
|
119734
120083
|
|
|
119735
120084
|
drawData.Value[i]=1;
|
|
119736
120085
|
drawData.Text[i]=text;
|
|
@@ -119738,7 +120087,7 @@ function JSDraw(errorHandler,symbolData)
|
|
|
119738
120087
|
}
|
|
119739
120088
|
else
|
|
119740
120089
|
{
|
|
119741
|
-
if(condition)
|
|
120090
|
+
if(condition===1)
|
|
119742
120091
|
{
|
|
119743
120092
|
for(var i=0;i<this.SymbolData.Data.Data.length;++i)
|
|
119744
120093
|
{
|
|
@@ -120477,10 +120826,10 @@ function JSDraw(errorHandler,symbolData)
|
|
|
120477
120826
|
|
|
120478
120827
|
/*
|
|
120479
120828
|
固定位置显示数字.
|
|
120480
|
-
用法: DRAWNUMBER_FIX(COND,X,Y,TYPE,NUMBER),当COND条件满足时,在当前指标窗口内(X,Y)位置书写数字NUMBER,X,Y为书写点在窗口中相对于左上角的百分比,TYPE:0为左对齐,1
|
|
120829
|
+
用法: DRAWNUMBER_FIX(COND,X,Y,TYPE,NUMBER,decimal=2),当COND条件满足时,在当前指标窗口内(X,Y)位置书写数字NUMBER,X,Y为书写点在窗口中相对于左上角的百分比,TYPE:0为左对齐,1为右对齐 2=居中
|
|
120481
120830
|
例如: DRAWNUMBER_FIX(CURRBARSCOUNT=1 AND CLOSE/OPEN>1.08,0.5,0.5,0,C)表示最后一个交易日实体阳线大于8%时在窗口中间位置显示收盘价.
|
|
120482
120831
|
*/
|
|
120483
|
-
this.DRAWNUMBER_FIX=function(condition,x,y,align,data)
|
|
120832
|
+
this.DRAWNUMBER_FIX=function(condition,x,y,align,data, decimal=2)
|
|
120484
120833
|
{
|
|
120485
120834
|
var drawData={ Value:[], Text:[], };
|
|
120486
120835
|
var result={ DrawData:drawData, DrawType:'DRAWNUMBER_FIX', Position:{ X:x, Y:y, Type:align } };
|
|
@@ -120488,15 +120837,15 @@ function JSDraw(errorHandler,symbolData)
|
|
|
120488
120837
|
|
|
120489
120838
|
if (Array.isArray(condition))
|
|
120490
120839
|
{
|
|
120491
|
-
for(var i
|
|
120840
|
+
for(var i=0; i<condition.length; ++i)
|
|
120492
120841
|
{
|
|
120493
120842
|
drawData.Text[i]=null;
|
|
120494
120843
|
drawData.Value[i]=null;
|
|
120495
|
-
if (
|
|
120844
|
+
if (condition[i]!==1) continue;
|
|
120496
120845
|
|
|
120497
120846
|
if (isNumber)
|
|
120498
120847
|
{
|
|
120499
|
-
drawData.Text[i]=this.RemoveZero(data.toFixed(
|
|
120848
|
+
drawData.Text[i]=this.RemoveZero(data.toFixed(decimal));
|
|
120500
120849
|
drawData.Value[i]=data;
|
|
120501
120850
|
}
|
|
120502
120851
|
else
|
|
@@ -120504,14 +120853,14 @@ function JSDraw(errorHandler,symbolData)
|
|
|
120504
120853
|
if (i>=data.length || !IFrameSplitOperator.IsNumber(data[i])) continue;
|
|
120505
120854
|
|
|
120506
120855
|
var item=data[i];
|
|
120507
|
-
drawData.Text[i]=this.RemoveZero(item.toFixed(
|
|
120856
|
+
drawData.Text[i]=this.RemoveZero(item.toFixed(decimal));
|
|
120508
120857
|
drawData.Value[i]=item;
|
|
120509
120858
|
}
|
|
120510
120859
|
}
|
|
120511
120860
|
}
|
|
120512
120861
|
else
|
|
120513
120862
|
{
|
|
120514
|
-
if(
|
|
120863
|
+
if(condition!==1)
|
|
120515
120864
|
{
|
|
120516
120865
|
|
|
120517
120866
|
}
|
|
@@ -120521,7 +120870,7 @@ function JSDraw(errorHandler,symbolData)
|
|
|
120521
120870
|
{
|
|
120522
120871
|
if (isNumber)
|
|
120523
120872
|
{
|
|
120524
|
-
drawData.Text[i]=this.RemoveZero(data.toFixed(
|
|
120873
|
+
drawData.Text[i]=this.RemoveZero(data.toFixed(decimal));
|
|
120525
120874
|
drawData.Value[i]=data;
|
|
120526
120875
|
}
|
|
120527
120876
|
else
|
|
@@ -120529,7 +120878,7 @@ function JSDraw(errorHandler,symbolData)
|
|
|
120529
120878
|
if (i>=data.length || !IFrameSplitOperator.IsNumber(data[i])) continue;
|
|
120530
120879
|
|
|
120531
120880
|
var item=data[i];
|
|
120532
|
-
drawData.Text[i]=this.RemoveZero(item.toFixed(
|
|
120881
|
+
drawData.Text[i]=this.RemoveZero(item.toFixed(decimal));
|
|
120533
120882
|
drawData.Value[i]=item;
|
|
120534
120883
|
}
|
|
120535
120884
|
}
|
|
@@ -128691,7 +129040,7 @@ function JSExecute(ast,option)
|
|
|
128691
129040
|
node.Out=node.Draw.DrawData.Value;
|
|
128692
129041
|
break;
|
|
128693
129042
|
case "DRAWNUMBER_FIX":
|
|
128694
|
-
node.Draw=this.Draw.DRAWNUMBER_FIX(args[0],args[1],args[2],args[3],args[4]);
|
|
129043
|
+
node.Draw=this.Draw.DRAWNUMBER_FIX(args[0],args[1],args[2],args[3],args[4], args[5]);
|
|
128695
129044
|
node.Out=node.Draw.DrawData.Value;
|
|
128696
129045
|
break;
|
|
128697
129046
|
case "DRAWCHANNEL":
|
|
@@ -132158,6 +132507,102 @@ function ScriptIndex(name,script,args,option)
|
|
|
132158
132507
|
hqChart.ChartPaint.push(chartText);
|
|
132159
132508
|
}
|
|
132160
132509
|
|
|
132510
|
+
this.CreateDrawText_Fix=function(hqChart,windowIndex,varItem,id)
|
|
132511
|
+
{
|
|
132512
|
+
var chartText=new ChartDrawText_Fix();
|
|
132513
|
+
chartText.Canvas=hqChart.Canvas;
|
|
132514
|
+
chartText.Name=varItem.Name;
|
|
132515
|
+
chartText.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
|
|
132516
|
+
chartText.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
|
|
132517
|
+
chartText.ReloadResource();
|
|
132518
|
+
chartText.HQChart=hqChart;
|
|
132519
|
+
|
|
132520
|
+
if (varItem.Draw.Position)
|
|
132521
|
+
{
|
|
132522
|
+
var item=varItem.Draw.Position;
|
|
132523
|
+
chartText.PtPercentage={ X:item.X, Y:item.Y }; //坐标
|
|
132524
|
+
// TYPE:0为左对齐,1为右对齐 2=居中
|
|
132525
|
+
if (item.Type===0) chartText.TextAlign="left";
|
|
132526
|
+
else if (item.Type===1) chartText.TextAlign="right";
|
|
132527
|
+
else if (item.Type===2) chartText.TextAlign="center";
|
|
132528
|
+
}
|
|
132529
|
+
|
|
132530
|
+
//字体
|
|
132531
|
+
if (varItem.DrawFontSize>0) chartText.TextFont=`${varItem.DrawFontSize*GetDevicePixelRatio()}px 微软雅黑`; //临时用下吧
|
|
132532
|
+
if (varItem.Font) chartText.TextFont=varItem.Font;
|
|
132533
|
+
|
|
132534
|
+
//颜色
|
|
132535
|
+
if (varItem.Color) chartText.Color=this.GetColor(varItem.Color);
|
|
132536
|
+
else chartText.Color=this.GetDefaultColor(id);
|
|
132537
|
+
|
|
132538
|
+
if (varItem.DrawVAlign>=0) //上下对齐
|
|
132539
|
+
{
|
|
132540
|
+
if (varItem.DrawVAlign==0) chartText.TextBaseline='top';
|
|
132541
|
+
else if (varItem.DrawVAlign==1) chartText.TextBaseline='middle';
|
|
132542
|
+
else if (varItem.DrawVAlign==2) chartText.TextBaseline='bottom';
|
|
132543
|
+
}
|
|
132544
|
+
|
|
132545
|
+
if (varItem.DrawAlign>=0) // 左右对齐
|
|
132546
|
+
{
|
|
132547
|
+
if (varItem.DrawAlign==0) chartText.TextAlign="left";
|
|
132548
|
+
else if (varItem.DrawAlign==1) chartText.TextAlign="center";
|
|
132549
|
+
else if (varItem.DrawAlign==2) chartText.TextAlign='right';
|
|
132550
|
+
}
|
|
132551
|
+
|
|
132552
|
+
chartText.BuildCacheData(hqChart.GetKData(),varItem.Draw.DrawData);
|
|
132553
|
+
|
|
132554
|
+
this.SetChartIndexName(chartText);
|
|
132555
|
+
hqChart.ChartPaint.push(chartText);
|
|
132556
|
+
}
|
|
132557
|
+
|
|
132558
|
+
this.CreateDrawNumber_Fix=function(hqChart,windowIndex,varItem,id)
|
|
132559
|
+
{
|
|
132560
|
+
var chartText=new ChartDrawNumber_Fix();
|
|
132561
|
+
chartText.Canvas=hqChart.Canvas;
|
|
132562
|
+
chartText.Name=varItem.Name;
|
|
132563
|
+
chartText.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
|
|
132564
|
+
chartText.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
|
|
132565
|
+
chartText.ReloadResource();
|
|
132566
|
+
chartText.HQChart=hqChart;
|
|
132567
|
+
|
|
132568
|
+
if (varItem.Draw.Position)
|
|
132569
|
+
{
|
|
132570
|
+
var item=varItem.Draw.Position;
|
|
132571
|
+
chartText.PtPercentage={ X:item.X, Y:item.Y }; //坐标
|
|
132572
|
+
// TYPE:0为左对齐,1为右对齐 2=居中
|
|
132573
|
+
if (item.Type===0) chartText.TextAlign="left";
|
|
132574
|
+
else if (item.Type===1) chartText.TextAlign="right";
|
|
132575
|
+
else if (item.Type===2) chartText.TextAlign="center";
|
|
132576
|
+
}
|
|
132577
|
+
|
|
132578
|
+
//字体
|
|
132579
|
+
if (varItem.DrawFontSize>0) chartText.TextFont=`${varItem.DrawFontSize*GetDevicePixelRatio()}px 微软雅黑`; //临时用下吧
|
|
132580
|
+
if (varItem.Font) chartText.TextFont=varItem.Font;
|
|
132581
|
+
|
|
132582
|
+
//颜色
|
|
132583
|
+
if (varItem.Color) chartText.Color=this.GetColor(varItem.Color);
|
|
132584
|
+
else chartText.Color=this.GetDefaultColor(id);
|
|
132585
|
+
|
|
132586
|
+
if (varItem.DrawVAlign>=0) //上下对齐
|
|
132587
|
+
{
|
|
132588
|
+
if (varItem.DrawVAlign==0) chartText.TextBaseline='top';
|
|
132589
|
+
else if (varItem.DrawVAlign==1) chartText.TextBaseline='middle';
|
|
132590
|
+
else if (varItem.DrawVAlign==2) chartText.TextBaseline='bottom';
|
|
132591
|
+
}
|
|
132592
|
+
|
|
132593
|
+
if (varItem.DrawAlign>=0) // 左右对齐
|
|
132594
|
+
{
|
|
132595
|
+
if (varItem.DrawAlign==0) chartText.TextAlign="left";
|
|
132596
|
+
else if (varItem.DrawAlign==1) chartText.TextAlign="center";
|
|
132597
|
+
else if (varItem.DrawAlign==2) chartText.TextAlign='right';
|
|
132598
|
+
}
|
|
132599
|
+
|
|
132600
|
+
chartText.BuildCacheData(hqChart.GetKData(),varItem.Draw.DrawData);
|
|
132601
|
+
|
|
132602
|
+
this.SetChartIndexName(chartText);
|
|
132603
|
+
hqChart.ChartPaint.push(chartText);
|
|
132604
|
+
}
|
|
132605
|
+
|
|
132161
132606
|
this.CreateDrawText=function(hqChart,windowIndex,varItem,id)
|
|
132162
132607
|
{
|
|
132163
132608
|
let chartText=new ChartSingleText();
|
|
@@ -132974,8 +133419,10 @@ function ScriptIndex(name,script,args,option)
|
|
|
132974
133419
|
this.CreateDrawNumber(hqChart,windowIndex,item,i);
|
|
132975
133420
|
break;
|
|
132976
133421
|
case "DRAWNUMBER_FIX":
|
|
133422
|
+
this.CreateDrawNumber_Fix(hqChart,windowIndex,item,i);
|
|
133423
|
+
break;
|
|
132977
133424
|
case 'DRAWTEXT_FIX':
|
|
132978
|
-
this.
|
|
133425
|
+
this.CreateDrawText_Fix(hqChart,windowIndex,item,i);
|
|
132979
133426
|
break;
|
|
132980
133427
|
case 'DRAWICON':
|
|
132981
133428
|
this.CreateIcon(hqChart,windowIndex,item,i);
|
|
@@ -133367,9 +133814,13 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
133367
133814
|
this.CreateBackgroud(hqChart,windowIndex,item,i);
|
|
133368
133815
|
break;
|
|
133369
133816
|
case 'DRAWNUMBER':
|
|
133817
|
+
this.CreateNumberText(hqChart,windowIndex,item,i);
|
|
133818
|
+
break;
|
|
133370
133819
|
case "DRAWNUMBER_FIX":
|
|
133820
|
+
this.CreateDrawNumber_Fix(hqChart,windowIndex,item,i);
|
|
133821
|
+
break;
|
|
133371
133822
|
case 'DRAWTEXT_FIX':
|
|
133372
|
-
this.
|
|
133823
|
+
this.CreateDrawText_Fix(hqChart,windowIndex,item,i);
|
|
133373
133824
|
break;
|
|
133374
133825
|
case 'DRAWICON':
|
|
133375
133826
|
this.CreateIcon(hqChart,windowIndex,item,i);
|
|
@@ -134078,6 +134529,110 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
134078
134529
|
frame.ChartPaint.push(chart);
|
|
134079
134530
|
}
|
|
134080
134531
|
|
|
134532
|
+
this.CreateDrawText_Fix=function(hqChart,windowIndex,varItem,id)
|
|
134533
|
+
{
|
|
134534
|
+
var overlayIndex=this.OverlayIndex;
|
|
134535
|
+
var frame=overlayIndex.Frame;
|
|
134536
|
+
var chart=new ChartDrawText_Fix();
|
|
134537
|
+
chart.Canvas=hqChart.Canvas;
|
|
134538
|
+
|
|
134539
|
+
chart.Name=varItem.Name;
|
|
134540
|
+
chart.ChartBorder=frame.Frame.ChartBorder;
|
|
134541
|
+
chart.ChartFrame=frame.Frame;
|
|
134542
|
+
chart.Identify=overlayIndex.Identify;
|
|
134543
|
+
chart.ReloadResource();
|
|
134544
|
+
chart.HQChart=hqChart;
|
|
134545
|
+
|
|
134546
|
+
if (varItem.Draw.Position)
|
|
134547
|
+
{
|
|
134548
|
+
var item=varItem.Draw.Position;
|
|
134549
|
+
chart.PtPercentage={ X:item.X, Y:item.Y }; //坐标
|
|
134550
|
+
// TYPE:0为左对齐,1为右对齐 2=居中
|
|
134551
|
+
if (item.Type===0) chart.TextAlign="left";
|
|
134552
|
+
else if (item.Type===1) chart.TextAlign="right";
|
|
134553
|
+
else if (item.Type===2) chart.TextAlign="center";
|
|
134554
|
+
}
|
|
134555
|
+
|
|
134556
|
+
//字体
|
|
134557
|
+
if (varItem.DrawFontSize>0) chart.TextFont=`${varItem.DrawFontSize*GetDevicePixelRatio()}px 微软雅黑`; //临时用下吧
|
|
134558
|
+
if (varItem.Font) chart.TextFont=varItem.Font;
|
|
134559
|
+
|
|
134560
|
+
//颜色
|
|
134561
|
+
if (varItem.Color) chart.Color=this.GetColor(varItem.Color);
|
|
134562
|
+
else chart.Color=this.GetDefaultColor(id);
|
|
134563
|
+
|
|
134564
|
+
if (varItem.DrawVAlign>=0) //上下对齐
|
|
134565
|
+
{
|
|
134566
|
+
if (varItem.DrawVAlign==0) chart.TextBaseline='top';
|
|
134567
|
+
else if (varItem.DrawVAlign==1) chart.TextBaseline='middle';
|
|
134568
|
+
else if (varItem.DrawVAlign==2) chart.TextBaseline='bottom';
|
|
134569
|
+
}
|
|
134570
|
+
|
|
134571
|
+
if (varItem.DrawAlign>=0) // 左右对齐
|
|
134572
|
+
{
|
|
134573
|
+
if (varItem.DrawAlign==0) chart.TextAlign="left";
|
|
134574
|
+
else if (varItem.DrawAlign==1) chart.TextAlign="center";
|
|
134575
|
+
else if (varItem.DrawAlign==2) chart.TextAlign='right';
|
|
134576
|
+
}
|
|
134577
|
+
|
|
134578
|
+
chart.BuildCacheData(hqChart.GetKData(),varItem.Draw.DrawData);
|
|
134579
|
+
|
|
134580
|
+
this.SetChartIndexName(chart);
|
|
134581
|
+
frame.ChartPaint.push(chart);
|
|
134582
|
+
}
|
|
134583
|
+
|
|
134584
|
+
this.CreateDrawNumber_Fix=function(hqChart,windowIndex,varItem,id)
|
|
134585
|
+
{
|
|
134586
|
+
var overlayIndex=this.OverlayIndex;
|
|
134587
|
+
var frame=overlayIndex.Frame;
|
|
134588
|
+
var chart=new ChartDrawNumber_Fix();
|
|
134589
|
+
chart.Canvas=hqChart.Canvas;
|
|
134590
|
+
|
|
134591
|
+
chart.Name=varItem.Name;
|
|
134592
|
+
chart.ChartBorder=frame.Frame.ChartBorder;
|
|
134593
|
+
chart.ChartFrame=frame.Frame;
|
|
134594
|
+
chart.Identify=overlayIndex.Identify;
|
|
134595
|
+
chart.ReloadResource();
|
|
134596
|
+
chart.HQChart=hqChart;
|
|
134597
|
+
|
|
134598
|
+
if (varItem.Draw.Position)
|
|
134599
|
+
{
|
|
134600
|
+
var item=varItem.Draw.Position;
|
|
134601
|
+
chart.PtPercentage={ X:item.X, Y:item.Y }; //坐标
|
|
134602
|
+
// TYPE:0为左对齐,1为右对齐 2=居中
|
|
134603
|
+
if (item.Type===0) chart.TextAlign="left";
|
|
134604
|
+
else if (item.Type===1) chart.TextAlign="right";
|
|
134605
|
+
else if (item.Type===2) chart.TextAlign="center";
|
|
134606
|
+
}
|
|
134607
|
+
|
|
134608
|
+
//字体
|
|
134609
|
+
if (varItem.DrawFontSize>0) chart.TextFont=`${varItem.DrawFontSize*GetDevicePixelRatio()}px 微软雅黑`; //临时用下吧
|
|
134610
|
+
if (varItem.Font) chart.TextFont=varItem.Font;
|
|
134611
|
+
|
|
134612
|
+
//颜色
|
|
134613
|
+
if (varItem.Color) chart.Color=this.GetColor(varItem.Color);
|
|
134614
|
+
else chart.Color=this.GetDefaultColor(id);
|
|
134615
|
+
|
|
134616
|
+
if (varItem.DrawVAlign>=0) //上下对齐
|
|
134617
|
+
{
|
|
134618
|
+
if (varItem.DrawVAlign==0) chart.TextBaseline='top';
|
|
134619
|
+
else if (varItem.DrawVAlign==1) chart.TextBaseline='middle';
|
|
134620
|
+
else if (varItem.DrawVAlign==2) chart.TextBaseline='bottom';
|
|
134621
|
+
}
|
|
134622
|
+
|
|
134623
|
+
if (varItem.DrawAlign>=0) // 左右对齐
|
|
134624
|
+
{
|
|
134625
|
+
if (varItem.DrawAlign==0) chart.TextAlign="left";
|
|
134626
|
+
else if (varItem.DrawAlign==1) chart.TextAlign="center";
|
|
134627
|
+
else if (varItem.DrawAlign==2) chart.TextAlign='right';
|
|
134628
|
+
}
|
|
134629
|
+
|
|
134630
|
+
chart.BuildCacheData(hqChart.GetKData(),varItem.Draw.DrawData);
|
|
134631
|
+
|
|
134632
|
+
this.SetChartIndexName(chart);
|
|
134633
|
+
frame.ChartPaint.push(chart);
|
|
134634
|
+
}
|
|
134635
|
+
|
|
134081
134636
|
this.CreateTextLine=function(hqChart,windowIndex,varItem,id)
|
|
134082
134637
|
{
|
|
134083
134638
|
var overlayIndex=this.OverlayIndex;
|
|
@@ -166352,7 +166907,7 @@ function HQChartScriptWorker()
|
|
|
166352
166907
|
|
|
166353
166908
|
|
|
166354
166909
|
|
|
166355
|
-
var HQCHART_VERSION="1.1.
|
|
166910
|
+
var HQCHART_VERSION="1.1.15272";
|
|
166356
166911
|
|
|
166357
166912
|
function PrintHQChartVersion()
|
|
166358
166913
|
{
|