hqchart 1.1.15255 → 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 +156 -101
- package/package.json +1 -1
- package/src/jscommon/umychart.NetworkFilterTest.js +22 -0
- package/src/jscommon/umychart.complier.js +269 -30
- 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 +592 -34
- 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 +592 -34
|
@@ -7445,6 +7445,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7445
7445
|
this.IsPress=false; //是否长按
|
|
7446
7446
|
this.IsPressKeyboard=false; //是否键盘按键
|
|
7447
7447
|
this.PressKeyboardConfig={ PauseUpdate:false, }; //按键以后 是否涨停数据更新
|
|
7448
|
+
this.DrawStatusData={ LatestTime:{ Draw:null, DrawDynamicInfo:null } };
|
|
7448
7449
|
|
|
7449
7450
|
this.NetworkFilter; //网络请求回调 function(data, callback);
|
|
7450
7451
|
this.LastMouseStatus={ MouseOnToolbar:null }; // MouseOnToolbar={ Rect:{}, Title: }
|
|
@@ -7650,6 +7651,24 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7650
7651
|
return unit;
|
|
7651
7652
|
}
|
|
7652
7653
|
|
|
7654
|
+
this.ClearDrawStatusData=function()
|
|
7655
|
+
{
|
|
7656
|
+
this.DrawStatusData.LatestTime.Draw=null;
|
|
7657
|
+
this.DrawStatusData.LatestTime.DrawDynamicInfo=null;
|
|
7658
|
+
}
|
|
7659
|
+
|
|
7660
|
+
this.UpdateDrawStatusData=function(funName)
|
|
7661
|
+
{
|
|
7662
|
+
if (funName=="Draw")
|
|
7663
|
+
{
|
|
7664
|
+
this.DrawStatusData.LatestTime.Draw=new Date();
|
|
7665
|
+
}
|
|
7666
|
+
else if (funName=="DrawDynamicInfo")
|
|
7667
|
+
{
|
|
7668
|
+
this.DrawStatusData.LatestTime.DrawDynamicInfo=new Date();
|
|
7669
|
+
}
|
|
7670
|
+
}
|
|
7671
|
+
|
|
7653
7672
|
this.ClearStockCache=function()
|
|
7654
7673
|
{
|
|
7655
7674
|
this.StockCache.Data=null;
|
|
@@ -10962,6 +10981,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
10962
10981
|
++this.TouchDrawCount;
|
|
10963
10982
|
|
|
10964
10983
|
this.UpdateCorssCursorStatus();
|
|
10984
|
+
this.UpdateDrawStatusData("Draw");
|
|
10965
10985
|
}
|
|
10966
10986
|
|
|
10967
10987
|
this.DrawExtendChartPaint=function(level, option)
|
|
@@ -11190,7 +11210,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
11190
11210
|
IsOnTouch:this.IsOnTouch,
|
|
11191
11211
|
CorssCursorTouchEnd:this.CorssCursorTouchEnd,
|
|
11192
11212
|
IsTitleShowLatestData:this.IsTitleShowLatestData,
|
|
11193
|
-
IsMinuteChart:(this.ClassName=="MinuteChartContainer" || this.ClassName=="MinuteChartHScreenContainer") ? true:false
|
|
11213
|
+
IsMinuteChart:(this.ClassName=="MinuteChartContainer" || this.ClassName=="MinuteChartHScreenContainer") ? true:false,
|
|
11214
|
+
DrawStatusData:this.DrawStatusData,
|
|
11194
11215
|
};
|
|
11195
11216
|
|
|
11196
11217
|
status.FrameID=this.Frame.PtInFrame(this.LastPoint.X, this.LastPoint.Y);
|
|
@@ -11485,6 +11506,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
11485
11506
|
++this.TouchDrawCount;
|
|
11486
11507
|
|
|
11487
11508
|
this.UpdateCorssCursorStatus();
|
|
11509
|
+
this.UpdateDrawStatusData("DrawDynamicInfo");
|
|
11510
|
+
|
|
11488
11511
|
}
|
|
11489
11512
|
|
|
11490
11513
|
this.DrawAnimation=function() //绘制动画 如弹幕
|
|
@@ -43716,6 +43739,294 @@ function ChartSingleText()
|
|
|
43716
43739
|
}
|
|
43717
43740
|
}
|
|
43718
43741
|
|
|
43742
|
+
function ChartDrawText_Fix()
|
|
43743
|
+
{
|
|
43744
|
+
this.newMethod=IChartPainting; //派生
|
|
43745
|
+
this.newMethod();
|
|
43746
|
+
delete this.newMethod;
|
|
43747
|
+
|
|
43748
|
+
this.ClassName='ChartDrawText_Fix'; //类名
|
|
43749
|
+
|
|
43750
|
+
this.Color="rgb(255,193,37)"; //字颜色
|
|
43751
|
+
this.TextFont=g_JSChartResource.DRAWTEXT_FIX.Font;
|
|
43752
|
+
this.PtPercentage=null; //{ X:, Y: } 百分比坐标
|
|
43753
|
+
this.TextBaseline="top";
|
|
43754
|
+
this.TextAlign='center';
|
|
43755
|
+
this.ShowOffset={ X:0, Y:0 }; //显示偏移
|
|
43756
|
+
this.MapCache;
|
|
43757
|
+
this.HQChart;
|
|
43758
|
+
this.AryText;
|
|
43759
|
+
|
|
43760
|
+
this.BuildCacheData=function(kData, data)
|
|
43761
|
+
{
|
|
43762
|
+
var mapData=new Map();
|
|
43763
|
+
this.MapCache=mapData;
|
|
43764
|
+
if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return;
|
|
43765
|
+
if (!data || !IFrameSplitOperator.IsNonEmptyArray(data.Value) || !IFrameSplitOperator.IsNonEmptyArray(data.Text)) return;
|
|
43766
|
+
|
|
43767
|
+
for(var i=0;i<kData.Data.length;++i)
|
|
43768
|
+
{
|
|
43769
|
+
var value=data.Value[i];
|
|
43770
|
+
if (value!==1) continue;
|
|
43771
|
+
|
|
43772
|
+
var text=data.Text[i];
|
|
43773
|
+
if (!text) continue;
|
|
43774
|
+
|
|
43775
|
+
var kItem=kData.Data[i];
|
|
43776
|
+
var item={ Value:value, Text:text, Date:kItem.Date, Time:kItem.Time };
|
|
43777
|
+
var key=this.BuildKey(item);
|
|
43778
|
+
|
|
43779
|
+
/* //测试
|
|
43780
|
+
item.Text=
|
|
43781
|
+
[
|
|
43782
|
+
{ Name:`日期`, Text:`${item.Date}`, Margin:{ Bottom:10 }},
|
|
43783
|
+
{ Name:`日期2`, Text:`${item.Date}-2`},
|
|
43784
|
+
]
|
|
43785
|
+
*/
|
|
43786
|
+
|
|
43787
|
+
mapData.set(key,item);
|
|
43788
|
+
}
|
|
43789
|
+
}
|
|
43790
|
+
|
|
43791
|
+
this.ReloadResource=function(resource)
|
|
43792
|
+
{
|
|
43793
|
+
this.TextFont=g_JSChartResource.DRAWTEXT_FIX.Font;
|
|
43794
|
+
}
|
|
43795
|
+
|
|
43796
|
+
this.Draw=function()
|
|
43797
|
+
{
|
|
43798
|
+
this.AryText=null;
|
|
43799
|
+
if (!this.IsShow || this.ChartFrame.IsMinSize) return;
|
|
43800
|
+
if (this.IsShowIndexTitleOnly()) return;
|
|
43801
|
+
if (this.IsHideScriptIndex()) return;
|
|
43802
|
+
if (!this.MapCache || this.MapCache.size<=0) return;
|
|
43803
|
+
if (!this.PtPercentage || !IFrameSplitOperator.IsNumber(this.PtPercentage.X) || !IFrameSplitOperator.IsNumber(this.PtPercentage.Y)) return;
|
|
43804
|
+
if (!this.IsDrawText()) return;
|
|
43805
|
+
|
|
43806
|
+
var bHScreen=(this.ChartFrame.IsHScreen===true)
|
|
43807
|
+
this.Canvas.save();
|
|
43808
|
+
this.ClipClient(bHScreen);
|
|
43809
|
+
|
|
43810
|
+
this.DrawText();
|
|
43811
|
+
|
|
43812
|
+
this.Canvas.restore();
|
|
43813
|
+
this.AryText=null;
|
|
43814
|
+
}
|
|
43815
|
+
|
|
43816
|
+
//当前屏是否要绘制文字
|
|
43817
|
+
this.IsDrawText=function()
|
|
43818
|
+
{
|
|
43819
|
+
if (!this.HQChart) return false;
|
|
43820
|
+
var kData=this.HQChart.GetKData();
|
|
43821
|
+
if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return false;
|
|
43822
|
+
|
|
43823
|
+
var bHScreen=(this.ChartFrame.IsHScreen===true)
|
|
43824
|
+
var dataWidth=this.ChartFrame.DataWidth;
|
|
43825
|
+
var distanceWidth=this.ChartFrame.DistanceWidth;
|
|
43826
|
+
var xPointCount=this.ChartFrame.XPointCount;
|
|
43827
|
+
var xOffset=this.ChartBorder.GetLeft()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
|
|
43828
|
+
var chartright=this.ChartBorder.GetRight();
|
|
43829
|
+
var top=this.ChartBorder.GetTopEx();
|
|
43830
|
+
var bottom=this.ChartBorder.GetBottomEx();
|
|
43831
|
+
|
|
43832
|
+
if (bHScreen)
|
|
43833
|
+
{
|
|
43834
|
+
chartright=this.ChartBorder.GetBottom();
|
|
43835
|
+
top=this.ChartBorder.GetRightEx();
|
|
43836
|
+
bottom=this.ChartBorder.GetLeftEx();
|
|
43837
|
+
xOffset=this.ChartBorder.GetTop()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
|
|
43838
|
+
}
|
|
43839
|
+
|
|
43840
|
+
for(var i=kData.DataOffset,j=0;i<kData.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth))
|
|
43841
|
+
{
|
|
43842
|
+
var kItem=kData.Data[i];
|
|
43843
|
+
if (kItem==null) continue;
|
|
43844
|
+
|
|
43845
|
+
var key=this.BuildKey(kItem);
|
|
43846
|
+
if (!this.MapCache.has(key)) continue;
|
|
43847
|
+
|
|
43848
|
+
var item=this.MapCache.get(key);
|
|
43849
|
+
if (Array.isArray(item.Text)) this.AryText=item.Text;
|
|
43850
|
+
else this.AryText=[{ Name:item.Text }];
|
|
43851
|
+
return true;
|
|
43852
|
+
}
|
|
43853
|
+
|
|
43854
|
+
return false;
|
|
43855
|
+
}
|
|
43856
|
+
|
|
43857
|
+
this.DrawText=function()
|
|
43858
|
+
{
|
|
43859
|
+
var bHScreen=(this.ChartFrame.IsHScreen===true);
|
|
43860
|
+
if (bHScreen)
|
|
43861
|
+
{
|
|
43862
|
+
var x=this.ChartBorder.GetRightEx()-this.ChartBorder.GetWidthEx()*this.PtPercentage.Y;
|
|
43863
|
+
var y=this.ChartBorder.GetTop()+this.ChartBorder.GetHeight()*this.PtPercentage.X;
|
|
43864
|
+
}
|
|
43865
|
+
else
|
|
43866
|
+
{
|
|
43867
|
+
var x=this.ChartBorder.GetLeft()+this.ChartBorder.GetWidth()*this.PtPercentage.X;
|
|
43868
|
+
var y=this.ChartBorder.GetTopEx()+this.ChartBorder.GetHeightEx()*this.PtPercentage.Y;
|
|
43869
|
+
}
|
|
43870
|
+
|
|
43871
|
+
var drawInfo=this.CalculateComplexTextSize(this.AryText, { Font:this.TextFont, Color:this.Color });
|
|
43872
|
+
if (!drawInfo) return;
|
|
43873
|
+
|
|
43874
|
+
drawInfo.IsHScreen=bHScreen;
|
|
43875
|
+
|
|
43876
|
+
if (bHScreen)
|
|
43877
|
+
{
|
|
43878
|
+
if (this.TextBaseline=="middle") x=x-drawInfo.Height/2; //上下居中
|
|
43879
|
+
else if (this.TextBaseline=="bottom") x=x-drawInfo.Height; //底部
|
|
43880
|
+
|
|
43881
|
+
if (this.TextAlign=="center") y=y-drawInfo.Width/2; //左右居中
|
|
43882
|
+
else if (this.TextAlign=='right') y=y-drawInfo.Width; //右对齐
|
|
43883
|
+
|
|
43884
|
+
this.DrawComplexText(x,y, drawInfo);
|
|
43885
|
+
}
|
|
43886
|
+
else
|
|
43887
|
+
{
|
|
43888
|
+
if (this.TextBaseline=="middle") y=y-drawInfo.Height/2; //上下居中
|
|
43889
|
+
else if (this.TextBaseline=="bottom") y=y-drawInfo.Height; //底部
|
|
43890
|
+
|
|
43891
|
+
if (this.TextAlign=="center") x=x-drawInfo.Width/2; //左右居中
|
|
43892
|
+
else if (this.TextAlign=='right') x=x-drawInfo.Width; //右对齐
|
|
43893
|
+
|
|
43894
|
+
this.DrawComplexText(x,y, drawInfo);
|
|
43895
|
+
}
|
|
43896
|
+
}
|
|
43897
|
+
|
|
43898
|
+
this.DrawComplexText=function(x, y, drawInfo)
|
|
43899
|
+
{
|
|
43900
|
+
var left=x;
|
|
43901
|
+
var lineTop=y;
|
|
43902
|
+
if (drawInfo.IsHScreen)
|
|
43903
|
+
{
|
|
43904
|
+
left=0;
|
|
43905
|
+
lineTop=0;
|
|
43906
|
+
this.Canvas.save();
|
|
43907
|
+
this.Canvas.translate(x, y);
|
|
43908
|
+
this.Canvas.rotate(90 * Math.PI / 180);
|
|
43909
|
+
}
|
|
43910
|
+
|
|
43911
|
+
this.Canvas.textBaseline="bottom";
|
|
43912
|
+
this.Canvas.textAlign="left";
|
|
43913
|
+
for(var i=0;i<drawInfo.AryData.length;++i)
|
|
43914
|
+
{
|
|
43915
|
+
var item=drawInfo.AryData[i];
|
|
43916
|
+
var margin=item.Margin;
|
|
43917
|
+
var xText=left+margin.Left;
|
|
43918
|
+
var yText=lineTop+item.Height-margin.Bottom;
|
|
43919
|
+
|
|
43920
|
+
if (item.Name)
|
|
43921
|
+
{
|
|
43922
|
+
this.Canvas.font=item.Font;
|
|
43923
|
+
this.Canvas.fillStyle=item.NameColor;
|
|
43924
|
+
this.Canvas.fillText(item.Name,xText,yText);
|
|
43925
|
+
xText+=item.NameWidth+item.Space;
|
|
43926
|
+
}
|
|
43927
|
+
|
|
43928
|
+
if (item.Text)
|
|
43929
|
+
{
|
|
43930
|
+
this.Canvas.font=item.Font;
|
|
43931
|
+
this.Canvas.fillStyle=item.TextColor;
|
|
43932
|
+
this.Canvas.fillText(item.Text,xText,yText);
|
|
43933
|
+
xText+=item.TextWidth;
|
|
43934
|
+
}
|
|
43935
|
+
|
|
43936
|
+
lineTop+=item.Height;
|
|
43937
|
+
}
|
|
43938
|
+
|
|
43939
|
+
if (drawInfo.IsHScreen) this.Canvas.restore();
|
|
43940
|
+
}
|
|
43941
|
+
|
|
43942
|
+
//计算复杂文本长度高度 defaultOption:{ Font:, }
|
|
43943
|
+
this.CalculateComplexTextSize=function(aryText, defaultOption)
|
|
43944
|
+
{
|
|
43945
|
+
if (!defaultOption) return null;
|
|
43946
|
+
if (!aryText || !IFrameSplitOperator.IsNonEmptyArray(aryText)) return null;
|
|
43947
|
+
|
|
43948
|
+
this.Canvas.font=defaultOption.Font;
|
|
43949
|
+
var lineHeight=this.Canvas.measureText("擎").width;
|
|
43950
|
+
var maxNameWidth=0, maxTextWidth=0;
|
|
43951
|
+
var result={ AryData:[], Width:0, Height:0 }
|
|
43952
|
+
for(var i=0;i<aryText.length;++i)
|
|
43953
|
+
{
|
|
43954
|
+
var item=aryText[i];
|
|
43955
|
+
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 };
|
|
43956
|
+
if (item.Name)
|
|
43957
|
+
{
|
|
43958
|
+
newItem.NameWidth=this.Canvas.measureText(item.Name).width;
|
|
43959
|
+
newItem.Name=item.Name;
|
|
43960
|
+
if (maxNameWidth<item.NameWidth) maxNameWidth=newItem.NameWidth;
|
|
43961
|
+
if (IFrameSplitOperator.IsNumber(item.Space)) newItem.Space=item.Space;
|
|
43962
|
+
if (item.NameColor) newItem.NameColor=item.NameColor;
|
|
43963
|
+
else newItem.NameColor=defaultOption.Color;
|
|
43964
|
+
}
|
|
43965
|
+
|
|
43966
|
+
if (item.Text)
|
|
43967
|
+
{
|
|
43968
|
+
newItem.TextWidth=this.Canvas.measureText(item.Text).width;
|
|
43969
|
+
newItem.Text=item.Text;
|
|
43970
|
+
if (maxTextWidth<item.TextWidth) maxTextWidth=newItem.TextWidth;
|
|
43971
|
+
if (item.TextColor) newItem.TextColor=item.TextColor;
|
|
43972
|
+
else newItem.TextColor=defaultOption.Color;
|
|
43973
|
+
}
|
|
43974
|
+
|
|
43975
|
+
|
|
43976
|
+
CopyMarginConfig(newItem.Margin, item.Margin);
|
|
43977
|
+
|
|
43978
|
+
if (IFrameSplitOperator.IsNumber(item.YOffset)) newItem.YOffset=item.YOffset;
|
|
43979
|
+
|
|
43980
|
+
newItem.Width=newItem.NameWidth+newItem.TextWidth;
|
|
43981
|
+
newItem.Width+=newItem.Margin.Left+newItem.Margin.Right+newItem.Space;
|
|
43982
|
+
newItem.Height=(lineHeight+newItem.Margin.Top+newItem.Margin.Bottom);
|
|
43983
|
+
|
|
43984
|
+
result.AryData.push(newItem);
|
|
43985
|
+
result.Height+=newItem.Height;
|
|
43986
|
+
if (result.Width<newItem.Width) result.Width=newItem.Width;
|
|
43987
|
+
}
|
|
43988
|
+
|
|
43989
|
+
return result;
|
|
43990
|
+
}
|
|
43991
|
+
|
|
43992
|
+
}
|
|
43993
|
+
|
|
43994
|
+
function ChartDrawNumber_Fix()
|
|
43995
|
+
{
|
|
43996
|
+
this.newMethod=ChartDrawText_Fix; //派生
|
|
43997
|
+
this.newMethod();
|
|
43998
|
+
delete this.newMethod;
|
|
43999
|
+
|
|
44000
|
+
this.ClassName='ChartDrawNumber_Fix'; //类名
|
|
44001
|
+
this.TextFont=g_JSChartResource.DRAWNUMBER_FIX.Font;
|
|
44002
|
+
|
|
44003
|
+
this.BuildCacheData=function(kData, data)
|
|
44004
|
+
{
|
|
44005
|
+
var mapData=new Map();
|
|
44006
|
+
this.MapCache=mapData;
|
|
44007
|
+
if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return;
|
|
44008
|
+
if (!data || !IFrameSplitOperator.IsNonEmptyArray(data.Value) || !IFrameSplitOperator.IsNonEmptyArray(data.Text)) return;
|
|
44009
|
+
|
|
44010
|
+
for(var i=0;i<kData.Data.length;++i)
|
|
44011
|
+
{
|
|
44012
|
+
var value=data.Value[i];
|
|
44013
|
+
var text=data.Text[i];
|
|
44014
|
+
if (!text) continue;
|
|
44015
|
+
|
|
44016
|
+
var kItem=kData.Data[i];
|
|
44017
|
+
var item={ Value:value, Text:text, Date:kItem.Date, Time:kItem.Time };
|
|
44018
|
+
var key=this.BuildKey(item);
|
|
44019
|
+
|
|
44020
|
+
mapData.set(key,item);
|
|
44021
|
+
}
|
|
44022
|
+
}
|
|
44023
|
+
|
|
44024
|
+
this.ReloadResource=function(resource)
|
|
44025
|
+
{
|
|
44026
|
+
this.TextFont=g_JSChartResource.DRAWNUMBER_FIX.Font;
|
|
44027
|
+
}
|
|
44028
|
+
}
|
|
44029
|
+
|
|
43719
44030
|
|
|
43720
44031
|
function ChartTradeIcon()
|
|
43721
44032
|
{
|
|
@@ -43882,6 +44193,12 @@ function ChartDrawText()
|
|
|
43882
44193
|
}
|
|
43883
44194
|
}
|
|
43884
44195
|
|
|
44196
|
+
this.GetMaxMin=function()
|
|
44197
|
+
{
|
|
44198
|
+
var range={ Min:null, Max:null };
|
|
44199
|
+
return range;
|
|
44200
|
+
}
|
|
44201
|
+
|
|
43885
44202
|
this.Draw=function()
|
|
43886
44203
|
{
|
|
43887
44204
|
if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
|
|
@@ -89721,7 +90038,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
89721
90038
|
this.ClearCustomKLine();
|
|
89722
90039
|
this.ClearKLineCaluate();
|
|
89723
90040
|
this.UnlockCorssCursor();
|
|
89724
|
-
|
|
90041
|
+
this.ClearDrawStatusData();
|
|
89725
90042
|
|
|
89726
90043
|
var kLineDrawType=this.GetKLineDrawType();
|
|
89727
90044
|
if (kLineDrawType==10 || kLineDrawType==11 || kLineDrawType==12 || kLineDrawType==16) isDataTypeChange=true;
|
|
@@ -91126,7 +91443,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
91126
91443
|
this.UnlockCorssCursor();
|
|
91127
91444
|
this.Frame.ClearYCoordinateMaxMin();
|
|
91128
91445
|
this.ClosePopMinuteChart();
|
|
91129
|
-
|
|
91446
|
+
this.ClearDrawStatusData();
|
|
91130
91447
|
|
|
91131
91448
|
this.Symbol=symbol;
|
|
91132
91449
|
if (!symbol)
|
|
@@ -97740,6 +98057,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
97740
98057
|
this.ClearStockCache();
|
|
97741
98058
|
this.UnlockCorssCursor();
|
|
97742
98059
|
this.Frame.ClearYCoordinateMaxMin();
|
|
98060
|
+
this.ClearDrawStatusData();
|
|
97743
98061
|
|
|
97744
98062
|
|
|
97745
98063
|
if (option)
|
|
@@ -97908,6 +98226,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
97908
98226
|
this.ClearStockCache();
|
|
97909
98227
|
this.UnlockCorssCursor();
|
|
97910
98228
|
this.Frame.ClearYCoordinateMaxMin();
|
|
98229
|
+
this.ClearDrawStatusData();
|
|
97911
98230
|
|
|
97912
98231
|
if (option && option.PageInfo)
|
|
97913
98232
|
{
|
|
@@ -115161,22 +115480,50 @@ function JSAlgorithm(errorHandler,symbolData)
|
|
|
115161
115480
|
this.FILTERX=function(data, n, node)
|
|
115162
115481
|
{
|
|
115163
115482
|
var result=[];
|
|
115164
|
-
|
|
115483
|
+
if (IFrameSplitOperator.IsNumber(n))
|
|
115165
115484
|
{
|
|
115166
|
-
|
|
115485
|
+
for(var i=data.length-1, j=0; i>=0; --i)
|
|
115167
115486
|
{
|
|
115168
|
-
|
|
115169
|
-
for(j=0;j<n && i-j-1>=0;++j)
|
|
115487
|
+
if (data[i])
|
|
115170
115488
|
{
|
|
115171
|
-
result[i
|
|
115489
|
+
result[i]=1;
|
|
115490
|
+
for(j=0;j<n && i-j-1>=0;++j)
|
|
115491
|
+
{
|
|
115492
|
+
result[i-j-1]=0;
|
|
115493
|
+
}
|
|
115494
|
+
i-=n;
|
|
115495
|
+
}
|
|
115496
|
+
else
|
|
115497
|
+
{
|
|
115498
|
+
result[i]=0;
|
|
115172
115499
|
}
|
|
115173
|
-
i+=n;
|
|
115174
115500
|
}
|
|
115175
|
-
|
|
115501
|
+
}
|
|
115502
|
+
else if (Array.isArray(n))
|
|
115503
|
+
{
|
|
115504
|
+
for(var i=data.length-1, j=0; i>=0; --i)
|
|
115176
115505
|
{
|
|
115177
|
-
|
|
115506
|
+
if (data[i])
|
|
115507
|
+
{
|
|
115508
|
+
result[i]=1;
|
|
115509
|
+
if (!IFrameSplitOperator.IsNumber(n[i])) continue;
|
|
115510
|
+
var period=parseInt(n[i]);
|
|
115511
|
+
if (period<=0) continue;
|
|
115512
|
+
|
|
115513
|
+
for(j=0;j<period && i-j-1>=0;++j)
|
|
115514
|
+
{
|
|
115515
|
+
result[i-j-1]=0;
|
|
115516
|
+
}
|
|
115517
|
+
|
|
115518
|
+
i-=period;
|
|
115519
|
+
}
|
|
115520
|
+
else
|
|
115521
|
+
{
|
|
115522
|
+
result[i]=0;
|
|
115523
|
+
}
|
|
115178
115524
|
}
|
|
115179
115525
|
}
|
|
115526
|
+
|
|
115180
115527
|
|
|
115181
115528
|
return result;
|
|
115182
115529
|
}
|
|
@@ -119614,6 +119961,7 @@ function JSDraw(errorHandler,symbolData)
|
|
|
119614
119961
|
return result;
|
|
119615
119962
|
}
|
|
119616
119963
|
|
|
119964
|
+
//只有条件==1 才显示文字
|
|
119617
119965
|
this.DRAWTEXT=function(condition,price,text)
|
|
119618
119966
|
{
|
|
119619
119967
|
let drawData=[];
|
|
@@ -119631,11 +119979,11 @@ function JSDraw(errorHandler,symbolData)
|
|
|
119631
119979
|
isFixedPosition=true;
|
|
119632
119980
|
}
|
|
119633
119981
|
|
|
119634
|
-
for(var i
|
|
119982
|
+
for(var i=0;i<condition.length;++i)
|
|
119635
119983
|
{
|
|
119636
119984
|
drawData[i]=null;
|
|
119637
119985
|
|
|
119638
|
-
if (
|
|
119986
|
+
if (condition[i]!==1) continue;
|
|
119639
119987
|
|
|
119640
119988
|
if (IsNumber || isFixedPosition)
|
|
119641
119989
|
{
|
|
@@ -119647,7 +119995,7 @@ function JSDraw(errorHandler,symbolData)
|
|
|
119647
119995
|
}
|
|
119648
119996
|
}
|
|
119649
119997
|
}
|
|
119650
|
-
else if (this.IsNumber(condition) && condition)
|
|
119998
|
+
else if (this.IsNumber(condition) && condition===1)
|
|
119651
119999
|
{
|
|
119652
120000
|
var IsNumber=this.IsNumber(price);
|
|
119653
120001
|
var isFixedPosition=false;
|
|
@@ -119673,20 +120021,21 @@ function JSDraw(errorHandler,symbolData)
|
|
|
119673
120021
|
return result;
|
|
119674
120022
|
}
|
|
119675
120023
|
|
|
120024
|
+
//1.固定位置显示文字;2.在指标排序中显示字符串栏目.
|
|
120025
|
+
//用法:DRAWTEXT_FIX(COND,X,Y,TYPE,TEXT),COND中一般需要加ISLASTBAR,当COND条件满足时,在当前指标窗口内(X,Y)位置书写文字TEXT,X,Y为书写点在窗口中相对于左上角的百分比,TYPE:0为左对齐,1为右对齐,2=居中.
|
|
120026
|
+
//例如:DRAWTEXT_FIX(ISLASTBAR AND CLOSE/OPEN>1.08,0.5,0.5,0,'大阳线')表示最后一个交易日实体阳线大于8%时在窗口中间位置显示'大阳线'字样.若文字中含有&,则进行折行.最多只能显示250个字符
|
|
119676
120027
|
this.DRAWTEXT_FIX=function(condition,x,y,type,text)
|
|
119677
120028
|
{
|
|
119678
120029
|
var drawData={ Value:[], Text:[] };
|
|
119679
120030
|
var result={DrawData:drawData, DrawType:'DRAWTEXT_FIX', Text:null, Position:{ X:x, Y:y, Type:type } };
|
|
119680
|
-
|
|
119681
|
-
|
|
120031
|
+
|
|
119682
120032
|
if (Array.isArray(condition))
|
|
119683
120033
|
{
|
|
119684
|
-
|
|
119685
|
-
for(var i in condition)
|
|
120034
|
+
for(var i=0; i<condition.length; ++i)
|
|
119686
120035
|
{
|
|
119687
120036
|
drawData.Text[i]=null;
|
|
119688
120037
|
drawData.Value[i]=0;
|
|
119689
|
-
if (
|
|
120038
|
+
if (condition[i]!==1) continue;
|
|
119690
120039
|
|
|
119691
120040
|
drawData.Value[i]=1;
|
|
119692
120041
|
drawData.Text[i]=text;
|
|
@@ -119694,7 +120043,7 @@ function JSDraw(errorHandler,symbolData)
|
|
|
119694
120043
|
}
|
|
119695
120044
|
else
|
|
119696
120045
|
{
|
|
119697
|
-
if(condition)
|
|
120046
|
+
if(condition===1)
|
|
119698
120047
|
{
|
|
119699
120048
|
for(var i=0;i<this.SymbolData.Data.Data.length;++i)
|
|
119700
120049
|
{
|
|
@@ -120433,10 +120782,10 @@ function JSDraw(errorHandler,symbolData)
|
|
|
120433
120782
|
|
|
120434
120783
|
/*
|
|
120435
120784
|
固定位置显示数字.
|
|
120436
|
-
用法: DRAWNUMBER_FIX(COND,X,Y,TYPE,NUMBER),当COND条件满足时,在当前指标窗口内(X,Y)位置书写数字NUMBER,X,Y为书写点在窗口中相对于左上角的百分比,TYPE:0为左对齐,1
|
|
120785
|
+
用法: DRAWNUMBER_FIX(COND,X,Y,TYPE,NUMBER,decimal=2),当COND条件满足时,在当前指标窗口内(X,Y)位置书写数字NUMBER,X,Y为书写点在窗口中相对于左上角的百分比,TYPE:0为左对齐,1为右对齐 2=居中
|
|
120437
120786
|
例如: DRAWNUMBER_FIX(CURRBARSCOUNT=1 AND CLOSE/OPEN>1.08,0.5,0.5,0,C)表示最后一个交易日实体阳线大于8%时在窗口中间位置显示收盘价.
|
|
120438
120787
|
*/
|
|
120439
|
-
this.DRAWNUMBER_FIX=function(condition,x,y,align,data)
|
|
120788
|
+
this.DRAWNUMBER_FIX=function(condition,x,y,align,data, decimal=2)
|
|
120440
120789
|
{
|
|
120441
120790
|
var drawData={ Value:[], Text:[], };
|
|
120442
120791
|
var result={ DrawData:drawData, DrawType:'DRAWNUMBER_FIX', Position:{ X:x, Y:y, Type:align } };
|
|
@@ -120444,15 +120793,15 @@ function JSDraw(errorHandler,symbolData)
|
|
|
120444
120793
|
|
|
120445
120794
|
if (Array.isArray(condition))
|
|
120446
120795
|
{
|
|
120447
|
-
for(var i
|
|
120796
|
+
for(var i=0; i<condition.length; ++i)
|
|
120448
120797
|
{
|
|
120449
120798
|
drawData.Text[i]=null;
|
|
120450
120799
|
drawData.Value[i]=null;
|
|
120451
|
-
if (
|
|
120800
|
+
if (condition[i]!==1) continue;
|
|
120452
120801
|
|
|
120453
120802
|
if (isNumber)
|
|
120454
120803
|
{
|
|
120455
|
-
drawData.Text[i]=this.RemoveZero(data.toFixed(
|
|
120804
|
+
drawData.Text[i]=this.RemoveZero(data.toFixed(decimal));
|
|
120456
120805
|
drawData.Value[i]=data;
|
|
120457
120806
|
}
|
|
120458
120807
|
else
|
|
@@ -120460,14 +120809,14 @@ function JSDraw(errorHandler,symbolData)
|
|
|
120460
120809
|
if (i>=data.length || !IFrameSplitOperator.IsNumber(data[i])) continue;
|
|
120461
120810
|
|
|
120462
120811
|
var item=data[i];
|
|
120463
|
-
drawData.Text[i]=this.RemoveZero(item.toFixed(
|
|
120812
|
+
drawData.Text[i]=this.RemoveZero(item.toFixed(decimal));
|
|
120464
120813
|
drawData.Value[i]=item;
|
|
120465
120814
|
}
|
|
120466
120815
|
}
|
|
120467
120816
|
}
|
|
120468
120817
|
else
|
|
120469
120818
|
{
|
|
120470
|
-
if(
|
|
120819
|
+
if(condition!==1)
|
|
120471
120820
|
{
|
|
120472
120821
|
|
|
120473
120822
|
}
|
|
@@ -120477,7 +120826,7 @@ function JSDraw(errorHandler,symbolData)
|
|
|
120477
120826
|
{
|
|
120478
120827
|
if (isNumber)
|
|
120479
120828
|
{
|
|
120480
|
-
drawData.Text[i]=this.RemoveZero(data.toFixed(
|
|
120829
|
+
drawData.Text[i]=this.RemoveZero(data.toFixed(decimal));
|
|
120481
120830
|
drawData.Value[i]=data;
|
|
120482
120831
|
}
|
|
120483
120832
|
else
|
|
@@ -120485,7 +120834,7 @@ function JSDraw(errorHandler,symbolData)
|
|
|
120485
120834
|
if (i>=data.length || !IFrameSplitOperator.IsNumber(data[i])) continue;
|
|
120486
120835
|
|
|
120487
120836
|
var item=data[i];
|
|
120488
|
-
drawData.Text[i]=this.RemoveZero(item.toFixed(
|
|
120837
|
+
drawData.Text[i]=this.RemoveZero(item.toFixed(decimal));
|
|
120489
120838
|
drawData.Value[i]=item;
|
|
120490
120839
|
}
|
|
120491
120840
|
}
|
|
@@ -128647,7 +128996,7 @@ function JSExecute(ast,option)
|
|
|
128647
128996
|
node.Out=node.Draw.DrawData.Value;
|
|
128648
128997
|
break;
|
|
128649
128998
|
case "DRAWNUMBER_FIX":
|
|
128650
|
-
node.Draw=this.Draw.DRAWNUMBER_FIX(args[0],args[1],args[2],args[3],args[4]);
|
|
128999
|
+
node.Draw=this.Draw.DRAWNUMBER_FIX(args[0],args[1],args[2],args[3],args[4], args[5]);
|
|
128651
129000
|
node.Out=node.Draw.DrawData.Value;
|
|
128652
129001
|
break;
|
|
128653
129002
|
case "DRAWCHANNEL":
|
|
@@ -129800,7 +130149,10 @@ function JSExplainer(ast,option)
|
|
|
129800
130149
|
|
|
129801
130150
|
["TABLE_CELL", { Name:"TABLE_CELL",Param:{ Dynamic:true }, ToString:function(args) { return `创建表格单元格`; } }],
|
|
129802
130151
|
["TABLE_ROW", { Name:"TABLE_ROW",Param:{ Dynamic:true }, ToString:function(args) { return `创建表格行`; } }],
|
|
129803
|
-
["DRAWTABLE", { Name:"DRAWTABLE",Param:{ Dynamic:true }, ToString:function(args) { return `绘制表格`; } }]
|
|
130152
|
+
["DRAWTABLE", { Name:"DRAWTABLE",Param:{ Dynamic:true }, ToString:function(args) { return `绘制表格`; } }],
|
|
130153
|
+
|
|
130154
|
+
["MAX6", { Name:"MAX6", Param:{ Dynamic:true }, ToString:function(args) { return "较大值"} } ],
|
|
130155
|
+
["MIN6", { Name:"MIN6", Param:{ Dynamic:true }, ToString:function(args) { return "较小值"} } ],
|
|
129804
130156
|
|
|
129805
130157
|
]
|
|
129806
130158
|
);
|
|
@@ -132111,6 +132463,102 @@ function ScriptIndex(name,script,args,option)
|
|
|
132111
132463
|
hqChart.ChartPaint.push(chartText);
|
|
132112
132464
|
}
|
|
132113
132465
|
|
|
132466
|
+
this.CreateDrawText_Fix=function(hqChart,windowIndex,varItem,id)
|
|
132467
|
+
{
|
|
132468
|
+
var chartText=new ChartDrawText_Fix();
|
|
132469
|
+
chartText.Canvas=hqChart.Canvas;
|
|
132470
|
+
chartText.Name=varItem.Name;
|
|
132471
|
+
chartText.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
|
|
132472
|
+
chartText.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
|
|
132473
|
+
chartText.ReloadResource();
|
|
132474
|
+
chartText.HQChart=hqChart;
|
|
132475
|
+
|
|
132476
|
+
if (varItem.Draw.Position)
|
|
132477
|
+
{
|
|
132478
|
+
var item=varItem.Draw.Position;
|
|
132479
|
+
chartText.PtPercentage={ X:item.X, Y:item.Y }; //坐标
|
|
132480
|
+
// TYPE:0为左对齐,1为右对齐 2=居中
|
|
132481
|
+
if (item.Type===0) chartText.TextAlign="left";
|
|
132482
|
+
else if (item.Type===1) chartText.TextAlign="right";
|
|
132483
|
+
else if (item.Type===2) chartText.TextAlign="center";
|
|
132484
|
+
}
|
|
132485
|
+
|
|
132486
|
+
//字体
|
|
132487
|
+
if (varItem.DrawFontSize>0) chartText.TextFont=`${varItem.DrawFontSize*GetDevicePixelRatio()}px 微软雅黑`; //临时用下吧
|
|
132488
|
+
if (varItem.Font) chartText.TextFont=varItem.Font;
|
|
132489
|
+
|
|
132490
|
+
//颜色
|
|
132491
|
+
if (varItem.Color) chartText.Color=this.GetColor(varItem.Color);
|
|
132492
|
+
else chartText.Color=this.GetDefaultColor(id);
|
|
132493
|
+
|
|
132494
|
+
if (varItem.DrawVAlign>=0) //上下对齐
|
|
132495
|
+
{
|
|
132496
|
+
if (varItem.DrawVAlign==0) chartText.TextBaseline='top';
|
|
132497
|
+
else if (varItem.DrawVAlign==1) chartText.TextBaseline='middle';
|
|
132498
|
+
else if (varItem.DrawVAlign==2) chartText.TextBaseline='bottom';
|
|
132499
|
+
}
|
|
132500
|
+
|
|
132501
|
+
if (varItem.DrawAlign>=0) // 左右对齐
|
|
132502
|
+
{
|
|
132503
|
+
if (varItem.DrawAlign==0) chartText.TextAlign="left";
|
|
132504
|
+
else if (varItem.DrawAlign==1) chartText.TextAlign="center";
|
|
132505
|
+
else if (varItem.DrawAlign==2) chartText.TextAlign='right';
|
|
132506
|
+
}
|
|
132507
|
+
|
|
132508
|
+
chartText.BuildCacheData(hqChart.GetKData(),varItem.Draw.DrawData);
|
|
132509
|
+
|
|
132510
|
+
this.SetChartIndexName(chartText);
|
|
132511
|
+
hqChart.ChartPaint.push(chartText);
|
|
132512
|
+
}
|
|
132513
|
+
|
|
132514
|
+
this.CreateDrawNumber_Fix=function(hqChart,windowIndex,varItem,id)
|
|
132515
|
+
{
|
|
132516
|
+
var chartText=new ChartDrawNumber_Fix();
|
|
132517
|
+
chartText.Canvas=hqChart.Canvas;
|
|
132518
|
+
chartText.Name=varItem.Name;
|
|
132519
|
+
chartText.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
|
|
132520
|
+
chartText.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
|
|
132521
|
+
chartText.ReloadResource();
|
|
132522
|
+
chartText.HQChart=hqChart;
|
|
132523
|
+
|
|
132524
|
+
if (varItem.Draw.Position)
|
|
132525
|
+
{
|
|
132526
|
+
var item=varItem.Draw.Position;
|
|
132527
|
+
chartText.PtPercentage={ X:item.X, Y:item.Y }; //坐标
|
|
132528
|
+
// TYPE:0为左对齐,1为右对齐 2=居中
|
|
132529
|
+
if (item.Type===0) chartText.TextAlign="left";
|
|
132530
|
+
else if (item.Type===1) chartText.TextAlign="right";
|
|
132531
|
+
else if (item.Type===2) chartText.TextAlign="center";
|
|
132532
|
+
}
|
|
132533
|
+
|
|
132534
|
+
//字体
|
|
132535
|
+
if (varItem.DrawFontSize>0) chartText.TextFont=`${varItem.DrawFontSize*GetDevicePixelRatio()}px 微软雅黑`; //临时用下吧
|
|
132536
|
+
if (varItem.Font) chartText.TextFont=varItem.Font;
|
|
132537
|
+
|
|
132538
|
+
//颜色
|
|
132539
|
+
if (varItem.Color) chartText.Color=this.GetColor(varItem.Color);
|
|
132540
|
+
else chartText.Color=this.GetDefaultColor(id);
|
|
132541
|
+
|
|
132542
|
+
if (varItem.DrawVAlign>=0) //上下对齐
|
|
132543
|
+
{
|
|
132544
|
+
if (varItem.DrawVAlign==0) chartText.TextBaseline='top';
|
|
132545
|
+
else if (varItem.DrawVAlign==1) chartText.TextBaseline='middle';
|
|
132546
|
+
else if (varItem.DrawVAlign==2) chartText.TextBaseline='bottom';
|
|
132547
|
+
}
|
|
132548
|
+
|
|
132549
|
+
if (varItem.DrawAlign>=0) // 左右对齐
|
|
132550
|
+
{
|
|
132551
|
+
if (varItem.DrawAlign==0) chartText.TextAlign="left";
|
|
132552
|
+
else if (varItem.DrawAlign==1) chartText.TextAlign="center";
|
|
132553
|
+
else if (varItem.DrawAlign==2) chartText.TextAlign='right';
|
|
132554
|
+
}
|
|
132555
|
+
|
|
132556
|
+
chartText.BuildCacheData(hqChart.GetKData(),varItem.Draw.DrawData);
|
|
132557
|
+
|
|
132558
|
+
this.SetChartIndexName(chartText);
|
|
132559
|
+
hqChart.ChartPaint.push(chartText);
|
|
132560
|
+
}
|
|
132561
|
+
|
|
132114
132562
|
this.CreateDrawText=function(hqChart,windowIndex,varItem,id)
|
|
132115
132563
|
{
|
|
132116
132564
|
let chartText=new ChartSingleText();
|
|
@@ -132927,8 +133375,10 @@ function ScriptIndex(name,script,args,option)
|
|
|
132927
133375
|
this.CreateDrawNumber(hqChart,windowIndex,item,i);
|
|
132928
133376
|
break;
|
|
132929
133377
|
case "DRAWNUMBER_FIX":
|
|
133378
|
+
this.CreateDrawNumber_Fix(hqChart,windowIndex,item,i);
|
|
133379
|
+
break;
|
|
132930
133380
|
case 'DRAWTEXT_FIX':
|
|
132931
|
-
this.
|
|
133381
|
+
this.CreateDrawText_Fix(hqChart,windowIndex,item,i);
|
|
132932
133382
|
break;
|
|
132933
133383
|
case 'DRAWICON':
|
|
132934
133384
|
this.CreateIcon(hqChart,windowIndex,item,i);
|
|
@@ -133320,9 +133770,13 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
133320
133770
|
this.CreateBackgroud(hqChart,windowIndex,item,i);
|
|
133321
133771
|
break;
|
|
133322
133772
|
case 'DRAWNUMBER':
|
|
133773
|
+
this.CreateNumberText(hqChart,windowIndex,item,i);
|
|
133774
|
+
break;
|
|
133323
133775
|
case "DRAWNUMBER_FIX":
|
|
133776
|
+
this.CreateDrawNumber_Fix(hqChart,windowIndex,item,i);
|
|
133777
|
+
break;
|
|
133324
133778
|
case 'DRAWTEXT_FIX':
|
|
133325
|
-
this.
|
|
133779
|
+
this.CreateDrawText_Fix(hqChart,windowIndex,item,i);
|
|
133326
133780
|
break;
|
|
133327
133781
|
case 'DRAWICON':
|
|
133328
133782
|
this.CreateIcon(hqChart,windowIndex,item,i);
|
|
@@ -134031,6 +134485,110 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
134031
134485
|
frame.ChartPaint.push(chart);
|
|
134032
134486
|
}
|
|
134033
134487
|
|
|
134488
|
+
this.CreateDrawText_Fix=function(hqChart,windowIndex,varItem,id)
|
|
134489
|
+
{
|
|
134490
|
+
var overlayIndex=this.OverlayIndex;
|
|
134491
|
+
var frame=overlayIndex.Frame;
|
|
134492
|
+
var chart=new ChartDrawText_Fix();
|
|
134493
|
+
chart.Canvas=hqChart.Canvas;
|
|
134494
|
+
|
|
134495
|
+
chart.Name=varItem.Name;
|
|
134496
|
+
chart.ChartBorder=frame.Frame.ChartBorder;
|
|
134497
|
+
chart.ChartFrame=frame.Frame;
|
|
134498
|
+
chart.Identify=overlayIndex.Identify;
|
|
134499
|
+
chart.ReloadResource();
|
|
134500
|
+
chart.HQChart=hqChart;
|
|
134501
|
+
|
|
134502
|
+
if (varItem.Draw.Position)
|
|
134503
|
+
{
|
|
134504
|
+
var item=varItem.Draw.Position;
|
|
134505
|
+
chart.PtPercentage={ X:item.X, Y:item.Y }; //坐标
|
|
134506
|
+
// TYPE:0为左对齐,1为右对齐 2=居中
|
|
134507
|
+
if (item.Type===0) chart.TextAlign="left";
|
|
134508
|
+
else if (item.Type===1) chart.TextAlign="right";
|
|
134509
|
+
else if (item.Type===2) chart.TextAlign="center";
|
|
134510
|
+
}
|
|
134511
|
+
|
|
134512
|
+
//字体
|
|
134513
|
+
if (varItem.DrawFontSize>0) chart.TextFont=`${varItem.DrawFontSize*GetDevicePixelRatio()}px 微软雅黑`; //临时用下吧
|
|
134514
|
+
if (varItem.Font) chart.TextFont=varItem.Font;
|
|
134515
|
+
|
|
134516
|
+
//颜色
|
|
134517
|
+
if (varItem.Color) chart.Color=this.GetColor(varItem.Color);
|
|
134518
|
+
else chart.Color=this.GetDefaultColor(id);
|
|
134519
|
+
|
|
134520
|
+
if (varItem.DrawVAlign>=0) //上下对齐
|
|
134521
|
+
{
|
|
134522
|
+
if (varItem.DrawVAlign==0) chart.TextBaseline='top';
|
|
134523
|
+
else if (varItem.DrawVAlign==1) chart.TextBaseline='middle';
|
|
134524
|
+
else if (varItem.DrawVAlign==2) chart.TextBaseline='bottom';
|
|
134525
|
+
}
|
|
134526
|
+
|
|
134527
|
+
if (varItem.DrawAlign>=0) // 左右对齐
|
|
134528
|
+
{
|
|
134529
|
+
if (varItem.DrawAlign==0) chart.TextAlign="left";
|
|
134530
|
+
else if (varItem.DrawAlign==1) chart.TextAlign="center";
|
|
134531
|
+
else if (varItem.DrawAlign==2) chart.TextAlign='right';
|
|
134532
|
+
}
|
|
134533
|
+
|
|
134534
|
+
chart.BuildCacheData(hqChart.GetKData(),varItem.Draw.DrawData);
|
|
134535
|
+
|
|
134536
|
+
this.SetChartIndexName(chart);
|
|
134537
|
+
frame.ChartPaint.push(chart);
|
|
134538
|
+
}
|
|
134539
|
+
|
|
134540
|
+
this.CreateDrawNumber_Fix=function(hqChart,windowIndex,varItem,id)
|
|
134541
|
+
{
|
|
134542
|
+
var overlayIndex=this.OverlayIndex;
|
|
134543
|
+
var frame=overlayIndex.Frame;
|
|
134544
|
+
var chart=new ChartDrawNumber_Fix();
|
|
134545
|
+
chart.Canvas=hqChart.Canvas;
|
|
134546
|
+
|
|
134547
|
+
chart.Name=varItem.Name;
|
|
134548
|
+
chart.ChartBorder=frame.Frame.ChartBorder;
|
|
134549
|
+
chart.ChartFrame=frame.Frame;
|
|
134550
|
+
chart.Identify=overlayIndex.Identify;
|
|
134551
|
+
chart.ReloadResource();
|
|
134552
|
+
chart.HQChart=hqChart;
|
|
134553
|
+
|
|
134554
|
+
if (varItem.Draw.Position)
|
|
134555
|
+
{
|
|
134556
|
+
var item=varItem.Draw.Position;
|
|
134557
|
+
chart.PtPercentage={ X:item.X, Y:item.Y }; //坐标
|
|
134558
|
+
// TYPE:0为左对齐,1为右对齐 2=居中
|
|
134559
|
+
if (item.Type===0) chart.TextAlign="left";
|
|
134560
|
+
else if (item.Type===1) chart.TextAlign="right";
|
|
134561
|
+
else if (item.Type===2) chart.TextAlign="center";
|
|
134562
|
+
}
|
|
134563
|
+
|
|
134564
|
+
//字体
|
|
134565
|
+
if (varItem.DrawFontSize>0) chart.TextFont=`${varItem.DrawFontSize*GetDevicePixelRatio()}px 微软雅黑`; //临时用下吧
|
|
134566
|
+
if (varItem.Font) chart.TextFont=varItem.Font;
|
|
134567
|
+
|
|
134568
|
+
//颜色
|
|
134569
|
+
if (varItem.Color) chart.Color=this.GetColor(varItem.Color);
|
|
134570
|
+
else chart.Color=this.GetDefaultColor(id);
|
|
134571
|
+
|
|
134572
|
+
if (varItem.DrawVAlign>=0) //上下对齐
|
|
134573
|
+
{
|
|
134574
|
+
if (varItem.DrawVAlign==0) chart.TextBaseline='top';
|
|
134575
|
+
else if (varItem.DrawVAlign==1) chart.TextBaseline='middle';
|
|
134576
|
+
else if (varItem.DrawVAlign==2) chart.TextBaseline='bottom';
|
|
134577
|
+
}
|
|
134578
|
+
|
|
134579
|
+
if (varItem.DrawAlign>=0) // 左右对齐
|
|
134580
|
+
{
|
|
134581
|
+
if (varItem.DrawAlign==0) chart.TextAlign="left";
|
|
134582
|
+
else if (varItem.DrawAlign==1) chart.TextAlign="center";
|
|
134583
|
+
else if (varItem.DrawAlign==2) chart.TextAlign='right';
|
|
134584
|
+
}
|
|
134585
|
+
|
|
134586
|
+
chart.BuildCacheData(hqChart.GetKData(),varItem.Draw.DrawData);
|
|
134587
|
+
|
|
134588
|
+
this.SetChartIndexName(chart);
|
|
134589
|
+
frame.ChartPaint.push(chart);
|
|
134590
|
+
}
|
|
134591
|
+
|
|
134034
134592
|
this.CreateTextLine=function(hqChart,windowIndex,varItem,id)
|
|
134035
134593
|
{
|
|
134036
134594
|
var overlayIndex=this.OverlayIndex;
|
|
@@ -154290,7 +154848,7 @@ function ScrollBarBGChart()
|
|
|
154290
154848
|
|
|
154291
154849
|
|
|
154292
154850
|
|
|
154293
|
-
var HQCHART_VERSION="1.1.
|
|
154851
|
+
var HQCHART_VERSION="1.1.15272";
|
|
154294
154852
|
|
|
154295
154853
|
function PrintHQChartVersion()
|
|
154296
154854
|
{
|