hqchart 1.1.13311 → 1.1.13318
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 +63 -41
- package/package.json +1 -1
- package/src/jscommon/umychart.DialogDrawTool.js +200 -2
- package/src/jscommon/umychart.complier.js +30 -12
- package/src/jscommon/umychart.js +273 -4
- package/src/jscommon/umychart.resource/css/tools.css +35 -0
- package/src/jscommon/umychart.resource/font/drawtool/demo_index.html +49 -3
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.css +11 -3
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.js +1 -1
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.json +14 -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 +304 -17
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +504 -19
|
@@ -5585,6 +5585,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5585
5585
|
|
|
5586
5586
|
//画图工具
|
|
5587
5587
|
if (option.EnableDrawToolDialogV2===true) chart.InitalDrawToolDialog();
|
|
5588
|
+
if (option.EnableModifyDrawDialogV2===true) chart.InitalModifyDrawDialog();
|
|
5588
5589
|
|
|
5589
5590
|
//注册事件
|
|
5590
5591
|
if (option.EventCallback)
|
|
@@ -6847,6 +6848,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
6847
6848
|
this.IsShowRightMenu=true; //显示右键菜单
|
|
6848
6849
|
|
|
6849
6850
|
this.DialogDrawTool; //画图工具
|
|
6851
|
+
this.DialogModifyDraw; //画图修改
|
|
6850
6852
|
|
|
6851
6853
|
|
|
6852
6854
|
this.ClearStockCache=function()
|
|
@@ -6871,6 +6873,15 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
6871
6873
|
this.DialogDrawTool.Create();
|
|
6872
6874
|
}
|
|
6873
6875
|
|
|
6876
|
+
this.InitalModifyDrawDialog=function()
|
|
6877
|
+
{
|
|
6878
|
+
if ( this.DialogModifyDraw) return;
|
|
6879
|
+
|
|
6880
|
+
this.DialogModifyDraw=new JSDialogModifyDraw();
|
|
6881
|
+
this.DialogModifyDraw.Inital(this);
|
|
6882
|
+
this.DialogModifyDraw.Create();
|
|
6883
|
+
}
|
|
6884
|
+
|
|
6874
6885
|
this.ShowDrawToolDialog=function(x,y)
|
|
6875
6886
|
{
|
|
6876
6887
|
if (!this.DialogDrawTool) return;
|
|
@@ -6893,6 +6904,31 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
6893
6904
|
return this.DialogDrawTool.IsShow();
|
|
6894
6905
|
}
|
|
6895
6906
|
|
|
6907
|
+
this.ShowModifyDrawDialog=function(chart, x,y)
|
|
6908
|
+
{
|
|
6909
|
+
if (!this.DialogModifyDraw) return;
|
|
6910
|
+
|
|
6911
|
+
this.DialogModifyDraw.SetChartPicture(chart);
|
|
6912
|
+
if (this.DialogModifyDraw.IsShow()) return;
|
|
6913
|
+
|
|
6914
|
+
var rtClient=this.UIElement.getBoundingClientRect();
|
|
6915
|
+
var rtScroll=GetScrollPosition();
|
|
6916
|
+
|
|
6917
|
+
var top=this.UIElement.offsetTop+15;
|
|
6918
|
+
var left=(this.UIElement.offsetWidth-this.DialogModifyDraw.DivDialog.offsetWidth)/2;
|
|
6919
|
+
left+=rtClient.left+rtScroll.Left;
|
|
6920
|
+
top+=rtClient.top+rtScroll.Top;
|
|
6921
|
+
|
|
6922
|
+
this.DialogModifyDraw.Show(left, top);
|
|
6923
|
+
}
|
|
6924
|
+
|
|
6925
|
+
this.CloseModifyDrawDialog=function()
|
|
6926
|
+
{
|
|
6927
|
+
if (!this.DialogModifyDraw) return;
|
|
6928
|
+
|
|
6929
|
+
this.DialogModifyDraw.Close();
|
|
6930
|
+
}
|
|
6931
|
+
|
|
6896
6932
|
//obj={ Element:, Canvas: }
|
|
6897
6933
|
this.SetCorssCursorElement=function(obj)
|
|
6898
6934
|
{
|
|
@@ -7572,6 +7608,9 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7572
7608
|
}
|
|
7573
7609
|
}
|
|
7574
7610
|
|
|
7611
|
+
|
|
7612
|
+
if (!this.SelectChartDrawPicture) this.CloseModifyDrawDialog(); //当前没有选中画图 隐藏画图修改框
|
|
7613
|
+
|
|
7575
7614
|
document.onmousemove=(e)=>{ this.DocOnMouseMove(e); }
|
|
7576
7615
|
document.onmouseup=(e)=> { this.DocOnMouseUp(e); }
|
|
7577
7616
|
|
|
@@ -10266,6 +10305,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
10266
10305
|
this.SelectChartDrawPicture=null;
|
|
10267
10306
|
if (this.ChartPictureMenu) this.ChartPictureMenu.Hide();
|
|
10268
10307
|
this.ClearChartDrawPicture(drawPicture); //删除选中的画图工具
|
|
10308
|
+
this.CloseModifyDrawDialog();
|
|
10269
10309
|
}
|
|
10270
10310
|
else if (this.SelectedChart && this.SelectedChart.Selected.Identify)
|
|
10271
10311
|
{
|
|
@@ -11972,11 +12012,23 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
11972
12012
|
this.OnSelectChartPicture=function(chart)
|
|
11973
12013
|
{
|
|
11974
12014
|
JSConsole.Chart.Log('[JSChartContainer::OnSelectChartPicture]',chart);
|
|
11975
|
-
if (!this.ChartPictureMenu) this.ChartPictureMenu=g_DialogFactory.Create('ChartPictureSettingMenu', this.UIElement.parentNode);
|
|
11976
|
-
if (!this.ChartPictureMenu) return;
|
|
11977
12015
|
|
|
11978
|
-
|
|
11979
|
-
|
|
12016
|
+
if (!this.DialogModifyDraw) return;
|
|
12017
|
+
|
|
12018
|
+
if (chart.ClassName=="ChartDrawPictureText" || chart.ClassName=='ChartDrawVolProfile')
|
|
12019
|
+
{
|
|
12020
|
+
this.CloseModifyDrawDialog();
|
|
12021
|
+
|
|
12022
|
+
if (!this.ChartPictureMenu) this.ChartPictureMenu=g_DialogFactory.Create('ChartPictureSettingMenu', this.UIElement.parentNode);
|
|
12023
|
+
if (!this.ChartPictureMenu) return;
|
|
12024
|
+
|
|
12025
|
+
var event={ data: { ChartPicture:chart, HQChart:this}};
|
|
12026
|
+
this.ChartPictureMenu.DoModal(event);
|
|
12027
|
+
}
|
|
12028
|
+
else
|
|
12029
|
+
{
|
|
12030
|
+
this.ShowModifyDrawDialog(chart);
|
|
12031
|
+
}
|
|
11980
12032
|
}
|
|
11981
12033
|
|
|
11982
12034
|
this.FinishMoveChartDrawPicture=function()
|
|
@@ -59523,6 +59575,8 @@ IChartDrawPicture.ArrayDrawPricture=
|
|
|
59523
59575
|
|
|
59524
59576
|
{ Name:"水平线2", ClassName:"ChartDrawHLine", Create:function() { return new ChartDrawHLine(); }},
|
|
59525
59577
|
|
|
59578
|
+
{ Name:"MonitorLine", ClassName:"ChartDrawMonitorLine", Create:function() { return new ChartDrawMonitorLine(); }},
|
|
59579
|
+
|
|
59526
59580
|
|
|
59527
59581
|
//trading view样式
|
|
59528
59582
|
{ Name:"Note", ClassName:"ChartDrawNote", Create:function() { return new ChartDrawNote(); } },
|
|
@@ -64378,6 +64432,221 @@ function ChartDrawCrosshair()
|
|
|
64378
64432
|
}
|
|
64379
64433
|
}
|
|
64380
64434
|
|
|
64435
|
+
//画图工具-监测线
|
|
64436
|
+
function ChartDrawMonitorLine()
|
|
64437
|
+
{
|
|
64438
|
+
this.newMethod=IChartDrawPicture; //派生
|
|
64439
|
+
this.newMethod();
|
|
64440
|
+
delete this.newMethod;
|
|
64441
|
+
|
|
64442
|
+
this.ClassName='ChartDrawMonitorLine';
|
|
64443
|
+
this.PointCount=1;
|
|
64444
|
+
this.IsPointIn=this.IsPointIn_XYValue_Line;
|
|
64445
|
+
this.IsHScreen=false;
|
|
64446
|
+
this.GetXYCoordinate=this.GetXYCoordinate_default;
|
|
64447
|
+
this.FormatLabelTextCallback=null;
|
|
64448
|
+
|
|
64449
|
+
this.LineColor='rgb(255,215,0)'
|
|
64450
|
+
this.LabelConfig=
|
|
64451
|
+
{
|
|
64452
|
+
Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
|
|
64453
|
+
BGColor:"rgb(30,144,255)", YTextOffset:4,
|
|
64454
|
+
LineColor:"rgba(255,215,0,0.8)",
|
|
64455
|
+
LineDash:[3,5],
|
|
64456
|
+
}
|
|
64457
|
+
|
|
64458
|
+
this.SetOption=function(option)
|
|
64459
|
+
{
|
|
64460
|
+
if (option.LineColor) this.LineColor=option.LineColor;
|
|
64461
|
+
if (option.Label)
|
|
64462
|
+
{
|
|
64463
|
+
var item=option.Label;
|
|
64464
|
+
var dest=this.LabelConfig
|
|
64465
|
+
if (item.Font) dest.Font=item.Font;
|
|
64466
|
+
if (item.BGColor) dest.BGColor=item.BGColor;
|
|
64467
|
+
if (item.LineColor) dest.LineColor=item.LineColor;
|
|
64468
|
+
if (item.LineDash) dest.LineDash=item.LineDash;
|
|
64469
|
+
if (IFrameSplitOperator.IsNumber(item.YTextOffset)) dest.YTextOffset=item.YTextOffset;
|
|
64470
|
+
}
|
|
64471
|
+
|
|
64472
|
+
if (option.FormatLabelTextCallback) this.FormatLabelTextCallback=option.FormatLabelTextCallback;
|
|
64473
|
+
}
|
|
64474
|
+
|
|
64475
|
+
this.Draw=function()
|
|
64476
|
+
{
|
|
64477
|
+
this.LinePoint=[];
|
|
64478
|
+
if (this.IsFrameMinSize()) return;
|
|
64479
|
+
if (!this.IsShow) return;
|
|
64480
|
+
|
|
64481
|
+
if (!this.Frame || !this.Frame.Data) return;
|
|
64482
|
+
var data=this.Frame.Data;
|
|
64483
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(data.Data)) return;
|
|
64484
|
+
|
|
64485
|
+
if (this.Point.length!=1) return;
|
|
64486
|
+
if (this.Value.length!=1) return;
|
|
64487
|
+
this.IsHScreen=this.Frame.IsHScreen;
|
|
64488
|
+
if (this.IsHScreen) return;
|
|
64489
|
+
|
|
64490
|
+
if (this.Status==20) this.DrawMoveLine();
|
|
64491
|
+
else if (this.Status==10) this.DrawMonitorLine(data);
|
|
64492
|
+
}
|
|
64493
|
+
|
|
64494
|
+
this.DrawMoveLine=function()
|
|
64495
|
+
{
|
|
64496
|
+
var border=this.Frame.ChartBorder.GetBorder();
|
|
64497
|
+
var pt=this.Point[0];
|
|
64498
|
+
var x=ToFixedPoint(pt.X);
|
|
64499
|
+
this.ClipFrame();
|
|
64500
|
+
|
|
64501
|
+
this.Canvas.strokeStyle=this.LineColor;
|
|
64502
|
+
this.Canvas.beginPath();
|
|
64503
|
+
this.Canvas.moveTo(x,border.TopEx);
|
|
64504
|
+
this.Canvas.lineTo(x,border.BottomEx);
|
|
64505
|
+
this.Canvas.stroke();
|
|
64506
|
+
|
|
64507
|
+
this.Canvas.restore();
|
|
64508
|
+
}
|
|
64509
|
+
|
|
64510
|
+
this.DrawMonitorLine=function(data)
|
|
64511
|
+
{
|
|
64512
|
+
var isMinute=this.Frame.IsMinuteFrame();
|
|
64513
|
+
var dataWidth=this.Frame.DataWidth;
|
|
64514
|
+
var distanceWidth=this.Frame.DistanceWidth;
|
|
64515
|
+
var xPointCount=this.Frame.XPointCount;
|
|
64516
|
+
|
|
64517
|
+
if (this.IsHScreen)
|
|
64518
|
+
{
|
|
64519
|
+
//var border=this.Frame.ChartBorder.GetHScreenBorder();
|
|
64520
|
+
//var chartright=border.BottomEx;
|
|
64521
|
+
//var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
|
|
64522
|
+
}
|
|
64523
|
+
else
|
|
64524
|
+
{
|
|
64525
|
+
var border=this.Frame.ChartBorder.GetBorder();
|
|
64526
|
+
var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
|
|
64527
|
+
var chartright=border.RightEx;
|
|
64528
|
+
}
|
|
64529
|
+
|
|
64530
|
+
var ptData=this.Value[0];
|
|
64531
|
+
this.ClipFrame();
|
|
64532
|
+
|
|
64533
|
+
var labelInfo=null;
|
|
64534
|
+
for(var i=data.DataOffset,j=0;i<data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth))
|
|
64535
|
+
{
|
|
64536
|
+
var item=data.Data[i];
|
|
64537
|
+
|
|
64538
|
+
if (isMinute)
|
|
64539
|
+
{
|
|
64540
|
+
var x=this.Frame.GetXFromIndex(j);
|
|
64541
|
+
}
|
|
64542
|
+
else
|
|
64543
|
+
{
|
|
64544
|
+
var left=xOffset;
|
|
64545
|
+
var right=xOffset+dataWidth;
|
|
64546
|
+
if (right>chartright) break;
|
|
64547
|
+
var x=left+(right-left)/2;
|
|
64548
|
+
}
|
|
64549
|
+
|
|
64550
|
+
if (i==ptData.XValue) //起始
|
|
64551
|
+
{
|
|
64552
|
+
this.Canvas.strokeStyle=this.LineColor;
|
|
64553
|
+
this.Canvas.beginPath();
|
|
64554
|
+
this.Canvas.moveTo(x,border.TopEx);
|
|
64555
|
+
this.Canvas.lineTo(x,border.BottomEx);
|
|
64556
|
+
this.Canvas.stroke();
|
|
64557
|
+
|
|
64558
|
+
var line={Start:{X:x, Y:border.TopEx}, End:{X:x, Y:border.BottomEx}};
|
|
64559
|
+
this.LinePoint.push(line);
|
|
64560
|
+
}
|
|
64561
|
+
else if (i==data.Data.length-1) //结束
|
|
64562
|
+
{
|
|
64563
|
+
if (this.LabelConfig.LineDash) this.Canvas.setLineDash(this.LabelConfig.LineDash);
|
|
64564
|
+
this.Canvas.strokeStyle=this.LabelConfig.LineColor;
|
|
64565
|
+
this.Canvas.beginPath();
|
|
64566
|
+
this.Canvas.moveTo(x,border.TopEx);
|
|
64567
|
+
this.Canvas.lineTo(x,border.BottomEx);
|
|
64568
|
+
this.Canvas.stroke();
|
|
64569
|
+
if (this.LabelConfig.LineDash) this.Canvas.setLineDash([]);
|
|
64570
|
+
|
|
64571
|
+
labelInfo={ Left:right, Data:data, StartIndex:ptData.XValue, AryText:[] };
|
|
64572
|
+
}
|
|
64573
|
+
}
|
|
64574
|
+
|
|
64575
|
+
this.Canvas.restore();
|
|
64576
|
+
|
|
64577
|
+
if (labelInfo) this.DrawLabel(labelInfo);
|
|
64578
|
+
}
|
|
64579
|
+
|
|
64580
|
+
this.DrawLabel=function(labelInfo)
|
|
64581
|
+
{
|
|
64582
|
+
if (!this.FormatLabelTextCallback) return;
|
|
64583
|
+
this.FormatLabelTextCallback(labelInfo);
|
|
64584
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(labelInfo.AryText)) return;
|
|
64585
|
+
if (!IFrameSplitOperator.IsNumber(labelInfo.YValue)) return;
|
|
64586
|
+
|
|
64587
|
+
/*
|
|
64588
|
+
labelInfo.YValue=7.15;
|
|
64589
|
+
labelInfo.AryText=
|
|
64590
|
+
[
|
|
64591
|
+
{ Name:"标题1:", Text:"6666", NameColor:"rgb(255,255,255)", TextColor:"rgb(30,10,30)" },
|
|
64592
|
+
{ Name:"标题2:", Text:"08.00", NameColor:"rgb(255,255,255)", TextColor:"rgb(30,10,30)" },
|
|
64593
|
+
{ Name:"标题3:", Text:"999.1", NameColor:"rgb(255,255,255)", TextColor:"rgb(30,10,30)" },
|
|
64594
|
+
{ Name:"标题4:", Text:"320" , NameColor:"rgb(255,255,255)", TextColor:"rgb(30,10,30)"},
|
|
64595
|
+
{ Name:"标题5:", Text:"77775.77", NameColor:"rgb(255,255,255)", TextColor:"rgb(30,10,30)" }
|
|
64596
|
+
]
|
|
64597
|
+
*/
|
|
64598
|
+
|
|
64599
|
+
var y=this.Frame.GetYFromData(labelInfo.YValue,false);
|
|
64600
|
+
this.Canvas.font=this.LabelConfig.Font;
|
|
64601
|
+
this.Canvas.textAlign="left";
|
|
64602
|
+
this.Canvas.textBaseline="top";
|
|
64603
|
+
var lineHeight=this.Canvas.measureText("擎").width+2;
|
|
64604
|
+
var maxWidth=0, lineCount=0;
|
|
64605
|
+
for(var i=0;i<labelInfo.AryText.length;++i)
|
|
64606
|
+
{
|
|
64607
|
+
var item=labelInfo.AryText[i];
|
|
64608
|
+
item.NameWidth=0;
|
|
64609
|
+
item.TextWidth=0;
|
|
64610
|
+
if (item.Name) item.NameWidth=this.Canvas.measureText(item.Name).width+2;
|
|
64611
|
+
if (item.Text) item.TextWidth=this.Canvas.measureText(item.Text).width+2;
|
|
64612
|
+
|
|
64613
|
+
var itemWidth=item.NameWidth+item.TextWidth;
|
|
64614
|
+
if (maxWidth<itemWidth) maxWidth=itemWidth;
|
|
64615
|
+
++lineCount;
|
|
64616
|
+
}
|
|
64617
|
+
|
|
64618
|
+
var rtBG={ Left:labelInfo.Left+1, Top:y, Width:maxWidth+4, Height:lineHeight*lineCount+4 };
|
|
64619
|
+
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
64620
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
64621
|
+
if (this.LabelConfig.BGColor)
|
|
64622
|
+
{
|
|
64623
|
+
this.Canvas.fillStyle=this.LabelConfig.BGColor
|
|
64624
|
+
this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));
|
|
64625
|
+
}
|
|
64626
|
+
|
|
64627
|
+
var xText=rtBG.Left+2;
|
|
64628
|
+
var yText=rtBG.Top+this.LabelConfig.YTextOffset;
|
|
64629
|
+
for(var i=0;i<labelInfo.AryText.length;++i)
|
|
64630
|
+
{
|
|
64631
|
+
var item=labelInfo.AryText[i];
|
|
64632
|
+
|
|
64633
|
+
if (item.Name)
|
|
64634
|
+
{
|
|
64635
|
+
this.Canvas.fillStyle=item.NameColor;
|
|
64636
|
+
this.Canvas.fillText(item.Name,xText,yText);
|
|
64637
|
+
}
|
|
64638
|
+
|
|
64639
|
+
if (item.Text)
|
|
64640
|
+
{
|
|
64641
|
+
this.Canvas.fillStyle=item.TextColor;
|
|
64642
|
+
this.Canvas.fillText(item.Text,xText+item.NameWidth ,yText);
|
|
64643
|
+
}
|
|
64644
|
+
|
|
64645
|
+
yText+=lineHeight;
|
|
64646
|
+
}
|
|
64647
|
+
}
|
|
64648
|
+
}
|
|
64649
|
+
|
|
64381
64650
|
//画图工具-波浪尺
|
|
64382
64651
|
function ChartDrawWaveRuler()
|
|
64383
64652
|
{
|
|
@@ -111570,6 +111839,7 @@ JSSymbolData.prototype.JsonDataToFinance=function(data)
|
|
|
111570
111839
|
|
|
111571
111840
|
var JS_EXECUTE_DEBUG_LOG=false;
|
|
111572
111841
|
|
|
111842
|
+
|
|
111573
111843
|
var JS_EXECUTE_JOB_ID=
|
|
111574
111844
|
{
|
|
111575
111845
|
JOB_DOWNLOAD_SYMBOL_DATA:1, //下载股票的K线数据
|
|
@@ -113697,9 +113967,10 @@ function JSExplainer(ast,option)
|
|
|
113697
113967
|
if (!this.AST) this.ThrowError();
|
|
113698
113968
|
if (!this.AST.Body) this.ThrowError();
|
|
113699
113969
|
|
|
113700
|
-
for(
|
|
113970
|
+
for(var i=0; i<this.AST.Body.length; ++i)
|
|
113701
113971
|
{
|
|
113702
|
-
|
|
113972
|
+
//console.log(`[JSExplainer::RunAST] ${i}`);
|
|
113973
|
+
var item =this.AST.Body[i];
|
|
113703
113974
|
this.VisitNode(item);
|
|
113704
113975
|
|
|
113705
113976
|
//输出变量
|
|
@@ -113822,7 +114093,7 @@ function JSExplainer(ast,option)
|
|
|
113822
114093
|
{
|
|
113823
114094
|
varName=itemExpression.Left.Name;
|
|
113824
114095
|
let varValue=this.VarTable.get(varName);
|
|
113825
|
-
this.VarTable.set(varName,varValue); //把常量放到变量表里
|
|
114096
|
+
this.VarTable.set(varName,this.ConvertToShortValue(varValue)); //把常量放到变量表里
|
|
113826
114097
|
}
|
|
113827
114098
|
else if (itemExpression.Type==Syntax.Identifier)
|
|
113828
114099
|
{
|
|
@@ -113860,7 +114131,7 @@ function JSExplainer(ast,option)
|
|
|
113860
114131
|
let varValue=this.ReadVariable(varName,itemExpression);
|
|
113861
114132
|
varName="__temp_si_"+i+"__";
|
|
113862
114133
|
isNoneName=true;
|
|
113863
|
-
this.VarTable.set(varName,varValue); //放到变量表里
|
|
114134
|
+
this.VarTable.set(varName,this.ConvertToShortValue(varValue)); //放到变量表里
|
|
113864
114135
|
}
|
|
113865
114136
|
}
|
|
113866
114137
|
else if(itemExpression.Type==Syntax.Literal) //常量
|
|
@@ -114065,7 +114336,7 @@ function JSExplainer(ast,option)
|
|
|
114065
114336
|
return node.Out;
|
|
114066
114337
|
}
|
|
114067
114338
|
|
|
114068
|
-
JSConsole.Complier.Log('[JSExplainer::VisitCallExpression]' , funcName, '(', args.toString() ,')');
|
|
114339
|
+
if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExplainer::VisitCallExpression]' , funcName, '(', args.toString() ,')');
|
|
114069
114340
|
|
|
114070
114341
|
if (g_JSComplierResource.IsCustomFunction(funcName))
|
|
114071
114342
|
{
|
|
@@ -114092,6 +114363,8 @@ function JSExplainer(ast,option)
|
|
|
114092
114363
|
["BARSLASTCOUNT", { Name:"BARSLASTCOUNT", Param:{ Count:1 }, ToString:function(args) { return `条件${args[0]}连续成立次数`; } } ],
|
|
114093
114364
|
["BARSCOUNT", { Name:"BARSCOUNT", Param:{ Count:1 }, ToString:function(args) { return `${args[0]}有效数据周期数`; } } ],
|
|
114094
114365
|
["BARSLAST", { Name:"BARSLAST", Param:{ Count:1 }, ToString:function(args) { return `上次${args[0]}不为0距今天数`; } } ],
|
|
114366
|
+
["BARSLASTS", { Name:"BARSLASTS", Param:{ Count:2 }, ToString:function(args) { return `倒数第N次成立时距今的周期数`; } } ],
|
|
114367
|
+
|
|
114095
114368
|
["BARSNEXT", { Name:"BARSNEXT", Param:{ Count:1 }, ToString:function(args) { return `下次${args[0]}不为0距今天数`; } } ],
|
|
114096
114369
|
["BARSSINCEN", { Name:"BARSSINCEN", Param:{ Count:2 }, ToString:function(args) { return `在${args[1]}周期内首次${args[0]}距今天数`; } } ],
|
|
114097
114370
|
["BARSSINCE", { Name:"BARSSINCE", Param:{ Count:1 }, ToString:function(args) { return `首次${args[0]}距今天数`; } } ],
|
|
@@ -114259,7 +114532,7 @@ function JSExplainer(ast,option)
|
|
|
114259
114532
|
if (item.Param.Count!=args.length)
|
|
114260
114533
|
this.ThrowUnexpectedNode(node,`函数${funcName}参数个数不正确. 需要${item.Param.Count}个参数`);
|
|
114261
114534
|
}
|
|
114262
|
-
|
|
114535
|
+
|
|
114263
114536
|
return item.ToString(args);
|
|
114264
114537
|
}
|
|
114265
114538
|
|
|
@@ -114536,8 +114809,22 @@ function JSExplainer(ast,option)
|
|
|
114536
114809
|
else if (right.Type==Syntax.UnaryExpression)
|
|
114537
114810
|
value=this.VisitUnaryExpression(right);
|
|
114538
114811
|
|
|
114539
|
-
JSConsole.Complier.Log('[JSExplainer::VisitAssignmentExpression]' , varName, ' = ',value);
|
|
114540
|
-
|
|
114812
|
+
if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExplainer::VisitAssignmentExpression]' , varName, ' = ',value);
|
|
114813
|
+
|
|
114814
|
+
this.VarTable.set(varName,this.ConvertToShortValue(value));
|
|
114815
|
+
}
|
|
114816
|
+
|
|
114817
|
+
this.ConvertToShortValue=function(value)
|
|
114818
|
+
{
|
|
114819
|
+
var maxLength=80;
|
|
114820
|
+
if (value && value.length>=maxLength)
|
|
114821
|
+
{
|
|
114822
|
+
var shortValue=value.slice(0, maxLength-10);
|
|
114823
|
+
shortValue+="......";
|
|
114824
|
+
return shortValue;
|
|
114825
|
+
}
|
|
114826
|
+
|
|
114827
|
+
return value;
|
|
114541
114828
|
}
|
|
114542
114829
|
|
|
114543
114830
|
this.ReadMemberVariable=function(node)
|
|
@@ -114597,7 +114884,7 @@ function JSExplainer(ast,option)
|
|
|
114597
114884
|
let leftValue=this.GetNodeValue(value.Left);
|
|
114598
114885
|
let rightValue=this.GetNodeValue(value.Right);
|
|
114599
114886
|
|
|
114600
|
-
JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] BinaryExpression',value , leftValue, rightValue);
|
|
114887
|
+
if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] BinaryExpression',value , leftValue, rightValue);
|
|
114601
114888
|
value.Out=null; //保存中间值
|
|
114602
114889
|
|
|
114603
114890
|
value.Out=`(${leftValue} ${value.Operator} ${rightValue})`;
|
|
@@ -114614,14 +114901,14 @@ function JSExplainer(ast,option)
|
|
|
114614
114901
|
else if (value.Operator=="=") value.Out='(平盘)';
|
|
114615
114902
|
}
|
|
114616
114903
|
|
|
114617
|
-
JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] BinaryExpression',value);
|
|
114904
|
+
if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] BinaryExpression',value);
|
|
114618
114905
|
}
|
|
114619
114906
|
else if (value.Type==Syntax.LogicalExpression)
|
|
114620
114907
|
{
|
|
114621
114908
|
let leftValue=this.GetNodeValue(value.Left);
|
|
114622
114909
|
let rightValue=this.GetNodeValue(value.Right);
|
|
114623
114910
|
|
|
114624
|
-
JSConsole.Complier.Log('[JSExecute::VisitBinaryExpression] LogicalExpression',value , leftValue, rightValue);
|
|
114911
|
+
if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExecute::VisitBinaryExpression] LogicalExpression',value , leftValue, rightValue);
|
|
114625
114912
|
value.Out=null; //保存中间值
|
|
114626
114913
|
|
|
114627
114914
|
switch(value.Operator)
|
|
@@ -114636,7 +114923,7 @@ function JSExplainer(ast,option)
|
|
|
114636
114923
|
break;
|
|
114637
114924
|
}
|
|
114638
114925
|
|
|
114639
|
-
JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] LogicalExpression',value);
|
|
114926
|
+
if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] LogicalExpression',value);
|
|
114640
114927
|
}
|
|
114641
114928
|
|
|
114642
114929
|
node=temp;
|
|
@@ -135347,6 +135634,7 @@ var JS_DRAWTOOL_MENU_ID=
|
|
|
135347
135634
|
CMD_DELETE_ALL_DRAW_CHART_ID:3,
|
|
135348
135635
|
CMD_ERASE_DRAW_CHART_ID:4,
|
|
135349
135636
|
CMD_ENABLE_MAGNET_ID:5, //画图工具磁体功能
|
|
135637
|
+
CMD_DELETE_DRAW_CHART_ID:6,
|
|
135350
135638
|
};
|
|
135351
135639
|
|
|
135352
135640
|
function JSDialogDrawTool()
|
|
@@ -135431,6 +135719,7 @@ function JSDialogDrawTool()
|
|
|
135431
135719
|
[
|
|
135432
135720
|
{ Title: '价格范围', ClassName: 'hqchart_drawtool icon-shijianfanwei', Type:0, Data:{ ID:"PriceRange" } },
|
|
135433
135721
|
{ Title: '时间范围', ClassName: 'hqchart_drawtool icon-jiagefanwei', Type:0, Data:{ ID:"DateRange" } },
|
|
135722
|
+
{ Title: "监测线", ClassName:"hqchart_drawtool icon-jiance", Type:0, Data:{ ID:"MonitorLine"} },
|
|
135434
135723
|
]
|
|
135435
135724
|
},
|
|
135436
135725
|
{
|
|
@@ -135848,8 +136137,10 @@ function JSDialogDrawTool()
|
|
|
135848
136137
|
if ((right+5)>=window.innerWidth) left=window.innerWidth-this.DivDialog.offsetWidth-5;
|
|
135849
136138
|
if ((bottom+5)>=window.innerHeight) top=window.innerHeight-this.DivDialog.offsetHeight-5;
|
|
135850
136139
|
|
|
135851
|
-
this.DivDialog.style.left = left + 'px'
|
|
135852
|
-
this.DivDialog.style.top = top + 'px'
|
|
136140
|
+
this.DivDialog.style.left = left + 'px';
|
|
136141
|
+
this.DivDialog.style.top = top + 'px';
|
|
136142
|
+
|
|
136143
|
+
if(e.preventDefault) e.preventDefault();
|
|
135853
136144
|
}
|
|
135854
136145
|
|
|
135855
136146
|
this.DocOnMouseUpTitle=function(e)
|
|
@@ -135871,6 +136162,200 @@ function JSDialogModifyDraw()
|
|
|
135871
136162
|
this.DivDialog=null;
|
|
135872
136163
|
this.HQChart;
|
|
135873
136164
|
this.ChartPicture;
|
|
136165
|
+
this.ColorButton=null;
|
|
136166
|
+
|
|
136167
|
+
this.RandomLineColor=["rgb(255,69,0)", "rgb(173,255,47)", "rgb(238,154,73)", "rgb(255,105,180)"];
|
|
136168
|
+
this.AryButton=
|
|
136169
|
+
[
|
|
136170
|
+
{ Title:"点击切换颜色", ClassName: 'hqchart_drawtool icon-fangkuai', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID }},
|
|
136171
|
+
{ Title:"删除", ClassName: 'hqchart_drawtool icon-recycle_bin', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_DELETE_DRAW_CHART_ID }}
|
|
136172
|
+
];
|
|
136173
|
+
|
|
136174
|
+
|
|
136175
|
+
this.Inital=function(hqchart)
|
|
136176
|
+
{
|
|
136177
|
+
this.HQChart=hqchart;
|
|
136178
|
+
}
|
|
136179
|
+
|
|
136180
|
+
this.Destroy=function()
|
|
136181
|
+
{
|
|
136182
|
+
this.ChartPicture=null;
|
|
136183
|
+
this.ColorButton=null;
|
|
136184
|
+
if (this.DivDialog)
|
|
136185
|
+
{
|
|
136186
|
+
document.body.remove(this.DivDialog);
|
|
136187
|
+
this.DivDialog=null;
|
|
136188
|
+
}
|
|
136189
|
+
}
|
|
136190
|
+
|
|
136191
|
+
this.Create=function()
|
|
136192
|
+
{
|
|
136193
|
+
var divDom=document.createElement("div");
|
|
136194
|
+
divDom.className='UMyChart_Draw_Modify_Dialog_Div';
|
|
136195
|
+
|
|
136196
|
+
var drgDiv=document.createElement("div");
|
|
136197
|
+
drgDiv.className="UMyChart_Draw_Modify_Dialog_Drag_Div";
|
|
136198
|
+
drgDiv.onmousedown=(e)=>{ this.OnMouseDownTitle(e); }
|
|
136199
|
+
divDom.appendChild(drgDiv);
|
|
136200
|
+
|
|
136201
|
+
var spanDom=document.createElement("span");
|
|
136202
|
+
spanDom.className="hqchart_drawtool icon-tuodong";
|
|
136203
|
+
spanDom.classList.add("UMyChart_DrawTool_Span");
|
|
136204
|
+
drgDiv.appendChild(spanDom);
|
|
136205
|
+
|
|
136206
|
+
for(var i=0;i<this.AryButton.length;++i)
|
|
136207
|
+
{
|
|
136208
|
+
var item=this.AryButton[i];
|
|
136209
|
+
this.CreateButtonItem(item, divDom);
|
|
136210
|
+
}
|
|
136211
|
+
|
|
136212
|
+
this.DivDialog=divDom;
|
|
136213
|
+
document.body.appendChild(divDom);
|
|
136214
|
+
}
|
|
136215
|
+
|
|
136216
|
+
this.CreateButtonItem=function(item, parentDivDom)
|
|
136217
|
+
{
|
|
136218
|
+
var divItem=document.createElement("div");
|
|
136219
|
+
divItem.className="UMyChart_Draw_Modify_Dialog_Button_Div";
|
|
136220
|
+
var spanDom=document.createElement("span");
|
|
136221
|
+
spanDom.className=item.ClassName;
|
|
136222
|
+
spanDom.classList.add("UMyChart_DrawTool_Span");
|
|
136223
|
+
divItem.appendChild(spanDom);
|
|
136224
|
+
|
|
136225
|
+
var data={ Span:spanDom, Parent:parentDivDom, Item:item };
|
|
136226
|
+
divItem.onmousedown=(e)=> { this.OnClickButton(e, data); }; //点击
|
|
136227
|
+
|
|
136228
|
+
if (item.Data.ID==JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID)
|
|
136229
|
+
this.ColorButton=data;
|
|
136230
|
+
|
|
136231
|
+
parentDivDom.appendChild(divItem);
|
|
136232
|
+
}
|
|
136233
|
+
|
|
136234
|
+
this.OnClickButton=function(e, data)
|
|
136235
|
+
{
|
|
136236
|
+
console.log('[JSDialogModifyDraw::OnClickButton] ', data);
|
|
136237
|
+
if (!data.Item || !data.Item.Data) return;
|
|
136238
|
+
|
|
136239
|
+
var id=data.Item.Data.ID;
|
|
136240
|
+
switch(id)
|
|
136241
|
+
{
|
|
136242
|
+
case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID:
|
|
136243
|
+
this.ModifyLineColor();
|
|
136244
|
+
break;
|
|
136245
|
+
case JS_DRAWTOOL_MENU_ID.CMD_DELETE_DRAW_CHART_ID:
|
|
136246
|
+
this.DeleteDrawPicture();
|
|
136247
|
+
break;
|
|
136248
|
+
}
|
|
136249
|
+
}
|
|
136250
|
+
|
|
136251
|
+
this.Close=function(e)
|
|
136252
|
+
{
|
|
136253
|
+
if (!this.DivDialog) return;
|
|
136254
|
+
|
|
136255
|
+
this.ChartPicture=null;
|
|
136256
|
+
this.DivDialog.style.visibility='hidden';
|
|
136257
|
+
}
|
|
136258
|
+
|
|
136259
|
+
this.IsShow=function()
|
|
136260
|
+
{
|
|
136261
|
+
if (!this.DivDialog) return false;
|
|
136262
|
+
return this.DivDialog.style.visibility==='visible';
|
|
136263
|
+
}
|
|
136264
|
+
|
|
136265
|
+
this.DeleteDrawPicture=function()
|
|
136266
|
+
{
|
|
136267
|
+
if (this.ChartPicture && this.HQChart)
|
|
136268
|
+
{
|
|
136269
|
+
this.HQChart.ClearChartDrawPicture(this.ChartPicture);
|
|
136270
|
+
}
|
|
136271
|
+
|
|
136272
|
+
this.Close();
|
|
136273
|
+
}
|
|
136274
|
+
|
|
136275
|
+
this.ModifyLineColor=function()
|
|
136276
|
+
{
|
|
136277
|
+
if (!this.ChartPicture || !this.HQChart) return;
|
|
136278
|
+
|
|
136279
|
+
var color=this.ChartPicture.LineColor;
|
|
136280
|
+
var colorIndex=0;
|
|
136281
|
+
for(var i=0;i<this.RandomLineColor.length;++i)
|
|
136282
|
+
{
|
|
136283
|
+
if (color==this.RandomLineColor[i])
|
|
136284
|
+
{
|
|
136285
|
+
colorIndex=i+1;
|
|
136286
|
+
break;
|
|
136287
|
+
}
|
|
136288
|
+
}
|
|
136289
|
+
|
|
136290
|
+
colorIndex=colorIndex%this.RandomLineColor.length;
|
|
136291
|
+
color=this.RandomLineColor[colorIndex];
|
|
136292
|
+
|
|
136293
|
+
this.ChartPicture.LineColor = color;
|
|
136294
|
+
this.ChartPicture.PointColor = color;
|
|
136295
|
+
|
|
136296
|
+
if (this.ColorButton) this.ColorButton.Span.style['color']=color;
|
|
136297
|
+
|
|
136298
|
+
if (this.HQChart.ChartDrawStorage) this.HQChart.ChartDrawStorage.SaveDrawData(this.ChartPicture); //保存下
|
|
136299
|
+
|
|
136300
|
+
this.HQChart.Draw();
|
|
136301
|
+
}
|
|
136302
|
+
|
|
136303
|
+
this.Show=function(x, y)
|
|
136304
|
+
{
|
|
136305
|
+
if (!this.DivDialog) this.Create();
|
|
136306
|
+
|
|
136307
|
+
this.DivDialog.style.visibility='visible';
|
|
136308
|
+
this.DivDialog.style.top = y + "px";
|
|
136309
|
+
this.DivDialog.style.left = x + "px";
|
|
136310
|
+
}
|
|
136311
|
+
|
|
136312
|
+
this.SetChartPicture=function(chart)
|
|
136313
|
+
{
|
|
136314
|
+
this.ChartPicture=chart;
|
|
136315
|
+
if (this.ColorButton)
|
|
136316
|
+
{
|
|
136317
|
+
this.ColorButton.Span.style['color']=chart.LineColor;
|
|
136318
|
+
}
|
|
136319
|
+
}
|
|
136320
|
+
|
|
136321
|
+
this.OnMouseDownTitle=function(e)
|
|
136322
|
+
{
|
|
136323
|
+
if (!this.DivDialog) return;
|
|
136324
|
+
|
|
136325
|
+
var dragData={ X:e.clientX, Y:e.clientY };
|
|
136326
|
+
dragData.YOffset=e.clientX - this.DivDialog.offsetLeft;
|
|
136327
|
+
dragData.XOffset=e.clientY - this.DivDialog.offsetTop;
|
|
136328
|
+
this.DragTitle=dragData;
|
|
136329
|
+
|
|
136330
|
+
document.onmousemove=(e)=>{ this.DocOnMouseMoveTitle(e); }
|
|
136331
|
+
document.onmouseup=(e)=>{ this.DocOnMouseUpTitle(e); }
|
|
136332
|
+
}
|
|
136333
|
+
|
|
136334
|
+
this.DocOnMouseMoveTitle=function(e)
|
|
136335
|
+
{
|
|
136336
|
+
if (!this.DragTitle) return;
|
|
136337
|
+
|
|
136338
|
+
var left = e.clientX - this.DragTitle.YOffset;
|
|
136339
|
+
var top = e.clientY - this.DragTitle.XOffset;
|
|
136340
|
+
|
|
136341
|
+
var right=left+this.DivDialog.offsetWidth;
|
|
136342
|
+
var bottom=top+ this.DivDialog.offsetHeight;
|
|
136343
|
+
|
|
136344
|
+
if ((right+5)>=window.innerWidth) left=window.innerWidth-this.DivDialog.offsetWidth-5;
|
|
136345
|
+
if ((bottom+5)>=window.innerHeight) top=window.innerHeight-this.DivDialog.offsetHeight-5;
|
|
136346
|
+
|
|
136347
|
+
this.DivDialog.style.left = left + 'px'
|
|
136348
|
+
this.DivDialog.style.top = top + 'px'
|
|
136349
|
+
|
|
136350
|
+
if(e.preventDefault) e.preventDefault();
|
|
136351
|
+
}
|
|
136352
|
+
|
|
136353
|
+
this.DocOnMouseUpTitle=function(e)
|
|
136354
|
+
{
|
|
136355
|
+
this.DragTitle=null;
|
|
136356
|
+
this.onmousemove = null;
|
|
136357
|
+
this.onmouseup = null;
|
|
136358
|
+
}
|
|
135874
136359
|
}
|
|
135875
136360
|
|
|
135876
136361
|
|
|
@@ -135998,7 +136483,7 @@ function HQChartScriptWorker()
|
|
|
135998
136483
|
|
|
135999
136484
|
|
|
136000
136485
|
|
|
136001
|
-
var HQCHART_VERSION="1.1.
|
|
136486
|
+
var HQCHART_VERSION="1.1.13317";
|
|
136002
136487
|
|
|
136003
136488
|
function PrintHQChartVersion()
|
|
136004
136489
|
{
|