hqchart 1.1.13346 → 1.1.13355
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 +40 -20
- package/package.json +1 -1
- package/src/jscommon/umychart.DialogDrawTool.js +4 -2
- package/src/jscommon/umychart.js +264 -115
- package/src/jscommon/umychart.resource/css/tools.css +1 -0
- package/src/jscommon/umychart.resource/font/drawtool/demo_index.html +26 -3
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.css +7 -3
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.js +1 -1
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.json +7 -0
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.ttf +0 -0
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.woff +0 -0
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.woff2 +0 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +265 -116
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +269 -118
package/src/jscommon/umychart.js
CHANGED
|
@@ -334,13 +334,22 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
334
334
|
if (IFrameSplitOperator.IsBool(item.IsShowKLineDivTooltip)) chart.IsShowKLineDivTooltip=item.IsShowKLineDivTooltip;
|
|
335
335
|
if (option.KLine.MaxRequestMinuteDayCount>0) chart.MaxRequestMinuteDayCount=option.KLine.MaxRequestMinuteDayCount;
|
|
336
336
|
if (option.KLine.DrawType) chart.KLineDrawType=option.KLine.DrawType;
|
|
337
|
-
if (option.KLine.FirstShowDate>19910101) chart.CustomShow={ Date:option.KLine.FirstShowDate, PageSize:option.KLine.PageSize };
|
|
337
|
+
if (option.KLine.FirstShowDate>19910101) chart.CustomShow={ Date:option.KLine.FirstShowDate, PageSize:option.KLine.PageSize }; //!!已弃用 新的格式"CustomShow"
|
|
338
338
|
if (option.KLine.RightSpaceCount>0) chart.RightSpaceCount=option.KLine.RightSpaceCount;
|
|
339
339
|
if (option.KLine.ZoomType>0) chart.ZoomType=option.KLine.ZoomType;
|
|
340
340
|
if (option.KLine.DataWidth>=1) chart.KLineSize={ DataWidth:option.KLine.DataWidth };
|
|
341
341
|
if (IFrameSplitOperator.IsNumber(option.KLine.RightFormula)) chart.RightFormula=option.KLine.RightFormula;
|
|
342
342
|
}
|
|
343
343
|
|
|
344
|
+
//自定义显示位置
|
|
345
|
+
if (option.CustomShow && IFrameSplitOperator.IsPlusNumber(option.CustomShow.Date))
|
|
346
|
+
{
|
|
347
|
+
var item=option.CustomShow;
|
|
348
|
+
chart.CustomShow={ Date:item.Date };
|
|
349
|
+
if (IFrameSplitOperator.IsNumber(item.Time)) chart.CustomShow.Time=item.Time;
|
|
350
|
+
if (IFrameSplitOperator.IsPlusNumber(item.PageSize)) chart.CustomShow.PageSize=item.PageSize;
|
|
351
|
+
}
|
|
352
|
+
|
|
344
353
|
if (option.EnableFlowCapital)
|
|
345
354
|
{
|
|
346
355
|
var item=option.EnableFlowCapital;
|
|
@@ -45416,6 +45425,51 @@ function IFrameSplitOperator()
|
|
|
45416
45425
|
}
|
|
45417
45426
|
|
|
45418
45427
|
this.SetOption=function(option) { }
|
|
45428
|
+
|
|
45429
|
+
//计算上下预留
|
|
45430
|
+
this.ReservedHeight=function(splitData)
|
|
45431
|
+
{
|
|
45432
|
+
if (!this.Frame) return;
|
|
45433
|
+
if (this.Frame.IsHScreen) return; //横屏以后再搞
|
|
45434
|
+
|
|
45435
|
+
var yReserved=this.Frame.HorizontalReserved;
|
|
45436
|
+
if (!yReserved) return;
|
|
45437
|
+
|
|
45438
|
+
var reservedHeight=0;
|
|
45439
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top)) reservedHeight+=yReserved.Top;
|
|
45440
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom)) reservedHeight+=yReserved.Bottom;
|
|
45441
|
+
if (reservedHeight<=0) return;
|
|
45442
|
+
|
|
45443
|
+
var border=this.Frame.GetBorder();
|
|
45444
|
+
var top=border.TopEx;
|
|
45445
|
+
var bottom=border.BottomEx;
|
|
45446
|
+
var srcHeight=bottom-top;
|
|
45447
|
+
if (srcHeight<reservedHeight) return;
|
|
45448
|
+
|
|
45449
|
+
var max=splitData.Max;
|
|
45450
|
+
var min=splitData.Min;
|
|
45451
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top)) top-=yReserved.Top;
|
|
45452
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom)) bottom+=yReserved.Bottom;
|
|
45453
|
+
|
|
45454
|
+
var value=(max-min)/(bottom-top); //1个像素点对应的数值
|
|
45455
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top))
|
|
45456
|
+
{
|
|
45457
|
+
var topValue=value*yReserved.Top;
|
|
45458
|
+
max+=topValue;
|
|
45459
|
+
}
|
|
45460
|
+
|
|
45461
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom))
|
|
45462
|
+
{
|
|
45463
|
+
var bottomValue=value*yReserved.Bottom;
|
|
45464
|
+
min-=bottomValue;
|
|
45465
|
+
}
|
|
45466
|
+
|
|
45467
|
+
splitData.Max=max;
|
|
45468
|
+
splitData.Min=min;
|
|
45469
|
+
|
|
45470
|
+
this.Frame.HorizontalMax=splitData.Max;
|
|
45471
|
+
this.Frame.HorizontalMin=splitData.Min;
|
|
45472
|
+
}
|
|
45419
45473
|
}
|
|
45420
45474
|
|
|
45421
45475
|
//字符串格式化 千分位分割
|
|
@@ -46068,6 +46122,8 @@ function FrameSplitKLinePriceY()
|
|
|
46068
46122
|
}
|
|
46069
46123
|
*/
|
|
46070
46124
|
|
|
46125
|
+
this.ReservedHeight(splitData); //预留高度
|
|
46126
|
+
|
|
46071
46127
|
JSConsole.Chart.Log(`[FrameSplitKLinePriceY::Operator] fixed . Max=${splitData.Max} Min=${splitData.Min} Count=${splitData.Count}`);
|
|
46072
46128
|
|
|
46073
46129
|
if (this.GetEventCallback)
|
|
@@ -46906,50 +46962,6 @@ function FrameSplitY()
|
|
|
46906
46962
|
}
|
|
46907
46963
|
}
|
|
46908
46964
|
|
|
46909
|
-
this.ReservedHeight=function(splitData)
|
|
46910
|
-
{
|
|
46911
|
-
if (this.Frame.IsHScreen) return; //横屏以后再搞
|
|
46912
|
-
|
|
46913
|
-
var yReserved=this.Frame.HorizontalReserved;
|
|
46914
|
-
if (!yReserved) return;
|
|
46915
|
-
|
|
46916
|
-
var reservedHeight=0;
|
|
46917
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top)) reservedHeight+=yReserved.Top;
|
|
46918
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom)) reservedHeight+=yReserved.Bottom;
|
|
46919
|
-
if (reservedHeight<=0) return;
|
|
46920
|
-
|
|
46921
|
-
var border=this.Frame.GetBorder();
|
|
46922
|
-
var top=border.TopEx;
|
|
46923
|
-
var bottom=border.BottomEx;
|
|
46924
|
-
var srcHeight=bottom-top;
|
|
46925
|
-
if (srcHeight<reservedHeight) return;
|
|
46926
|
-
|
|
46927
|
-
var max=splitData.Max;
|
|
46928
|
-
var min=splitData.Min;
|
|
46929
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top)) top-=yReserved.Top;
|
|
46930
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom)) bottom+=yReserved.Bottom;
|
|
46931
|
-
|
|
46932
|
-
var value=(max-min)/(bottom-top); //1个像素点对应的数值
|
|
46933
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top))
|
|
46934
|
-
{
|
|
46935
|
-
var topValue=value*yReserved.Top;
|
|
46936
|
-
max+=topValue;
|
|
46937
|
-
}
|
|
46938
|
-
|
|
46939
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom))
|
|
46940
|
-
{
|
|
46941
|
-
var bottomValue=value*yReserved.Bottom;
|
|
46942
|
-
min-=bottomValue;
|
|
46943
|
-
}
|
|
46944
|
-
|
|
46945
|
-
splitData.Max=max;
|
|
46946
|
-
splitData.Min=min;
|
|
46947
|
-
|
|
46948
|
-
this.Frame.HorizontalMax=splitData.Max;
|
|
46949
|
-
this.Frame.HorizontalMin=splitData.Min;
|
|
46950
|
-
}
|
|
46951
|
-
|
|
46952
|
-
|
|
46953
46965
|
this.FormatValueString=function(value)
|
|
46954
46966
|
{
|
|
46955
46967
|
var text;
|
|
@@ -55746,6 +55758,7 @@ IChartDrawPicture.ArrayDrawPricture=
|
|
|
55746
55758
|
{ Name:"PriceRange", ClassName:"ChartPriceRange", Create:function() { return new ChartPriceRange(); }},
|
|
55747
55759
|
{ Name:"DateRange", ClassName:"ChartDateRange", Create:function() { return new ChartDateRange(); }},
|
|
55748
55760
|
{ Name:"InfoLine", ClassName:"ChartInfoLine", Create:function() { return new ChartInfoLine(); }},
|
|
55761
|
+
{ Name:"TrendAngle", ClassName:"ChartTrendAngle", Create:function() { return new ChartTrendAngle(); }}
|
|
55749
55762
|
];
|
|
55750
55763
|
|
|
55751
55764
|
IChartDrawPicture.MapIonFont=new Map(
|
|
@@ -55910,6 +55923,103 @@ function ChartDrawPictureLine()
|
|
|
55910
55923
|
}
|
|
55911
55924
|
}
|
|
55912
55925
|
|
|
55926
|
+
//趋势线角度
|
|
55927
|
+
function ChartTrendAngle()
|
|
55928
|
+
{
|
|
55929
|
+
this.newMethod=ChartDrawPictureLine; //派生
|
|
55930
|
+
this.newMethod();
|
|
55931
|
+
delete this.newMethod;
|
|
55932
|
+
|
|
55933
|
+
this.ClassName='ChartTrendAngle';
|
|
55934
|
+
this.AngleLineLength=100;
|
|
55935
|
+
this.AngleLineDash=[3,3];
|
|
55936
|
+
this.Font=12*GetDevicePixelRatio() +"px 微软雅黑";
|
|
55937
|
+
this.Super_SetOption=this.SetOption; //父类函数
|
|
55938
|
+
|
|
55939
|
+
this.SetOption=function(option)
|
|
55940
|
+
{
|
|
55941
|
+
if (this.Super_SetOption) this.Super_SetOption(option);
|
|
55942
|
+
if (option)
|
|
55943
|
+
{
|
|
55944
|
+
if (IFrameSplitOperator.IsNumber(option.AngleLineLength)) this.AngleLineLength=option.AngleLineLength;
|
|
55945
|
+
if (option.Font) this.Font=option.Font;
|
|
55946
|
+
if (option.AngleLineDash) this.AngleLineDash=option.AngleLineDash;
|
|
55947
|
+
}
|
|
55948
|
+
}
|
|
55949
|
+
|
|
55950
|
+
this.Draw=function()
|
|
55951
|
+
{
|
|
55952
|
+
this.LinePoint=[];
|
|
55953
|
+
if (this.IsFrameMinSize()) return;
|
|
55954
|
+
if (!this.IsShow) return;
|
|
55955
|
+
|
|
55956
|
+
var drawPoint=this.CalculateDrawPoint( {IsCheckX:true, IsCheckY:false} );
|
|
55957
|
+
if (!drawPoint) return;
|
|
55958
|
+
if (drawPoint.length!=2) return;
|
|
55959
|
+
|
|
55960
|
+
this.ClipFrame();
|
|
55961
|
+
|
|
55962
|
+
var ptStart=drawPoint[0];
|
|
55963
|
+
var ptEnd=drawPoint[1];
|
|
55964
|
+
|
|
55965
|
+
this.SetLineWidth();
|
|
55966
|
+
this.Canvas.strokeStyle=this.LineColor;
|
|
55967
|
+
this.Canvas.beginPath();
|
|
55968
|
+
this.Canvas.moveTo(ptStart.X,ptStart.Y);
|
|
55969
|
+
this.Canvas.lineTo(ptEnd.X,ptEnd.Y);
|
|
55970
|
+
this.Canvas.stroke();
|
|
55971
|
+
this.RestoreLineWidth();
|
|
55972
|
+
|
|
55973
|
+
this.DrawAngle(ptStart, ptEnd);
|
|
55974
|
+
|
|
55975
|
+
var line={Start:ptStart, End:ptEnd};
|
|
55976
|
+
this.LinePoint.push(line);
|
|
55977
|
+
|
|
55978
|
+
this.DrawPoint(drawPoint); //画点
|
|
55979
|
+
this.Canvas.restore();
|
|
55980
|
+
}
|
|
55981
|
+
|
|
55982
|
+
this.DrawAngle=function(ptStart, ptEnd)
|
|
55983
|
+
{
|
|
55984
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
55985
|
+
var angle=this.CalculateAngle(ptStart.X, ptStart.Y, ptEnd.X, ptEnd.Y); //角度
|
|
55986
|
+
var lineLength=this.AngleLineLength*pixelRatio; //角度线长度
|
|
55987
|
+
var ptRight={ X:ptStart.X+lineLength, Y:ptStart.Y };
|
|
55988
|
+
|
|
55989
|
+
if (this.AngleLineDash) this.Canvas.setLineDash(this.AngleLineDash); //画虚线
|
|
55990
|
+
|
|
55991
|
+
this.Canvas.lineWidth=1*GetDevicePixelRatio();
|
|
55992
|
+
this.Canvas.beginPath();
|
|
55993
|
+
this.Canvas.moveTo(ToFixedPoint(ptStart.X),ToFixedPoint(ptStart.Y));
|
|
55994
|
+
this.Canvas.lineTo(ToFixedPoint(ptRight.X),ToFixedPoint(ptRight.Y));
|
|
55995
|
+
this.Canvas.stroke();
|
|
55996
|
+
|
|
55997
|
+
this.Canvas.beginPath();
|
|
55998
|
+
if (angle<=180)
|
|
55999
|
+
{
|
|
56000
|
+
this.Canvas.arc(ptStart.X,ToFixedPoint(ptStart.Y),lineLength,0,(Math.PI / 180)*(360-angle), true);
|
|
56001
|
+
var text=`${angle.toFixed(0)}°`;
|
|
56002
|
+
}
|
|
56003
|
+
else
|
|
56004
|
+
{
|
|
56005
|
+
this.Canvas.arc(ptStart.X,ToFixedPoint(ptStart.Y),lineLength,0,(Math.PI / 180)*(360-angle), false);
|
|
56006
|
+
var text=`${(angle-360).toFixed(0)}°`;
|
|
56007
|
+
}
|
|
56008
|
+
|
|
56009
|
+
this.Canvas.stroke();
|
|
56010
|
+
|
|
56011
|
+
this.Canvas.textAlign="left";
|
|
56012
|
+
this.Canvas.textBaseline="middle";
|
|
56013
|
+
this.Canvas.font=this.Font;
|
|
56014
|
+
this.Canvas.fillStyle=this.LineColor;
|
|
56015
|
+
|
|
56016
|
+
if (this.AngleLineDash) this.Canvas.setLineDash([]);
|
|
56017
|
+
|
|
56018
|
+
|
|
56019
|
+
this.Canvas.fillText(text,ptRight.X+5,ptRight.Y);
|
|
56020
|
+
}
|
|
56021
|
+
}
|
|
56022
|
+
|
|
55913
56023
|
//画图工具-涂鸦线段 Y轴关联数值, X轴不关联
|
|
55914
56024
|
function ChartDrawGraffitiLine()
|
|
55915
56025
|
{
|
|
@@ -68189,7 +68299,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
68189
68299
|
this.SourceDataLimit=new Map(); //每个周期缓存数据最大个数 key=周期 value=最大个数
|
|
68190
68300
|
this.CtrlMoveStep=5; //Ctrl+(Left/Right) 移动数据个数
|
|
68191
68301
|
|
|
68192
|
-
this.CustomShow=null; //首先显示的K线的起始日期 { Date
|
|
68302
|
+
this.CustomShow=null; //首先显示的K线的起始日期 { Date:日期, Time:时间, PageSize:}
|
|
68193
68303
|
this.ZoomType=0; //缩放模式 0=最右边固定缩放, 1=十字光标两边缩放
|
|
68194
68304
|
this.IsZoomLockRight=false;
|
|
68195
68305
|
this.KLineSize=null; //{ DataWidth:, }
|
|
@@ -68775,47 +68885,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
68775
68885
|
var hisData=this.ChartOperator_Temp_GetHistroyData();
|
|
68776
68886
|
if (!hisData) return; //数据还没有到达
|
|
68777
68887
|
|
|
68778
|
-
var index=
|
|
68779
|
-
if (ChartData.IsDayPeriod(this.Period,true))
|
|
68780
|
-
{
|
|
68781
|
-
for(var i=0;i<hisData.Data.length;++i)
|
|
68782
|
-
{
|
|
68783
|
-
var item=hisData.Data[i];
|
|
68784
|
-
if (item.Date>=obj.Date)
|
|
68785
|
-
{
|
|
68786
|
-
index=i;
|
|
68787
|
-
break;
|
|
68788
|
-
}
|
|
68789
|
-
}
|
|
68790
|
-
}
|
|
68791
|
-
else if (ChartData.IsMinutePeriod(this.Period,true))
|
|
68792
|
-
{
|
|
68793
|
-
let findTime=obj.Time;
|
|
68794
|
-
if (IFrameSplitOperator.IsPlusNumber(findTime))
|
|
68795
|
-
{
|
|
68796
|
-
for(var i=0;i<hisData.Data.length;++i)
|
|
68797
|
-
{
|
|
68798
|
-
var item=hisData.Data[i];
|
|
68799
|
-
if (item.Date>obj.Date || (item.Date==obj.Date && item.Time>=findTime))
|
|
68800
|
-
{
|
|
68801
|
-
index=i;
|
|
68802
|
-
break;
|
|
68803
|
-
}
|
|
68804
|
-
}
|
|
68805
|
-
}
|
|
68806
|
-
else //只有日期
|
|
68807
|
-
{
|
|
68808
|
-
for(var i=0;i<hisData.Data.length;++i)
|
|
68809
|
-
{
|
|
68810
|
-
var item=hisData.Data[i];
|
|
68811
|
-
if (item.Date>=obj.Date)
|
|
68812
|
-
{
|
|
68813
|
-
index=i;
|
|
68814
|
-
break;
|
|
68815
|
-
}
|
|
68816
|
-
}
|
|
68817
|
-
}
|
|
68818
|
-
}
|
|
68888
|
+
var index=this.ChartOperator_GetIndex_ByDateTime(hisData, obj, this.Period, 0);
|
|
68819
68889
|
|
|
68820
68890
|
if (index===null)
|
|
68821
68891
|
{
|
|
@@ -68935,6 +69005,63 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
68935
69005
|
this.UpdatePointByCursorIndex(); //更新十字光标位子
|
|
68936
69006
|
}
|
|
68937
69007
|
|
|
69008
|
+
//定位K线的索引
|
|
69009
|
+
//searchType 0模糊匹配 1=精确匹配
|
|
69010
|
+
this.ChartOperator_GetIndex_ByDateTime=function(hisData, dateTime, period, searchType)
|
|
69011
|
+
{
|
|
69012
|
+
if (!hisData) return null; //数据还没有到达
|
|
69013
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(hisData.Data)) return null;
|
|
69014
|
+
if (!IFrameSplitOperator.IsPlusNumber(dateTime.Date) || dateTime.Date<19810101) return null;
|
|
69015
|
+
|
|
69016
|
+
if (ChartData.IsDayPeriod(period, true))
|
|
69017
|
+
{
|
|
69018
|
+
for(var i=0;i<hisData.Data.length;++i)
|
|
69019
|
+
{
|
|
69020
|
+
var item=hisData.Data[i];
|
|
69021
|
+
if (searchType==1)
|
|
69022
|
+
{
|
|
69023
|
+
if (item.Date==dateTime.Date) return i;
|
|
69024
|
+
}
|
|
69025
|
+
else
|
|
69026
|
+
{
|
|
69027
|
+
if (item.Date>=dateTime.Date) return i;
|
|
69028
|
+
}
|
|
69029
|
+
}
|
|
69030
|
+
|
|
69031
|
+
return null;
|
|
69032
|
+
}
|
|
69033
|
+
|
|
69034
|
+
if (ChartData.IsMinutePeriod(period,true) || ChartData.IsMilliSecondPeriod(period))
|
|
69035
|
+
{
|
|
69036
|
+
var findTime=null;
|
|
69037
|
+
if (IFrameSplitOperator.IsNumber(dateTime.Time)) findTime=dateTime.Time;
|
|
69038
|
+
for(var i=0;i<hisData.Data.length;++i)
|
|
69039
|
+
{
|
|
69040
|
+
var item=hisData.Data[i];
|
|
69041
|
+
if (searchType==1) //精确匹配
|
|
69042
|
+
{
|
|
69043
|
+
if (findTime==null) return null;
|
|
69044
|
+
if (item.Date==dateTime.Date && item.Time==findTime) return i;
|
|
69045
|
+
}
|
|
69046
|
+
else
|
|
69047
|
+
{
|
|
69048
|
+
if (findTime==null) //只有日期
|
|
69049
|
+
{
|
|
69050
|
+
if (item.Date>=dateTime.Date) return i;
|
|
69051
|
+
}
|
|
69052
|
+
else
|
|
69053
|
+
{
|
|
69054
|
+
if (item.Date>dateTime.Date || (item.Date==dateTime.Date && item.Time>=findTime)) return i;
|
|
69055
|
+
}
|
|
69056
|
+
}
|
|
69057
|
+
}
|
|
69058
|
+
|
|
69059
|
+
return null;
|
|
69060
|
+
}
|
|
69061
|
+
|
|
69062
|
+
return null;
|
|
69063
|
+
}
|
|
69064
|
+
|
|
68938
69065
|
this.OnWheel=function(e)
|
|
68939
69066
|
{
|
|
68940
69067
|
JSConsole.Chart.Log('[KLineChartContainer::OnWheel]',e);
|
|
@@ -69553,37 +69680,21 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
69553
69680
|
|
|
69554
69681
|
this.SetCustomShow=function(customShow,hisData)
|
|
69555
69682
|
{
|
|
69556
|
-
|
|
69557
|
-
|
|
69558
|
-
var firstDate=customShow.Date;
|
|
69559
|
-
var index=null;
|
|
69560
|
-
for(var i =0;i<hisData.Data.length;++i)
|
|
69561
|
-
{
|
|
69562
|
-
var item=hisData.Data[i];
|
|
69563
|
-
if (item.Date>=firstDate)
|
|
69564
|
-
{
|
|
69565
|
-
index=i;
|
|
69566
|
-
break;
|
|
69567
|
-
}
|
|
69568
|
-
}
|
|
69683
|
+
var index=this.ChartOperator_GetIndex_ByDateTime(hisData,customShow, this.Period, 0);
|
|
69569
69684
|
if (index===null)
|
|
69570
69685
|
{
|
|
69571
|
-
JSConsole.Chart.Log(
|
|
69686
|
+
JSConsole.Chart.Log("[KLineChartContainer::SetCustomShow] Can't find index by customShow=",customShow);
|
|
69572
69687
|
return;
|
|
69573
69688
|
}
|
|
69574
69689
|
|
|
69575
|
-
|
|
69576
|
-
if (customShow.PageSize>0) count=customShow.PageSize;
|
|
69577
|
-
|
|
69578
|
-
var customShowCount=count;
|
|
69579
|
-
var pageSize=this.GetMaxMinPageSize();
|
|
69580
|
-
if (count>pageSize.Max) customShowCount=pageSize.Max;
|
|
69581
|
-
else if (count<pageSize.Min) customShowCount=pageSize.Min;
|
|
69582
|
-
|
|
69583
|
-
for(var i in this.Frame.SubFrame)
|
|
69690
|
+
if (IFrameSplitOperator.IsPlusNumber(customShow.PageSize)) //调整一屏显示个数 否则使用默认的
|
|
69584
69691
|
{
|
|
69585
|
-
var
|
|
69586
|
-
|
|
69692
|
+
var showCount=customShow.PageSize;
|
|
69693
|
+
for(var i=0;i<this.Frame.SubFrame.length; ++i)
|
|
69694
|
+
{
|
|
69695
|
+
var item =this.Frame.SubFrame[i].Frame;
|
|
69696
|
+
item.XPointCount=showCount;
|
|
69697
|
+
}
|
|
69587
69698
|
}
|
|
69588
69699
|
|
|
69589
69700
|
this.ChartPaint[0].Data.DataOffset=index;
|
|
@@ -71731,15 +71842,40 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
71731
71842
|
}
|
|
71732
71843
|
}
|
|
71733
71844
|
|
|
71845
|
+
this.SetFrameAttribute=function(windowIndex, attr)
|
|
71846
|
+
{
|
|
71847
|
+
if (!window || !this.Frame.SubFrame[windowIndex] || !this.Frame.SubFrame[windowIndex].Frame) return;
|
|
71848
|
+
if (!attr) return;
|
|
71849
|
+
|
|
71850
|
+
var frame=this.Frame.SubFrame[windowIndex].Frame;
|
|
71851
|
+
|
|
71852
|
+
if (!IFrameSplitOperator.IsUndefined(attr.HorizontalReserved)) frame.HorizontalReserved=attr.HorizontalReserved; //Y轴上下预留
|
|
71853
|
+
if (IFrameSplitOperator.IsNumber(attr.TitleHeight)) frame.ChartBorder.TitleHeight=attr.TitleHeight; //指标标题高度
|
|
71854
|
+
}
|
|
71855
|
+
|
|
71856
|
+
this.ResetFrameAttribute=function(windowIndex)
|
|
71857
|
+
{
|
|
71858
|
+
if (!window || !this.Frame.SubFrame[windowIndex] || !this.Frame.SubFrame[windowIndex].Frame) return;
|
|
71859
|
+
var frame=this.Frame.SubFrame[windowIndex].Frame;
|
|
71860
|
+
|
|
71861
|
+
frame.HorizontalReserved=null;
|
|
71862
|
+
}
|
|
71863
|
+
|
|
71864
|
+
|
|
71734
71865
|
//切换成 脚本指标
|
|
71735
71866
|
this.ChangeScriptIndex=function(windowIndex,indexData,option)
|
|
71736
71867
|
{
|
|
71737
71868
|
this.DeleteIndexPaint(windowIndex, true);
|
|
71738
71869
|
this.WindowIndex[windowIndex]=new ScriptIndex(indexData.Name,indexData.Script,indexData.Args,indexData); //脚本执行
|
|
71870
|
+
this.ResetFrameAttribute(windowIndex);
|
|
71739
71871
|
|
|
71740
71872
|
if (option)
|
|
71741
71873
|
{
|
|
71742
|
-
if (option.Window)
|
|
71874
|
+
if (option.Window)
|
|
71875
|
+
{
|
|
71876
|
+
this.SetFrameToolbar(windowIndex,option.Window);
|
|
71877
|
+
this.SetFrameAttribute(windowIndex,option.Window); //窗口属性
|
|
71878
|
+
}
|
|
71743
71879
|
}
|
|
71744
71880
|
|
|
71745
71881
|
this.OnChangeIndexEvent(windowIndex, { ID:indexData.ID, Name:indexData.Name, FunctionName:"ChangeScriptIndex" });
|
|
@@ -71786,14 +71922,19 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
71786
71922
|
//使用API挂接指标数据 API:{ Name:指标名字, Script:指标脚本可以为空, Args:参数可以为空, Url:指标执行地址 }
|
|
71787
71923
|
var apiItem=indexData.API;
|
|
71788
71924
|
this.WindowIndex[windowIndex]=new APIScriptIndex(apiItem.Name,apiItem.Script,apiItem.Args,indexData);
|
|
71925
|
+
this.ResetFrameAttribute(windowIndex);
|
|
71789
71926
|
|
|
71790
71927
|
this.OnChangeIndexEvent(windowIndex, { ID:indexData.ID, Name:indexData.Name, FunctionName:"ChangeAPIIndex" });
|
|
71791
71928
|
|
|
71792
71929
|
if (indexData)
|
|
71793
71930
|
{
|
|
71794
|
-
if (indexData.Window)
|
|
71931
|
+
if (indexData.Window)
|
|
71932
|
+
{
|
|
71933
|
+
this.SetFrameToolbar(windowIndex,indexData.Window);
|
|
71934
|
+
this.SetFrameAttribute(windowIndex,indexData.Window); //窗口属性
|
|
71935
|
+
}
|
|
71795
71936
|
}
|
|
71796
|
-
|
|
71937
|
+
|
|
71797
71938
|
this.Frame.ClearUpDonwFrameYData({ Index:windowIndex });
|
|
71798
71939
|
var bindData=this.ChartPaint[0].Data;
|
|
71799
71940
|
this.BindIndexData(windowIndex,bindData); //执行脚本
|
|
@@ -72871,6 +73012,14 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72871
73012
|
}
|
|
72872
73013
|
}
|
|
72873
73014
|
}
|
|
73015
|
+
|
|
73016
|
+
if (option.CustomShow && IFrameSplitOperator.IsPlusNumber(option.CustomShow.Date))
|
|
73017
|
+
{
|
|
73018
|
+
var item=option.CustomShow;
|
|
73019
|
+
this.CustomShow={ Date:item.Date };
|
|
73020
|
+
if (IFrameSplitOperator.IsNumber(item.Time)) this.CustomShow.Time=item.Time;
|
|
73021
|
+
if (IFrameSplitOperator.IsPlusNumber(item.PageSize)) this.CustomShow.PageSize=item.PageSize;
|
|
73022
|
+
}
|
|
72874
73023
|
}
|
|
72875
73024
|
|
|
72876
73025
|
this.ReloadChartDrawPicture();
|
|
@@ -54,6 +54,12 @@
|
|
|
54
54
|
<div class="content unicode" style="display: block;">
|
|
55
55
|
<ul class="icon_lists dib-box">
|
|
56
56
|
|
|
57
|
+
<li class="dib">
|
|
58
|
+
<span class="icon hqchart_drawtool"></span>
|
|
59
|
+
<div class="name">趋势线角度</div>
|
|
60
|
+
<div class="code-name">&#xe60c;</div>
|
|
61
|
+
</li>
|
|
62
|
+
|
|
57
63
|
<li class="dib">
|
|
58
64
|
<span class="icon hqchart_drawtool"></span>
|
|
59
65
|
<div class="name">info line</div>
|
|
@@ -438,9 +444,9 @@
|
|
|
438
444
|
<pre><code class="language-css"
|
|
439
445
|
>@font-face {
|
|
440
446
|
font-family: 'hqchart_drawtool';
|
|
441
|
-
src: url('iconfont.woff2?t=
|
|
442
|
-
url('iconfont.woff?t=
|
|
443
|
-
url('iconfont.ttf?t=
|
|
447
|
+
src: url('iconfont.woff2?t=1716529516458') format('woff2'),
|
|
448
|
+
url('iconfont.woff?t=1716529516458') format('woff'),
|
|
449
|
+
url('iconfont.ttf?t=1716529516458') format('truetype');
|
|
444
450
|
}
|
|
445
451
|
</code></pre>
|
|
446
452
|
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
|
|
@@ -466,6 +472,15 @@
|
|
|
466
472
|
<div class="content font-class">
|
|
467
473
|
<ul class="icon_lists dib-box">
|
|
468
474
|
|
|
475
|
+
<li class="dib">
|
|
476
|
+
<span class="icon hqchart_drawtool icon-qushixianjiaodu"></span>
|
|
477
|
+
<div class="name">
|
|
478
|
+
趋势线角度
|
|
479
|
+
</div>
|
|
480
|
+
<div class="code-name">.icon-qushixianjiaodu
|
|
481
|
+
</div>
|
|
482
|
+
</li>
|
|
483
|
+
|
|
469
484
|
<li class="dib">
|
|
470
485
|
<span class="icon hqchart_drawtool icon-infoline"></span>
|
|
471
486
|
<div class="name">
|
|
@@ -1042,6 +1057,14 @@
|
|
|
1042
1057
|
<div class="content symbol">
|
|
1043
1058
|
<ul class="icon_lists dib-box">
|
|
1044
1059
|
|
|
1060
|
+
<li class="dib">
|
|
1061
|
+
<svg class="icon svg-icon" aria-hidden="true">
|
|
1062
|
+
<use xlink:href="#icon-qushixianjiaodu"></use>
|
|
1063
|
+
</svg>
|
|
1064
|
+
<div class="name">趋势线角度</div>
|
|
1065
|
+
<div class="code-name">#icon-qushixianjiaodu</div>
|
|
1066
|
+
</li>
|
|
1067
|
+
|
|
1045
1068
|
<li class="dib">
|
|
1046
1069
|
<svg class="icon svg-icon" aria-hidden="true">
|
|
1047
1070
|
<use xlink:href="#icon-infoline"></use>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
@font-face {
|
|
2
2
|
font-family: "hqchart_drawtool"; /* Project id 4529603 */
|
|
3
|
-
src: url('iconfont.woff2?t=
|
|
4
|
-
url('iconfont.woff?t=
|
|
5
|
-
url('iconfont.ttf?t=
|
|
3
|
+
src: url('iconfont.woff2?t=1716529516458') format('woff2'),
|
|
4
|
+
url('iconfont.woff?t=1716529516458') format('woff'),
|
|
5
|
+
url('iconfont.ttf?t=1716529516458') format('truetype');
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.hqchart_drawtool {
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
-moz-osx-font-smoothing: grayscale;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
.icon-qushixianjiaodu:before {
|
|
17
|
+
content: "\e60c";
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
.icon-infoline:before {
|
|
17
21
|
content: "\e64a";
|
|
18
22
|
}
|