hqchart 1.1.15480 → 1.1.15494
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 +41 -16
- package/package.json +1 -1
- package/src/jscommon/umychart.TReport.js +1 -0
- package/src/jscommon/umychart.complier.js +56 -10
- package/src/jscommon/umychart.js +166 -3
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +223 -14
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +224 -14
|
@@ -5851,6 +5851,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5851
5851
|
{
|
|
5852
5852
|
var item=option.Frame[i];
|
|
5853
5853
|
if (!chart.Frame.SubFrame[i]) continue;
|
|
5854
|
+
chart.SetSubFrameAttribute(chart.Frame.SubFrame[i], null, item);
|
|
5855
|
+
/*
|
|
5854
5856
|
if (item.SplitCount) chart.Frame.SubFrame[i].Frame.YSplitOperator.SplitCount=item.SplitCount;
|
|
5855
5857
|
if (item.StringFormat) chart.Frame.SubFrame[i].Frame.YSplitOperator.StringFormat=item.StringFormat;
|
|
5856
5858
|
if (IFrameSplitOperator.IsNumber(item.FloatPrecision)) chart.Frame.SubFrame[i].Frame.YSplitOperator.FloatPrecision=item.FloatPrecision;
|
|
@@ -5860,6 +5862,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5860
5862
|
|
|
5861
5863
|
if (item.IsShowLeftText==false) chart.Frame.SubFrame[i].Frame.YSplitOperator.IsShowLeftText=item.IsShowLeftText; //显示左边刻度
|
|
5862
5864
|
if (item.IsShowRightText==false) chart.Frame.SubFrame[i].Frame.YSplitOperator.IsShowRightText=item.IsShowRightText; //显示右边刻度
|
|
5865
|
+
*/
|
|
5863
5866
|
}
|
|
5864
5867
|
}
|
|
5865
5868
|
|
|
@@ -5874,9 +5877,13 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5874
5877
|
|
|
5875
5878
|
if(option.KLineTitle) //股票名称 日期 周期
|
|
5876
5879
|
{
|
|
5877
|
-
|
|
5878
|
-
|
|
5879
|
-
if(
|
|
5880
|
+
var item=option.KLineTitle;
|
|
5881
|
+
var chartTitle=chart.TitlePaint[0];
|
|
5882
|
+
if (IFrameSplitOperator.IsBool(item.IsShowName)) chartTitle.IsShowName=item.IsShowName;
|
|
5883
|
+
if (IFrameSplitOperator.IsBool(item.IsShowSettingInfo)) chartTitle.IsShowSettingInfo=item.IsShowSettingInfo;
|
|
5884
|
+
if (IFrameSplitOperator.IsBool(item.IsShow)) chartTitle.IsShow=item.IsShow;
|
|
5885
|
+
if (IFrameSplitOperator.IsBool(item.IsShowDateTime)) chartTitle.IsShowDateTime=item.IsShowDateTime;
|
|
5886
|
+
if (IFrameSplitOperator.IsBool(item.IsTitleShowLatestData)) chart.IsTitleShowLatestData=item.IsTitleShowLatestData;
|
|
5880
5887
|
}
|
|
5881
5888
|
|
|
5882
5889
|
if (IFrameSplitOperator.IsNonEmptyArray(option.Overlay)) //叠加股票
|
|
@@ -43622,6 +43629,125 @@ function ChartText()
|
|
|
43622
43629
|
}
|
|
43623
43630
|
}
|
|
43624
43631
|
|
|
43632
|
+
function ChartDrawIconV2()
|
|
43633
|
+
{
|
|
43634
|
+
this.newMethod=IChartPainting; //派生
|
|
43635
|
+
this.newMethod();
|
|
43636
|
+
delete this.newMethod;
|
|
43637
|
+
|
|
43638
|
+
this.ClassName="ChartDrawIconV2";
|
|
43639
|
+
this.bHScreen=false; //是否横屏
|
|
43640
|
+
this.Icon=null;
|
|
43641
|
+
this.TextAlign='left';
|
|
43642
|
+
this.Direction=0; //0=middle 1=bottom 2=top
|
|
43643
|
+
this.ShowOffset={ X:0, Y:0 }; //显示偏移
|
|
43644
|
+
this.Size=null;
|
|
43645
|
+
|
|
43646
|
+
this.Draw=function()
|
|
43647
|
+
{
|
|
43648
|
+
if (!this.IsShow || this.ChartFrame.IsMinSize) return;
|
|
43649
|
+
if (this.IsShowIndexTitleOnly()) return;
|
|
43650
|
+
if (this.IsHideScriptIndex()) return;
|
|
43651
|
+
|
|
43652
|
+
if (!this.Data || !this.Data.Data) return;
|
|
43653
|
+
if (!this.Icon) return;
|
|
43654
|
+
|
|
43655
|
+
this.bHScreen=(this.ChartFrame.IsHScreen===true);
|
|
43656
|
+
var xPointCount=this.ChartFrame.XPointCount;
|
|
43657
|
+
var bMinute=this.IsMinuteFrame();
|
|
43658
|
+
var dataWidth=this.ChartFrame.DataWidth;
|
|
43659
|
+
var distanceWidth=this.ChartFrame.DistanceWidth;
|
|
43660
|
+
var xOffset=this.ChartBorder.GetLeft()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
|
|
43661
|
+
var chartright=this.ChartBorder.GetRight();
|
|
43662
|
+
var top=this.ChartBorder.GetTopEx();
|
|
43663
|
+
var bottom=this.ChartBorder.GetBottomEx();
|
|
43664
|
+
|
|
43665
|
+
if (this.bHScreen)
|
|
43666
|
+
{
|
|
43667
|
+
chartright=this.ChartBorder.GetBottom();
|
|
43668
|
+
top=this.ChartBorder.GetRightEx();
|
|
43669
|
+
bottom=this.ChartBorder.GetLeftEx();
|
|
43670
|
+
xOffset=this.ChartBorder.GetTop()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
|
|
43671
|
+
}
|
|
43672
|
+
|
|
43673
|
+
var pixelTatio = GetDevicePixelRatio();
|
|
43674
|
+
var iconWidth=this.Icon.Width*pixelTatio;
|
|
43675
|
+
var iconHeight=this.Icon.Height*pixelTatio;
|
|
43676
|
+
if (IFrameSplitOperator.IsNumber(this.Size)) iconWidth=iconHeight=this.Size*pixelTatio;
|
|
43677
|
+
|
|
43678
|
+
|
|
43679
|
+
|
|
43680
|
+
this.Canvas.save();
|
|
43681
|
+
this.ClipClient(this.ChartFrame.IsHScreen);
|
|
43682
|
+
|
|
43683
|
+
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth))
|
|
43684
|
+
{
|
|
43685
|
+
var value=this.Data.Data[i];
|
|
43686
|
+
if (value==null) continue;
|
|
43687
|
+
|
|
43688
|
+
if (bMinute)
|
|
43689
|
+
{
|
|
43690
|
+
var x=this.ChartFrame.GetXFromIndex(j);
|
|
43691
|
+
}
|
|
43692
|
+
else
|
|
43693
|
+
{
|
|
43694
|
+
var left=xOffset;
|
|
43695
|
+
var right=xOffset+dataWidth;
|
|
43696
|
+
if (right>chartright) break;
|
|
43697
|
+
var x=left+(right-left)/2;
|
|
43698
|
+
}
|
|
43699
|
+
|
|
43700
|
+
var y=this.ChartFrame.GetYFromData(value,false);
|
|
43701
|
+
|
|
43702
|
+
if (x>chartright) break;
|
|
43703
|
+
|
|
43704
|
+
if (this.TextAlign=="right") x-=iconWidth;
|
|
43705
|
+
else if (this.TextAlign=="center") x-=iconWidth/2;
|
|
43706
|
+
|
|
43707
|
+
if (this.Direction===0) y-=iconHeight/2;
|
|
43708
|
+
else if (this.Direction===1) y-=iconHeight;
|
|
43709
|
+
|
|
43710
|
+
|
|
43711
|
+
y+=this.ShowOffset.Y;
|
|
43712
|
+
x+=this.ShowOffset.X;
|
|
43713
|
+
|
|
43714
|
+
var drawInfo={ X:x, Y:y, Image:this.Icon.Image, Width:iconWidth, Height:iconHeight };
|
|
43715
|
+
|
|
43716
|
+
this.DrawIcon(drawInfo);
|
|
43717
|
+
}
|
|
43718
|
+
|
|
43719
|
+
|
|
43720
|
+
|
|
43721
|
+
this.Canvas.restore();
|
|
43722
|
+
|
|
43723
|
+
}
|
|
43724
|
+
|
|
43725
|
+
this.DrawIcon=function(drawInfo)
|
|
43726
|
+
{
|
|
43727
|
+
if (!drawInfo || !drawInfo.Image) return;
|
|
43728
|
+
|
|
43729
|
+
if (this.bHScreen)
|
|
43730
|
+
{
|
|
43731
|
+
/*
|
|
43732
|
+
var xCenter=drawInfo.X+drawInfo.Width/2;
|
|
43733
|
+
var yCenter=drawInfo.Y+drawInfo.Height/2;
|
|
43734
|
+
this.Canvas.save();
|
|
43735
|
+
this.Canvas.translate(yCenter,xCenter);
|
|
43736
|
+
this.Canvas.rotate(90 * Math.PI / 180);
|
|
43737
|
+
this.Canvas.drawImage(drawInfo.Image, 0, 0, drawInfo.Width, drawInfo.Height);
|
|
43738
|
+
this.Canvas.restore();
|
|
43739
|
+
*/
|
|
43740
|
+
|
|
43741
|
+
this.Canvas.drawImage(drawInfo.Image, drawInfo.Y, drawInfo.X, drawInfo.Width, drawInfo.Height);
|
|
43742
|
+
}
|
|
43743
|
+
else
|
|
43744
|
+
{
|
|
43745
|
+
this.Canvas.drawImage(drawInfo.Image, drawInfo.X, drawInfo.Y, drawInfo.Width, drawInfo.Height);
|
|
43746
|
+
}
|
|
43747
|
+
}
|
|
43748
|
+
}
|
|
43749
|
+
|
|
43750
|
+
|
|
43625
43751
|
/*
|
|
43626
43752
|
文字输出 支持横屏
|
|
43627
43753
|
数组(Data)不为null的数据中输出 this.Text文本
|
|
@@ -107146,6 +107272,26 @@ var MARKET_SUFFIX_NAME=
|
|
|
107146
107272
|
return false;
|
|
107147
107273
|
},
|
|
107148
107274
|
|
|
107275
|
+
IsCFFEXOption:function(upperSymbol) //中金所股票期权
|
|
107276
|
+
{
|
|
107277
|
+
if (!upperSymbol) return false;
|
|
107278
|
+
if (!this.IsCFFEX(upperSymbol)) return false;
|
|
107279
|
+
var shortSymbol=JSChart.GetShortSymbol(upperSymbol);
|
|
107280
|
+
//MO2602-C-6300.cffex
|
|
107281
|
+
var aryValue=shortSymbol.split("-");
|
|
107282
|
+
if (!aryValue || aryValue.length!=3) return false;
|
|
107283
|
+
|
|
107284
|
+
var strValue=aryValue[0];
|
|
107285
|
+
const regex = /([a-zA-Z]+)(\d+)/;
|
|
107286
|
+
const match = strValue.match(regex);
|
|
107287
|
+
if (!match || !match[1] || !match[2]) return false;
|
|
107288
|
+
|
|
107289
|
+
var prefix=match[1];
|
|
107290
|
+
if (["IM","IO","MO","HO"].includes(prefix)) return true;
|
|
107291
|
+
|
|
107292
|
+
return true;
|
|
107293
|
+
},
|
|
107294
|
+
|
|
107149
107295
|
IsDCE: function (upperSymbol)
|
|
107150
107296
|
{
|
|
107151
107297
|
if (!upperSymbol) return false;
|
|
@@ -107752,6 +107898,23 @@ var MARKET_SUFFIX_NAME=
|
|
|
107752
107898
|
if (pos<=0) return symbol;
|
|
107753
107899
|
|
|
107754
107900
|
return symbol.slice(0,pos);
|
|
107901
|
+
},
|
|
107902
|
+
|
|
107903
|
+
SplitSymbol:function(symbol, format) //分析代码 返回对象
|
|
107904
|
+
{
|
|
107905
|
+
if (!format || !symbol) return null;
|
|
107906
|
+
var shortSymbol=this.GetShortSymbol(symbol);
|
|
107907
|
+
if (format=="A+D+")
|
|
107908
|
+
{
|
|
107909
|
+
var regex=/([a-zA-Z]+)(\d+)/;
|
|
107910
|
+
var match=shortSymbol.match(regex);
|
|
107911
|
+
if (!match || !match[1] || !match[2]) return null;
|
|
107912
|
+
|
|
107913
|
+
return { AryString:[match[1], match[2]], ShortSymbol:shortSymbol, Symbol:symbol, Market:symbol.slice(shortSymbol.length) };
|
|
107914
|
+
}
|
|
107915
|
+
|
|
107916
|
+
|
|
107917
|
+
return null;
|
|
107755
107918
|
}
|
|
107756
107919
|
|
|
107757
107920
|
}
|
|
@@ -111652,6 +111815,7 @@ var g_JSComplierResource=
|
|
|
111652
111815
|
Data:new Map() //自定义图标 key=id
|
|
111653
111816
|
//value={ID:, Text:, Color, Family: } //svg
|
|
111654
111817
|
//value={ ID:1, Symbol:'↑', Color:'rgb(238,44,44)' } //文字
|
|
111818
|
+
//value={ ID:, Image:, Width, Height }
|
|
111655
111819
|
},
|
|
111656
111820
|
|
|
111657
111821
|
CustomFunction: //定制函数
|
|
@@ -111699,20 +111863,24 @@ var g_JSComplierResource=
|
|
|
111699
111863
|
GetDrawIcon:function(id)
|
|
111700
111864
|
{
|
|
111701
111865
|
var icon;
|
|
111702
|
-
if (
|
|
111866
|
+
if (this.CustomDrawIcon.Data.has(id))
|
|
111703
111867
|
{
|
|
111704
111868
|
const iconfont=g_JSComplierResource.CustomDrawIcon.Data.get(id);
|
|
111705
|
-
|
|
111869
|
+
|
|
111870
|
+
if (iconfont.Image) //图片
|
|
111871
|
+
icon={ ID:id, Image:iconfont.Image, Width:iconfont.Width, Height:iconfont.Height };
|
|
111872
|
+
else if (iconfont.Symbol) //文字
|
|
111706
111873
|
icon={ Symbol:iconfont.Symbol, Color:iconfont.Color, IconFont:false, ID:id };
|
|
111707
111874
|
else //SVG图标
|
|
111708
111875
|
icon={ Symbol:iconfont.Text, Color:iconfont.Color, Family:iconfont.Family, IconFont:true, ID:id };
|
|
111876
|
+
|
|
111709
111877
|
return icon;
|
|
111710
111878
|
}
|
|
111711
111879
|
|
|
111712
|
-
if (
|
|
111880
|
+
if (this.DrawIcon.Data.has(id))
|
|
111713
111881
|
{
|
|
111714
|
-
const iconfont=
|
|
111715
|
-
icon={ Symbol:iconfont.Text, Color:iconfont.Color, Family:
|
|
111882
|
+
const iconfont=this.DrawIcon.Data.get(id);
|
|
111883
|
+
icon={ Symbol:iconfont.Text, Color:iconfont.Color, Family:this.DrawIcon.Family, IconFont:true, ID:id };
|
|
111716
111884
|
return icon;
|
|
111717
111885
|
}
|
|
111718
111886
|
|
|
@@ -111754,6 +111922,11 @@ var g_JSComplierResource=
|
|
|
111754
111922
|
{
|
|
111755
111923
|
if (g_JSComplierResource.CustomDataFunction.Data.has(name)) return true;
|
|
111756
111924
|
return false;
|
|
111925
|
+
},
|
|
111926
|
+
|
|
111927
|
+
AddDrawIcon:function(id, icon)
|
|
111928
|
+
{
|
|
111929
|
+
this.CustomDrawIcon.Data.set(id, icon);
|
|
111757
111930
|
}
|
|
111758
111931
|
}
|
|
111759
111932
|
|
|
@@ -132213,14 +132386,16 @@ JSComplier.SetDomain = function (domain, cacheDomain) //修改API地址
|
|
|
132213
132386
|
|
|
132214
132387
|
JSComplier.AddIcon=function(obj) //添加一个obj={ID:, Text:, Color, Family: }
|
|
132215
132388
|
{
|
|
132216
|
-
|
|
132389
|
+
|
|
132390
|
+
if (!obj || !obj.ID) return;
|
|
132391
|
+
|
|
132392
|
+
g_JSComplierResource.AddDrawIcon(obj.ID, obj);
|
|
132217
132393
|
}
|
|
132218
132394
|
|
|
132219
132395
|
JSComplier.AddFunction=function(obj) //添加函数 { Name:函数名, Description:描述信息, IsDownload:是否需要下载数据, Invoke:函数执行(可选) }
|
|
132220
132396
|
{
|
|
132221
132397
|
if (!obj || !obj.Name) return;
|
|
132222
132398
|
|
|
132223
|
-
var ID=obj.Name.toUpperCase();
|
|
132224
132399
|
g_JSComplierResource.CustomFunction.Data.set(ID, obj);
|
|
132225
132400
|
}
|
|
132226
132401
|
|
|
@@ -134004,7 +134179,21 @@ function ScriptIndex(name,script,args,option)
|
|
|
134004
134179
|
//创建图标
|
|
134005
134180
|
this.CreateIcon=function(hqChart,windowIndex,varItem,id)
|
|
134006
134181
|
{
|
|
134007
|
-
|
|
134182
|
+
var chartText=null;
|
|
134183
|
+
|
|
134184
|
+
if (varItem.Draw && varItem.Draw.Icon && varItem.Draw.Icon.Image)
|
|
134185
|
+
{
|
|
134186
|
+
chartText=new ChartDrawIconV2();
|
|
134187
|
+
chartText.Icon=varItem.Draw.Icon;
|
|
134188
|
+
if (varItem.DrawFontSize>0) chartText.Size=varItem.DrawFontSize;
|
|
134189
|
+
}
|
|
134190
|
+
else
|
|
134191
|
+
{
|
|
134192
|
+
chartText=new ChartSingleText();
|
|
134193
|
+
if (varItem.DrawFontSize>0) chartText.FixedFontSize=varItem.DrawFontSize;
|
|
134194
|
+
}
|
|
134195
|
+
|
|
134196
|
+
|
|
134008
134197
|
chartText.Canvas=hqChart.Canvas;
|
|
134009
134198
|
chartText.TextAlign='center';
|
|
134010
134199
|
|
|
@@ -134035,6 +134224,10 @@ function ScriptIndex(name,script,args,option)
|
|
|
134035
134224
|
{
|
|
134036
134225
|
chartText.IconFont={ Family:icon.Family, Text:icon.Symbol, Color:icon.Color };
|
|
134037
134226
|
if (varItem.Color) chartText.IconFont.Color=this.GetColor(varItem.Color);
|
|
134227
|
+
}
|
|
134228
|
+
else if (icon.Image)
|
|
134229
|
+
{
|
|
134230
|
+
|
|
134038
134231
|
}
|
|
134039
134232
|
else
|
|
134040
134233
|
{
|
|
@@ -134044,7 +134237,7 @@ function ScriptIndex(name,script,args,option)
|
|
|
134044
134237
|
else chartText.Color='rgb(0,0,0)';
|
|
134045
134238
|
}
|
|
134046
134239
|
|
|
134047
|
-
|
|
134240
|
+
|
|
134048
134241
|
if (IFrameSplitOperator.IsNumber(varItem.XOffset)) chartText.ShowOffset.X=varItem.XOffset;
|
|
134049
134242
|
if (IFrameSplitOperator.IsNumber(varItem.YOffset)) chartText.ShowOffset.Y=varItem.YOffset;
|
|
134050
134243
|
|
|
@@ -136102,7 +136295,19 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
136102
136295
|
{
|
|
136103
136296
|
var overlayIndex=this.OverlayIndex;
|
|
136104
136297
|
var frame=overlayIndex.Frame;
|
|
136105
|
-
|
|
136298
|
+
var chart=null;
|
|
136299
|
+
|
|
136300
|
+
if (varItem.Draw && varItem.Draw.Icon && varItem.Draw.Icon.Image)
|
|
136301
|
+
{
|
|
136302
|
+
chart=new ChartDrawIconV2();
|
|
136303
|
+
chart.Icon=varItem.Draw.Icon;
|
|
136304
|
+
if (varItem.DrawFontSize>0) chart.Size=varItem.DrawFontSize;
|
|
136305
|
+
}
|
|
136306
|
+
else
|
|
136307
|
+
{
|
|
136308
|
+
chart=new ChartSingleText();
|
|
136309
|
+
}
|
|
136310
|
+
|
|
136106
136311
|
chart.Canvas=hqChart.Canvas;
|
|
136107
136312
|
chart.TextAlign='center';
|
|
136108
136313
|
|
|
@@ -136133,6 +136338,10 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
136133
136338
|
if (icon.IconFont==true)
|
|
136134
136339
|
{
|
|
136135
136340
|
chart.IconFont={ Family:icon.Family, Text:icon.Symbol, Color:icon.Color };
|
|
136341
|
+
}
|
|
136342
|
+
else if (icon.Image)
|
|
136343
|
+
{
|
|
136344
|
+
|
|
136136
136345
|
}
|
|
136137
136346
|
else
|
|
136138
136347
|
{
|
|
@@ -153956,6 +154165,7 @@ function JSTReportChartContainer(uielement)
|
|
|
153956
154165
|
{
|
|
153957
154166
|
Name:'JSTReportChartContainer::RequestStockListData', //类名::
|
|
153958
154167
|
Explain:'T型报价列表数据',
|
|
154168
|
+
Request:{ Data: { symbol:this.Symbol } },
|
|
153959
154169
|
Self:this,
|
|
153960
154170
|
PreventDefault:false
|
|
153961
154171
|
};
|
|
@@ -171502,7 +171712,7 @@ function ChartStockData()
|
|
|
171502
171712
|
|
|
171503
171713
|
|
|
171504
171714
|
|
|
171505
|
-
var HQCHART_VERSION="1.1.
|
|
171715
|
+
var HQCHART_VERSION="1.1.15493";
|
|
171506
171716
|
|
|
171507
171717
|
function PrintHQChartVersion()
|
|
171508
171718
|
{
|