hqchart 1.1.15816 → 1.1.15821
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 +13 -11
- package/package.json +1 -1
- package/src/jscommon/umychart/umychart.js +64 -38
- package/src/jscommon/umychart/umychart.min.js +1 -1
- package/src/jscommon/umychart.js +63 -37
- package/src/jscommon/umychart.order.js +39 -2
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +64 -38
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +64 -38
package/src/jscommon/umychart.js
CHANGED
|
@@ -31878,7 +31878,7 @@ function ChartKLine()
|
|
|
31878
31878
|
var iconTop=item.YMax+1*pixelTatio;
|
|
31879
31879
|
var iconBottom=item.YMin+1*pixelTatio+iconSize;
|
|
31880
31880
|
var drawTop=true;
|
|
31881
|
-
var yOffset=0;
|
|
31881
|
+
var yOffset=0, yTopOffset=0;
|
|
31882
31882
|
for(var i in infoData.Data)
|
|
31883
31883
|
{
|
|
31884
31884
|
var infoItem=infoData.Data[i];
|
|
@@ -31914,35 +31914,41 @@ function ChartKLine()
|
|
|
31914
31914
|
if (infoPosition===1) //底部
|
|
31915
31915
|
{
|
|
31916
31916
|
var yBottom=bottom+yOffset;
|
|
31917
|
-
this.Canvas.fillText(icon.Text,item.XCenter,yBottom,iconSize);
|
|
31918
31917
|
var iconRect=new Rect(item.XCenter-iconSize/2,yBottom-iconSize,iconSize,iconSize);
|
|
31918
|
+
this.DrawInfoIcon(item, icon, iconRect);
|
|
31919
|
+
|
|
31919
31920
|
var infoCache={ Data:new Array(infoItem), Rect:iconRect, Type:infoItem.InfoType, TextRect:{X:item.XCenter, Y:yBottom}, IsShowNumber:bShowNumber };
|
|
31920
31921
|
mapImage.set(infoItem.InfoType,infoCache);
|
|
31921
31922
|
yOffset-=iconSize;
|
|
31922
31923
|
}
|
|
31923
31924
|
else if (infoPosition===2) //顶部
|
|
31924
31925
|
{
|
|
31925
|
-
var yBottom=topTitle+iconSize+1;
|
|
31926
|
-
this.Canvas.fillText(icon.Text,item.XCenter,yBottom,iconSize);
|
|
31926
|
+
var yBottom=topTitle+iconSize+1+yTopOffset;
|
|
31927
31927
|
var iconRect=new Rect(item.XCenter-iconSize/2,yBottom-iconSize,iconSize,iconSize);
|
|
31928
|
+
this.DrawInfoIcon(item, icon, iconRect);
|
|
31929
|
+
|
|
31928
31930
|
var infoCache={ Data:new Array(infoItem), Rect:iconRect, Type:infoItem.InfoType, TextRect:{X:item.XCenter, Y:yBottom}, IsShowNumber:bShowNumber };
|
|
31929
31931
|
mapImage.set(infoItem.InfoType,infoCache);
|
|
31932
|
+
|
|
31933
|
+
yTopOffset+=iconSize;
|
|
31930
31934
|
}
|
|
31931
31935
|
else
|
|
31932
31936
|
{
|
|
31933
|
-
if (drawTop)
|
|
31937
|
+
if (drawTop) //K线上面
|
|
31934
31938
|
{
|
|
31935
|
-
this.Canvas.fillText(icon.Text,item.XCenter,iconTop,iconSize);
|
|
31936
31939
|
var iconRect=new Rect(item.XCenter-iconSize/2,iconTop-iconSize,iconSize,iconSize);
|
|
31940
|
+
this.DrawInfoIcon(item, icon, iconRect);
|
|
31941
|
+
|
|
31937
31942
|
var infoCache={ Data:new Array(infoItem), Rect:iconRect, Type:infoItem.InfoType, TextRect:{X:item.XCenter, Y:iconTop}, IsShowNumber:bShowNumber };
|
|
31938
31943
|
mapImage.set(infoItem.InfoType,infoCache);
|
|
31939
31944
|
iconTop-=iconSize;
|
|
31940
31945
|
if (iconTop-iconSize<top ) drawTop=false;
|
|
31941
31946
|
}
|
|
31942
|
-
else
|
|
31947
|
+
else //上面显示不下,就显示在K线下面
|
|
31943
31948
|
{
|
|
31944
|
-
this.Canvas.fillText(icon.Text,item.XCenter,iconBottom,iconSize);
|
|
31945
31949
|
var iconRect=new Rect(item.XCenter-iconSize/2,iconBottom-iconSize,iconSize,iconSize);
|
|
31950
|
+
this.DrawInfoIcon(item, icon, iconRect);
|
|
31951
|
+
|
|
31946
31952
|
var infoCache={ Data:new Array(infoItem), Rect:iconRect, Type:infoItem.InfoType, TextRect:{X:item.XCenter, Y:iconBottom} , IsShowNumber:bShowNumber};
|
|
31947
31953
|
mapImage.set(infoItem.InfoType,infoCache);
|
|
31948
31954
|
iconBottom+=iconSize;
|
|
@@ -31982,6 +31988,18 @@ function ChartKLine()
|
|
|
31982
31988
|
this.ClipClient(isHScreen);
|
|
31983
31989
|
}
|
|
31984
31990
|
|
|
31991
|
+
this.DrawInfoIcon=function(item, iconItem, rtIcon)
|
|
31992
|
+
{
|
|
31993
|
+
if (iconItem.BGColor)
|
|
31994
|
+
{
|
|
31995
|
+
this.Canvas.fillStyle=iconItem.BGColor;
|
|
31996
|
+
this.Canvas.fillRect(rtIcon.X, rtIcon.Y, rtIcon.Width, rtIcon.Height);
|
|
31997
|
+
}
|
|
31998
|
+
|
|
31999
|
+
this.Canvas.fillStyle=iconItem.Color;
|
|
32000
|
+
this.Canvas.fillText(iconItem.Text,item.XCenter,rtIcon.Y+rtIcon.Height, rtIcon.Width);
|
|
32001
|
+
}
|
|
32002
|
+
|
|
31985
32003
|
//画交易图标
|
|
31986
32004
|
this.DrawTradeIcon=function()
|
|
31987
32005
|
{
|
|
@@ -90834,25 +90852,44 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
90834
90852
|
if (bUpdate==true) this.ReqeustKLineInfoData({ FunctionName:"SetKLineInfo" });
|
|
90835
90853
|
}
|
|
90836
90854
|
|
|
90837
|
-
|
|
90838
|
-
|
|
90855
|
+
|
|
90856
|
+
//option={ ClassName:, Name: }
|
|
90857
|
+
this.GetKLineInfo=function(option)
|
|
90839
90858
|
{
|
|
90840
|
-
|
|
90841
|
-
if (!
|
|
90859
|
+
if (!option) return null;
|
|
90860
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.ChartInfo)) return null;
|
|
90861
|
+
|
|
90862
|
+
var className=null;
|
|
90863
|
+
if (option.Name)
|
|
90842
90864
|
{
|
|
90843
|
-
|
|
90844
|
-
|
|
90865
|
+
var classInfo=JSKLineInfoMap.GetClassInfo(option.Name);
|
|
90866
|
+
if (classInfo) className=classInfo.ClassName;
|
|
90845
90867
|
}
|
|
90846
90868
|
|
|
90847
|
-
|
|
90869
|
+
if (!className) return null;
|
|
90870
|
+
|
|
90871
|
+
for(var i=0; i<this.ChartInfo.length; ++i)
|
|
90848
90872
|
{
|
|
90849
90873
|
var item=this.ChartInfo[i];
|
|
90850
|
-
if (item.ClassName==
|
|
90851
|
-
return;
|
|
90874
|
+
if (item.ClassName==className) //已经存在
|
|
90875
|
+
return item;
|
|
90852
90876
|
}
|
|
90853
90877
|
|
|
90878
|
+
return null;
|
|
90879
|
+
}
|
|
90880
|
+
|
|
90881
|
+
//添加信息地雷
|
|
90882
|
+
this.AddKLineInfo=function(infoName,bUpdate)
|
|
90883
|
+
{
|
|
90884
|
+
var item=this.GetKLineInfo({ Name:infoName });
|
|
90885
|
+
if (item) return;
|
|
90886
|
+
|
|
90854
90887
|
var infoItem=JSKLineInfoMap.Get(infoName);
|
|
90855
|
-
if (!infoItem)
|
|
90888
|
+
if (!infoItem)
|
|
90889
|
+
{
|
|
90890
|
+
console.warn(`[KLineChartContainer::AddKLineInfo] can't find infoName=${infoName}`);
|
|
90891
|
+
return;
|
|
90892
|
+
}
|
|
90856
90893
|
|
|
90857
90894
|
var item=infoItem.Create();
|
|
90858
90895
|
item.MaxRequestDataCount=this.MaxRequestDataCount;
|
|
@@ -90864,39 +90901,28 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
90864
90901
|
}
|
|
90865
90902
|
}
|
|
90866
90903
|
|
|
90867
|
-
|
|
90904
|
+
//更新信息地雷列表 Option :{ InsertNew:, 如果没有找到对应的地雷,是否插入新的地雷, Update:是否立即请求数据 }
|
|
90868
90905
|
this.UpdateKLineInfo=function(infoName, option)
|
|
90869
90906
|
{
|
|
90870
|
-
var classInfo=JSKLineInfoMap.GetClassInfo(infoName);
|
|
90871
|
-
if (!classInfo)
|
|
90872
|
-
{
|
|
90873
|
-
console.warn("[KLineChartContainer::UpdateKLineInfo] can't find infoname=", infoName);
|
|
90874
|
-
return;
|
|
90875
|
-
}
|
|
90876
|
-
|
|
90877
90907
|
var bInsertNew=false, bUpdate=false;
|
|
90878
90908
|
if (option)
|
|
90879
90909
|
{
|
|
90880
90910
|
if (IFrameSplitOperator.IsBoolean(option.InsertNew)) bInsertNew=option.InsertNew;
|
|
90881
90911
|
if (IFrameSplitOperator.IsBoolean(option.Update)) bUpdate=option.Update;
|
|
90882
90912
|
}
|
|
90883
|
-
var finder=null;
|
|
90884
|
-
for(var i=0;i<this.ChartInfo.length; ++i)
|
|
90885
|
-
{
|
|
90886
|
-
var item=this.ChartInfo[i];
|
|
90887
|
-
if (item.ClassName==classInfo.ClassName)
|
|
90888
|
-
{
|
|
90889
|
-
finder=item;
|
|
90890
|
-
break;
|
|
90891
|
-
}
|
|
90892
|
-
}
|
|
90893
90913
|
|
|
90914
|
+
var finder=this.GetKLineInfo({ Name:infoName });
|
|
90915
|
+
|
|
90894
90916
|
if (!finder)
|
|
90895
90917
|
{
|
|
90896
90918
|
if (bInsertNew===true)
|
|
90897
90919
|
{
|
|
90898
90920
|
var infoItem=JSKLineInfoMap.Get(infoName);
|
|
90899
|
-
if (!infoItem)
|
|
90921
|
+
if (!infoItem)
|
|
90922
|
+
{
|
|
90923
|
+
console.warn(`[KLineChartContainer::UpdateKLineInfo] can't find infoname=${infoName}`);
|
|
90924
|
+
return;
|
|
90925
|
+
}
|
|
90900
90926
|
|
|
90901
90927
|
var item=infoItem.Create();
|
|
90902
90928
|
item.MaxRequestDataCount=this.MaxRequestDataCount;
|
|
@@ -355,6 +355,7 @@ class JSOrderChartContainer
|
|
|
355
355
|
if (option)
|
|
356
356
|
{
|
|
357
357
|
if (IFrameSplitOperator.IsNumber(option.BorderLine)) this.Frame.BorderLine=option.BorderLine; //边框
|
|
358
|
+
if (IFrameSplitOperator.IsBool(option.IsShowHeader)) chart.IsShowHeader=option.IsShowHeader;
|
|
358
359
|
}
|
|
359
360
|
|
|
360
361
|
var bRegisterKeydown=true;
|
|
@@ -1316,7 +1317,8 @@ class ChartOrderList
|
|
|
1316
1317
|
Data=null; //数据 { Data:[ { Price:, Color:, BGColor:, Data:{ } } ], Offset: }
|
|
1317
1318
|
Symbol=null;
|
|
1318
1319
|
Decimal=2; //小数位数
|
|
1319
|
-
IsShowHeader=true;
|
|
1320
|
+
IsShowHeader=true; //是否显示表头
|
|
1321
|
+
IsShowFooter=true; //是否显示页脚
|
|
1320
1322
|
SelectedData={ Data:null, Enable:true }; //{ Data:{ ColIndex:null, Price:null, Type:null }, Enable:是否启动 }
|
|
1321
1323
|
MoveOnData={ Data:null, Enable:true }; //鼠标在上面
|
|
1322
1324
|
|
|
@@ -1352,14 +1354,22 @@ class ChartOrderList
|
|
|
1352
1354
|
Top:g_JSChartResource.OrderList.Item.Margin.Top,
|
|
1353
1355
|
Bottom:g_JSChartResource.OrderList.Item.Margin.Bottom,
|
|
1354
1356
|
};
|
|
1357
|
+
|
|
1358
|
+
FooterConfig=
|
|
1359
|
+
{
|
|
1360
|
+
Font:{ Size:g_JSChartResource.OrderList.Header.Font.Size, Name:g_JSChartResource.OrderList.Header.Font.Name },
|
|
1361
|
+
Margin:CloneData(g_JSChartResource.OrderList.Header.Margin )
|
|
1362
|
+
}
|
|
1355
1363
|
|
|
1356
1364
|
//缓存
|
|
1357
1365
|
HeaderFont=12*GetDevicePixelRatio() +"px 微软雅黑";
|
|
1358
1366
|
ItemFont=15*GetDevicePixelRatio() +"px 微软雅黑";
|
|
1367
|
+
FooterFont=12*GetDevicePixelRatio() +"px 微软雅黑";
|
|
1359
1368
|
|
|
1360
1369
|
RowHeight=20;
|
|
1361
1370
|
RowCount=0;
|
|
1362
1371
|
HeaderHeight=0;
|
|
1372
|
+
FooterHeight=0;
|
|
1363
1373
|
|
|
1364
1374
|
//自定义颜色
|
|
1365
1375
|
AryColor=g_JSChartResource.OrderList.AryColor.slice();
|
|
@@ -1389,6 +1399,14 @@ class ChartOrderList
|
|
|
1389
1399
|
TooltipRect=[];
|
|
1390
1400
|
MapDrawPrice=new Map(); //当前绘制的价格列表
|
|
1391
1401
|
|
|
1402
|
+
|
|
1403
|
+
SetOption(option)
|
|
1404
|
+
{
|
|
1405
|
+
if (!option) return;
|
|
1406
|
+
if (IFrameSplitOperator.IsBool(option.IsShowHeader)) this.IsShowHeader=option.IsShowHeader;
|
|
1407
|
+
if (IFrameSplitOperator.IsBool(option.IsShowFooter)) this.IsShowFooter=option.IsShowFooter;
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1392
1410
|
ReloadResource(resource)
|
|
1393
1411
|
{
|
|
1394
1412
|
this.UpColor=g_JSChartResource.OrderList.UpTextColor;
|
|
@@ -1557,6 +1575,7 @@ class ChartOrderList
|
|
|
1557
1575
|
this.DrawBodyBG();
|
|
1558
1576
|
this.DrawBorder();
|
|
1559
1577
|
this.DrawBody();
|
|
1578
|
+
this.DrawFooter();
|
|
1560
1579
|
this.Canvas.restore();
|
|
1561
1580
|
|
|
1562
1581
|
this.SizeChange=false;
|
|
@@ -1647,8 +1666,15 @@ class ChartOrderList
|
|
|
1647
1666
|
this.HeaderHeight=this.GetFontHeight(this.HeaderFont,"擎")+ this.HeaderMargin.Top+ this.HeaderMargin.Bottom;
|
|
1648
1667
|
if (!this.IsShowHeader) this.HeaderHeight=0;
|
|
1649
1668
|
|
|
1669
|
+
this.FooterHeight=0;
|
|
1670
|
+
if (this.IsShowFooter)
|
|
1671
|
+
{
|
|
1672
|
+
var config=this.FooterConfig;
|
|
1673
|
+
this.FooterHeight=this.GetFontHeight(this.FooterFont,"擎")+config.Margin.Top+config.Margin.Bottom;
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1650
1676
|
this.RowHeight=this.GetFontHeight(this.ItemFont,"擎")+ this.ItemMargin.Top+ this.ItemMargin.Bottom;
|
|
1651
|
-
this.RowCount=parseInt((this.RectClient.Bottom-this.RectClient.Top-this.HeaderHeight)/this.RowHeight);
|
|
1677
|
+
this.RowCount=parseInt((this.RectClient.Bottom-this.RectClient.Top-this.HeaderHeight-this.FooterHeight)/this.RowHeight);
|
|
1652
1678
|
}
|
|
1653
1679
|
|
|
1654
1680
|
DrawHeader()
|
|
@@ -1755,6 +1781,11 @@ class ChartOrderList
|
|
|
1755
1781
|
yCellTop=top+this.HeaderHeight;
|
|
1756
1782
|
}
|
|
1757
1783
|
|
|
1784
|
+
if (this.IsShowFooter)
|
|
1785
|
+
{
|
|
1786
|
+
bottom-=this.FooterHeight;
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1758
1789
|
//左右边框
|
|
1759
1790
|
this.Canvas.moveTo(left, top);
|
|
1760
1791
|
this.Canvas.lineTo(right, top);
|
|
@@ -2118,6 +2149,12 @@ class ChartOrderList
|
|
|
2118
2149
|
}
|
|
2119
2150
|
}
|
|
2120
2151
|
|
|
2152
|
+
|
|
2153
|
+
DrawFooter()
|
|
2154
|
+
{
|
|
2155
|
+
|
|
2156
|
+
}
|
|
2157
|
+
|
|
2121
2158
|
|
|
2122
2159
|
GetFontHeight(font,word)
|
|
2123
2160
|
{
|
|
@@ -35991,7 +35991,7 @@ function ChartKLine()
|
|
|
35991
35991
|
var iconTop=item.YMax+1*pixelTatio;
|
|
35992
35992
|
var iconBottom=item.YMin+1*pixelTatio+iconSize;
|
|
35993
35993
|
var drawTop=true;
|
|
35994
|
-
var yOffset=0;
|
|
35994
|
+
var yOffset=0, yTopOffset=0;
|
|
35995
35995
|
for(var i in infoData.Data)
|
|
35996
35996
|
{
|
|
35997
35997
|
var infoItem=infoData.Data[i];
|
|
@@ -36027,35 +36027,41 @@ function ChartKLine()
|
|
|
36027
36027
|
if (infoPosition===1) //底部
|
|
36028
36028
|
{
|
|
36029
36029
|
var yBottom=bottom+yOffset;
|
|
36030
|
-
this.Canvas.fillText(icon.Text,item.XCenter,yBottom,iconSize);
|
|
36031
36030
|
var iconRect=new Rect(item.XCenter-iconSize/2,yBottom-iconSize,iconSize,iconSize);
|
|
36031
|
+
this.DrawInfoIcon(item, icon, iconRect);
|
|
36032
|
+
|
|
36032
36033
|
var infoCache={ Data:new Array(infoItem), Rect:iconRect, Type:infoItem.InfoType, TextRect:{X:item.XCenter, Y:yBottom}, IsShowNumber:bShowNumber };
|
|
36033
36034
|
mapImage.set(infoItem.InfoType,infoCache);
|
|
36034
36035
|
yOffset-=iconSize;
|
|
36035
36036
|
}
|
|
36036
36037
|
else if (infoPosition===2) //顶部
|
|
36037
36038
|
{
|
|
36038
|
-
var yBottom=topTitle+iconSize+1;
|
|
36039
|
-
this.Canvas.fillText(icon.Text,item.XCenter,yBottom,iconSize);
|
|
36039
|
+
var yBottom=topTitle+iconSize+1+yTopOffset;
|
|
36040
36040
|
var iconRect=new Rect(item.XCenter-iconSize/2,yBottom-iconSize,iconSize,iconSize);
|
|
36041
|
+
this.DrawInfoIcon(item, icon, iconRect);
|
|
36042
|
+
|
|
36041
36043
|
var infoCache={ Data:new Array(infoItem), Rect:iconRect, Type:infoItem.InfoType, TextRect:{X:item.XCenter, Y:yBottom}, IsShowNumber:bShowNumber };
|
|
36042
36044
|
mapImage.set(infoItem.InfoType,infoCache);
|
|
36045
|
+
|
|
36046
|
+
yTopOffset+=iconSize;
|
|
36043
36047
|
}
|
|
36044
36048
|
else
|
|
36045
36049
|
{
|
|
36046
|
-
if (drawTop)
|
|
36050
|
+
if (drawTop) //K线上面
|
|
36047
36051
|
{
|
|
36048
|
-
this.Canvas.fillText(icon.Text,item.XCenter,iconTop,iconSize);
|
|
36049
36052
|
var iconRect=new Rect(item.XCenter-iconSize/2,iconTop-iconSize,iconSize,iconSize);
|
|
36053
|
+
this.DrawInfoIcon(item, icon, iconRect);
|
|
36054
|
+
|
|
36050
36055
|
var infoCache={ Data:new Array(infoItem), Rect:iconRect, Type:infoItem.InfoType, TextRect:{X:item.XCenter, Y:iconTop}, IsShowNumber:bShowNumber };
|
|
36051
36056
|
mapImage.set(infoItem.InfoType,infoCache);
|
|
36052
36057
|
iconTop-=iconSize;
|
|
36053
36058
|
if (iconTop-iconSize<top ) drawTop=false;
|
|
36054
36059
|
}
|
|
36055
|
-
else
|
|
36060
|
+
else //上面显示不下,就显示在K线下面
|
|
36056
36061
|
{
|
|
36057
|
-
this.Canvas.fillText(icon.Text,item.XCenter,iconBottom,iconSize);
|
|
36058
36062
|
var iconRect=new Rect(item.XCenter-iconSize/2,iconBottom-iconSize,iconSize,iconSize);
|
|
36063
|
+
this.DrawInfoIcon(item, icon, iconRect);
|
|
36064
|
+
|
|
36059
36065
|
var infoCache={ Data:new Array(infoItem), Rect:iconRect, Type:infoItem.InfoType, TextRect:{X:item.XCenter, Y:iconBottom} , IsShowNumber:bShowNumber};
|
|
36060
36066
|
mapImage.set(infoItem.InfoType,infoCache);
|
|
36061
36067
|
iconBottom+=iconSize;
|
|
@@ -36095,6 +36101,18 @@ function ChartKLine()
|
|
|
36095
36101
|
this.ClipClient(isHScreen);
|
|
36096
36102
|
}
|
|
36097
36103
|
|
|
36104
|
+
this.DrawInfoIcon=function(item, iconItem, rtIcon)
|
|
36105
|
+
{
|
|
36106
|
+
if (iconItem.BGColor)
|
|
36107
|
+
{
|
|
36108
|
+
this.Canvas.fillStyle=iconItem.BGColor;
|
|
36109
|
+
this.Canvas.fillRect(rtIcon.X, rtIcon.Y, rtIcon.Width, rtIcon.Height);
|
|
36110
|
+
}
|
|
36111
|
+
|
|
36112
|
+
this.Canvas.fillStyle=iconItem.Color;
|
|
36113
|
+
this.Canvas.fillText(iconItem.Text,item.XCenter,rtIcon.Y+rtIcon.Height, rtIcon.Width);
|
|
36114
|
+
}
|
|
36115
|
+
|
|
36098
36116
|
//画交易图标
|
|
36099
36117
|
this.DrawTradeIcon=function()
|
|
36100
36118
|
{
|
|
@@ -94947,25 +94965,44 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
94947
94965
|
if (bUpdate==true) this.ReqeustKLineInfoData({ FunctionName:"SetKLineInfo" });
|
|
94948
94966
|
}
|
|
94949
94967
|
|
|
94950
|
-
|
|
94951
|
-
|
|
94968
|
+
|
|
94969
|
+
//option={ ClassName:, Name: }
|
|
94970
|
+
this.GetKLineInfo=function(option)
|
|
94952
94971
|
{
|
|
94953
|
-
|
|
94954
|
-
if (!
|
|
94972
|
+
if (!option) return null;
|
|
94973
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.ChartInfo)) return null;
|
|
94974
|
+
|
|
94975
|
+
var className=null;
|
|
94976
|
+
if (option.Name)
|
|
94955
94977
|
{
|
|
94956
|
-
|
|
94957
|
-
|
|
94978
|
+
var classInfo=JSKLineInfoMap.GetClassInfo(option.Name);
|
|
94979
|
+
if (classInfo) className=classInfo.ClassName;
|
|
94958
94980
|
}
|
|
94959
94981
|
|
|
94960
|
-
|
|
94982
|
+
if (!className) return null;
|
|
94983
|
+
|
|
94984
|
+
for(var i=0; i<this.ChartInfo.length; ++i)
|
|
94961
94985
|
{
|
|
94962
94986
|
var item=this.ChartInfo[i];
|
|
94963
|
-
if (item.ClassName==
|
|
94964
|
-
return;
|
|
94987
|
+
if (item.ClassName==className) //已经存在
|
|
94988
|
+
return item;
|
|
94965
94989
|
}
|
|
94966
94990
|
|
|
94991
|
+
return null;
|
|
94992
|
+
}
|
|
94993
|
+
|
|
94994
|
+
//添加信息地雷
|
|
94995
|
+
this.AddKLineInfo=function(infoName,bUpdate)
|
|
94996
|
+
{
|
|
94997
|
+
var item=this.GetKLineInfo({ Name:infoName });
|
|
94998
|
+
if (item) return;
|
|
94999
|
+
|
|
94967
95000
|
var infoItem=JSKLineInfoMap.Get(infoName);
|
|
94968
|
-
if (!infoItem)
|
|
95001
|
+
if (!infoItem)
|
|
95002
|
+
{
|
|
95003
|
+
console.warn(`[KLineChartContainer::AddKLineInfo] can't find infoName=${infoName}`);
|
|
95004
|
+
return;
|
|
95005
|
+
}
|
|
94969
95006
|
|
|
94970
95007
|
var item=infoItem.Create();
|
|
94971
95008
|
item.MaxRequestDataCount=this.MaxRequestDataCount;
|
|
@@ -94977,39 +95014,28 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
94977
95014
|
}
|
|
94978
95015
|
}
|
|
94979
95016
|
|
|
94980
|
-
|
|
95017
|
+
//更新信息地雷列表 Option :{ InsertNew:, 如果没有找到对应的地雷,是否插入新的地雷, Update:是否立即请求数据 }
|
|
94981
95018
|
this.UpdateKLineInfo=function(infoName, option)
|
|
94982
95019
|
{
|
|
94983
|
-
var classInfo=JSKLineInfoMap.GetClassInfo(infoName);
|
|
94984
|
-
if (!classInfo)
|
|
94985
|
-
{
|
|
94986
|
-
console.warn("[KLineChartContainer::UpdateKLineInfo] can't find infoname=", infoName);
|
|
94987
|
-
return;
|
|
94988
|
-
}
|
|
94989
|
-
|
|
94990
95020
|
var bInsertNew=false, bUpdate=false;
|
|
94991
95021
|
if (option)
|
|
94992
95022
|
{
|
|
94993
95023
|
if (IFrameSplitOperator.IsBoolean(option.InsertNew)) bInsertNew=option.InsertNew;
|
|
94994
95024
|
if (IFrameSplitOperator.IsBoolean(option.Update)) bUpdate=option.Update;
|
|
94995
95025
|
}
|
|
94996
|
-
var finder=null;
|
|
94997
|
-
for(var i=0;i<this.ChartInfo.length; ++i)
|
|
94998
|
-
{
|
|
94999
|
-
var item=this.ChartInfo[i];
|
|
95000
|
-
if (item.ClassName==classInfo.ClassName)
|
|
95001
|
-
{
|
|
95002
|
-
finder=item;
|
|
95003
|
-
break;
|
|
95004
|
-
}
|
|
95005
|
-
}
|
|
95006
95026
|
|
|
95027
|
+
var finder=this.GetKLineInfo({ Name:infoName });
|
|
95028
|
+
|
|
95007
95029
|
if (!finder)
|
|
95008
95030
|
{
|
|
95009
95031
|
if (bInsertNew===true)
|
|
95010
95032
|
{
|
|
95011
95033
|
var infoItem=JSKLineInfoMap.Get(infoName);
|
|
95012
|
-
if (!infoItem)
|
|
95034
|
+
if (!infoItem)
|
|
95035
|
+
{
|
|
95036
|
+
console.warn(`[KLineChartContainer::UpdateKLineInfo] can't find infoname=${infoName}`);
|
|
95037
|
+
return;
|
|
95038
|
+
}
|
|
95013
95039
|
|
|
95014
95040
|
var item=infoItem.Create();
|
|
95015
95041
|
item.MaxRequestDataCount=this.MaxRequestDataCount;
|
|
@@ -160855,7 +160881,7 @@ function ScrollBarBGChart()
|
|
|
160855
160881
|
|
|
160856
160882
|
|
|
160857
160883
|
|
|
160858
|
-
var HQCHART_VERSION="1.1.
|
|
160884
|
+
var HQCHART_VERSION="1.1.15820";
|
|
160859
160885
|
|
|
160860
160886
|
function PrintHQChartVersion()
|
|
160861
160887
|
{
|
|
@@ -36035,7 +36035,7 @@ function ChartKLine()
|
|
|
36035
36035
|
var iconTop=item.YMax+1*pixelTatio;
|
|
36036
36036
|
var iconBottom=item.YMin+1*pixelTatio+iconSize;
|
|
36037
36037
|
var drawTop=true;
|
|
36038
|
-
var yOffset=0;
|
|
36038
|
+
var yOffset=0, yTopOffset=0;
|
|
36039
36039
|
for(var i in infoData.Data)
|
|
36040
36040
|
{
|
|
36041
36041
|
var infoItem=infoData.Data[i];
|
|
@@ -36071,35 +36071,41 @@ function ChartKLine()
|
|
|
36071
36071
|
if (infoPosition===1) //底部
|
|
36072
36072
|
{
|
|
36073
36073
|
var yBottom=bottom+yOffset;
|
|
36074
|
-
this.Canvas.fillText(icon.Text,item.XCenter,yBottom,iconSize);
|
|
36075
36074
|
var iconRect=new Rect(item.XCenter-iconSize/2,yBottom-iconSize,iconSize,iconSize);
|
|
36075
|
+
this.DrawInfoIcon(item, icon, iconRect);
|
|
36076
|
+
|
|
36076
36077
|
var infoCache={ Data:new Array(infoItem), Rect:iconRect, Type:infoItem.InfoType, TextRect:{X:item.XCenter, Y:yBottom}, IsShowNumber:bShowNumber };
|
|
36077
36078
|
mapImage.set(infoItem.InfoType,infoCache);
|
|
36078
36079
|
yOffset-=iconSize;
|
|
36079
36080
|
}
|
|
36080
36081
|
else if (infoPosition===2) //顶部
|
|
36081
36082
|
{
|
|
36082
|
-
var yBottom=topTitle+iconSize+1;
|
|
36083
|
-
this.Canvas.fillText(icon.Text,item.XCenter,yBottom,iconSize);
|
|
36083
|
+
var yBottom=topTitle+iconSize+1+yTopOffset;
|
|
36084
36084
|
var iconRect=new Rect(item.XCenter-iconSize/2,yBottom-iconSize,iconSize,iconSize);
|
|
36085
|
+
this.DrawInfoIcon(item, icon, iconRect);
|
|
36086
|
+
|
|
36085
36087
|
var infoCache={ Data:new Array(infoItem), Rect:iconRect, Type:infoItem.InfoType, TextRect:{X:item.XCenter, Y:yBottom}, IsShowNumber:bShowNumber };
|
|
36086
36088
|
mapImage.set(infoItem.InfoType,infoCache);
|
|
36089
|
+
|
|
36090
|
+
yTopOffset+=iconSize;
|
|
36087
36091
|
}
|
|
36088
36092
|
else
|
|
36089
36093
|
{
|
|
36090
|
-
if (drawTop)
|
|
36094
|
+
if (drawTop) //K线上面
|
|
36091
36095
|
{
|
|
36092
|
-
this.Canvas.fillText(icon.Text,item.XCenter,iconTop,iconSize);
|
|
36093
36096
|
var iconRect=new Rect(item.XCenter-iconSize/2,iconTop-iconSize,iconSize,iconSize);
|
|
36097
|
+
this.DrawInfoIcon(item, icon, iconRect);
|
|
36098
|
+
|
|
36094
36099
|
var infoCache={ Data:new Array(infoItem), Rect:iconRect, Type:infoItem.InfoType, TextRect:{X:item.XCenter, Y:iconTop}, IsShowNumber:bShowNumber };
|
|
36095
36100
|
mapImage.set(infoItem.InfoType,infoCache);
|
|
36096
36101
|
iconTop-=iconSize;
|
|
36097
36102
|
if (iconTop-iconSize<top ) drawTop=false;
|
|
36098
36103
|
}
|
|
36099
|
-
else
|
|
36104
|
+
else //上面显示不下,就显示在K线下面
|
|
36100
36105
|
{
|
|
36101
|
-
this.Canvas.fillText(icon.Text,item.XCenter,iconBottom,iconSize);
|
|
36102
36106
|
var iconRect=new Rect(item.XCenter-iconSize/2,iconBottom-iconSize,iconSize,iconSize);
|
|
36107
|
+
this.DrawInfoIcon(item, icon, iconRect);
|
|
36108
|
+
|
|
36103
36109
|
var infoCache={ Data:new Array(infoItem), Rect:iconRect, Type:infoItem.InfoType, TextRect:{X:item.XCenter, Y:iconBottom} , IsShowNumber:bShowNumber};
|
|
36104
36110
|
mapImage.set(infoItem.InfoType,infoCache);
|
|
36105
36111
|
iconBottom+=iconSize;
|
|
@@ -36139,6 +36145,18 @@ function ChartKLine()
|
|
|
36139
36145
|
this.ClipClient(isHScreen);
|
|
36140
36146
|
}
|
|
36141
36147
|
|
|
36148
|
+
this.DrawInfoIcon=function(item, iconItem, rtIcon)
|
|
36149
|
+
{
|
|
36150
|
+
if (iconItem.BGColor)
|
|
36151
|
+
{
|
|
36152
|
+
this.Canvas.fillStyle=iconItem.BGColor;
|
|
36153
|
+
this.Canvas.fillRect(rtIcon.X, rtIcon.Y, rtIcon.Width, rtIcon.Height);
|
|
36154
|
+
}
|
|
36155
|
+
|
|
36156
|
+
this.Canvas.fillStyle=iconItem.Color;
|
|
36157
|
+
this.Canvas.fillText(iconItem.Text,item.XCenter,rtIcon.Y+rtIcon.Height, rtIcon.Width);
|
|
36158
|
+
}
|
|
36159
|
+
|
|
36142
36160
|
//画交易图标
|
|
36143
36161
|
this.DrawTradeIcon=function()
|
|
36144
36162
|
{
|
|
@@ -94991,25 +95009,44 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
94991
95009
|
if (bUpdate==true) this.ReqeustKLineInfoData({ FunctionName:"SetKLineInfo" });
|
|
94992
95010
|
}
|
|
94993
95011
|
|
|
94994
|
-
|
|
94995
|
-
|
|
95012
|
+
|
|
95013
|
+
//option={ ClassName:, Name: }
|
|
95014
|
+
this.GetKLineInfo=function(option)
|
|
94996
95015
|
{
|
|
94997
|
-
|
|
94998
|
-
if (!
|
|
95016
|
+
if (!option) return null;
|
|
95017
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.ChartInfo)) return null;
|
|
95018
|
+
|
|
95019
|
+
var className=null;
|
|
95020
|
+
if (option.Name)
|
|
94999
95021
|
{
|
|
95000
|
-
|
|
95001
|
-
|
|
95022
|
+
var classInfo=JSKLineInfoMap.GetClassInfo(option.Name);
|
|
95023
|
+
if (classInfo) className=classInfo.ClassName;
|
|
95002
95024
|
}
|
|
95003
95025
|
|
|
95004
|
-
|
|
95026
|
+
if (!className) return null;
|
|
95027
|
+
|
|
95028
|
+
for(var i=0; i<this.ChartInfo.length; ++i)
|
|
95005
95029
|
{
|
|
95006
95030
|
var item=this.ChartInfo[i];
|
|
95007
|
-
if (item.ClassName==
|
|
95008
|
-
return;
|
|
95031
|
+
if (item.ClassName==className) //已经存在
|
|
95032
|
+
return item;
|
|
95009
95033
|
}
|
|
95010
95034
|
|
|
95035
|
+
return null;
|
|
95036
|
+
}
|
|
95037
|
+
|
|
95038
|
+
//添加信息地雷
|
|
95039
|
+
this.AddKLineInfo=function(infoName,bUpdate)
|
|
95040
|
+
{
|
|
95041
|
+
var item=this.GetKLineInfo({ Name:infoName });
|
|
95042
|
+
if (item) return;
|
|
95043
|
+
|
|
95011
95044
|
var infoItem=JSKLineInfoMap.Get(infoName);
|
|
95012
|
-
if (!infoItem)
|
|
95045
|
+
if (!infoItem)
|
|
95046
|
+
{
|
|
95047
|
+
console.warn(`[KLineChartContainer::AddKLineInfo] can't find infoName=${infoName}`);
|
|
95048
|
+
return;
|
|
95049
|
+
}
|
|
95013
95050
|
|
|
95014
95051
|
var item=infoItem.Create();
|
|
95015
95052
|
item.MaxRequestDataCount=this.MaxRequestDataCount;
|
|
@@ -95021,39 +95058,28 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
95021
95058
|
}
|
|
95022
95059
|
}
|
|
95023
95060
|
|
|
95024
|
-
|
|
95061
|
+
//更新信息地雷列表 Option :{ InsertNew:, 如果没有找到对应的地雷,是否插入新的地雷, Update:是否立即请求数据 }
|
|
95025
95062
|
this.UpdateKLineInfo=function(infoName, option)
|
|
95026
95063
|
{
|
|
95027
|
-
var classInfo=JSKLineInfoMap.GetClassInfo(infoName);
|
|
95028
|
-
if (!classInfo)
|
|
95029
|
-
{
|
|
95030
|
-
console.warn("[KLineChartContainer::UpdateKLineInfo] can't find infoname=", infoName);
|
|
95031
|
-
return;
|
|
95032
|
-
}
|
|
95033
|
-
|
|
95034
95064
|
var bInsertNew=false, bUpdate=false;
|
|
95035
95065
|
if (option)
|
|
95036
95066
|
{
|
|
95037
95067
|
if (IFrameSplitOperator.IsBoolean(option.InsertNew)) bInsertNew=option.InsertNew;
|
|
95038
95068
|
if (IFrameSplitOperator.IsBoolean(option.Update)) bUpdate=option.Update;
|
|
95039
95069
|
}
|
|
95040
|
-
var finder=null;
|
|
95041
|
-
for(var i=0;i<this.ChartInfo.length; ++i)
|
|
95042
|
-
{
|
|
95043
|
-
var item=this.ChartInfo[i];
|
|
95044
|
-
if (item.ClassName==classInfo.ClassName)
|
|
95045
|
-
{
|
|
95046
|
-
finder=item;
|
|
95047
|
-
break;
|
|
95048
|
-
}
|
|
95049
|
-
}
|
|
95050
95070
|
|
|
95071
|
+
var finder=this.GetKLineInfo({ Name:infoName });
|
|
95072
|
+
|
|
95051
95073
|
if (!finder)
|
|
95052
95074
|
{
|
|
95053
95075
|
if (bInsertNew===true)
|
|
95054
95076
|
{
|
|
95055
95077
|
var infoItem=JSKLineInfoMap.Get(infoName);
|
|
95056
|
-
if (!infoItem)
|
|
95078
|
+
if (!infoItem)
|
|
95079
|
+
{
|
|
95080
|
+
console.warn(`[KLineChartContainer::UpdateKLineInfo] can't find infoname=${infoName}`);
|
|
95081
|
+
return;
|
|
95082
|
+
}
|
|
95057
95083
|
|
|
95058
95084
|
var item=infoItem.Create();
|
|
95059
95085
|
item.MaxRequestDataCount=this.MaxRequestDataCount;
|
|
@@ -177301,7 +177327,7 @@ function ChartScrollText()
|
|
|
177301
177327
|
|
|
177302
177328
|
|
|
177303
177329
|
|
|
177304
|
-
var HQCHART_VERSION="1.1.
|
|
177330
|
+
var HQCHART_VERSION="1.1.15820";
|
|
177305
177331
|
|
|
177306
177332
|
function PrintHQChartVersion()
|
|
177307
177333
|
{
|