hqchart 1.1.15273 → 1.1.15299
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 +86 -73
- package/package.json +1 -1
- package/src/jscommon/umychart.NetworkFilterTest.js +48 -0
- package/src/jscommon/umychart.complier.js +76 -16
- package/src/jscommon/umychart.js +121 -31
- package/src/jscommon/umychart.resource/js/codemirror/javascript.js +1 -1
- package/src/jscommon/umychart.testdata.js +48 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +198 -48
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.NetworkFilterTest.vue.js +48 -0
- package/src/jscommon/umychart.vue/umychart.vue.js +198 -48
|
@@ -58292,6 +58292,8 @@ HQData.Report_APIIndex=function(data, callback)
|
|
|
58292
58292
|
HQData.APIIndex_BASELINE_BAR(data, callback);
|
|
58293
58293
|
else if (request.Data.indexname=="API_VERTLINE")
|
|
58294
58294
|
HQData.APIIndex_VERTLINE(data, callback);
|
|
58295
|
+
else if (request.Data.indexname=="API_DRAWTEXT_FIX")
|
|
58296
|
+
HQData.APIIndex_DRAWTEXT_FIX(data, callback);
|
|
58295
58297
|
|
|
58296
58298
|
else if (request.Data.indexname=="API_ERRORMESSAGE")
|
|
58297
58299
|
HQData.APIIndex_ErrorMessage(data, callback);
|
|
@@ -59987,6 +59989,52 @@ HQData.API_CHART_AREA_TEXT=function(data, callback)
|
|
|
59987
59989
|
}
|
|
59988
59990
|
|
|
59989
59991
|
|
|
59992
|
+
HQData.APIIndex_DRAWTEXT_FIX=function(data, callback)
|
|
59993
|
+
{
|
|
59994
|
+
data.PreventDefault=true;
|
|
59995
|
+
var hqchart=data.HQChart;
|
|
59996
|
+
var kData=hqchart.GetKData();
|
|
59997
|
+
|
|
59998
|
+
var textData=
|
|
59999
|
+
{
|
|
60000
|
+
name:'DRAWTEXT_FIX', type:1,
|
|
60001
|
+
Draw:
|
|
60002
|
+
{
|
|
60003
|
+
DrawType:'DRAWTEXT_FIX',
|
|
60004
|
+
DrawData: { Value:[], Text:[] },
|
|
60005
|
+
Position:{ X:0.5, Y:0.2, Type:1 }
|
|
60006
|
+
},
|
|
60007
|
+
Color:"rgb(30,144,255)",
|
|
60008
|
+
Font:`italic bold 2.2em "Fira Sans", sans-serif`,
|
|
60009
|
+
};
|
|
60010
|
+
|
|
60011
|
+
for(var i=0;i<kData.Data.length;++i)
|
|
60012
|
+
{
|
|
60013
|
+
var kItem=kData.Data[i];
|
|
60014
|
+
|
|
60015
|
+
if (i%50==1)
|
|
60016
|
+
{
|
|
60017
|
+
textData.Draw.DrawData.Value[i]=1;
|
|
60018
|
+
textData.Draw.DrawData.Text[i]=`${kItem.Date}-${i}`;
|
|
60019
|
+
}
|
|
60020
|
+
else
|
|
60021
|
+
{
|
|
60022
|
+
textData.Draw.DrawData.Value[i]=0;
|
|
60023
|
+
}
|
|
60024
|
+
}
|
|
60025
|
+
|
|
60026
|
+
var apiData=
|
|
60027
|
+
{
|
|
60028
|
+
code:0,
|
|
60029
|
+
stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
|
|
60030
|
+
outdata: { date:kData.GetDate(), time:kData.GetTime(), outvar:[textData] }
|
|
60031
|
+
};
|
|
60032
|
+
|
|
60033
|
+
console.log('[HQData.APIIndex_PARTLINE] apiData ', apiData);
|
|
60034
|
+
callback(apiData);
|
|
60035
|
+
}
|
|
60036
|
+
|
|
60037
|
+
|
|
59990
60038
|
HQData.APIIndex_ErrorMessage=function(data, callback)
|
|
59991
60039
|
{
|
|
59992
60040
|
data.PreventDefault=true;
|
|
@@ -7278,6 +7278,7 @@ var JSCHART_MENU_ID=
|
|
|
7278
7278
|
CMD_CORSS_X_TEXTALIGN_ID:61, //十字光标 底部文字对齐方式
|
|
7279
7279
|
|
|
7280
7280
|
CMD_CHANGE_YRIGHT_TEXT_FORMAT:62, //分时图主图 右侧刻度格式
|
|
7281
|
+
CMD_ENABLE_ZOOM_Y_ID:63, //放大缩小Y坐标 { FrameID:, Enable: , Range:{ Max:, Min: }}
|
|
7281
7282
|
|
|
7282
7283
|
|
|
7283
7284
|
CMD_REPORT_CHANGE_BLOCK_ID:100, //报价列表 切换板块ID
|
|
@@ -16080,6 +16081,10 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
16080
16081
|
this.ResetFrameXYSplit();
|
|
16081
16082
|
this.Draw();
|
|
16082
16083
|
break;
|
|
16084
|
+
case JSCHART_MENU_ID.CMD_ENABLE_ZOOM_Y_ID:
|
|
16085
|
+
if (!srcParam) return false;
|
|
16086
|
+
if (this.EnableZoomYCoordinate) this.EnableZoomYCoordinate(srcParam);
|
|
16087
|
+
break;
|
|
16083
16088
|
}
|
|
16084
16089
|
}
|
|
16085
16090
|
|
|
@@ -34758,12 +34763,13 @@ function ChartKLine()
|
|
|
34758
34763
|
if (this.TradeIcon) this.DrawTradeIcon()
|
|
34759
34764
|
else this.DrawTrade();
|
|
34760
34765
|
|
|
34766
|
+
if (this.PriceGap.Enable) this.DrawPriceGap();
|
|
34767
|
+
|
|
34761
34768
|
this.Canvas.restore();
|
|
34762
34769
|
|
|
34763
34770
|
this.UpdateGlobalLatestPoint();
|
|
34764
34771
|
|
|
34765
34772
|
this.DrawPredictionLine();
|
|
34766
|
-
if (this.PriceGap.Enable) this.DrawPriceGap();
|
|
34767
34773
|
|
|
34768
34774
|
if (this.IsShowMaxMinPrice) //标注最大值最小值
|
|
34769
34775
|
{
|
|
@@ -44206,7 +44212,8 @@ function ChartDrawText()
|
|
|
44206
44212
|
|
|
44207
44213
|
this.ClassName='ChartDrawText'; //类名
|
|
44208
44214
|
this.Color="rgb(255,193,37)"; //线段颜色
|
|
44209
|
-
this.
|
|
44215
|
+
this.Font; //固定字体
|
|
44216
|
+
this.TextFont="14px 微软雅黑"; //输出使用的字体
|
|
44210
44217
|
this.TextBaseline="middle";
|
|
44211
44218
|
this.TextAlign='left';
|
|
44212
44219
|
this.Text
|
|
@@ -44281,8 +44288,9 @@ function ChartDrawText()
|
|
|
44281
44288
|
var isArrayText=Array.isArray(this.Text);
|
|
44282
44289
|
var drawTextInfo={ Text:{ Color:this.Color, Align:this.TextAlign, Baseline:this.TextBaseline }, Font:{ } };
|
|
44283
44290
|
|
|
44284
|
-
|
|
44285
|
-
|
|
44291
|
+
if (this.Font)
|
|
44292
|
+
this.TextFont=this.Font;
|
|
44293
|
+
else if (this.FixedFontSize>0) //固定字体大小模式
|
|
44286
44294
|
this.TextFont=`${this.FixedFontSize}px ${this.TextSize.FontName}`;
|
|
44287
44295
|
else //动态字体大小
|
|
44288
44296
|
this.TextFont=this.GetDynamicFont(dataWidth,distanceWidth,this.TextSize.Max,this.TextSize.Min,this.TextSize.Zoom,this.TextSize.FontName);
|
|
@@ -53132,6 +53140,7 @@ function KLineTooltipPaint()
|
|
|
53132
53140
|
this.ExtendLineWidth=2;
|
|
53133
53141
|
|
|
53134
53142
|
this.Font=[g_JSChartResource.TooltipPaint.TitleFont];
|
|
53143
|
+
|
|
53135
53144
|
|
|
53136
53145
|
this.HQChart;
|
|
53137
53146
|
this.KLineTitlePaint;
|
|
@@ -53251,6 +53260,8 @@ function KLineTooltipPaint()
|
|
|
53251
53260
|
lineWidth+=textWidth;
|
|
53252
53261
|
}
|
|
53253
53262
|
|
|
53263
|
+
if (IFrameSplitOperator.IsNumber(item.Space)) lineWidth+=item.Space;
|
|
53264
|
+
|
|
53254
53265
|
if (maxLineWidth<lineWidth) maxLineWidth=lineWidth;
|
|
53255
53266
|
|
|
53256
53267
|
height+=this.LineHeight;
|
|
@@ -53442,20 +53453,33 @@ function KLineTooltipPaint()
|
|
|
53442
53453
|
{
|
|
53443
53454
|
var item=titleData.AryText[i];
|
|
53444
53455
|
|
|
53456
|
+
var titleWidth=0;
|
|
53445
53457
|
if (item.Title)
|
|
53446
53458
|
{
|
|
53447
53459
|
this.Canvas.textAlign="left";
|
|
53448
53460
|
this.Canvas.fillStyle=item.TitleColor;
|
|
53449
53461
|
this.Canvas.fillText(item.Title,left,top);
|
|
53462
|
+
var titleWidth=this.Canvas.measureText(item.Title).width+2;
|
|
53450
53463
|
}
|
|
53451
53464
|
|
|
53452
53465
|
if (item.Text)
|
|
53453
53466
|
{
|
|
53454
|
-
|
|
53455
|
-
|
|
53456
|
-
|
|
53467
|
+
if (item.TextAlign==1) //1=左对齐 0=右对齐
|
|
53468
|
+
{
|
|
53469
|
+
var yText=left+titleWidth+2;
|
|
53470
|
+
if (IFrameSplitOperator.IsNumber(item.Space)) yText+=item.Space; //标题和数据内容间距
|
|
53471
|
+
this.Canvas.textAlign="left";
|
|
53472
|
+
this.Canvas.fillStyle=item.Color;
|
|
53473
|
+
this.Canvas.fillText(item.Text,yText,top);
|
|
53474
|
+
}
|
|
53475
|
+
else
|
|
53476
|
+
{
|
|
53477
|
+
this.Canvas.textAlign="right";
|
|
53478
|
+
this.Canvas.fillStyle=item.Color;
|
|
53479
|
+
this.Canvas.fillText(item.Text,right,top);
|
|
53480
|
+
}
|
|
53457
53481
|
}
|
|
53458
|
-
|
|
53482
|
+
|
|
53459
53483
|
top+=this.LineHeight+this.LineSpace;
|
|
53460
53484
|
}
|
|
53461
53485
|
|
|
@@ -57623,6 +57647,8 @@ function LatestPointFlashPaint()
|
|
|
57623
57647
|
this.ClassName='LatestPointFlashPaint';
|
|
57624
57648
|
this.HQChart;
|
|
57625
57649
|
|
|
57650
|
+
this.FlashType=0; //0=数据更新了闪烁, 1=一直显示
|
|
57651
|
+
//闪烁
|
|
57626
57652
|
this.Status=0;
|
|
57627
57653
|
this.UpdateTime=new Date();
|
|
57628
57654
|
this.FlashCount=0; //闪烁次数
|
|
@@ -57647,6 +57673,7 @@ function LatestPointFlashPaint()
|
|
|
57647
57673
|
if (option)
|
|
57648
57674
|
{
|
|
57649
57675
|
if (IFrameSplitOperator.IsNumber(option.Frequency)) this.Frequency=option.Frequency;
|
|
57676
|
+
if (IFrameSplitOperator.IsNumber(option.FlashType)) this.FlashType=option.FlashType;
|
|
57650
57677
|
}
|
|
57651
57678
|
}
|
|
57652
57679
|
|
|
@@ -57681,18 +57708,32 @@ function LatestPointFlashPaint()
|
|
|
57681
57708
|
if (!this.HQChart) return;
|
|
57682
57709
|
this.HQChart.ClearCanvas(this.FlashCanvas);
|
|
57683
57710
|
|
|
57684
|
-
if (this.
|
|
57685
|
-
|
|
57711
|
+
if (this.FlashType===1)
|
|
57712
|
+
{
|
|
57713
|
+
|
|
57714
|
+
}
|
|
57715
|
+
else
|
|
57686
57716
|
{
|
|
57687
|
-
|
|
57688
|
-
|
|
57717
|
+
if (this.FlashCount<=0) return;
|
|
57718
|
+
if (this.IsStatusChange())
|
|
57719
|
+
{
|
|
57720
|
+
this.Status=(this.Status+1)%2;
|
|
57721
|
+
--this.FlashCount;
|
|
57722
|
+
}
|
|
57723
|
+
if (this.Status==0) return;
|
|
57689
57724
|
}
|
|
57725
|
+
|
|
57726
|
+
|
|
57690
57727
|
|
|
57691
|
-
if (this.Status==0) return;
|
|
57692
57728
|
if (!this.HQChart.GlobalOption || !this.HQChart.GlobalOption.LatestPoint) return;
|
|
57693
57729
|
var point=this.HQChart.GlobalOption.LatestPoint;
|
|
57694
57730
|
if (!IFrameSplitOperator.IsNumber(point.X) || !IFrameSplitOperator.IsNumber(point.Y)) return;
|
|
57695
57731
|
|
|
57732
|
+
this.DrawPoint(point);
|
|
57733
|
+
}
|
|
57734
|
+
|
|
57735
|
+
this.DrawPoint=function(point)
|
|
57736
|
+
{
|
|
57696
57737
|
if (this.Style==1) this.GetChartColor();
|
|
57697
57738
|
|
|
57698
57739
|
this.FlashCanvas.fillStyle=this.BGColor;
|
|
@@ -62200,7 +62241,7 @@ function FrameSplitMinuteX()
|
|
|
62200
62241
|
width=width/GetDevicePixelRatio();
|
|
62201
62242
|
|
|
62202
62243
|
const minuteCoordinate = g_MinuteCoordinateData;
|
|
62203
|
-
var xcoordinateData = minuteCoordinate.GetCoordinateData(this.Symbol,width);
|
|
62244
|
+
var xcoordinateData = minuteCoordinate.GetCoordinateData(this.Symbol, width, this.Frame.GlobalOption);
|
|
62204
62245
|
var minuteCount=xcoordinateData.Count;
|
|
62205
62246
|
var minuteMiddleCount=xcoordinateData.MiddleCount>0? xcoordinateData.MiddleCount: parseInt(minuteCount/2);
|
|
62206
62247
|
var xcoordinate = xcoordinateData.Data;
|
|
@@ -64866,7 +64907,8 @@ function HQMinuteTimeStringFormat()
|
|
|
64866
64907
|
this.MultiDayBeforeOpenData; //多日分时图 盘前数据
|
|
64867
64908
|
this.MultiDayAfterCloseData; //多日分时图 收盘数据
|
|
64868
64909
|
|
|
64869
|
-
this.GetEventCallback
|
|
64910
|
+
this.GetEventCallback;
|
|
64911
|
+
this.HQChart;
|
|
64870
64912
|
|
|
64871
64913
|
this.GetBeforeOpen=function()
|
|
64872
64914
|
{
|
|
@@ -64964,7 +65006,9 @@ function HQMinuteTimeStringFormat()
|
|
|
64964
65006
|
if (this.Frame && this.Frame.MinuteCount) showIndex=index%this.Frame.MinuteCount;
|
|
64965
65007
|
|
|
64966
65008
|
var timeStringData=g_MinuteTimeStringData;
|
|
64967
|
-
var
|
|
65009
|
+
var globalOption=null;
|
|
65010
|
+
if (this.HQChart) globalOption=this.HQChart.GlobalOption;
|
|
65011
|
+
var timeData=timeStringData.GetTimeData(this.Symbol, globalOption);
|
|
64968
65012
|
if (!timeData) return false;
|
|
64969
65013
|
|
|
64970
65014
|
if (showIndex<0) showIndex=0;
|
|
@@ -82826,7 +82870,7 @@ function JSChartResource()
|
|
|
82826
82870
|
//虚线配置
|
|
82827
82871
|
this.DOTLINE=
|
|
82828
82872
|
{
|
|
82829
|
-
LineDash:[
|
|
82873
|
+
LineDash:[2*GetDevicePixelRatio(),2*GetDevicePixelRatio()] //虚线配置
|
|
82830
82874
|
}
|
|
82831
82875
|
|
|
82832
82876
|
this.DRAWSL=
|
|
@@ -92347,12 +92391,19 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
92347
92391
|
var bDaySummary=klineChart.DaySummary.Enable;
|
|
92348
92392
|
var infoPosition=klineChart.InfoPosition;
|
|
92349
92393
|
var coordinateType=null, yCoordinateType=null; //坐标类型
|
|
92394
|
+
var bZoomYCoordinate=false;
|
|
92350
92395
|
var mainFrame=null;
|
|
92351
92396
|
if (this.Frame.SubFrame[0] && this.Frame.SubFrame[0].Frame) mainFrame=this.Frame.SubFrame[0].Frame;
|
|
92352
92397
|
if (mainFrame)
|
|
92353
92398
|
{
|
|
92354
92399
|
coordinateType=mainFrame.CoordinateType;
|
|
92355
|
-
if (mainFrame.YSplitOperator)
|
|
92400
|
+
if (mainFrame.YSplitOperator)
|
|
92401
|
+
{
|
|
92402
|
+
yCoordinateType=mainFrame.YSplitOperator.CoordinateType;
|
|
92403
|
+
if (mainFrame.YSplitOperator.FixedYMaxMin && mainFrame.YSplitOperator.EnableZoomUpDown)
|
|
92404
|
+
bZoomYCoordinate=true;
|
|
92405
|
+
}
|
|
92406
|
+
|
|
92356
92407
|
}
|
|
92357
92408
|
|
|
92358
92409
|
var aryKLineInfo=[]; //信息地雷
|
|
@@ -92614,6 +92665,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
92614
92665
|
|
|
92615
92666
|
{ Name:"显示走完剩余时间", Data:{ ID:JSCHART_MENU_ID.CMD_ENABLE_KLINE_DAY_SUMMARY_ID, Args:[!bDaySummary]}, Checked:bDaySummary},
|
|
92616
92667
|
|
|
92668
|
+
{ Name:"拖动Y轴", Data:{ ID:JSCHART_MENU_ID.CMD_ENABLE_ZOOM_Y_ID, Args:[{FrameID:0, Enable:!bZoomYCoordinate }, ]}, Checked:bZoomYCoordinate},
|
|
92669
|
+
|
|
92617
92670
|
{ Name:JSPopMenu.SEPARATOR_LINE_NAME },
|
|
92618
92671
|
{
|
|
92619
92672
|
Name:"鼠标形状",
|
|
@@ -94487,6 +94540,41 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
94487
94540
|
|
|
94488
94541
|
return false;
|
|
94489
94542
|
}
|
|
94543
|
+
|
|
94544
|
+
//option={ FrameID:, Enable: }
|
|
94545
|
+
this.EnableZoomYCoordinate=function(option)
|
|
94546
|
+
{
|
|
94547
|
+
if (!option) return false;
|
|
94548
|
+
if (!IFrameSplitOperator.IsNumber(option.FrameID)) return false;
|
|
94549
|
+
if (!IFrameSplitOperator.IsBool(option.Enable)) return false;
|
|
94550
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.Frame.SubFrame)) return false;
|
|
94551
|
+
if (option.FrameID<0 || option.FrameID>this.Frame.SubFrame.length) return false;
|
|
94552
|
+
|
|
94553
|
+
var item=this.Frame.SubFrame[option.FrameID];
|
|
94554
|
+
if (!item || !item.Frame || !item.Frame.YSplitOperator) return false;
|
|
94555
|
+
|
|
94556
|
+
var frame=item.Frame;
|
|
94557
|
+
var splitOper=frame.YSplitOperator;
|
|
94558
|
+
|
|
94559
|
+
if (option.Enable)
|
|
94560
|
+
{
|
|
94561
|
+
var max=frame.HorizontalMax, min=frame.HorizontalMin;
|
|
94562
|
+
if (!IFrameSplitOperator.IsNumber(max) || !IFrameSplitOperator.IsNumber(min)) return false;
|
|
94563
|
+
|
|
94564
|
+
splitOper.FixedYMaxMin={ Max:max, Min:min };
|
|
94565
|
+
splitOper.EnableZoomUpDown=true;
|
|
94566
|
+
frame.XYSplit=true;
|
|
94567
|
+
this.ChartDragSelectRect.EnableLButton=false;
|
|
94568
|
+
}
|
|
94569
|
+
else
|
|
94570
|
+
{
|
|
94571
|
+
splitOper.FixedYMaxMin=null
|
|
94572
|
+
splitOper.EnableZoomUpDown=false;
|
|
94573
|
+
frame.XYSplit=true;
|
|
94574
|
+
}
|
|
94575
|
+
|
|
94576
|
+
this.Draw();
|
|
94577
|
+
}
|
|
94490
94578
|
}
|
|
94491
94579
|
|
|
94492
94580
|
//API 返回数据 转化为array[]
|
|
@@ -97239,7 +97327,8 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
97239
97327
|
this.ChartCorssCursor.PtInClient=(x,y)=>{ return this.PtInClient(x,y); }
|
|
97240
97328
|
this.ChartCorssCursor.Canvas=this.Canvas;
|
|
97241
97329
|
this.ChartCorssCursor.StringFormatX=g_DivTooltipDataForamt.Create("CorssCursor_Minute_XStringFormat");
|
|
97242
|
-
this.ChartCorssCursor.StringFormatX.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
97330
|
+
this.ChartCorssCursor.StringFormatX.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
|
|
97331
|
+
this.ChartCorssCursor.StringFormatX.HQChart=this;
|
|
97243
97332
|
this.ChartCorssCursor.StringFormatY=g_DivTooltipDataForamt.Create("CorssCursor_YStringFormat");
|
|
97244
97333
|
this.ChartCorssCursor.StringFormatY.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
97245
97334
|
this.ChartCorssCursor.StringFormatY.LanguageID=this.LanguageID;
|
|
@@ -103261,6 +103350,7 @@ function MinuteChartHScreenContainer(uielement)
|
|
|
103261
103350
|
this.ChartCorssCursor.Canvas=this.Canvas;
|
|
103262
103351
|
this.ChartCorssCursor.StringFormatX=g_DivTooltipDataForamt.Create("CorssCursor_Minute_XStringFormat");
|
|
103263
103352
|
this.ChartCorssCursor.StringFormatX.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
103353
|
+
this.ChartCorssCursor.StringFormatX.HQChart=this;
|
|
103264
103354
|
this.ChartCorssCursor.StringFormatY=g_DivTooltipDataForamt.Create("CorssCursor_YStringFormat");
|
|
103265
103355
|
this.ChartCorssCursor.StringFormatY.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
103266
103356
|
this.ChartCorssCursor.StringFormatY.HQChart=this;
|
|
@@ -106897,7 +106987,7 @@ function MinuteTimeStringData()
|
|
|
106897
106987
|
return data;
|
|
106898
106988
|
}
|
|
106899
106989
|
|
|
106900
|
-
this.GetTimeData = function (symbol)
|
|
106990
|
+
this.GetTimeData = function (symbol, option)
|
|
106901
106991
|
{
|
|
106902
106992
|
if (!symbol) return this.SHSZ;
|
|
106903
106993
|
|
|
@@ -106913,7 +107003,7 @@ function MinuteTimeStringData()
|
|
|
106913
107003
|
if (MARKET_SUFFIX_NAME.IsUSA(upperSymbol)) return this.GetUSA(upperSymbol);
|
|
106914
107004
|
if (MARKET_SUFFIX_NAME.IsCFFEX(upperSymbol) || MARKET_SUFFIX_NAME.IsCZCE(upperSymbol) || MARKET_SUFFIX_NAME.IsDCE(upperSymbol) || MARKET_SUFFIX_NAME.IsSHFE(upperSymbol) || MARKET_SUFFIX_NAME.IsGZFE(upperSymbol))
|
|
106915
107005
|
{
|
|
106916
|
-
var splitData = g_FuturesTimeData.GetSplitData(upperSymbol);
|
|
107006
|
+
var splitData = g_FuturesTimeData.GetSplitData(upperSymbol, option);
|
|
106917
107007
|
if (!splitData) return null;
|
|
106918
107008
|
return this.GetFutures(splitData);
|
|
106919
107009
|
}
|
|
@@ -107378,8 +107468,8 @@ function MinuteCoordinateData()
|
|
|
107378
107468
|
}
|
|
107379
107469
|
|
|
107380
107470
|
|
|
107381
|
-
|
|
107382
|
-
this.GetCoordinateData = function (symbol, width)
|
|
107471
|
+
// option=GlobalOption
|
|
107472
|
+
this.GetCoordinateData = function (symbol, width, option)
|
|
107383
107473
|
{
|
|
107384
107474
|
var data = null;
|
|
107385
107475
|
if (!symbol)
|
|
@@ -107404,7 +107494,7 @@ function MinuteCoordinateData()
|
|
|
107404
107494
|
else if (MARKET_SUFFIX_NAME.IsJP(upperSymbol))
|
|
107405
107495
|
data=this.GetJPData(upperSymbol,width);
|
|
107406
107496
|
else if (MARKET_SUFFIX_NAME.IsCFFEX(upperSymbol) || MARKET_SUFFIX_NAME.IsCZCE(upperSymbol) || MARKET_SUFFIX_NAME.IsDCE(upperSymbol) || MARKET_SUFFIX_NAME.IsSHFE(upperSymbol) || MARKET_SUFFIX_NAME.IsGZFE(upperSymbol))
|
|
107407
|
-
return this.GetChinatFuturesData(upperSymbol,width);
|
|
107497
|
+
return this.GetChinatFuturesData(upperSymbol, width, option);
|
|
107408
107498
|
else if (MARKET_SUFFIX_NAME.IsUSA(upperSymbol))
|
|
107409
107499
|
data = this.GetUSAData(upperSymbol,width);
|
|
107410
107500
|
else if (MARKET_SUFFIX_NAME.IsFTSE(upperSymbol))
|
|
@@ -107486,9 +107576,9 @@ function MinuteCoordinateData()
|
|
|
107486
107576
|
return result;
|
|
107487
107577
|
}
|
|
107488
107578
|
|
|
107489
|
-
this.GetFuturesData = function (upperSymbol,width,timeData)
|
|
107579
|
+
this.GetFuturesData = function (upperSymbol,width,timeData, option)
|
|
107490
107580
|
{
|
|
107491
|
-
var splitData = timeData.GetSplitData(upperSymbol);
|
|
107581
|
+
var splitData = timeData.GetSplitData(upperSymbol, option);
|
|
107492
107582
|
if (!splitData) return null;
|
|
107493
107583
|
var stringData = g_MinuteTimeStringData.GetFutures(splitData);
|
|
107494
107584
|
if (!stringData) return null;
|
|
@@ -107527,9 +107617,9 @@ function MinuteCoordinateData()
|
|
|
107527
107617
|
return result;
|
|
107528
107618
|
}
|
|
107529
107619
|
|
|
107530
|
-
this.GetChinatFuturesData=function(upperSymbol,width)
|
|
107620
|
+
this.GetChinatFuturesData=function(upperSymbol, width, option)
|
|
107531
107621
|
{
|
|
107532
|
-
return this.GetFuturesData(upperSymbol,width, g_FuturesTimeData);
|
|
107622
|
+
return this.GetFuturesData(upperSymbol,width, g_FuturesTimeData, option);
|
|
107533
107623
|
}
|
|
107534
107624
|
|
|
107535
107625
|
this.GetNYMEXData=function(upperSymbol,width)
|
|
@@ -108335,7 +108425,7 @@ function FuturesTimeData()
|
|
|
108335
108425
|
}
|
|
108336
108426
|
}
|
|
108337
108427
|
|
|
108338
|
-
this.GetData=function(upperSymbol)
|
|
108428
|
+
this.GetData=function(upperSymbol, option)
|
|
108339
108429
|
{
|
|
108340
108430
|
var oneWord = upperSymbol.charAt(0);
|
|
108341
108431
|
var twoWords = upperSymbol.substr(0,2);
|
|
@@ -108380,9 +108470,9 @@ function FuturesTimeData()
|
|
|
108380
108470
|
return null;
|
|
108381
108471
|
}
|
|
108382
108472
|
|
|
108383
|
-
this.GetSplitData = function (upperSymbol)
|
|
108473
|
+
this.GetSplitData = function (upperSymbol, option)
|
|
108384
108474
|
{
|
|
108385
|
-
var data=this.GetData(upperSymbol);
|
|
108475
|
+
var data=this.GetData(upperSymbol, option);
|
|
108386
108476
|
if (!data) return null;
|
|
108387
108477
|
|
|
108388
108478
|
return this.TIME_SPLIT[data.Time];
|
|
@@ -120228,6 +120318,17 @@ function JSDraw(errorHandler,symbolData)
|
|
|
120228
120318
|
let bSecondPont=false;
|
|
120229
120319
|
let lineCache={Start:{ },End:{ }, List:new Array()};
|
|
120230
120320
|
|
|
120321
|
+
function CopyLineData(aryDest, arySrc)
|
|
120322
|
+
{
|
|
120323
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(arySrc)) return;
|
|
120324
|
+
|
|
120325
|
+
for(var j=0; j<arySrc.length; ++j)
|
|
120326
|
+
{
|
|
120327
|
+
var item=arySrc[j];
|
|
120328
|
+
aryDest[item.ID]=item.Value;
|
|
120329
|
+
}
|
|
120330
|
+
}
|
|
120331
|
+
|
|
120231
120332
|
for(let i=0;i<count;++i)
|
|
120232
120333
|
{
|
|
120233
120334
|
drawData[i]=null;
|
|
@@ -120254,6 +120355,16 @@ function JSDraw(errorHandler,symbolData)
|
|
|
120254
120355
|
{
|
|
120255
120356
|
bSecondPont=true;
|
|
120256
120357
|
lineCache.End={ID:i, Value:data2[i]}; //第2个点
|
|
120358
|
+
|
|
120359
|
+
if (condition[i])
|
|
120360
|
+
{
|
|
120361
|
+
var lineData=this.CalculateDrawLine(lineCache); //计算2个点的线上 其他点的数值
|
|
120362
|
+
CopyLineData(drawData,lineData);
|
|
120363
|
+
|
|
120364
|
+
bFirstPoint=true;
|
|
120365
|
+
bSecondPont=false;
|
|
120366
|
+
lineCache.Start={ID:i, Value:data[i]}; //第1个点
|
|
120367
|
+
}
|
|
120257
120368
|
}
|
|
120258
120369
|
}
|
|
120259
120370
|
else if (bFirstPoint==true && bSecondPont==true)
|
|
@@ -120265,13 +120376,8 @@ function JSDraw(errorHandler,symbolData)
|
|
|
120265
120376
|
}
|
|
120266
120377
|
else if (condition[i]) //条件1满足
|
|
120267
120378
|
{
|
|
120268
|
-
|
|
120269
|
-
|
|
120270
|
-
for(let j in lineData)
|
|
120271
|
-
{
|
|
120272
|
-
let item=lineData[j];
|
|
120273
|
-
drawData[item.ID]=item.Value;
|
|
120274
|
-
}
|
|
120379
|
+
var lineData=this.CalculateDrawLine(lineCache); //计算2个点的线上 其他点的数值
|
|
120380
|
+
CopyLineData(drawData,lineData);
|
|
120275
120381
|
|
|
120276
120382
|
if (expand==1) this.CalculateDrawDataExtendLine(drawData, lineCache.Start.ID-2);//右延长线
|
|
120277
120383
|
|
|
@@ -120288,12 +120394,9 @@ function JSDraw(errorHandler,symbolData)
|
|
|
120288
120394
|
//最后一组线
|
|
120289
120395
|
if (bFirstPoint==true && bSecondPont==true)
|
|
120290
120396
|
{
|
|
120291
|
-
|
|
120292
|
-
|
|
120293
|
-
|
|
120294
|
-
let item=lineData[j];
|
|
120295
|
-
drawData[item.ID]=item.Value;
|
|
120296
|
-
}
|
|
120397
|
+
var lineData=this.CalculateDrawLine(lineCache);
|
|
120398
|
+
CopyLineData(drawData,lineData);
|
|
120399
|
+
|
|
120297
120400
|
}
|
|
120298
120401
|
}
|
|
120299
120402
|
|
|
@@ -120810,7 +120913,13 @@ function JSDraw(errorHandler,symbolData)
|
|
|
120810
120913
|
{
|
|
120811
120914
|
if (!numberData) return null;
|
|
120812
120915
|
|
|
120813
|
-
if (numberData.DataType==1)
|
|
120916
|
+
if (numberData.DataType==1)
|
|
120917
|
+
{
|
|
120918
|
+
var value=numberData.SingleValue;
|
|
120919
|
+
if (IFrameSplitOperator.IsNumber(value)) return value.toFixed(decimal);
|
|
120920
|
+
else if (value) return value.toString();
|
|
120921
|
+
else return null;
|
|
120922
|
+
}
|
|
120814
120923
|
|
|
120815
120924
|
if (!IFrameSplitOperator.IsNonEmptyArray(numberData.ArrayValue)) return null;
|
|
120816
120925
|
|
|
@@ -121196,6 +121305,12 @@ function JSDraw(errorHandler,symbolData)
|
|
|
121196
121305
|
return rgba;
|
|
121197
121306
|
}
|
|
121198
121307
|
|
|
121308
|
+
//设置字体
|
|
121309
|
+
this.CSSFONT=function(strFont)
|
|
121310
|
+
{
|
|
121311
|
+
return strFont;
|
|
121312
|
+
}
|
|
121313
|
+
|
|
121199
121314
|
this.UPCOLOR=function(color)
|
|
121200
121315
|
{
|
|
121201
121316
|
return color;
|
|
@@ -128241,6 +128356,7 @@ function JSExecute(ast,option)
|
|
|
128241
128356
|
let xOffset=null, yOffset=null;
|
|
128242
128357
|
var klineType=null;
|
|
128243
128358
|
var lineDash=null;
|
|
128359
|
+
var font=null;
|
|
128244
128360
|
for(let j=0; j<item.Expression.Expression.length; ++j)
|
|
128245
128361
|
{
|
|
128246
128362
|
let itemExpression=item.Expression.Expression[j];
|
|
@@ -128357,6 +128473,10 @@ function JSExecute(ast,option)
|
|
|
128357
128473
|
{
|
|
128358
128474
|
downColor=itemExpression.Out;
|
|
128359
128475
|
}
|
|
128476
|
+
else if (itemExpression.Callee.Name=="CSSFONT")
|
|
128477
|
+
{
|
|
128478
|
+
font=itemExpression.Out;
|
|
128479
|
+
}
|
|
128360
128480
|
else if (itemExpression.Callee.Name=="STICKTYPE")
|
|
128361
128481
|
{
|
|
128362
128482
|
stickType=itemExpression.Out;
|
|
@@ -128559,6 +128679,7 @@ function JSExecute(ast,option)
|
|
|
128559
128679
|
if (drawAlign>=0) outVar.DrawAlign=drawAlign;
|
|
128560
128680
|
if (drawVAlign>=0) outVar.DrawVAlign=drawVAlign;
|
|
128561
128681
|
if (fontSize>0) outVar.DrawFontSize=fontSize;
|
|
128682
|
+
if (font) outVar.Font=font;
|
|
128562
128683
|
if (bgConfig) outVar.Background=bgConfig;
|
|
128563
128684
|
if (vLineConfig) outVar.VerticalLine=vLineConfig;
|
|
128564
128685
|
if (IFrameSplitOperator.IsNumber(xOffset)) outVar.XOffset=xOffset;
|
|
@@ -129059,6 +129180,9 @@ function JSExecute(ast,option)
|
|
|
129059
129180
|
case "DOWNCOLOR":
|
|
129060
129181
|
node.Out=this.Draw.DOWNCOLOR(args[0]);
|
|
129061
129182
|
break;
|
|
129183
|
+
case "CSSFONT":
|
|
129184
|
+
node.Out=this.Draw.CSSFONT(args[0]);
|
|
129185
|
+
break;
|
|
129062
129186
|
case "STICKTYPE": //柱子类型
|
|
129063
129187
|
node.Out=this.Draw.STICKTYPE(args[0]);
|
|
129064
129188
|
break;
|
|
@@ -131773,6 +131897,7 @@ function ScriptIndex(name,script,args,option)
|
|
|
131773
131897
|
}
|
|
131774
131898
|
|
|
131775
131899
|
if (varItem.DrawFontSize>0) chartText.FixedFontSize=varItem.DrawFontSize;
|
|
131900
|
+
if (varItem.Font) chartText.Font=varItem.Font;
|
|
131776
131901
|
if (varItem.Background) chartText.TextBG=varItem.Background;
|
|
131777
131902
|
if (varItem.VerticalLine) chartText.VerticalLine=varItem.VerticalLine;
|
|
131778
131903
|
|
|
@@ -131928,6 +132053,12 @@ function ScriptIndex(name,script,args,option)
|
|
|
131928
132053
|
let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
|
|
131929
132054
|
if (!isNaN(width) && width>0) line.LineWidth=width;
|
|
131930
132055
|
}
|
|
132056
|
+
|
|
132057
|
+
if (varItem.IsDotLine)
|
|
132058
|
+
{
|
|
132059
|
+
line.IsDotLine=true; //虚线
|
|
132060
|
+
line.LineDash=g_JSChartResource.DOTLINE.LineDash.slice();
|
|
132061
|
+
}
|
|
131931
132062
|
|
|
131932
132063
|
let titleIndex=windowIndex+1;
|
|
131933
132064
|
line.Data.Data=varItem.Draw.DrawData;
|
|
@@ -134162,6 +134293,7 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
134162
134293
|
}
|
|
134163
134294
|
|
|
134164
134295
|
if (varItem.DrawFontSize>0) chartText.FixedFontSize=varItem.DrawFontSize;
|
|
134296
|
+
if (varItem.Font) chartText.Font=varItem.Font;
|
|
134165
134297
|
if (varItem.Background) chartText.TextBG=varItem.Background;
|
|
134166
134298
|
if (varItem.VerticalLine) chartText.VerticalLine=varItem.VerticalLine;
|
|
134167
134299
|
if (IFrameSplitOperator.IsNumber(varItem.XOffset)) chartText.ShowOffset.X=varItem.XOffset;
|
|
@@ -134360,6 +134492,12 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
134360
134492
|
let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
|
|
134361
134493
|
if (!isNaN(width) && width>0) chart.LineWidth=width;
|
|
134362
134494
|
}
|
|
134495
|
+
|
|
134496
|
+
if (varItem.IsDotLine)
|
|
134497
|
+
{
|
|
134498
|
+
chart.IsDotLine=true; //虚线
|
|
134499
|
+
chart.LineDash=g_JSChartResource.DOTLINE.LineDash.slice();
|
|
134500
|
+
}
|
|
134363
134501
|
|
|
134364
134502
|
let titleIndex=windowIndex+1;
|
|
134365
134503
|
chart.Data.Data=varItem.Draw.DrawData;
|
|
@@ -136157,14 +136295,14 @@ function APIScriptIndex(name,script,args,option, isOverlay)
|
|
|
136157
136295
|
var indexData=[];
|
|
136158
136296
|
var outVarItem={Name:item.name,Type:item.type};
|
|
136159
136297
|
if (item.color) outVarItem.Color=item.color;
|
|
136298
|
+
else if (item.Color) outVarItem.Color=item.Color;
|
|
136160
136299
|
if (IFrameSplitOperator.IsBool(item.IsShowTitle)) outVarItem.IsShowTitle = item.IsShowTitle; //是否显示指标标题
|
|
136161
136300
|
if (IFrameSplitOperator.IsNumber(item.DrawVAlign)) outVarItem.DrawVAlign = item.DrawVAlign;
|
|
136162
136301
|
if (IFrameSplitOperator.IsNumber(item.DrawAlign)) outVarItem.DrawAlign = item.DrawAlign;
|
|
136302
|
+
if (item.Font) outVarItem.Font=item.Font;
|
|
136163
136303
|
if (item.data)
|
|
136164
136304
|
{
|
|
136165
136305
|
outVarItem.Data=this.FittingArray(item.data,date,time,hqChart);
|
|
136166
|
-
|
|
136167
|
-
if (item.color) outVarItem.Color=item.color;
|
|
136168
136306
|
if (item.linewidth) outVarItem.LineWidth=item.linewidth;
|
|
136169
136307
|
if (IFrameSplitOperator.IsBool(item.isshow)) outVarItem.IsShow = item.isshow; //是否绘制线段
|
|
136170
136308
|
if (item.isexdata==true) outVarItem.IsExData = true;
|
|
@@ -136204,6 +136342,18 @@ function APIScriptIndex(name,script,args,option, isOverlay)
|
|
|
136204
136342
|
|
|
136205
136343
|
result.push(outVarItem);
|
|
136206
136344
|
}
|
|
136345
|
+
else if (draw.DrawType=="DRAWTEXT_FIX")
|
|
136346
|
+
{
|
|
136347
|
+
drawItem.Text=draw.Text;
|
|
136348
|
+
drawItem.Name=draw.Name;
|
|
136349
|
+
drawItem.DrawType=draw.DrawType;
|
|
136350
|
+
drawItem.DrawData={ Value:null, Text:null };
|
|
136351
|
+
drawItem.DrawData.Value=this.FittingArray(draw.DrawData.Value,date,time,hqChart);
|
|
136352
|
+
drawItem.DrawData.Text=this.FittingArray(draw.DrawData.Text,date,time,hqChart);
|
|
136353
|
+
drawItem.Position=draw.Position;
|
|
136354
|
+
outVarItem.Draw=drawItem;
|
|
136355
|
+
result.push(outVarItem);
|
|
136356
|
+
}
|
|
136207
136357
|
else if (draw.DrawType=="VERTLINE") //竖线
|
|
136208
136358
|
{
|
|
136209
136359
|
drawItem.Text=draw.Text;
|
|
@@ -166907,7 +167057,7 @@ function HQChartScriptWorker()
|
|
|
166907
167057
|
|
|
166908
167058
|
|
|
166909
167059
|
|
|
166910
|
-
var HQCHART_VERSION="1.1.
|
|
167060
|
+
var HQCHART_VERSION="1.1.15298";
|
|
166911
167061
|
|
|
166912
167062
|
function PrintHQChartVersion()
|
|
166913
167063
|
{
|