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
|
@@ -2760,6 +2760,8 @@ HQData.Report_APIIndex=function(data, callback)
|
|
|
2760
2760
|
HQData.APIIndex_BASELINE_BAR(data, callback);
|
|
2761
2761
|
else if (request.Data.indexname=="API_VERTLINE")
|
|
2762
2762
|
HQData.APIIndex_VERTLINE(data, callback);
|
|
2763
|
+
else if (request.Data.indexname=="API_DRAWTEXT_FIX")
|
|
2764
|
+
HQData.APIIndex_DRAWTEXT_FIX(data, callback);
|
|
2763
2765
|
|
|
2764
2766
|
else if (request.Data.indexname=="API_ERRORMESSAGE")
|
|
2765
2767
|
HQData.APIIndex_ErrorMessage(data, callback);
|
|
@@ -4455,6 +4457,52 @@ HQData.API_CHART_AREA_TEXT=function(data, callback)
|
|
|
4455
4457
|
}
|
|
4456
4458
|
|
|
4457
4459
|
|
|
4460
|
+
HQData.APIIndex_DRAWTEXT_FIX=function(data, callback)
|
|
4461
|
+
{
|
|
4462
|
+
data.PreventDefault=true;
|
|
4463
|
+
var hqchart=data.HQChart;
|
|
4464
|
+
var kData=hqchart.GetKData();
|
|
4465
|
+
|
|
4466
|
+
var textData=
|
|
4467
|
+
{
|
|
4468
|
+
name:'DRAWTEXT_FIX', type:1,
|
|
4469
|
+
Draw:
|
|
4470
|
+
{
|
|
4471
|
+
DrawType:'DRAWTEXT_FIX',
|
|
4472
|
+
DrawData: { Value:[], Text:[] },
|
|
4473
|
+
Position:{ X:0.5, Y:0.2, Type:1 }
|
|
4474
|
+
},
|
|
4475
|
+
Color:"rgb(30,144,255)",
|
|
4476
|
+
Font:`italic bold 2.2em "Fira Sans", sans-serif`,
|
|
4477
|
+
};
|
|
4478
|
+
|
|
4479
|
+
for(var i=0;i<kData.Data.length;++i)
|
|
4480
|
+
{
|
|
4481
|
+
var kItem=kData.Data[i];
|
|
4482
|
+
|
|
4483
|
+
if (i%50==1)
|
|
4484
|
+
{
|
|
4485
|
+
textData.Draw.DrawData.Value[i]=1;
|
|
4486
|
+
textData.Draw.DrawData.Text[i]=`${kItem.Date}-${i}`;
|
|
4487
|
+
}
|
|
4488
|
+
else
|
|
4489
|
+
{
|
|
4490
|
+
textData.Draw.DrawData.Value[i]=0;
|
|
4491
|
+
}
|
|
4492
|
+
}
|
|
4493
|
+
|
|
4494
|
+
var apiData=
|
|
4495
|
+
{
|
|
4496
|
+
code:0,
|
|
4497
|
+
stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
|
|
4498
|
+
outdata: { date:kData.GetDate(), time:kData.GetTime(), outvar:[textData] }
|
|
4499
|
+
};
|
|
4500
|
+
|
|
4501
|
+
console.log('[HQData.APIIndex_PARTLINE] apiData ', apiData);
|
|
4502
|
+
callback(apiData);
|
|
4503
|
+
}
|
|
4504
|
+
|
|
4505
|
+
|
|
4458
4506
|
HQData.APIIndex_ErrorMessage=function(data, callback)
|
|
4459
4507
|
{
|
|
4460
4508
|
data.PreventDefault=true;
|
|
@@ -7234,6 +7234,7 @@ var JSCHART_MENU_ID=
|
|
|
7234
7234
|
CMD_CORSS_X_TEXTALIGN_ID:61, //十字光标 底部文字对齐方式
|
|
7235
7235
|
|
|
7236
7236
|
CMD_CHANGE_YRIGHT_TEXT_FORMAT:62, //分时图主图 右侧刻度格式
|
|
7237
|
+
CMD_ENABLE_ZOOM_Y_ID:63, //放大缩小Y坐标 { FrameID:, Enable: , Range:{ Max:, Min: }}
|
|
7237
7238
|
|
|
7238
7239
|
|
|
7239
7240
|
CMD_REPORT_CHANGE_BLOCK_ID:100, //报价列表 切换板块ID
|
|
@@ -16036,6 +16037,10 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
16036
16037
|
this.ResetFrameXYSplit();
|
|
16037
16038
|
this.Draw();
|
|
16038
16039
|
break;
|
|
16040
|
+
case JSCHART_MENU_ID.CMD_ENABLE_ZOOM_Y_ID:
|
|
16041
|
+
if (!srcParam) return false;
|
|
16042
|
+
if (this.EnableZoomYCoordinate) this.EnableZoomYCoordinate(srcParam);
|
|
16043
|
+
break;
|
|
16039
16044
|
}
|
|
16040
16045
|
}
|
|
16041
16046
|
|
|
@@ -34714,12 +34719,13 @@ function ChartKLine()
|
|
|
34714
34719
|
if (this.TradeIcon) this.DrawTradeIcon()
|
|
34715
34720
|
else this.DrawTrade();
|
|
34716
34721
|
|
|
34722
|
+
if (this.PriceGap.Enable) this.DrawPriceGap();
|
|
34723
|
+
|
|
34717
34724
|
this.Canvas.restore();
|
|
34718
34725
|
|
|
34719
34726
|
this.UpdateGlobalLatestPoint();
|
|
34720
34727
|
|
|
34721
34728
|
this.DrawPredictionLine();
|
|
34722
|
-
if (this.PriceGap.Enable) this.DrawPriceGap();
|
|
34723
34729
|
|
|
34724
34730
|
if (this.IsShowMaxMinPrice) //标注最大值最小值
|
|
34725
34731
|
{
|
|
@@ -44162,7 +44168,8 @@ function ChartDrawText()
|
|
|
44162
44168
|
|
|
44163
44169
|
this.ClassName='ChartDrawText'; //类名
|
|
44164
44170
|
this.Color="rgb(255,193,37)"; //线段颜色
|
|
44165
|
-
this.
|
|
44171
|
+
this.Font; //固定字体
|
|
44172
|
+
this.TextFont="14px 微软雅黑"; //输出使用的字体
|
|
44166
44173
|
this.TextBaseline="middle";
|
|
44167
44174
|
this.TextAlign='left';
|
|
44168
44175
|
this.Text
|
|
@@ -44237,8 +44244,9 @@ function ChartDrawText()
|
|
|
44237
44244
|
var isArrayText=Array.isArray(this.Text);
|
|
44238
44245
|
var drawTextInfo={ Text:{ Color:this.Color, Align:this.TextAlign, Baseline:this.TextBaseline }, Font:{ } };
|
|
44239
44246
|
|
|
44240
|
-
|
|
44241
|
-
|
|
44247
|
+
if (this.Font)
|
|
44248
|
+
this.TextFont=this.Font;
|
|
44249
|
+
else if (this.FixedFontSize>0) //固定字体大小模式
|
|
44242
44250
|
this.TextFont=`${this.FixedFontSize}px ${this.TextSize.FontName}`;
|
|
44243
44251
|
else //动态字体大小
|
|
44244
44252
|
this.TextFont=this.GetDynamicFont(dataWidth,distanceWidth,this.TextSize.Max,this.TextSize.Min,this.TextSize.Zoom,this.TextSize.FontName);
|
|
@@ -53088,6 +53096,7 @@ function KLineTooltipPaint()
|
|
|
53088
53096
|
this.ExtendLineWidth=2;
|
|
53089
53097
|
|
|
53090
53098
|
this.Font=[g_JSChartResource.TooltipPaint.TitleFont];
|
|
53099
|
+
|
|
53091
53100
|
|
|
53092
53101
|
this.HQChart;
|
|
53093
53102
|
this.KLineTitlePaint;
|
|
@@ -53207,6 +53216,8 @@ function KLineTooltipPaint()
|
|
|
53207
53216
|
lineWidth+=textWidth;
|
|
53208
53217
|
}
|
|
53209
53218
|
|
|
53219
|
+
if (IFrameSplitOperator.IsNumber(item.Space)) lineWidth+=item.Space;
|
|
53220
|
+
|
|
53210
53221
|
if (maxLineWidth<lineWidth) maxLineWidth=lineWidth;
|
|
53211
53222
|
|
|
53212
53223
|
height+=this.LineHeight;
|
|
@@ -53398,20 +53409,33 @@ function KLineTooltipPaint()
|
|
|
53398
53409
|
{
|
|
53399
53410
|
var item=titleData.AryText[i];
|
|
53400
53411
|
|
|
53412
|
+
var titleWidth=0;
|
|
53401
53413
|
if (item.Title)
|
|
53402
53414
|
{
|
|
53403
53415
|
this.Canvas.textAlign="left";
|
|
53404
53416
|
this.Canvas.fillStyle=item.TitleColor;
|
|
53405
53417
|
this.Canvas.fillText(item.Title,left,top);
|
|
53418
|
+
var titleWidth=this.Canvas.measureText(item.Title).width+2;
|
|
53406
53419
|
}
|
|
53407
53420
|
|
|
53408
53421
|
if (item.Text)
|
|
53409
53422
|
{
|
|
53410
|
-
|
|
53411
|
-
|
|
53412
|
-
|
|
53423
|
+
if (item.TextAlign==1) //1=左对齐 0=右对齐
|
|
53424
|
+
{
|
|
53425
|
+
var yText=left+titleWidth+2;
|
|
53426
|
+
if (IFrameSplitOperator.IsNumber(item.Space)) yText+=item.Space; //标题和数据内容间距
|
|
53427
|
+
this.Canvas.textAlign="left";
|
|
53428
|
+
this.Canvas.fillStyle=item.Color;
|
|
53429
|
+
this.Canvas.fillText(item.Text,yText,top);
|
|
53430
|
+
}
|
|
53431
|
+
else
|
|
53432
|
+
{
|
|
53433
|
+
this.Canvas.textAlign="right";
|
|
53434
|
+
this.Canvas.fillStyle=item.Color;
|
|
53435
|
+
this.Canvas.fillText(item.Text,right,top);
|
|
53436
|
+
}
|
|
53413
53437
|
}
|
|
53414
|
-
|
|
53438
|
+
|
|
53415
53439
|
top+=this.LineHeight+this.LineSpace;
|
|
53416
53440
|
}
|
|
53417
53441
|
|
|
@@ -57579,6 +57603,8 @@ function LatestPointFlashPaint()
|
|
|
57579
57603
|
this.ClassName='LatestPointFlashPaint';
|
|
57580
57604
|
this.HQChart;
|
|
57581
57605
|
|
|
57606
|
+
this.FlashType=0; //0=数据更新了闪烁, 1=一直显示
|
|
57607
|
+
//闪烁
|
|
57582
57608
|
this.Status=0;
|
|
57583
57609
|
this.UpdateTime=new Date();
|
|
57584
57610
|
this.FlashCount=0; //闪烁次数
|
|
@@ -57603,6 +57629,7 @@ function LatestPointFlashPaint()
|
|
|
57603
57629
|
if (option)
|
|
57604
57630
|
{
|
|
57605
57631
|
if (IFrameSplitOperator.IsNumber(option.Frequency)) this.Frequency=option.Frequency;
|
|
57632
|
+
if (IFrameSplitOperator.IsNumber(option.FlashType)) this.FlashType=option.FlashType;
|
|
57606
57633
|
}
|
|
57607
57634
|
}
|
|
57608
57635
|
|
|
@@ -57637,18 +57664,32 @@ function LatestPointFlashPaint()
|
|
|
57637
57664
|
if (!this.HQChart) return;
|
|
57638
57665
|
this.HQChart.ClearCanvas(this.FlashCanvas);
|
|
57639
57666
|
|
|
57640
|
-
if (this.
|
|
57641
|
-
|
|
57667
|
+
if (this.FlashType===1)
|
|
57668
|
+
{
|
|
57669
|
+
|
|
57670
|
+
}
|
|
57671
|
+
else
|
|
57642
57672
|
{
|
|
57643
|
-
|
|
57644
|
-
|
|
57673
|
+
if (this.FlashCount<=0) return;
|
|
57674
|
+
if (this.IsStatusChange())
|
|
57675
|
+
{
|
|
57676
|
+
this.Status=(this.Status+1)%2;
|
|
57677
|
+
--this.FlashCount;
|
|
57678
|
+
}
|
|
57679
|
+
if (this.Status==0) return;
|
|
57645
57680
|
}
|
|
57681
|
+
|
|
57682
|
+
|
|
57646
57683
|
|
|
57647
|
-
if (this.Status==0) return;
|
|
57648
57684
|
if (!this.HQChart.GlobalOption || !this.HQChart.GlobalOption.LatestPoint) return;
|
|
57649
57685
|
var point=this.HQChart.GlobalOption.LatestPoint;
|
|
57650
57686
|
if (!IFrameSplitOperator.IsNumber(point.X) || !IFrameSplitOperator.IsNumber(point.Y)) return;
|
|
57651
57687
|
|
|
57688
|
+
this.DrawPoint(point);
|
|
57689
|
+
}
|
|
57690
|
+
|
|
57691
|
+
this.DrawPoint=function(point)
|
|
57692
|
+
{
|
|
57652
57693
|
if (this.Style==1) this.GetChartColor();
|
|
57653
57694
|
|
|
57654
57695
|
this.FlashCanvas.fillStyle=this.BGColor;
|
|
@@ -62156,7 +62197,7 @@ function FrameSplitMinuteX()
|
|
|
62156
62197
|
width=width/GetDevicePixelRatio();
|
|
62157
62198
|
|
|
62158
62199
|
const minuteCoordinate = g_MinuteCoordinateData;
|
|
62159
|
-
var xcoordinateData = minuteCoordinate.GetCoordinateData(this.Symbol,width);
|
|
62200
|
+
var xcoordinateData = minuteCoordinate.GetCoordinateData(this.Symbol, width, this.Frame.GlobalOption);
|
|
62160
62201
|
var minuteCount=xcoordinateData.Count;
|
|
62161
62202
|
var minuteMiddleCount=xcoordinateData.MiddleCount>0? xcoordinateData.MiddleCount: parseInt(minuteCount/2);
|
|
62162
62203
|
var xcoordinate = xcoordinateData.Data;
|
|
@@ -64822,7 +64863,8 @@ function HQMinuteTimeStringFormat()
|
|
|
64822
64863
|
this.MultiDayBeforeOpenData; //多日分时图 盘前数据
|
|
64823
64864
|
this.MultiDayAfterCloseData; //多日分时图 收盘数据
|
|
64824
64865
|
|
|
64825
|
-
this.GetEventCallback
|
|
64866
|
+
this.GetEventCallback;
|
|
64867
|
+
this.HQChart;
|
|
64826
64868
|
|
|
64827
64869
|
this.GetBeforeOpen=function()
|
|
64828
64870
|
{
|
|
@@ -64920,7 +64962,9 @@ function HQMinuteTimeStringFormat()
|
|
|
64920
64962
|
if (this.Frame && this.Frame.MinuteCount) showIndex=index%this.Frame.MinuteCount;
|
|
64921
64963
|
|
|
64922
64964
|
var timeStringData=g_MinuteTimeStringData;
|
|
64923
|
-
var
|
|
64965
|
+
var globalOption=null;
|
|
64966
|
+
if (this.HQChart) globalOption=this.HQChart.GlobalOption;
|
|
64967
|
+
var timeData=timeStringData.GetTimeData(this.Symbol, globalOption);
|
|
64924
64968
|
if (!timeData) return false;
|
|
64925
64969
|
|
|
64926
64970
|
if (showIndex<0) showIndex=0;
|
|
@@ -82782,7 +82826,7 @@ function JSChartResource()
|
|
|
82782
82826
|
//虚线配置
|
|
82783
82827
|
this.DOTLINE=
|
|
82784
82828
|
{
|
|
82785
|
-
LineDash:[
|
|
82829
|
+
LineDash:[2*GetDevicePixelRatio(),2*GetDevicePixelRatio()] //虚线配置
|
|
82786
82830
|
}
|
|
82787
82831
|
|
|
82788
82832
|
this.DRAWSL=
|
|
@@ -92303,12 +92347,19 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
92303
92347
|
var bDaySummary=klineChart.DaySummary.Enable;
|
|
92304
92348
|
var infoPosition=klineChart.InfoPosition;
|
|
92305
92349
|
var coordinateType=null, yCoordinateType=null; //坐标类型
|
|
92350
|
+
var bZoomYCoordinate=false;
|
|
92306
92351
|
var mainFrame=null;
|
|
92307
92352
|
if (this.Frame.SubFrame[0] && this.Frame.SubFrame[0].Frame) mainFrame=this.Frame.SubFrame[0].Frame;
|
|
92308
92353
|
if (mainFrame)
|
|
92309
92354
|
{
|
|
92310
92355
|
coordinateType=mainFrame.CoordinateType;
|
|
92311
|
-
if (mainFrame.YSplitOperator)
|
|
92356
|
+
if (mainFrame.YSplitOperator)
|
|
92357
|
+
{
|
|
92358
|
+
yCoordinateType=mainFrame.YSplitOperator.CoordinateType;
|
|
92359
|
+
if (mainFrame.YSplitOperator.FixedYMaxMin && mainFrame.YSplitOperator.EnableZoomUpDown)
|
|
92360
|
+
bZoomYCoordinate=true;
|
|
92361
|
+
}
|
|
92362
|
+
|
|
92312
92363
|
}
|
|
92313
92364
|
|
|
92314
92365
|
var aryKLineInfo=[]; //信息地雷
|
|
@@ -92570,6 +92621,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
92570
92621
|
|
|
92571
92622
|
{ Name:"显示走完剩余时间", Data:{ ID:JSCHART_MENU_ID.CMD_ENABLE_KLINE_DAY_SUMMARY_ID, Args:[!bDaySummary]}, Checked:bDaySummary},
|
|
92572
92623
|
|
|
92624
|
+
{ Name:"拖动Y轴", Data:{ ID:JSCHART_MENU_ID.CMD_ENABLE_ZOOM_Y_ID, Args:[{FrameID:0, Enable:!bZoomYCoordinate }, ]}, Checked:bZoomYCoordinate},
|
|
92625
|
+
|
|
92573
92626
|
{ Name:JSPopMenu.SEPARATOR_LINE_NAME },
|
|
92574
92627
|
{
|
|
92575
92628
|
Name:"鼠标形状",
|
|
@@ -94443,6 +94496,41 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
94443
94496
|
|
|
94444
94497
|
return false;
|
|
94445
94498
|
}
|
|
94499
|
+
|
|
94500
|
+
//option={ FrameID:, Enable: }
|
|
94501
|
+
this.EnableZoomYCoordinate=function(option)
|
|
94502
|
+
{
|
|
94503
|
+
if (!option) return false;
|
|
94504
|
+
if (!IFrameSplitOperator.IsNumber(option.FrameID)) return false;
|
|
94505
|
+
if (!IFrameSplitOperator.IsBool(option.Enable)) return false;
|
|
94506
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.Frame.SubFrame)) return false;
|
|
94507
|
+
if (option.FrameID<0 || option.FrameID>this.Frame.SubFrame.length) return false;
|
|
94508
|
+
|
|
94509
|
+
var item=this.Frame.SubFrame[option.FrameID];
|
|
94510
|
+
if (!item || !item.Frame || !item.Frame.YSplitOperator) return false;
|
|
94511
|
+
|
|
94512
|
+
var frame=item.Frame;
|
|
94513
|
+
var splitOper=frame.YSplitOperator;
|
|
94514
|
+
|
|
94515
|
+
if (option.Enable)
|
|
94516
|
+
{
|
|
94517
|
+
var max=frame.HorizontalMax, min=frame.HorizontalMin;
|
|
94518
|
+
if (!IFrameSplitOperator.IsNumber(max) || !IFrameSplitOperator.IsNumber(min)) return false;
|
|
94519
|
+
|
|
94520
|
+
splitOper.FixedYMaxMin={ Max:max, Min:min };
|
|
94521
|
+
splitOper.EnableZoomUpDown=true;
|
|
94522
|
+
frame.XYSplit=true;
|
|
94523
|
+
this.ChartDragSelectRect.EnableLButton=false;
|
|
94524
|
+
}
|
|
94525
|
+
else
|
|
94526
|
+
{
|
|
94527
|
+
splitOper.FixedYMaxMin=null
|
|
94528
|
+
splitOper.EnableZoomUpDown=false;
|
|
94529
|
+
frame.XYSplit=true;
|
|
94530
|
+
}
|
|
94531
|
+
|
|
94532
|
+
this.Draw();
|
|
94533
|
+
}
|
|
94446
94534
|
}
|
|
94447
94535
|
|
|
94448
94536
|
//API 返回数据 转化为array[]
|
|
@@ -97195,7 +97283,8 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
97195
97283
|
this.ChartCorssCursor.PtInClient=(x,y)=>{ return this.PtInClient(x,y); }
|
|
97196
97284
|
this.ChartCorssCursor.Canvas=this.Canvas;
|
|
97197
97285
|
this.ChartCorssCursor.StringFormatX=g_DivTooltipDataForamt.Create("CorssCursor_Minute_XStringFormat");
|
|
97198
|
-
this.ChartCorssCursor.StringFormatX.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
97286
|
+
this.ChartCorssCursor.StringFormatX.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
|
|
97287
|
+
this.ChartCorssCursor.StringFormatX.HQChart=this;
|
|
97199
97288
|
this.ChartCorssCursor.StringFormatY=g_DivTooltipDataForamt.Create("CorssCursor_YStringFormat");
|
|
97200
97289
|
this.ChartCorssCursor.StringFormatY.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
97201
97290
|
this.ChartCorssCursor.StringFormatY.LanguageID=this.LanguageID;
|
|
@@ -103217,6 +103306,7 @@ function MinuteChartHScreenContainer(uielement)
|
|
|
103217
103306
|
this.ChartCorssCursor.Canvas=this.Canvas;
|
|
103218
103307
|
this.ChartCorssCursor.StringFormatX=g_DivTooltipDataForamt.Create("CorssCursor_Minute_XStringFormat");
|
|
103219
103308
|
this.ChartCorssCursor.StringFormatX.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
103309
|
+
this.ChartCorssCursor.StringFormatX.HQChart=this;
|
|
103220
103310
|
this.ChartCorssCursor.StringFormatY=g_DivTooltipDataForamt.Create("CorssCursor_YStringFormat");
|
|
103221
103311
|
this.ChartCorssCursor.StringFormatY.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
103222
103312
|
this.ChartCorssCursor.StringFormatY.HQChart=this;
|
|
@@ -106853,7 +106943,7 @@ function MinuteTimeStringData()
|
|
|
106853
106943
|
return data;
|
|
106854
106944
|
}
|
|
106855
106945
|
|
|
106856
|
-
this.GetTimeData = function (symbol)
|
|
106946
|
+
this.GetTimeData = function (symbol, option)
|
|
106857
106947
|
{
|
|
106858
106948
|
if (!symbol) return this.SHSZ;
|
|
106859
106949
|
|
|
@@ -106869,7 +106959,7 @@ function MinuteTimeStringData()
|
|
|
106869
106959
|
if (MARKET_SUFFIX_NAME.IsUSA(upperSymbol)) return this.GetUSA(upperSymbol);
|
|
106870
106960
|
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))
|
|
106871
106961
|
{
|
|
106872
|
-
var splitData = g_FuturesTimeData.GetSplitData(upperSymbol);
|
|
106962
|
+
var splitData = g_FuturesTimeData.GetSplitData(upperSymbol, option);
|
|
106873
106963
|
if (!splitData) return null;
|
|
106874
106964
|
return this.GetFutures(splitData);
|
|
106875
106965
|
}
|
|
@@ -107334,8 +107424,8 @@ function MinuteCoordinateData()
|
|
|
107334
107424
|
}
|
|
107335
107425
|
|
|
107336
107426
|
|
|
107337
|
-
|
|
107338
|
-
this.GetCoordinateData = function (symbol, width)
|
|
107427
|
+
// option=GlobalOption
|
|
107428
|
+
this.GetCoordinateData = function (symbol, width, option)
|
|
107339
107429
|
{
|
|
107340
107430
|
var data = null;
|
|
107341
107431
|
if (!symbol)
|
|
@@ -107360,7 +107450,7 @@ function MinuteCoordinateData()
|
|
|
107360
107450
|
else if (MARKET_SUFFIX_NAME.IsJP(upperSymbol))
|
|
107361
107451
|
data=this.GetJPData(upperSymbol,width);
|
|
107362
107452
|
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))
|
|
107363
|
-
return this.GetChinatFuturesData(upperSymbol,width);
|
|
107453
|
+
return this.GetChinatFuturesData(upperSymbol, width, option);
|
|
107364
107454
|
else if (MARKET_SUFFIX_NAME.IsUSA(upperSymbol))
|
|
107365
107455
|
data = this.GetUSAData(upperSymbol,width);
|
|
107366
107456
|
else if (MARKET_SUFFIX_NAME.IsFTSE(upperSymbol))
|
|
@@ -107442,9 +107532,9 @@ function MinuteCoordinateData()
|
|
|
107442
107532
|
return result;
|
|
107443
107533
|
}
|
|
107444
107534
|
|
|
107445
|
-
this.GetFuturesData = function (upperSymbol,width,timeData)
|
|
107535
|
+
this.GetFuturesData = function (upperSymbol,width,timeData, option)
|
|
107446
107536
|
{
|
|
107447
|
-
var splitData = timeData.GetSplitData(upperSymbol);
|
|
107537
|
+
var splitData = timeData.GetSplitData(upperSymbol, option);
|
|
107448
107538
|
if (!splitData) return null;
|
|
107449
107539
|
var stringData = g_MinuteTimeStringData.GetFutures(splitData);
|
|
107450
107540
|
if (!stringData) return null;
|
|
@@ -107483,9 +107573,9 @@ function MinuteCoordinateData()
|
|
|
107483
107573
|
return result;
|
|
107484
107574
|
}
|
|
107485
107575
|
|
|
107486
|
-
this.GetChinatFuturesData=function(upperSymbol,width)
|
|
107576
|
+
this.GetChinatFuturesData=function(upperSymbol, width, option)
|
|
107487
107577
|
{
|
|
107488
|
-
return this.GetFuturesData(upperSymbol,width, g_FuturesTimeData);
|
|
107578
|
+
return this.GetFuturesData(upperSymbol,width, g_FuturesTimeData, option);
|
|
107489
107579
|
}
|
|
107490
107580
|
|
|
107491
107581
|
this.GetNYMEXData=function(upperSymbol,width)
|
|
@@ -108291,7 +108381,7 @@ function FuturesTimeData()
|
|
|
108291
108381
|
}
|
|
108292
108382
|
}
|
|
108293
108383
|
|
|
108294
|
-
this.GetData=function(upperSymbol)
|
|
108384
|
+
this.GetData=function(upperSymbol, option)
|
|
108295
108385
|
{
|
|
108296
108386
|
var oneWord = upperSymbol.charAt(0);
|
|
108297
108387
|
var twoWords = upperSymbol.substr(0,2);
|
|
@@ -108336,9 +108426,9 @@ function FuturesTimeData()
|
|
|
108336
108426
|
return null;
|
|
108337
108427
|
}
|
|
108338
108428
|
|
|
108339
|
-
this.GetSplitData = function (upperSymbol)
|
|
108429
|
+
this.GetSplitData = function (upperSymbol, option)
|
|
108340
108430
|
{
|
|
108341
|
-
var data=this.GetData(upperSymbol);
|
|
108431
|
+
var data=this.GetData(upperSymbol, option);
|
|
108342
108432
|
if (!data) return null;
|
|
108343
108433
|
|
|
108344
108434
|
return this.TIME_SPLIT[data.Time];
|
|
@@ -120184,6 +120274,17 @@ function JSDraw(errorHandler,symbolData)
|
|
|
120184
120274
|
let bSecondPont=false;
|
|
120185
120275
|
let lineCache={Start:{ },End:{ }, List:new Array()};
|
|
120186
120276
|
|
|
120277
|
+
function CopyLineData(aryDest, arySrc)
|
|
120278
|
+
{
|
|
120279
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(arySrc)) return;
|
|
120280
|
+
|
|
120281
|
+
for(var j=0; j<arySrc.length; ++j)
|
|
120282
|
+
{
|
|
120283
|
+
var item=arySrc[j];
|
|
120284
|
+
aryDest[item.ID]=item.Value;
|
|
120285
|
+
}
|
|
120286
|
+
}
|
|
120287
|
+
|
|
120187
120288
|
for(let i=0;i<count;++i)
|
|
120188
120289
|
{
|
|
120189
120290
|
drawData[i]=null;
|
|
@@ -120210,6 +120311,16 @@ function JSDraw(errorHandler,symbolData)
|
|
|
120210
120311
|
{
|
|
120211
120312
|
bSecondPont=true;
|
|
120212
120313
|
lineCache.End={ID:i, Value:data2[i]}; //第2个点
|
|
120314
|
+
|
|
120315
|
+
if (condition[i])
|
|
120316
|
+
{
|
|
120317
|
+
var lineData=this.CalculateDrawLine(lineCache); //计算2个点的线上 其他点的数值
|
|
120318
|
+
CopyLineData(drawData,lineData);
|
|
120319
|
+
|
|
120320
|
+
bFirstPoint=true;
|
|
120321
|
+
bSecondPont=false;
|
|
120322
|
+
lineCache.Start={ID:i, Value:data[i]}; //第1个点
|
|
120323
|
+
}
|
|
120213
120324
|
}
|
|
120214
120325
|
}
|
|
120215
120326
|
else if (bFirstPoint==true && bSecondPont==true)
|
|
@@ -120221,13 +120332,8 @@ function JSDraw(errorHandler,symbolData)
|
|
|
120221
120332
|
}
|
|
120222
120333
|
else if (condition[i]) //条件1满足
|
|
120223
120334
|
{
|
|
120224
|
-
|
|
120225
|
-
|
|
120226
|
-
for(let j in lineData)
|
|
120227
|
-
{
|
|
120228
|
-
let item=lineData[j];
|
|
120229
|
-
drawData[item.ID]=item.Value;
|
|
120230
|
-
}
|
|
120335
|
+
var lineData=this.CalculateDrawLine(lineCache); //计算2个点的线上 其他点的数值
|
|
120336
|
+
CopyLineData(drawData,lineData);
|
|
120231
120337
|
|
|
120232
120338
|
if (expand==1) this.CalculateDrawDataExtendLine(drawData, lineCache.Start.ID-2);//右延长线
|
|
120233
120339
|
|
|
@@ -120244,12 +120350,9 @@ function JSDraw(errorHandler,symbolData)
|
|
|
120244
120350
|
//最后一组线
|
|
120245
120351
|
if (bFirstPoint==true && bSecondPont==true)
|
|
120246
120352
|
{
|
|
120247
|
-
|
|
120248
|
-
|
|
120249
|
-
|
|
120250
|
-
let item=lineData[j];
|
|
120251
|
-
drawData[item.ID]=item.Value;
|
|
120252
|
-
}
|
|
120353
|
+
var lineData=this.CalculateDrawLine(lineCache);
|
|
120354
|
+
CopyLineData(drawData,lineData);
|
|
120355
|
+
|
|
120253
120356
|
}
|
|
120254
120357
|
}
|
|
120255
120358
|
|
|
@@ -120766,7 +120869,13 @@ function JSDraw(errorHandler,symbolData)
|
|
|
120766
120869
|
{
|
|
120767
120870
|
if (!numberData) return null;
|
|
120768
120871
|
|
|
120769
|
-
if (numberData.DataType==1)
|
|
120872
|
+
if (numberData.DataType==1)
|
|
120873
|
+
{
|
|
120874
|
+
var value=numberData.SingleValue;
|
|
120875
|
+
if (IFrameSplitOperator.IsNumber(value)) return value.toFixed(decimal);
|
|
120876
|
+
else if (value) return value.toString();
|
|
120877
|
+
else return null;
|
|
120878
|
+
}
|
|
120770
120879
|
|
|
120771
120880
|
if (!IFrameSplitOperator.IsNonEmptyArray(numberData.ArrayValue)) return null;
|
|
120772
120881
|
|
|
@@ -121152,6 +121261,12 @@ function JSDraw(errorHandler,symbolData)
|
|
|
121152
121261
|
return rgba;
|
|
121153
121262
|
}
|
|
121154
121263
|
|
|
121264
|
+
//设置字体
|
|
121265
|
+
this.CSSFONT=function(strFont)
|
|
121266
|
+
{
|
|
121267
|
+
return strFont;
|
|
121268
|
+
}
|
|
121269
|
+
|
|
121155
121270
|
this.UPCOLOR=function(color)
|
|
121156
121271
|
{
|
|
121157
121272
|
return color;
|
|
@@ -128197,6 +128312,7 @@ function JSExecute(ast,option)
|
|
|
128197
128312
|
let xOffset=null, yOffset=null;
|
|
128198
128313
|
var klineType=null;
|
|
128199
128314
|
var lineDash=null;
|
|
128315
|
+
var font=null;
|
|
128200
128316
|
for(let j=0; j<item.Expression.Expression.length; ++j)
|
|
128201
128317
|
{
|
|
128202
128318
|
let itemExpression=item.Expression.Expression[j];
|
|
@@ -128313,6 +128429,10 @@ function JSExecute(ast,option)
|
|
|
128313
128429
|
{
|
|
128314
128430
|
downColor=itemExpression.Out;
|
|
128315
128431
|
}
|
|
128432
|
+
else if (itemExpression.Callee.Name=="CSSFONT")
|
|
128433
|
+
{
|
|
128434
|
+
font=itemExpression.Out;
|
|
128435
|
+
}
|
|
128316
128436
|
else if (itemExpression.Callee.Name=="STICKTYPE")
|
|
128317
128437
|
{
|
|
128318
128438
|
stickType=itemExpression.Out;
|
|
@@ -128515,6 +128635,7 @@ function JSExecute(ast,option)
|
|
|
128515
128635
|
if (drawAlign>=0) outVar.DrawAlign=drawAlign;
|
|
128516
128636
|
if (drawVAlign>=0) outVar.DrawVAlign=drawVAlign;
|
|
128517
128637
|
if (fontSize>0) outVar.DrawFontSize=fontSize;
|
|
128638
|
+
if (font) outVar.Font=font;
|
|
128518
128639
|
if (bgConfig) outVar.Background=bgConfig;
|
|
128519
128640
|
if (vLineConfig) outVar.VerticalLine=vLineConfig;
|
|
128520
128641
|
if (IFrameSplitOperator.IsNumber(xOffset)) outVar.XOffset=xOffset;
|
|
@@ -129015,6 +129136,9 @@ function JSExecute(ast,option)
|
|
|
129015
129136
|
case "DOWNCOLOR":
|
|
129016
129137
|
node.Out=this.Draw.DOWNCOLOR(args[0]);
|
|
129017
129138
|
break;
|
|
129139
|
+
case "CSSFONT":
|
|
129140
|
+
node.Out=this.Draw.CSSFONT(args[0]);
|
|
129141
|
+
break;
|
|
129018
129142
|
case "STICKTYPE": //柱子类型
|
|
129019
129143
|
node.Out=this.Draw.STICKTYPE(args[0]);
|
|
129020
129144
|
break;
|
|
@@ -131729,6 +131853,7 @@ function ScriptIndex(name,script,args,option)
|
|
|
131729
131853
|
}
|
|
131730
131854
|
|
|
131731
131855
|
if (varItem.DrawFontSize>0) chartText.FixedFontSize=varItem.DrawFontSize;
|
|
131856
|
+
if (varItem.Font) chartText.Font=varItem.Font;
|
|
131732
131857
|
if (varItem.Background) chartText.TextBG=varItem.Background;
|
|
131733
131858
|
if (varItem.VerticalLine) chartText.VerticalLine=varItem.VerticalLine;
|
|
131734
131859
|
|
|
@@ -131884,6 +132009,12 @@ function ScriptIndex(name,script,args,option)
|
|
|
131884
132009
|
let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
|
|
131885
132010
|
if (!isNaN(width) && width>0) line.LineWidth=width;
|
|
131886
132011
|
}
|
|
132012
|
+
|
|
132013
|
+
if (varItem.IsDotLine)
|
|
132014
|
+
{
|
|
132015
|
+
line.IsDotLine=true; //虚线
|
|
132016
|
+
line.LineDash=g_JSChartResource.DOTLINE.LineDash.slice();
|
|
132017
|
+
}
|
|
131887
132018
|
|
|
131888
132019
|
let titleIndex=windowIndex+1;
|
|
131889
132020
|
line.Data.Data=varItem.Draw.DrawData;
|
|
@@ -134118,6 +134249,7 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
134118
134249
|
}
|
|
134119
134250
|
|
|
134120
134251
|
if (varItem.DrawFontSize>0) chartText.FixedFontSize=varItem.DrawFontSize;
|
|
134252
|
+
if (varItem.Font) chartText.Font=varItem.Font;
|
|
134121
134253
|
if (varItem.Background) chartText.TextBG=varItem.Background;
|
|
134122
134254
|
if (varItem.VerticalLine) chartText.VerticalLine=varItem.VerticalLine;
|
|
134123
134255
|
if (IFrameSplitOperator.IsNumber(varItem.XOffset)) chartText.ShowOffset.X=varItem.XOffset;
|
|
@@ -134316,6 +134448,12 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
134316
134448
|
let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
|
|
134317
134449
|
if (!isNaN(width) && width>0) chart.LineWidth=width;
|
|
134318
134450
|
}
|
|
134451
|
+
|
|
134452
|
+
if (varItem.IsDotLine)
|
|
134453
|
+
{
|
|
134454
|
+
chart.IsDotLine=true; //虚线
|
|
134455
|
+
chart.LineDash=g_JSChartResource.DOTLINE.LineDash.slice();
|
|
134456
|
+
}
|
|
134319
134457
|
|
|
134320
134458
|
let titleIndex=windowIndex+1;
|
|
134321
134459
|
chart.Data.Data=varItem.Draw.DrawData;
|
|
@@ -136113,14 +136251,14 @@ function APIScriptIndex(name,script,args,option, isOverlay)
|
|
|
136113
136251
|
var indexData=[];
|
|
136114
136252
|
var outVarItem={Name:item.name,Type:item.type};
|
|
136115
136253
|
if (item.color) outVarItem.Color=item.color;
|
|
136254
|
+
else if (item.Color) outVarItem.Color=item.Color;
|
|
136116
136255
|
if (IFrameSplitOperator.IsBool(item.IsShowTitle)) outVarItem.IsShowTitle = item.IsShowTitle; //是否显示指标标题
|
|
136117
136256
|
if (IFrameSplitOperator.IsNumber(item.DrawVAlign)) outVarItem.DrawVAlign = item.DrawVAlign;
|
|
136118
136257
|
if (IFrameSplitOperator.IsNumber(item.DrawAlign)) outVarItem.DrawAlign = item.DrawAlign;
|
|
136258
|
+
if (item.Font) outVarItem.Font=item.Font;
|
|
136119
136259
|
if (item.data)
|
|
136120
136260
|
{
|
|
136121
136261
|
outVarItem.Data=this.FittingArray(item.data,date,time,hqChart);
|
|
136122
|
-
|
|
136123
|
-
if (item.color) outVarItem.Color=item.color;
|
|
136124
136262
|
if (item.linewidth) outVarItem.LineWidth=item.linewidth;
|
|
136125
136263
|
if (IFrameSplitOperator.IsBool(item.isshow)) outVarItem.IsShow = item.isshow; //是否绘制线段
|
|
136126
136264
|
if (item.isexdata==true) outVarItem.IsExData = true;
|
|
@@ -136160,6 +136298,18 @@ function APIScriptIndex(name,script,args,option, isOverlay)
|
|
|
136160
136298
|
|
|
136161
136299
|
result.push(outVarItem);
|
|
136162
136300
|
}
|
|
136301
|
+
else if (draw.DrawType=="DRAWTEXT_FIX")
|
|
136302
|
+
{
|
|
136303
|
+
drawItem.Text=draw.Text;
|
|
136304
|
+
drawItem.Name=draw.Name;
|
|
136305
|
+
drawItem.DrawType=draw.DrawType;
|
|
136306
|
+
drawItem.DrawData={ Value:null, Text:null };
|
|
136307
|
+
drawItem.DrawData.Value=this.FittingArray(draw.DrawData.Value,date,time,hqChart);
|
|
136308
|
+
drawItem.DrawData.Text=this.FittingArray(draw.DrawData.Text,date,time,hqChart);
|
|
136309
|
+
drawItem.Position=draw.Position;
|
|
136310
|
+
outVarItem.Draw=drawItem;
|
|
136311
|
+
result.push(outVarItem);
|
|
136312
|
+
}
|
|
136163
136313
|
else if (draw.DrawType=="VERTLINE") //竖线
|
|
136164
136314
|
{
|
|
136165
136315
|
drawItem.Text=draw.Text;
|
|
@@ -154848,7 +154998,7 @@ function ScrollBarBGChart()
|
|
|
154848
154998
|
|
|
154849
154999
|
|
|
154850
155000
|
|
|
154851
|
-
var HQCHART_VERSION="1.1.
|
|
155001
|
+
var HQCHART_VERSION="1.1.15298";
|
|
154852
155002
|
|
|
154853
155003
|
function PrintHQChartVersion()
|
|
154854
155004
|
{
|