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
|
@@ -4226,13 +4226,22 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4226
4226
|
if (IFrameSplitOperator.IsBool(item.IsShowKLineDivTooltip)) chart.IsShowKLineDivTooltip=item.IsShowKLineDivTooltip;
|
|
4227
4227
|
if (option.KLine.MaxRequestMinuteDayCount>0) chart.MaxRequestMinuteDayCount=option.KLine.MaxRequestMinuteDayCount;
|
|
4228
4228
|
if (option.KLine.DrawType) chart.KLineDrawType=option.KLine.DrawType;
|
|
4229
|
-
if (option.KLine.FirstShowDate>19910101) chart.CustomShow={ Date:option.KLine.FirstShowDate, PageSize:option.KLine.PageSize };
|
|
4229
|
+
if (option.KLine.FirstShowDate>19910101) chart.CustomShow={ Date:option.KLine.FirstShowDate, PageSize:option.KLine.PageSize }; //!!已弃用 新的格式"CustomShow"
|
|
4230
4230
|
if (option.KLine.RightSpaceCount>0) chart.RightSpaceCount=option.KLine.RightSpaceCount;
|
|
4231
4231
|
if (option.KLine.ZoomType>0) chart.ZoomType=option.KLine.ZoomType;
|
|
4232
4232
|
if (option.KLine.DataWidth>=1) chart.KLineSize={ DataWidth:option.KLine.DataWidth };
|
|
4233
4233
|
if (IFrameSplitOperator.IsNumber(option.KLine.RightFormula)) chart.RightFormula=option.KLine.RightFormula;
|
|
4234
4234
|
}
|
|
4235
4235
|
|
|
4236
|
+
//自定义显示位置
|
|
4237
|
+
if (option.CustomShow && IFrameSplitOperator.IsPlusNumber(option.CustomShow.Date))
|
|
4238
|
+
{
|
|
4239
|
+
var item=option.CustomShow;
|
|
4240
|
+
chart.CustomShow={ Date:item.Date };
|
|
4241
|
+
if (IFrameSplitOperator.IsNumber(item.Time)) chart.CustomShow.Time=item.Time;
|
|
4242
|
+
if (IFrameSplitOperator.IsPlusNumber(item.PageSize)) chart.CustomShow.PageSize=item.PageSize;
|
|
4243
|
+
}
|
|
4244
|
+
|
|
4236
4245
|
if (option.EnableFlowCapital)
|
|
4237
4246
|
{
|
|
4238
4247
|
var item=option.EnableFlowCapital;
|
|
@@ -49308,6 +49317,51 @@ function IFrameSplitOperator()
|
|
|
49308
49317
|
}
|
|
49309
49318
|
|
|
49310
49319
|
this.SetOption=function(option) { }
|
|
49320
|
+
|
|
49321
|
+
//计算上下预留
|
|
49322
|
+
this.ReservedHeight=function(splitData)
|
|
49323
|
+
{
|
|
49324
|
+
if (!this.Frame) return;
|
|
49325
|
+
if (this.Frame.IsHScreen) return; //横屏以后再搞
|
|
49326
|
+
|
|
49327
|
+
var yReserved=this.Frame.HorizontalReserved;
|
|
49328
|
+
if (!yReserved) return;
|
|
49329
|
+
|
|
49330
|
+
var reservedHeight=0;
|
|
49331
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top)) reservedHeight+=yReserved.Top;
|
|
49332
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom)) reservedHeight+=yReserved.Bottom;
|
|
49333
|
+
if (reservedHeight<=0) return;
|
|
49334
|
+
|
|
49335
|
+
var border=this.Frame.GetBorder();
|
|
49336
|
+
var top=border.TopEx;
|
|
49337
|
+
var bottom=border.BottomEx;
|
|
49338
|
+
var srcHeight=bottom-top;
|
|
49339
|
+
if (srcHeight<reservedHeight) return;
|
|
49340
|
+
|
|
49341
|
+
var max=splitData.Max;
|
|
49342
|
+
var min=splitData.Min;
|
|
49343
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top)) top-=yReserved.Top;
|
|
49344
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom)) bottom+=yReserved.Bottom;
|
|
49345
|
+
|
|
49346
|
+
var value=(max-min)/(bottom-top); //1个像素点对应的数值
|
|
49347
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top))
|
|
49348
|
+
{
|
|
49349
|
+
var topValue=value*yReserved.Top;
|
|
49350
|
+
max+=topValue;
|
|
49351
|
+
}
|
|
49352
|
+
|
|
49353
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom))
|
|
49354
|
+
{
|
|
49355
|
+
var bottomValue=value*yReserved.Bottom;
|
|
49356
|
+
min-=bottomValue;
|
|
49357
|
+
}
|
|
49358
|
+
|
|
49359
|
+
splitData.Max=max;
|
|
49360
|
+
splitData.Min=min;
|
|
49361
|
+
|
|
49362
|
+
this.Frame.HorizontalMax=splitData.Max;
|
|
49363
|
+
this.Frame.HorizontalMin=splitData.Min;
|
|
49364
|
+
}
|
|
49311
49365
|
}
|
|
49312
49366
|
|
|
49313
49367
|
//字符串格式化 千分位分割
|
|
@@ -49960,6 +50014,8 @@ function FrameSplitKLinePriceY()
|
|
|
49960
50014
|
}
|
|
49961
50015
|
*/
|
|
49962
50016
|
|
|
50017
|
+
this.ReservedHeight(splitData); //预留高度
|
|
50018
|
+
|
|
49963
50019
|
JSConsole.Chart.Log(`[FrameSplitKLinePriceY::Operator] fixed . Max=${splitData.Max} Min=${splitData.Min} Count=${splitData.Count}`);
|
|
49964
50020
|
|
|
49965
50021
|
if (this.GetEventCallback)
|
|
@@ -50798,50 +50854,6 @@ function FrameSplitY()
|
|
|
50798
50854
|
}
|
|
50799
50855
|
}
|
|
50800
50856
|
|
|
50801
|
-
this.ReservedHeight=function(splitData)
|
|
50802
|
-
{
|
|
50803
|
-
if (this.Frame.IsHScreen) return; //横屏以后再搞
|
|
50804
|
-
|
|
50805
|
-
var yReserved=this.Frame.HorizontalReserved;
|
|
50806
|
-
if (!yReserved) return;
|
|
50807
|
-
|
|
50808
|
-
var reservedHeight=0;
|
|
50809
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top)) reservedHeight+=yReserved.Top;
|
|
50810
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom)) reservedHeight+=yReserved.Bottom;
|
|
50811
|
-
if (reservedHeight<=0) return;
|
|
50812
|
-
|
|
50813
|
-
var border=this.Frame.GetBorder();
|
|
50814
|
-
var top=border.TopEx;
|
|
50815
|
-
var bottom=border.BottomEx;
|
|
50816
|
-
var srcHeight=bottom-top;
|
|
50817
|
-
if (srcHeight<reservedHeight) return;
|
|
50818
|
-
|
|
50819
|
-
var max=splitData.Max;
|
|
50820
|
-
var min=splitData.Min;
|
|
50821
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top)) top-=yReserved.Top;
|
|
50822
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom)) bottom+=yReserved.Bottom;
|
|
50823
|
-
|
|
50824
|
-
var value=(max-min)/(bottom-top); //1个像素点对应的数值
|
|
50825
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top))
|
|
50826
|
-
{
|
|
50827
|
-
var topValue=value*yReserved.Top;
|
|
50828
|
-
max+=topValue;
|
|
50829
|
-
}
|
|
50830
|
-
|
|
50831
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom))
|
|
50832
|
-
{
|
|
50833
|
-
var bottomValue=value*yReserved.Bottom;
|
|
50834
|
-
min-=bottomValue;
|
|
50835
|
-
}
|
|
50836
|
-
|
|
50837
|
-
splitData.Max=max;
|
|
50838
|
-
splitData.Min=min;
|
|
50839
|
-
|
|
50840
|
-
this.Frame.HorizontalMax=splitData.Max;
|
|
50841
|
-
this.Frame.HorizontalMin=splitData.Min;
|
|
50842
|
-
}
|
|
50843
|
-
|
|
50844
|
-
|
|
50845
50857
|
this.FormatValueString=function(value)
|
|
50846
50858
|
{
|
|
50847
50859
|
var text;
|
|
@@ -59638,6 +59650,7 @@ IChartDrawPicture.ArrayDrawPricture=
|
|
|
59638
59650
|
{ Name:"PriceRange", ClassName:"ChartPriceRange", Create:function() { return new ChartPriceRange(); }},
|
|
59639
59651
|
{ Name:"DateRange", ClassName:"ChartDateRange", Create:function() { return new ChartDateRange(); }},
|
|
59640
59652
|
{ Name:"InfoLine", ClassName:"ChartInfoLine", Create:function() { return new ChartInfoLine(); }},
|
|
59653
|
+
{ Name:"TrendAngle", ClassName:"ChartTrendAngle", Create:function() { return new ChartTrendAngle(); }}
|
|
59641
59654
|
];
|
|
59642
59655
|
|
|
59643
59656
|
IChartDrawPicture.MapIonFont=new Map(
|
|
@@ -59802,6 +59815,103 @@ function ChartDrawPictureLine()
|
|
|
59802
59815
|
}
|
|
59803
59816
|
}
|
|
59804
59817
|
|
|
59818
|
+
//趋势线角度
|
|
59819
|
+
function ChartTrendAngle()
|
|
59820
|
+
{
|
|
59821
|
+
this.newMethod=ChartDrawPictureLine; //派生
|
|
59822
|
+
this.newMethod();
|
|
59823
|
+
delete this.newMethod;
|
|
59824
|
+
|
|
59825
|
+
this.ClassName='ChartTrendAngle';
|
|
59826
|
+
this.AngleLineLength=100;
|
|
59827
|
+
this.AngleLineDash=[3,3];
|
|
59828
|
+
this.Font=12*GetDevicePixelRatio() +"px 微软雅黑";
|
|
59829
|
+
this.Super_SetOption=this.SetOption; //父类函数
|
|
59830
|
+
|
|
59831
|
+
this.SetOption=function(option)
|
|
59832
|
+
{
|
|
59833
|
+
if (this.Super_SetOption) this.Super_SetOption(option);
|
|
59834
|
+
if (option)
|
|
59835
|
+
{
|
|
59836
|
+
if (IFrameSplitOperator.IsNumber(option.AngleLineLength)) this.AngleLineLength=option.AngleLineLength;
|
|
59837
|
+
if (option.Font) this.Font=option.Font;
|
|
59838
|
+
if (option.AngleLineDash) this.AngleLineDash=option.AngleLineDash;
|
|
59839
|
+
}
|
|
59840
|
+
}
|
|
59841
|
+
|
|
59842
|
+
this.Draw=function()
|
|
59843
|
+
{
|
|
59844
|
+
this.LinePoint=[];
|
|
59845
|
+
if (this.IsFrameMinSize()) return;
|
|
59846
|
+
if (!this.IsShow) return;
|
|
59847
|
+
|
|
59848
|
+
var drawPoint=this.CalculateDrawPoint( {IsCheckX:true, IsCheckY:false} );
|
|
59849
|
+
if (!drawPoint) return;
|
|
59850
|
+
if (drawPoint.length!=2) return;
|
|
59851
|
+
|
|
59852
|
+
this.ClipFrame();
|
|
59853
|
+
|
|
59854
|
+
var ptStart=drawPoint[0];
|
|
59855
|
+
var ptEnd=drawPoint[1];
|
|
59856
|
+
|
|
59857
|
+
this.SetLineWidth();
|
|
59858
|
+
this.Canvas.strokeStyle=this.LineColor;
|
|
59859
|
+
this.Canvas.beginPath();
|
|
59860
|
+
this.Canvas.moveTo(ptStart.X,ptStart.Y);
|
|
59861
|
+
this.Canvas.lineTo(ptEnd.X,ptEnd.Y);
|
|
59862
|
+
this.Canvas.stroke();
|
|
59863
|
+
this.RestoreLineWidth();
|
|
59864
|
+
|
|
59865
|
+
this.DrawAngle(ptStart, ptEnd);
|
|
59866
|
+
|
|
59867
|
+
var line={Start:ptStart, End:ptEnd};
|
|
59868
|
+
this.LinePoint.push(line);
|
|
59869
|
+
|
|
59870
|
+
this.DrawPoint(drawPoint); //画点
|
|
59871
|
+
this.Canvas.restore();
|
|
59872
|
+
}
|
|
59873
|
+
|
|
59874
|
+
this.DrawAngle=function(ptStart, ptEnd)
|
|
59875
|
+
{
|
|
59876
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
59877
|
+
var angle=this.CalculateAngle(ptStart.X, ptStart.Y, ptEnd.X, ptEnd.Y); //角度
|
|
59878
|
+
var lineLength=this.AngleLineLength*pixelRatio; //角度线长度
|
|
59879
|
+
var ptRight={ X:ptStart.X+lineLength, Y:ptStart.Y };
|
|
59880
|
+
|
|
59881
|
+
if (this.AngleLineDash) this.Canvas.setLineDash(this.AngleLineDash); //画虚线
|
|
59882
|
+
|
|
59883
|
+
this.Canvas.lineWidth=1*GetDevicePixelRatio();
|
|
59884
|
+
this.Canvas.beginPath();
|
|
59885
|
+
this.Canvas.moveTo(ToFixedPoint(ptStart.X),ToFixedPoint(ptStart.Y));
|
|
59886
|
+
this.Canvas.lineTo(ToFixedPoint(ptRight.X),ToFixedPoint(ptRight.Y));
|
|
59887
|
+
this.Canvas.stroke();
|
|
59888
|
+
|
|
59889
|
+
this.Canvas.beginPath();
|
|
59890
|
+
if (angle<=180)
|
|
59891
|
+
{
|
|
59892
|
+
this.Canvas.arc(ptStart.X,ToFixedPoint(ptStart.Y),lineLength,0,(Math.PI / 180)*(360-angle), true);
|
|
59893
|
+
var text=`${angle.toFixed(0)}°`;
|
|
59894
|
+
}
|
|
59895
|
+
else
|
|
59896
|
+
{
|
|
59897
|
+
this.Canvas.arc(ptStart.X,ToFixedPoint(ptStart.Y),lineLength,0,(Math.PI / 180)*(360-angle), false);
|
|
59898
|
+
var text=`${(angle-360).toFixed(0)}°`;
|
|
59899
|
+
}
|
|
59900
|
+
|
|
59901
|
+
this.Canvas.stroke();
|
|
59902
|
+
|
|
59903
|
+
this.Canvas.textAlign="left";
|
|
59904
|
+
this.Canvas.textBaseline="middle";
|
|
59905
|
+
this.Canvas.font=this.Font;
|
|
59906
|
+
this.Canvas.fillStyle=this.LineColor;
|
|
59907
|
+
|
|
59908
|
+
if (this.AngleLineDash) this.Canvas.setLineDash([]);
|
|
59909
|
+
|
|
59910
|
+
|
|
59911
|
+
this.Canvas.fillText(text,ptRight.X+5,ptRight.Y);
|
|
59912
|
+
}
|
|
59913
|
+
}
|
|
59914
|
+
|
|
59805
59915
|
//画图工具-涂鸦线段 Y轴关联数值, X轴不关联
|
|
59806
59916
|
function ChartDrawGraffitiLine()
|
|
59807
59917
|
{
|
|
@@ -72081,7 +72191,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72081
72191
|
this.SourceDataLimit=new Map(); //每个周期缓存数据最大个数 key=周期 value=最大个数
|
|
72082
72192
|
this.CtrlMoveStep=5; //Ctrl+(Left/Right) 移动数据个数
|
|
72083
72193
|
|
|
72084
|
-
this.CustomShow=null; //首先显示的K线的起始日期 { Date
|
|
72194
|
+
this.CustomShow=null; //首先显示的K线的起始日期 { Date:日期, Time:时间, PageSize:}
|
|
72085
72195
|
this.ZoomType=0; //缩放模式 0=最右边固定缩放, 1=十字光标两边缩放
|
|
72086
72196
|
this.IsZoomLockRight=false;
|
|
72087
72197
|
this.KLineSize=null; //{ DataWidth:, }
|
|
@@ -72667,47 +72777,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72667
72777
|
var hisData=this.ChartOperator_Temp_GetHistroyData();
|
|
72668
72778
|
if (!hisData) return; //数据还没有到达
|
|
72669
72779
|
|
|
72670
|
-
var index=
|
|
72671
|
-
if (ChartData.IsDayPeriod(this.Period,true))
|
|
72672
|
-
{
|
|
72673
|
-
for(var i=0;i<hisData.Data.length;++i)
|
|
72674
|
-
{
|
|
72675
|
-
var item=hisData.Data[i];
|
|
72676
|
-
if (item.Date>=obj.Date)
|
|
72677
|
-
{
|
|
72678
|
-
index=i;
|
|
72679
|
-
break;
|
|
72680
|
-
}
|
|
72681
|
-
}
|
|
72682
|
-
}
|
|
72683
|
-
else if (ChartData.IsMinutePeriod(this.Period,true))
|
|
72684
|
-
{
|
|
72685
|
-
let findTime=obj.Time;
|
|
72686
|
-
if (IFrameSplitOperator.IsPlusNumber(findTime))
|
|
72687
|
-
{
|
|
72688
|
-
for(var i=0;i<hisData.Data.length;++i)
|
|
72689
|
-
{
|
|
72690
|
-
var item=hisData.Data[i];
|
|
72691
|
-
if (item.Date>obj.Date || (item.Date==obj.Date && item.Time>=findTime))
|
|
72692
|
-
{
|
|
72693
|
-
index=i;
|
|
72694
|
-
break;
|
|
72695
|
-
}
|
|
72696
|
-
}
|
|
72697
|
-
}
|
|
72698
|
-
else //只有日期
|
|
72699
|
-
{
|
|
72700
|
-
for(var i=0;i<hisData.Data.length;++i)
|
|
72701
|
-
{
|
|
72702
|
-
var item=hisData.Data[i];
|
|
72703
|
-
if (item.Date>=obj.Date)
|
|
72704
|
-
{
|
|
72705
|
-
index=i;
|
|
72706
|
-
break;
|
|
72707
|
-
}
|
|
72708
|
-
}
|
|
72709
|
-
}
|
|
72710
|
-
}
|
|
72780
|
+
var index=this.ChartOperator_GetIndex_ByDateTime(hisData, obj, this.Period, 0);
|
|
72711
72781
|
|
|
72712
72782
|
if (index===null)
|
|
72713
72783
|
{
|
|
@@ -72827,6 +72897,63 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72827
72897
|
this.UpdatePointByCursorIndex(); //更新十字光标位子
|
|
72828
72898
|
}
|
|
72829
72899
|
|
|
72900
|
+
//定位K线的索引
|
|
72901
|
+
//searchType 0模糊匹配 1=精确匹配
|
|
72902
|
+
this.ChartOperator_GetIndex_ByDateTime=function(hisData, dateTime, period, searchType)
|
|
72903
|
+
{
|
|
72904
|
+
if (!hisData) return null; //数据还没有到达
|
|
72905
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(hisData.Data)) return null;
|
|
72906
|
+
if (!IFrameSplitOperator.IsPlusNumber(dateTime.Date) || dateTime.Date<19810101) return null;
|
|
72907
|
+
|
|
72908
|
+
if (ChartData.IsDayPeriod(period, true))
|
|
72909
|
+
{
|
|
72910
|
+
for(var i=0;i<hisData.Data.length;++i)
|
|
72911
|
+
{
|
|
72912
|
+
var item=hisData.Data[i];
|
|
72913
|
+
if (searchType==1)
|
|
72914
|
+
{
|
|
72915
|
+
if (item.Date==dateTime.Date) return i;
|
|
72916
|
+
}
|
|
72917
|
+
else
|
|
72918
|
+
{
|
|
72919
|
+
if (item.Date>=dateTime.Date) return i;
|
|
72920
|
+
}
|
|
72921
|
+
}
|
|
72922
|
+
|
|
72923
|
+
return null;
|
|
72924
|
+
}
|
|
72925
|
+
|
|
72926
|
+
if (ChartData.IsMinutePeriod(period,true) || ChartData.IsMilliSecondPeriod(period))
|
|
72927
|
+
{
|
|
72928
|
+
var findTime=null;
|
|
72929
|
+
if (IFrameSplitOperator.IsNumber(dateTime.Time)) findTime=dateTime.Time;
|
|
72930
|
+
for(var i=0;i<hisData.Data.length;++i)
|
|
72931
|
+
{
|
|
72932
|
+
var item=hisData.Data[i];
|
|
72933
|
+
if (searchType==1) //精确匹配
|
|
72934
|
+
{
|
|
72935
|
+
if (findTime==null) return null;
|
|
72936
|
+
if (item.Date==dateTime.Date && item.Time==findTime) return i;
|
|
72937
|
+
}
|
|
72938
|
+
else
|
|
72939
|
+
{
|
|
72940
|
+
if (findTime==null) //只有日期
|
|
72941
|
+
{
|
|
72942
|
+
if (item.Date>=dateTime.Date) return i;
|
|
72943
|
+
}
|
|
72944
|
+
else
|
|
72945
|
+
{
|
|
72946
|
+
if (item.Date>dateTime.Date || (item.Date==dateTime.Date && item.Time>=findTime)) return i;
|
|
72947
|
+
}
|
|
72948
|
+
}
|
|
72949
|
+
}
|
|
72950
|
+
|
|
72951
|
+
return null;
|
|
72952
|
+
}
|
|
72953
|
+
|
|
72954
|
+
return null;
|
|
72955
|
+
}
|
|
72956
|
+
|
|
72830
72957
|
this.OnWheel=function(e)
|
|
72831
72958
|
{
|
|
72832
72959
|
JSConsole.Chart.Log('[KLineChartContainer::OnWheel]',e);
|
|
@@ -73445,37 +73572,21 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
73445
73572
|
|
|
73446
73573
|
this.SetCustomShow=function(customShow,hisData)
|
|
73447
73574
|
{
|
|
73448
|
-
|
|
73449
|
-
|
|
73450
|
-
var firstDate=customShow.Date;
|
|
73451
|
-
var index=null;
|
|
73452
|
-
for(var i =0;i<hisData.Data.length;++i)
|
|
73453
|
-
{
|
|
73454
|
-
var item=hisData.Data[i];
|
|
73455
|
-
if (item.Date>=firstDate)
|
|
73456
|
-
{
|
|
73457
|
-
index=i;
|
|
73458
|
-
break;
|
|
73459
|
-
}
|
|
73460
|
-
}
|
|
73575
|
+
var index=this.ChartOperator_GetIndex_ByDateTime(hisData,customShow, this.Period, 0);
|
|
73461
73576
|
if (index===null)
|
|
73462
73577
|
{
|
|
73463
|
-
JSConsole.Chart.Log(
|
|
73578
|
+
JSConsole.Chart.Log("[KLineChartContainer::SetCustomShow] Can't find index by customShow=",customShow);
|
|
73464
73579
|
return;
|
|
73465
73580
|
}
|
|
73466
73581
|
|
|
73467
|
-
|
|
73468
|
-
if (customShow.PageSize>0) count=customShow.PageSize;
|
|
73469
|
-
|
|
73470
|
-
var customShowCount=count;
|
|
73471
|
-
var pageSize=this.GetMaxMinPageSize();
|
|
73472
|
-
if (count>pageSize.Max) customShowCount=pageSize.Max;
|
|
73473
|
-
else if (count<pageSize.Min) customShowCount=pageSize.Min;
|
|
73474
|
-
|
|
73475
|
-
for(var i in this.Frame.SubFrame)
|
|
73582
|
+
if (IFrameSplitOperator.IsPlusNumber(customShow.PageSize)) //调整一屏显示个数 否则使用默认的
|
|
73476
73583
|
{
|
|
73477
|
-
var
|
|
73478
|
-
|
|
73584
|
+
var showCount=customShow.PageSize;
|
|
73585
|
+
for(var i=0;i<this.Frame.SubFrame.length; ++i)
|
|
73586
|
+
{
|
|
73587
|
+
var item =this.Frame.SubFrame[i].Frame;
|
|
73588
|
+
item.XPointCount=showCount;
|
|
73589
|
+
}
|
|
73479
73590
|
}
|
|
73480
73591
|
|
|
73481
73592
|
this.ChartPaint[0].Data.DataOffset=index;
|
|
@@ -75623,15 +75734,40 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
75623
75734
|
}
|
|
75624
75735
|
}
|
|
75625
75736
|
|
|
75737
|
+
this.SetFrameAttribute=function(windowIndex, attr)
|
|
75738
|
+
{
|
|
75739
|
+
if (!window || !this.Frame.SubFrame[windowIndex] || !this.Frame.SubFrame[windowIndex].Frame) return;
|
|
75740
|
+
if (!attr) return;
|
|
75741
|
+
|
|
75742
|
+
var frame=this.Frame.SubFrame[windowIndex].Frame;
|
|
75743
|
+
|
|
75744
|
+
if (!IFrameSplitOperator.IsUndefined(attr.HorizontalReserved)) frame.HorizontalReserved=attr.HorizontalReserved; //Y轴上下预留
|
|
75745
|
+
if (IFrameSplitOperator.IsNumber(attr.TitleHeight)) frame.ChartBorder.TitleHeight=attr.TitleHeight; //指标标题高度
|
|
75746
|
+
}
|
|
75747
|
+
|
|
75748
|
+
this.ResetFrameAttribute=function(windowIndex)
|
|
75749
|
+
{
|
|
75750
|
+
if (!window || !this.Frame.SubFrame[windowIndex] || !this.Frame.SubFrame[windowIndex].Frame) return;
|
|
75751
|
+
var frame=this.Frame.SubFrame[windowIndex].Frame;
|
|
75752
|
+
|
|
75753
|
+
frame.HorizontalReserved=null;
|
|
75754
|
+
}
|
|
75755
|
+
|
|
75756
|
+
|
|
75626
75757
|
//切换成 脚本指标
|
|
75627
75758
|
this.ChangeScriptIndex=function(windowIndex,indexData,option)
|
|
75628
75759
|
{
|
|
75629
75760
|
this.DeleteIndexPaint(windowIndex, true);
|
|
75630
75761
|
this.WindowIndex[windowIndex]=new ScriptIndex(indexData.Name,indexData.Script,indexData.Args,indexData); //脚本执行
|
|
75762
|
+
this.ResetFrameAttribute(windowIndex);
|
|
75631
75763
|
|
|
75632
75764
|
if (option)
|
|
75633
75765
|
{
|
|
75634
|
-
if (option.Window)
|
|
75766
|
+
if (option.Window)
|
|
75767
|
+
{
|
|
75768
|
+
this.SetFrameToolbar(windowIndex,option.Window);
|
|
75769
|
+
this.SetFrameAttribute(windowIndex,option.Window); //窗口属性
|
|
75770
|
+
}
|
|
75635
75771
|
}
|
|
75636
75772
|
|
|
75637
75773
|
this.OnChangeIndexEvent(windowIndex, { ID:indexData.ID, Name:indexData.Name, FunctionName:"ChangeScriptIndex" });
|
|
@@ -75678,14 +75814,19 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
75678
75814
|
//使用API挂接指标数据 API:{ Name:指标名字, Script:指标脚本可以为空, Args:参数可以为空, Url:指标执行地址 }
|
|
75679
75815
|
var apiItem=indexData.API;
|
|
75680
75816
|
this.WindowIndex[windowIndex]=new APIScriptIndex(apiItem.Name,apiItem.Script,apiItem.Args,indexData);
|
|
75817
|
+
this.ResetFrameAttribute(windowIndex);
|
|
75681
75818
|
|
|
75682
75819
|
this.OnChangeIndexEvent(windowIndex, { ID:indexData.ID, Name:indexData.Name, FunctionName:"ChangeAPIIndex" });
|
|
75683
75820
|
|
|
75684
75821
|
if (indexData)
|
|
75685
75822
|
{
|
|
75686
|
-
if (indexData.Window)
|
|
75823
|
+
if (indexData.Window)
|
|
75824
|
+
{
|
|
75825
|
+
this.SetFrameToolbar(windowIndex,indexData.Window);
|
|
75826
|
+
this.SetFrameAttribute(windowIndex,indexData.Window); //窗口属性
|
|
75827
|
+
}
|
|
75687
75828
|
}
|
|
75688
|
-
|
|
75829
|
+
|
|
75689
75830
|
this.Frame.ClearUpDonwFrameYData({ Index:windowIndex });
|
|
75690
75831
|
var bindData=this.ChartPaint[0].Data;
|
|
75691
75832
|
this.BindIndexData(windowIndex,bindData); //执行脚本
|
|
@@ -76763,6 +76904,14 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
76763
76904
|
}
|
|
76764
76905
|
}
|
|
76765
76906
|
}
|
|
76907
|
+
|
|
76908
|
+
if (option.CustomShow && IFrameSplitOperator.IsPlusNumber(option.CustomShow.Date))
|
|
76909
|
+
{
|
|
76910
|
+
var item=option.CustomShow;
|
|
76911
|
+
this.CustomShow={ Date:item.Date };
|
|
76912
|
+
if (IFrameSplitOperator.IsNumber(item.Time)) this.CustomShow.Time=item.Time;
|
|
76913
|
+
if (IFrameSplitOperator.IsPlusNumber(item.PageSize)) this.CustomShow.PageSize=item.PageSize;
|
|
76914
|
+
}
|
|
76766
76915
|
}
|
|
76767
76916
|
|
|
76768
76917
|
this.ReloadChartDrawPicture();
|
|
@@ -133118,7 +133267,7 @@ function ScrollBarBGChart()
|
|
|
133118
133267
|
|
|
133119
133268
|
|
|
133120
133269
|
|
|
133121
|
-
var HQCHART_VERSION="1.1.
|
|
133270
|
+
var HQCHART_VERSION="1.1.13354";
|
|
133122
133271
|
|
|
133123
133272
|
function PrintHQChartVersion()
|
|
133124
133273
|
{
|