hqchart 1.1.15258 → 1.1.15292
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 +187 -122
- package/package.json +1 -1
- package/src/jscommon/umychart.NetworkFilterTest.js +22 -0
- package/src/jscommon/umychart.complier.js +327 -43
- package/src/jscommon/umychart.js +370 -16
- package/src/jscommon/umychart.resource/js/codemirror/javascript.js +1 -1
- package/src/jscommon/umychart.testdata.js +22 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +698 -60
- 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 +698 -60
|
@@ -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
|
{
|
|
@@ -43895,7 +44206,8 @@ function ChartDrawText()
|
|
|
43895
44206
|
|
|
43896
44207
|
this.ClassName='ChartDrawText'; //类名
|
|
43897
44208
|
this.Color="rgb(255,193,37)"; //线段颜色
|
|
43898
|
-
this.
|
|
44209
|
+
this.Font; //固定字体
|
|
44210
|
+
this.TextFont="14px 微软雅黑"; //输出使用的字体
|
|
43899
44211
|
this.TextBaseline="middle";
|
|
43900
44212
|
this.TextAlign='left';
|
|
43901
44213
|
this.Text
|
|
@@ -43926,6 +44238,12 @@ function ChartDrawText()
|
|
|
43926
44238
|
}
|
|
43927
44239
|
}
|
|
43928
44240
|
|
|
44241
|
+
this.GetMaxMin=function()
|
|
44242
|
+
{
|
|
44243
|
+
var range={ Min:null, Max:null };
|
|
44244
|
+
return range;
|
|
44245
|
+
}
|
|
44246
|
+
|
|
43929
44247
|
this.Draw=function()
|
|
43930
44248
|
{
|
|
43931
44249
|
if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
|
|
@@ -43964,8 +44282,9 @@ function ChartDrawText()
|
|
|
43964
44282
|
var isArrayText=Array.isArray(this.Text);
|
|
43965
44283
|
var drawTextInfo={ Text:{ Color:this.Color, Align:this.TextAlign, Baseline:this.TextBaseline }, Font:{ } };
|
|
43966
44284
|
|
|
43967
|
-
|
|
43968
|
-
|
|
44285
|
+
if (this.Font)
|
|
44286
|
+
this.TextFont=this.Font;
|
|
44287
|
+
else if (this.FixedFontSize>0) //固定字体大小模式
|
|
43969
44288
|
this.TextFont=`${this.FixedFontSize}px ${this.TextSize.FontName}`;
|
|
43970
44289
|
else //动态字体大小
|
|
43971
44290
|
this.TextFont=this.GetDynamicFont(dataWidth,distanceWidth,this.TextSize.Max,this.TextSize.Min,this.TextSize.Zoom,this.TextSize.FontName);
|
|
@@ -52815,6 +53134,7 @@ function KLineTooltipPaint()
|
|
|
52815
53134
|
this.ExtendLineWidth=2;
|
|
52816
53135
|
|
|
52817
53136
|
this.Font=[g_JSChartResource.TooltipPaint.TitleFont];
|
|
53137
|
+
|
|
52818
53138
|
|
|
52819
53139
|
this.HQChart;
|
|
52820
53140
|
this.KLineTitlePaint;
|
|
@@ -52934,6 +53254,8 @@ function KLineTooltipPaint()
|
|
|
52934
53254
|
lineWidth+=textWidth;
|
|
52935
53255
|
}
|
|
52936
53256
|
|
|
53257
|
+
if (IFrameSplitOperator.IsNumber(item.Space)) lineWidth+=item.Space;
|
|
53258
|
+
|
|
52937
53259
|
if (maxLineWidth<lineWidth) maxLineWidth=lineWidth;
|
|
52938
53260
|
|
|
52939
53261
|
height+=this.LineHeight;
|
|
@@ -53125,20 +53447,33 @@ function KLineTooltipPaint()
|
|
|
53125
53447
|
{
|
|
53126
53448
|
var item=titleData.AryText[i];
|
|
53127
53449
|
|
|
53450
|
+
var titleWidth=0;
|
|
53128
53451
|
if (item.Title)
|
|
53129
53452
|
{
|
|
53130
53453
|
this.Canvas.textAlign="left";
|
|
53131
53454
|
this.Canvas.fillStyle=item.TitleColor;
|
|
53132
53455
|
this.Canvas.fillText(item.Title,left,top);
|
|
53456
|
+
var titleWidth=this.Canvas.measureText(item.Title).width+2;
|
|
53133
53457
|
}
|
|
53134
53458
|
|
|
53135
53459
|
if (item.Text)
|
|
53136
53460
|
{
|
|
53137
|
-
|
|
53138
|
-
|
|
53139
|
-
|
|
53461
|
+
if (item.TextAlign==1) //1=左对齐 0=右对齐
|
|
53462
|
+
{
|
|
53463
|
+
var yText=left+titleWidth+2;
|
|
53464
|
+
if (IFrameSplitOperator.IsNumber(item.Space)) yText+=item.Space; //标题和数据内容间距
|
|
53465
|
+
this.Canvas.textAlign="left";
|
|
53466
|
+
this.Canvas.fillStyle=item.Color;
|
|
53467
|
+
this.Canvas.fillText(item.Text,yText,top);
|
|
53468
|
+
}
|
|
53469
|
+
else
|
|
53470
|
+
{
|
|
53471
|
+
this.Canvas.textAlign="right";
|
|
53472
|
+
this.Canvas.fillStyle=item.Color;
|
|
53473
|
+
this.Canvas.fillText(item.Text,right,top);
|
|
53474
|
+
}
|
|
53140
53475
|
}
|
|
53141
|
-
|
|
53476
|
+
|
|
53142
53477
|
top+=this.LineHeight+this.LineSpace;
|
|
53143
53478
|
}
|
|
53144
53479
|
|
|
@@ -57306,6 +57641,8 @@ function LatestPointFlashPaint()
|
|
|
57306
57641
|
this.ClassName='LatestPointFlashPaint';
|
|
57307
57642
|
this.HQChart;
|
|
57308
57643
|
|
|
57644
|
+
this.FlashType=0; //0=数据更新了闪烁, 1=一直显示
|
|
57645
|
+
//闪烁
|
|
57309
57646
|
this.Status=0;
|
|
57310
57647
|
this.UpdateTime=new Date();
|
|
57311
57648
|
this.FlashCount=0; //闪烁次数
|
|
@@ -57330,6 +57667,7 @@ function LatestPointFlashPaint()
|
|
|
57330
57667
|
if (option)
|
|
57331
57668
|
{
|
|
57332
57669
|
if (IFrameSplitOperator.IsNumber(option.Frequency)) this.Frequency=option.Frequency;
|
|
57670
|
+
if (IFrameSplitOperator.IsNumber(option.FlashType)) this.FlashType=option.FlashType;
|
|
57333
57671
|
}
|
|
57334
57672
|
}
|
|
57335
57673
|
|
|
@@ -57364,18 +57702,32 @@ function LatestPointFlashPaint()
|
|
|
57364
57702
|
if (!this.HQChart) return;
|
|
57365
57703
|
this.HQChart.ClearCanvas(this.FlashCanvas);
|
|
57366
57704
|
|
|
57367
|
-
if (this.
|
|
57368
|
-
|
|
57705
|
+
if (this.FlashType===1)
|
|
57706
|
+
{
|
|
57707
|
+
|
|
57708
|
+
}
|
|
57709
|
+
else
|
|
57369
57710
|
{
|
|
57370
|
-
|
|
57371
|
-
|
|
57711
|
+
if (this.FlashCount<=0) return;
|
|
57712
|
+
if (this.IsStatusChange())
|
|
57713
|
+
{
|
|
57714
|
+
this.Status=(this.Status+1)%2;
|
|
57715
|
+
--this.FlashCount;
|
|
57716
|
+
}
|
|
57717
|
+
if (this.Status==0) return;
|
|
57372
57718
|
}
|
|
57719
|
+
|
|
57720
|
+
|
|
57373
57721
|
|
|
57374
|
-
if (this.Status==0) return;
|
|
57375
57722
|
if (!this.HQChart.GlobalOption || !this.HQChart.GlobalOption.LatestPoint) return;
|
|
57376
57723
|
var point=this.HQChart.GlobalOption.LatestPoint;
|
|
57377
57724
|
if (!IFrameSplitOperator.IsNumber(point.X) || !IFrameSplitOperator.IsNumber(point.Y)) return;
|
|
57378
57725
|
|
|
57726
|
+
this.DrawPoint(point);
|
|
57727
|
+
}
|
|
57728
|
+
|
|
57729
|
+
this.DrawPoint=function(point)
|
|
57730
|
+
{
|
|
57379
57731
|
if (this.Style==1) this.GetChartColor();
|
|
57380
57732
|
|
|
57381
57733
|
this.FlashCanvas.fillStyle=this.BGColor;
|
|
@@ -82509,7 +82861,7 @@ function JSChartResource()
|
|
|
82509
82861
|
//虚线配置
|
|
82510
82862
|
this.DOTLINE=
|
|
82511
82863
|
{
|
|
82512
|
-
LineDash:[
|
|
82864
|
+
LineDash:[2*GetDevicePixelRatio(),2*GetDevicePixelRatio()] //虚线配置
|
|
82513
82865
|
}
|
|
82514
82866
|
|
|
82515
82867
|
this.DRAWSL=
|
|
@@ -89765,7 +90117,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
89765
90117
|
this.ClearCustomKLine();
|
|
89766
90118
|
this.ClearKLineCaluate();
|
|
89767
90119
|
this.UnlockCorssCursor();
|
|
89768
|
-
|
|
90120
|
+
this.ClearDrawStatusData();
|
|
89769
90121
|
|
|
89770
90122
|
var kLineDrawType=this.GetKLineDrawType();
|
|
89771
90123
|
if (kLineDrawType==10 || kLineDrawType==11 || kLineDrawType==12 || kLineDrawType==16) isDataTypeChange=true;
|
|
@@ -91170,7 +91522,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
91170
91522
|
this.UnlockCorssCursor();
|
|
91171
91523
|
this.Frame.ClearYCoordinateMaxMin();
|
|
91172
91524
|
this.ClosePopMinuteChart();
|
|
91173
|
-
|
|
91525
|
+
this.ClearDrawStatusData();
|
|
91174
91526
|
|
|
91175
91527
|
this.Symbol=symbol;
|
|
91176
91528
|
if (!symbol)
|
|
@@ -97784,6 +98136,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
97784
98136
|
this.ClearStockCache();
|
|
97785
98137
|
this.UnlockCorssCursor();
|
|
97786
98138
|
this.Frame.ClearYCoordinateMaxMin();
|
|
98139
|
+
this.ClearDrawStatusData();
|
|
97787
98140
|
|
|
97788
98141
|
|
|
97789
98142
|
if (option)
|
|
@@ -97952,6 +98305,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
97952
98305
|
this.ClearStockCache();
|
|
97953
98306
|
this.UnlockCorssCursor();
|
|
97954
98307
|
this.Frame.ClearYCoordinateMaxMin();
|
|
98308
|
+
this.ClearDrawStatusData();
|
|
97955
98309
|
|
|
97956
98310
|
if (option && option.PageInfo)
|
|
97957
98311
|
{
|
|
@@ -115205,22 +115559,50 @@ function JSAlgorithm(errorHandler,symbolData)
|
|
|
115205
115559
|
this.FILTERX=function(data, n, node)
|
|
115206
115560
|
{
|
|
115207
115561
|
var result=[];
|
|
115208
|
-
|
|
115562
|
+
if (IFrameSplitOperator.IsNumber(n))
|
|
115209
115563
|
{
|
|
115210
|
-
|
|
115564
|
+
for(var i=data.length-1, j=0; i>=0; --i)
|
|
115211
115565
|
{
|
|
115212
|
-
|
|
115213
|
-
for(j=0;j<n && i-j-1>=0;++j)
|
|
115566
|
+
if (data[i])
|
|
115214
115567
|
{
|
|
115215
|
-
result[i
|
|
115568
|
+
result[i]=1;
|
|
115569
|
+
for(j=0;j<n && i-j-1>=0;++j)
|
|
115570
|
+
{
|
|
115571
|
+
result[i-j-1]=0;
|
|
115572
|
+
}
|
|
115573
|
+
i-=n;
|
|
115574
|
+
}
|
|
115575
|
+
else
|
|
115576
|
+
{
|
|
115577
|
+
result[i]=0;
|
|
115216
115578
|
}
|
|
115217
|
-
i+=n;
|
|
115218
115579
|
}
|
|
115219
|
-
|
|
115580
|
+
}
|
|
115581
|
+
else if (Array.isArray(n))
|
|
115582
|
+
{
|
|
115583
|
+
for(var i=data.length-1, j=0; i>=0; --i)
|
|
115220
115584
|
{
|
|
115221
|
-
|
|
115585
|
+
if (data[i])
|
|
115586
|
+
{
|
|
115587
|
+
result[i]=1;
|
|
115588
|
+
if (!IFrameSplitOperator.IsNumber(n[i])) continue;
|
|
115589
|
+
var period=parseInt(n[i]);
|
|
115590
|
+
if (period<=0) continue;
|
|
115591
|
+
|
|
115592
|
+
for(j=0;j<period && i-j-1>=0;++j)
|
|
115593
|
+
{
|
|
115594
|
+
result[i-j-1]=0;
|
|
115595
|
+
}
|
|
115596
|
+
|
|
115597
|
+
i-=period;
|
|
115598
|
+
}
|
|
115599
|
+
else
|
|
115600
|
+
{
|
|
115601
|
+
result[i]=0;
|
|
115602
|
+
}
|
|
115222
115603
|
}
|
|
115223
115604
|
}
|
|
115605
|
+
|
|
115224
115606
|
|
|
115225
115607
|
return result;
|
|
115226
115608
|
}
|
|
@@ -119658,6 +120040,7 @@ function JSDraw(errorHandler,symbolData)
|
|
|
119658
120040
|
return result;
|
|
119659
120041
|
}
|
|
119660
120042
|
|
|
120043
|
+
//只有条件==1 才显示文字
|
|
119661
120044
|
this.DRAWTEXT=function(condition,price,text)
|
|
119662
120045
|
{
|
|
119663
120046
|
let drawData=[];
|
|
@@ -119675,11 +120058,11 @@ function JSDraw(errorHandler,symbolData)
|
|
|
119675
120058
|
isFixedPosition=true;
|
|
119676
120059
|
}
|
|
119677
120060
|
|
|
119678
|
-
for(var i
|
|
120061
|
+
for(var i=0;i<condition.length;++i)
|
|
119679
120062
|
{
|
|
119680
120063
|
drawData[i]=null;
|
|
119681
120064
|
|
|
119682
|
-
if (
|
|
120065
|
+
if (condition[i]!==1) continue;
|
|
119683
120066
|
|
|
119684
120067
|
if (IsNumber || isFixedPosition)
|
|
119685
120068
|
{
|
|
@@ -119691,7 +120074,7 @@ function JSDraw(errorHandler,symbolData)
|
|
|
119691
120074
|
}
|
|
119692
120075
|
}
|
|
119693
120076
|
}
|
|
119694
|
-
else if (this.IsNumber(condition) && condition)
|
|
120077
|
+
else if (this.IsNumber(condition) && condition===1)
|
|
119695
120078
|
{
|
|
119696
120079
|
var IsNumber=this.IsNumber(price);
|
|
119697
120080
|
var isFixedPosition=false;
|
|
@@ -119717,20 +120100,21 @@ function JSDraw(errorHandler,symbolData)
|
|
|
119717
120100
|
return result;
|
|
119718
120101
|
}
|
|
119719
120102
|
|
|
120103
|
+
//1.固定位置显示文字;2.在指标排序中显示字符串栏目.
|
|
120104
|
+
//用法:DRAWTEXT_FIX(COND,X,Y,TYPE,TEXT),COND中一般需要加ISLASTBAR,当COND条件满足时,在当前指标窗口内(X,Y)位置书写文字TEXT,X,Y为书写点在窗口中相对于左上角的百分比,TYPE:0为左对齐,1为右对齐,2=居中.
|
|
120105
|
+
//例如:DRAWTEXT_FIX(ISLASTBAR AND CLOSE/OPEN>1.08,0.5,0.5,0,'大阳线')表示最后一个交易日实体阳线大于8%时在窗口中间位置显示'大阳线'字样.若文字中含有&,则进行折行.最多只能显示250个字符
|
|
119720
120106
|
this.DRAWTEXT_FIX=function(condition,x,y,type,text)
|
|
119721
120107
|
{
|
|
119722
120108
|
var drawData={ Value:[], Text:[] };
|
|
119723
120109
|
var result={DrawData:drawData, DrawType:'DRAWTEXT_FIX', Text:null, Position:{ X:x, Y:y, Type:type } };
|
|
119724
|
-
|
|
119725
|
-
|
|
120110
|
+
|
|
119726
120111
|
if (Array.isArray(condition))
|
|
119727
120112
|
{
|
|
119728
|
-
|
|
119729
|
-
for(var i in condition)
|
|
120113
|
+
for(var i=0; i<condition.length; ++i)
|
|
119730
120114
|
{
|
|
119731
120115
|
drawData.Text[i]=null;
|
|
119732
120116
|
drawData.Value[i]=0;
|
|
119733
|
-
if (
|
|
120117
|
+
if (condition[i]!==1) continue;
|
|
119734
120118
|
|
|
119735
120119
|
drawData.Value[i]=1;
|
|
119736
120120
|
drawData.Text[i]=text;
|
|
@@ -119738,7 +120122,7 @@ function JSDraw(errorHandler,symbolData)
|
|
|
119738
120122
|
}
|
|
119739
120123
|
else
|
|
119740
120124
|
{
|
|
119741
|
-
if(condition)
|
|
120125
|
+
if(condition===1)
|
|
119742
120126
|
{
|
|
119743
120127
|
for(var i=0;i<this.SymbolData.Data.Data.length;++i)
|
|
119744
120128
|
{
|
|
@@ -119879,6 +120263,17 @@ function JSDraw(errorHandler,symbolData)
|
|
|
119879
120263
|
let bSecondPont=false;
|
|
119880
120264
|
let lineCache={Start:{ },End:{ }, List:new Array()};
|
|
119881
120265
|
|
|
120266
|
+
function CopyLineData(aryDest, arySrc)
|
|
120267
|
+
{
|
|
120268
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(arySrc)) return;
|
|
120269
|
+
|
|
120270
|
+
for(var j=0; j<arySrc.length; ++j)
|
|
120271
|
+
{
|
|
120272
|
+
var item=arySrc[j];
|
|
120273
|
+
aryDest[item.ID]=item.Value;
|
|
120274
|
+
}
|
|
120275
|
+
}
|
|
120276
|
+
|
|
119882
120277
|
for(let i=0;i<count;++i)
|
|
119883
120278
|
{
|
|
119884
120279
|
drawData[i]=null;
|
|
@@ -119905,6 +120300,16 @@ function JSDraw(errorHandler,symbolData)
|
|
|
119905
120300
|
{
|
|
119906
120301
|
bSecondPont=true;
|
|
119907
120302
|
lineCache.End={ID:i, Value:data2[i]}; //第2个点
|
|
120303
|
+
|
|
120304
|
+
if (condition[i])
|
|
120305
|
+
{
|
|
120306
|
+
var lineData=this.CalculateDrawLine(lineCache); //计算2个点的线上 其他点的数值
|
|
120307
|
+
CopyLineData(drawData,lineData);
|
|
120308
|
+
|
|
120309
|
+
bFirstPoint=true;
|
|
120310
|
+
bSecondPont=false;
|
|
120311
|
+
lineCache.Start={ID:i, Value:data[i]}; //第1个点
|
|
120312
|
+
}
|
|
119908
120313
|
}
|
|
119909
120314
|
}
|
|
119910
120315
|
else if (bFirstPoint==true && bSecondPont==true)
|
|
@@ -119916,13 +120321,8 @@ function JSDraw(errorHandler,symbolData)
|
|
|
119916
120321
|
}
|
|
119917
120322
|
else if (condition[i]) //条件1满足
|
|
119918
120323
|
{
|
|
119919
|
-
|
|
119920
|
-
|
|
119921
|
-
for(let j in lineData)
|
|
119922
|
-
{
|
|
119923
|
-
let item=lineData[j];
|
|
119924
|
-
drawData[item.ID]=item.Value;
|
|
119925
|
-
}
|
|
120324
|
+
var lineData=this.CalculateDrawLine(lineCache); //计算2个点的线上 其他点的数值
|
|
120325
|
+
CopyLineData(drawData,lineData);
|
|
119926
120326
|
|
|
119927
120327
|
if (expand==1) this.CalculateDrawDataExtendLine(drawData, lineCache.Start.ID-2);//右延长线
|
|
119928
120328
|
|
|
@@ -119939,12 +120339,9 @@ function JSDraw(errorHandler,symbolData)
|
|
|
119939
120339
|
//最后一组线
|
|
119940
120340
|
if (bFirstPoint==true && bSecondPont==true)
|
|
119941
120341
|
{
|
|
119942
|
-
|
|
119943
|
-
|
|
119944
|
-
|
|
119945
|
-
let item=lineData[j];
|
|
119946
|
-
drawData[item.ID]=item.Value;
|
|
119947
|
-
}
|
|
120342
|
+
var lineData=this.CalculateDrawLine(lineCache);
|
|
120343
|
+
CopyLineData(drawData,lineData);
|
|
120344
|
+
|
|
119948
120345
|
}
|
|
119949
120346
|
}
|
|
119950
120347
|
|
|
@@ -120461,7 +120858,13 @@ function JSDraw(errorHandler,symbolData)
|
|
|
120461
120858
|
{
|
|
120462
120859
|
if (!numberData) return null;
|
|
120463
120860
|
|
|
120464
|
-
if (numberData.DataType==1)
|
|
120861
|
+
if (numberData.DataType==1)
|
|
120862
|
+
{
|
|
120863
|
+
var value=numberData.SingleValue;
|
|
120864
|
+
if (IFrameSplitOperator.IsNumber(value)) return value.toFixed(decimal);
|
|
120865
|
+
else if (value) return value.toString();
|
|
120866
|
+
else return null;
|
|
120867
|
+
}
|
|
120465
120868
|
|
|
120466
120869
|
if (!IFrameSplitOperator.IsNonEmptyArray(numberData.ArrayValue)) return null;
|
|
120467
120870
|
|
|
@@ -120477,10 +120880,10 @@ function JSDraw(errorHandler,symbolData)
|
|
|
120477
120880
|
|
|
120478
120881
|
/*
|
|
120479
120882
|
固定位置显示数字.
|
|
120480
|
-
用法: DRAWNUMBER_FIX(COND,X,Y,TYPE,NUMBER),当COND条件满足时,在当前指标窗口内(X,Y)位置书写数字NUMBER,X,Y为书写点在窗口中相对于左上角的百分比,TYPE:0为左对齐,1
|
|
120883
|
+
用法: DRAWNUMBER_FIX(COND,X,Y,TYPE,NUMBER,decimal=2),当COND条件满足时,在当前指标窗口内(X,Y)位置书写数字NUMBER,X,Y为书写点在窗口中相对于左上角的百分比,TYPE:0为左对齐,1为右对齐 2=居中
|
|
120481
120884
|
例如: DRAWNUMBER_FIX(CURRBARSCOUNT=1 AND CLOSE/OPEN>1.08,0.5,0.5,0,C)表示最后一个交易日实体阳线大于8%时在窗口中间位置显示收盘价.
|
|
120482
120885
|
*/
|
|
120483
|
-
this.DRAWNUMBER_FIX=function(condition,x,y,align,data)
|
|
120886
|
+
this.DRAWNUMBER_FIX=function(condition,x,y,align,data, decimal=2)
|
|
120484
120887
|
{
|
|
120485
120888
|
var drawData={ Value:[], Text:[], };
|
|
120486
120889
|
var result={ DrawData:drawData, DrawType:'DRAWNUMBER_FIX', Position:{ X:x, Y:y, Type:align } };
|
|
@@ -120488,15 +120891,15 @@ function JSDraw(errorHandler,symbolData)
|
|
|
120488
120891
|
|
|
120489
120892
|
if (Array.isArray(condition))
|
|
120490
120893
|
{
|
|
120491
|
-
for(var i
|
|
120894
|
+
for(var i=0; i<condition.length; ++i)
|
|
120492
120895
|
{
|
|
120493
120896
|
drawData.Text[i]=null;
|
|
120494
120897
|
drawData.Value[i]=null;
|
|
120495
|
-
if (
|
|
120898
|
+
if (condition[i]!==1) continue;
|
|
120496
120899
|
|
|
120497
120900
|
if (isNumber)
|
|
120498
120901
|
{
|
|
120499
|
-
drawData.Text[i]=this.RemoveZero(data.toFixed(
|
|
120902
|
+
drawData.Text[i]=this.RemoveZero(data.toFixed(decimal));
|
|
120500
120903
|
drawData.Value[i]=data;
|
|
120501
120904
|
}
|
|
120502
120905
|
else
|
|
@@ -120504,14 +120907,14 @@ function JSDraw(errorHandler,symbolData)
|
|
|
120504
120907
|
if (i>=data.length || !IFrameSplitOperator.IsNumber(data[i])) continue;
|
|
120505
120908
|
|
|
120506
120909
|
var item=data[i];
|
|
120507
|
-
drawData.Text[i]=this.RemoveZero(item.toFixed(
|
|
120910
|
+
drawData.Text[i]=this.RemoveZero(item.toFixed(decimal));
|
|
120508
120911
|
drawData.Value[i]=item;
|
|
120509
120912
|
}
|
|
120510
120913
|
}
|
|
120511
120914
|
}
|
|
120512
120915
|
else
|
|
120513
120916
|
{
|
|
120514
|
-
if(
|
|
120917
|
+
if(condition!==1)
|
|
120515
120918
|
{
|
|
120516
120919
|
|
|
120517
120920
|
}
|
|
@@ -120521,7 +120924,7 @@ function JSDraw(errorHandler,symbolData)
|
|
|
120521
120924
|
{
|
|
120522
120925
|
if (isNumber)
|
|
120523
120926
|
{
|
|
120524
|
-
drawData.Text[i]=this.RemoveZero(data.toFixed(
|
|
120927
|
+
drawData.Text[i]=this.RemoveZero(data.toFixed(decimal));
|
|
120525
120928
|
drawData.Value[i]=data;
|
|
120526
120929
|
}
|
|
120527
120930
|
else
|
|
@@ -120529,7 +120932,7 @@ function JSDraw(errorHandler,symbolData)
|
|
|
120529
120932
|
if (i>=data.length || !IFrameSplitOperator.IsNumber(data[i])) continue;
|
|
120530
120933
|
|
|
120531
120934
|
var item=data[i];
|
|
120532
|
-
drawData.Text[i]=this.RemoveZero(item.toFixed(
|
|
120935
|
+
drawData.Text[i]=this.RemoveZero(item.toFixed(decimal));
|
|
120533
120936
|
drawData.Value[i]=item;
|
|
120534
120937
|
}
|
|
120535
120938
|
}
|
|
@@ -120847,6 +121250,12 @@ function JSDraw(errorHandler,symbolData)
|
|
|
120847
121250
|
return rgba;
|
|
120848
121251
|
}
|
|
120849
121252
|
|
|
121253
|
+
//设置字体
|
|
121254
|
+
this.CSSFONT=function(strFont)
|
|
121255
|
+
{
|
|
121256
|
+
return strFont;
|
|
121257
|
+
}
|
|
121258
|
+
|
|
120850
121259
|
this.UPCOLOR=function(color)
|
|
120851
121260
|
{
|
|
120852
121261
|
return color;
|
|
@@ -127892,6 +128301,7 @@ function JSExecute(ast,option)
|
|
|
127892
128301
|
let xOffset=null, yOffset=null;
|
|
127893
128302
|
var klineType=null;
|
|
127894
128303
|
var lineDash=null;
|
|
128304
|
+
var font=null;
|
|
127895
128305
|
for(let j=0; j<item.Expression.Expression.length; ++j)
|
|
127896
128306
|
{
|
|
127897
128307
|
let itemExpression=item.Expression.Expression[j];
|
|
@@ -128008,6 +128418,10 @@ function JSExecute(ast,option)
|
|
|
128008
128418
|
{
|
|
128009
128419
|
downColor=itemExpression.Out;
|
|
128010
128420
|
}
|
|
128421
|
+
else if (itemExpression.Callee.Name=="CSSFONT")
|
|
128422
|
+
{
|
|
128423
|
+
font=itemExpression.Out;
|
|
128424
|
+
}
|
|
128011
128425
|
else if (itemExpression.Callee.Name=="STICKTYPE")
|
|
128012
128426
|
{
|
|
128013
128427
|
stickType=itemExpression.Out;
|
|
@@ -128210,6 +128624,7 @@ function JSExecute(ast,option)
|
|
|
128210
128624
|
if (drawAlign>=0) outVar.DrawAlign=drawAlign;
|
|
128211
128625
|
if (drawVAlign>=0) outVar.DrawVAlign=drawVAlign;
|
|
128212
128626
|
if (fontSize>0) outVar.DrawFontSize=fontSize;
|
|
128627
|
+
if (font) outVar.Font=font;
|
|
128213
128628
|
if (bgConfig) outVar.Background=bgConfig;
|
|
128214
128629
|
if (vLineConfig) outVar.VerticalLine=vLineConfig;
|
|
128215
128630
|
if (IFrameSplitOperator.IsNumber(xOffset)) outVar.XOffset=xOffset;
|
|
@@ -128691,7 +129106,7 @@ function JSExecute(ast,option)
|
|
|
128691
129106
|
node.Out=node.Draw.DrawData.Value;
|
|
128692
129107
|
break;
|
|
128693
129108
|
case "DRAWNUMBER_FIX":
|
|
128694
|
-
node.Draw=this.Draw.DRAWNUMBER_FIX(args[0],args[1],args[2],args[3],args[4]);
|
|
129109
|
+
node.Draw=this.Draw.DRAWNUMBER_FIX(args[0],args[1],args[2],args[3],args[4], args[5]);
|
|
128695
129110
|
node.Out=node.Draw.DrawData.Value;
|
|
128696
129111
|
break;
|
|
128697
129112
|
case "DRAWCHANNEL":
|
|
@@ -128710,6 +129125,9 @@ function JSExecute(ast,option)
|
|
|
128710
129125
|
case "DOWNCOLOR":
|
|
128711
129126
|
node.Out=this.Draw.DOWNCOLOR(args[0]);
|
|
128712
129127
|
break;
|
|
129128
|
+
case "CSSFONT":
|
|
129129
|
+
node.Out=this.Draw.CSSFONT(args[0]);
|
|
129130
|
+
break;
|
|
128713
129131
|
case "STICKTYPE": //柱子类型
|
|
128714
129132
|
node.Out=this.Draw.STICKTYPE(args[0]);
|
|
128715
129133
|
break;
|
|
@@ -131424,6 +131842,7 @@ function ScriptIndex(name,script,args,option)
|
|
|
131424
131842
|
}
|
|
131425
131843
|
|
|
131426
131844
|
if (varItem.DrawFontSize>0) chartText.FixedFontSize=varItem.DrawFontSize;
|
|
131845
|
+
if (varItem.Font) chartText.Font=varItem.Font;
|
|
131427
131846
|
if (varItem.Background) chartText.TextBG=varItem.Background;
|
|
131428
131847
|
if (varItem.VerticalLine) chartText.VerticalLine=varItem.VerticalLine;
|
|
131429
131848
|
|
|
@@ -131579,6 +131998,12 @@ function ScriptIndex(name,script,args,option)
|
|
|
131579
131998
|
let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
|
|
131580
131999
|
if (!isNaN(width) && width>0) line.LineWidth=width;
|
|
131581
132000
|
}
|
|
132001
|
+
|
|
132002
|
+
if (varItem.IsDotLine)
|
|
132003
|
+
{
|
|
132004
|
+
line.IsDotLine=true; //虚线
|
|
132005
|
+
line.LineDash=g_JSChartResource.DOTLINE.LineDash.slice();
|
|
132006
|
+
}
|
|
131582
132007
|
|
|
131583
132008
|
let titleIndex=windowIndex+1;
|
|
131584
132009
|
line.Data.Data=varItem.Draw.DrawData;
|
|
@@ -132158,6 +132583,102 @@ function ScriptIndex(name,script,args,option)
|
|
|
132158
132583
|
hqChart.ChartPaint.push(chartText);
|
|
132159
132584
|
}
|
|
132160
132585
|
|
|
132586
|
+
this.CreateDrawText_Fix=function(hqChart,windowIndex,varItem,id)
|
|
132587
|
+
{
|
|
132588
|
+
var chartText=new ChartDrawText_Fix();
|
|
132589
|
+
chartText.Canvas=hqChart.Canvas;
|
|
132590
|
+
chartText.Name=varItem.Name;
|
|
132591
|
+
chartText.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
|
|
132592
|
+
chartText.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
|
|
132593
|
+
chartText.ReloadResource();
|
|
132594
|
+
chartText.HQChart=hqChart;
|
|
132595
|
+
|
|
132596
|
+
if (varItem.Draw.Position)
|
|
132597
|
+
{
|
|
132598
|
+
var item=varItem.Draw.Position;
|
|
132599
|
+
chartText.PtPercentage={ X:item.X, Y:item.Y }; //坐标
|
|
132600
|
+
// TYPE:0为左对齐,1为右对齐 2=居中
|
|
132601
|
+
if (item.Type===0) chartText.TextAlign="left";
|
|
132602
|
+
else if (item.Type===1) chartText.TextAlign="right";
|
|
132603
|
+
else if (item.Type===2) chartText.TextAlign="center";
|
|
132604
|
+
}
|
|
132605
|
+
|
|
132606
|
+
//字体
|
|
132607
|
+
if (varItem.DrawFontSize>0) chartText.TextFont=`${varItem.DrawFontSize*GetDevicePixelRatio()}px 微软雅黑`; //临时用下吧
|
|
132608
|
+
if (varItem.Font) chartText.TextFont=varItem.Font;
|
|
132609
|
+
|
|
132610
|
+
//颜色
|
|
132611
|
+
if (varItem.Color) chartText.Color=this.GetColor(varItem.Color);
|
|
132612
|
+
else chartText.Color=this.GetDefaultColor(id);
|
|
132613
|
+
|
|
132614
|
+
if (varItem.DrawVAlign>=0) //上下对齐
|
|
132615
|
+
{
|
|
132616
|
+
if (varItem.DrawVAlign==0) chartText.TextBaseline='top';
|
|
132617
|
+
else if (varItem.DrawVAlign==1) chartText.TextBaseline='middle';
|
|
132618
|
+
else if (varItem.DrawVAlign==2) chartText.TextBaseline='bottom';
|
|
132619
|
+
}
|
|
132620
|
+
|
|
132621
|
+
if (varItem.DrawAlign>=0) // 左右对齐
|
|
132622
|
+
{
|
|
132623
|
+
if (varItem.DrawAlign==0) chartText.TextAlign="left";
|
|
132624
|
+
else if (varItem.DrawAlign==1) chartText.TextAlign="center";
|
|
132625
|
+
else if (varItem.DrawAlign==2) chartText.TextAlign='right';
|
|
132626
|
+
}
|
|
132627
|
+
|
|
132628
|
+
chartText.BuildCacheData(hqChart.GetKData(),varItem.Draw.DrawData);
|
|
132629
|
+
|
|
132630
|
+
this.SetChartIndexName(chartText);
|
|
132631
|
+
hqChart.ChartPaint.push(chartText);
|
|
132632
|
+
}
|
|
132633
|
+
|
|
132634
|
+
this.CreateDrawNumber_Fix=function(hqChart,windowIndex,varItem,id)
|
|
132635
|
+
{
|
|
132636
|
+
var chartText=new ChartDrawNumber_Fix();
|
|
132637
|
+
chartText.Canvas=hqChart.Canvas;
|
|
132638
|
+
chartText.Name=varItem.Name;
|
|
132639
|
+
chartText.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
|
|
132640
|
+
chartText.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
|
|
132641
|
+
chartText.ReloadResource();
|
|
132642
|
+
chartText.HQChart=hqChart;
|
|
132643
|
+
|
|
132644
|
+
if (varItem.Draw.Position)
|
|
132645
|
+
{
|
|
132646
|
+
var item=varItem.Draw.Position;
|
|
132647
|
+
chartText.PtPercentage={ X:item.X, Y:item.Y }; //坐标
|
|
132648
|
+
// TYPE:0为左对齐,1为右对齐 2=居中
|
|
132649
|
+
if (item.Type===0) chartText.TextAlign="left";
|
|
132650
|
+
else if (item.Type===1) chartText.TextAlign="right";
|
|
132651
|
+
else if (item.Type===2) chartText.TextAlign="center";
|
|
132652
|
+
}
|
|
132653
|
+
|
|
132654
|
+
//字体
|
|
132655
|
+
if (varItem.DrawFontSize>0) chartText.TextFont=`${varItem.DrawFontSize*GetDevicePixelRatio()}px 微软雅黑`; //临时用下吧
|
|
132656
|
+
if (varItem.Font) chartText.TextFont=varItem.Font;
|
|
132657
|
+
|
|
132658
|
+
//颜色
|
|
132659
|
+
if (varItem.Color) chartText.Color=this.GetColor(varItem.Color);
|
|
132660
|
+
else chartText.Color=this.GetDefaultColor(id);
|
|
132661
|
+
|
|
132662
|
+
if (varItem.DrawVAlign>=0) //上下对齐
|
|
132663
|
+
{
|
|
132664
|
+
if (varItem.DrawVAlign==0) chartText.TextBaseline='top';
|
|
132665
|
+
else if (varItem.DrawVAlign==1) chartText.TextBaseline='middle';
|
|
132666
|
+
else if (varItem.DrawVAlign==2) chartText.TextBaseline='bottom';
|
|
132667
|
+
}
|
|
132668
|
+
|
|
132669
|
+
if (varItem.DrawAlign>=0) // 左右对齐
|
|
132670
|
+
{
|
|
132671
|
+
if (varItem.DrawAlign==0) chartText.TextAlign="left";
|
|
132672
|
+
else if (varItem.DrawAlign==1) chartText.TextAlign="center";
|
|
132673
|
+
else if (varItem.DrawAlign==2) chartText.TextAlign='right';
|
|
132674
|
+
}
|
|
132675
|
+
|
|
132676
|
+
chartText.BuildCacheData(hqChart.GetKData(),varItem.Draw.DrawData);
|
|
132677
|
+
|
|
132678
|
+
this.SetChartIndexName(chartText);
|
|
132679
|
+
hqChart.ChartPaint.push(chartText);
|
|
132680
|
+
}
|
|
132681
|
+
|
|
132161
132682
|
this.CreateDrawText=function(hqChart,windowIndex,varItem,id)
|
|
132162
132683
|
{
|
|
132163
132684
|
let chartText=new ChartSingleText();
|
|
@@ -132974,8 +133495,10 @@ function ScriptIndex(name,script,args,option)
|
|
|
132974
133495
|
this.CreateDrawNumber(hqChart,windowIndex,item,i);
|
|
132975
133496
|
break;
|
|
132976
133497
|
case "DRAWNUMBER_FIX":
|
|
133498
|
+
this.CreateDrawNumber_Fix(hqChart,windowIndex,item,i);
|
|
133499
|
+
break;
|
|
132977
133500
|
case 'DRAWTEXT_FIX':
|
|
132978
|
-
this.
|
|
133501
|
+
this.CreateDrawText_Fix(hqChart,windowIndex,item,i);
|
|
132979
133502
|
break;
|
|
132980
133503
|
case 'DRAWICON':
|
|
132981
133504
|
this.CreateIcon(hqChart,windowIndex,item,i);
|
|
@@ -133367,9 +133890,13 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
133367
133890
|
this.CreateBackgroud(hqChart,windowIndex,item,i);
|
|
133368
133891
|
break;
|
|
133369
133892
|
case 'DRAWNUMBER':
|
|
133893
|
+
this.CreateNumberText(hqChart,windowIndex,item,i);
|
|
133894
|
+
break;
|
|
133370
133895
|
case "DRAWNUMBER_FIX":
|
|
133896
|
+
this.CreateDrawNumber_Fix(hqChart,windowIndex,item,i);
|
|
133897
|
+
break;
|
|
133371
133898
|
case 'DRAWTEXT_FIX':
|
|
133372
|
-
this.
|
|
133899
|
+
this.CreateDrawText_Fix(hqChart,windowIndex,item,i);
|
|
133373
133900
|
break;
|
|
133374
133901
|
case 'DRAWICON':
|
|
133375
133902
|
this.CreateIcon(hqChart,windowIndex,item,i);
|
|
@@ -133711,6 +134238,7 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
133711
134238
|
}
|
|
133712
134239
|
|
|
133713
134240
|
if (varItem.DrawFontSize>0) chartText.FixedFontSize=varItem.DrawFontSize;
|
|
134241
|
+
if (varItem.Font) chartText.Font=varItem.Font;
|
|
133714
134242
|
if (varItem.Background) chartText.TextBG=varItem.Background;
|
|
133715
134243
|
if (varItem.VerticalLine) chartText.VerticalLine=varItem.VerticalLine;
|
|
133716
134244
|
if (IFrameSplitOperator.IsNumber(varItem.XOffset)) chartText.ShowOffset.X=varItem.XOffset;
|
|
@@ -133909,6 +134437,12 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
133909
134437
|
let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
|
|
133910
134438
|
if (!isNaN(width) && width>0) chart.LineWidth=width;
|
|
133911
134439
|
}
|
|
134440
|
+
|
|
134441
|
+
if (varItem.IsDotLine)
|
|
134442
|
+
{
|
|
134443
|
+
chart.IsDotLine=true; //虚线
|
|
134444
|
+
chart.LineDash=g_JSChartResource.DOTLINE.LineDash.slice();
|
|
134445
|
+
}
|
|
133912
134446
|
|
|
133913
134447
|
let titleIndex=windowIndex+1;
|
|
133914
134448
|
chart.Data.Data=varItem.Draw.DrawData;
|
|
@@ -134078,6 +134612,110 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
134078
134612
|
frame.ChartPaint.push(chart);
|
|
134079
134613
|
}
|
|
134080
134614
|
|
|
134615
|
+
this.CreateDrawText_Fix=function(hqChart,windowIndex,varItem,id)
|
|
134616
|
+
{
|
|
134617
|
+
var overlayIndex=this.OverlayIndex;
|
|
134618
|
+
var frame=overlayIndex.Frame;
|
|
134619
|
+
var chart=new ChartDrawText_Fix();
|
|
134620
|
+
chart.Canvas=hqChart.Canvas;
|
|
134621
|
+
|
|
134622
|
+
chart.Name=varItem.Name;
|
|
134623
|
+
chart.ChartBorder=frame.Frame.ChartBorder;
|
|
134624
|
+
chart.ChartFrame=frame.Frame;
|
|
134625
|
+
chart.Identify=overlayIndex.Identify;
|
|
134626
|
+
chart.ReloadResource();
|
|
134627
|
+
chart.HQChart=hqChart;
|
|
134628
|
+
|
|
134629
|
+
if (varItem.Draw.Position)
|
|
134630
|
+
{
|
|
134631
|
+
var item=varItem.Draw.Position;
|
|
134632
|
+
chart.PtPercentage={ X:item.X, Y:item.Y }; //坐标
|
|
134633
|
+
// TYPE:0为左对齐,1为右对齐 2=居中
|
|
134634
|
+
if (item.Type===0) chart.TextAlign="left";
|
|
134635
|
+
else if (item.Type===1) chart.TextAlign="right";
|
|
134636
|
+
else if (item.Type===2) chart.TextAlign="center";
|
|
134637
|
+
}
|
|
134638
|
+
|
|
134639
|
+
//字体
|
|
134640
|
+
if (varItem.DrawFontSize>0) chart.TextFont=`${varItem.DrawFontSize*GetDevicePixelRatio()}px 微软雅黑`; //临时用下吧
|
|
134641
|
+
if (varItem.Font) chart.TextFont=varItem.Font;
|
|
134642
|
+
|
|
134643
|
+
//颜色
|
|
134644
|
+
if (varItem.Color) chart.Color=this.GetColor(varItem.Color);
|
|
134645
|
+
else chart.Color=this.GetDefaultColor(id);
|
|
134646
|
+
|
|
134647
|
+
if (varItem.DrawVAlign>=0) //上下对齐
|
|
134648
|
+
{
|
|
134649
|
+
if (varItem.DrawVAlign==0) chart.TextBaseline='top';
|
|
134650
|
+
else if (varItem.DrawVAlign==1) chart.TextBaseline='middle';
|
|
134651
|
+
else if (varItem.DrawVAlign==2) chart.TextBaseline='bottom';
|
|
134652
|
+
}
|
|
134653
|
+
|
|
134654
|
+
if (varItem.DrawAlign>=0) // 左右对齐
|
|
134655
|
+
{
|
|
134656
|
+
if (varItem.DrawAlign==0) chart.TextAlign="left";
|
|
134657
|
+
else if (varItem.DrawAlign==1) chart.TextAlign="center";
|
|
134658
|
+
else if (varItem.DrawAlign==2) chart.TextAlign='right';
|
|
134659
|
+
}
|
|
134660
|
+
|
|
134661
|
+
chart.BuildCacheData(hqChart.GetKData(),varItem.Draw.DrawData);
|
|
134662
|
+
|
|
134663
|
+
this.SetChartIndexName(chart);
|
|
134664
|
+
frame.ChartPaint.push(chart);
|
|
134665
|
+
}
|
|
134666
|
+
|
|
134667
|
+
this.CreateDrawNumber_Fix=function(hqChart,windowIndex,varItem,id)
|
|
134668
|
+
{
|
|
134669
|
+
var overlayIndex=this.OverlayIndex;
|
|
134670
|
+
var frame=overlayIndex.Frame;
|
|
134671
|
+
var chart=new ChartDrawNumber_Fix();
|
|
134672
|
+
chart.Canvas=hqChart.Canvas;
|
|
134673
|
+
|
|
134674
|
+
chart.Name=varItem.Name;
|
|
134675
|
+
chart.ChartBorder=frame.Frame.ChartBorder;
|
|
134676
|
+
chart.ChartFrame=frame.Frame;
|
|
134677
|
+
chart.Identify=overlayIndex.Identify;
|
|
134678
|
+
chart.ReloadResource();
|
|
134679
|
+
chart.HQChart=hqChart;
|
|
134680
|
+
|
|
134681
|
+
if (varItem.Draw.Position)
|
|
134682
|
+
{
|
|
134683
|
+
var item=varItem.Draw.Position;
|
|
134684
|
+
chart.PtPercentage={ X:item.X, Y:item.Y }; //坐标
|
|
134685
|
+
// TYPE:0为左对齐,1为右对齐 2=居中
|
|
134686
|
+
if (item.Type===0) chart.TextAlign="left";
|
|
134687
|
+
else if (item.Type===1) chart.TextAlign="right";
|
|
134688
|
+
else if (item.Type===2) chart.TextAlign="center";
|
|
134689
|
+
}
|
|
134690
|
+
|
|
134691
|
+
//字体
|
|
134692
|
+
if (varItem.DrawFontSize>0) chart.TextFont=`${varItem.DrawFontSize*GetDevicePixelRatio()}px 微软雅黑`; //临时用下吧
|
|
134693
|
+
if (varItem.Font) chart.TextFont=varItem.Font;
|
|
134694
|
+
|
|
134695
|
+
//颜色
|
|
134696
|
+
if (varItem.Color) chart.Color=this.GetColor(varItem.Color);
|
|
134697
|
+
else chart.Color=this.GetDefaultColor(id);
|
|
134698
|
+
|
|
134699
|
+
if (varItem.DrawVAlign>=0) //上下对齐
|
|
134700
|
+
{
|
|
134701
|
+
if (varItem.DrawVAlign==0) chart.TextBaseline='top';
|
|
134702
|
+
else if (varItem.DrawVAlign==1) chart.TextBaseline='middle';
|
|
134703
|
+
else if (varItem.DrawVAlign==2) chart.TextBaseline='bottom';
|
|
134704
|
+
}
|
|
134705
|
+
|
|
134706
|
+
if (varItem.DrawAlign>=0) // 左右对齐
|
|
134707
|
+
{
|
|
134708
|
+
if (varItem.DrawAlign==0) chart.TextAlign="left";
|
|
134709
|
+
else if (varItem.DrawAlign==1) chart.TextAlign="center";
|
|
134710
|
+
else if (varItem.DrawAlign==2) chart.TextAlign='right';
|
|
134711
|
+
}
|
|
134712
|
+
|
|
134713
|
+
chart.BuildCacheData(hqChart.GetKData(),varItem.Draw.DrawData);
|
|
134714
|
+
|
|
134715
|
+
this.SetChartIndexName(chart);
|
|
134716
|
+
frame.ChartPaint.push(chart);
|
|
134717
|
+
}
|
|
134718
|
+
|
|
134081
134719
|
this.CreateTextLine=function(hqChart,windowIndex,varItem,id)
|
|
134082
134720
|
{
|
|
134083
134721
|
var overlayIndex=this.OverlayIndex;
|
|
@@ -166352,7 +166990,7 @@ function HQChartScriptWorker()
|
|
|
166352
166990
|
|
|
166353
166991
|
|
|
166354
166992
|
|
|
166355
|
-
var HQCHART_VERSION="1.1.
|
|
166993
|
+
var HQCHART_VERSION="1.1.15291";
|
|
166356
166994
|
|
|
166357
166995
|
function PrintHQChartVersion()
|
|
166358
166996
|
{
|