hqchart 1.1.13313 → 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 +45 -40
- package/package.json +1 -1
- package/src/jscommon/umychart.DialogDrawTool.js +199 -2
- package/src/jscommon/umychart.complier.js +30 -12
- package/src/jscommon/umychart.js +58 -7
- package/src/jscommon/umychart.resource/css/tools.css +35 -0
- package/src/jscommon/umychart.resource/font/drawtool/demo_index.html +26 -3
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.css +7 -3
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.js +1 -1
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.json +7 -0
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.ttf +0 -0
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.woff +0 -0
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.woff2 +0 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +89 -20
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +288 -22
package/package.json
CHANGED
|
@@ -17,6 +17,7 @@ var JS_DRAWTOOL_MENU_ID=
|
|
|
17
17
|
CMD_DELETE_ALL_DRAW_CHART_ID:3,
|
|
18
18
|
CMD_ERASE_DRAW_CHART_ID:4,
|
|
19
19
|
CMD_ENABLE_MAGNET_ID:5, //画图工具磁体功能
|
|
20
|
+
CMD_DELETE_DRAW_CHART_ID:6,
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
function JSDialogDrawTool()
|
|
@@ -519,8 +520,10 @@ function JSDialogDrawTool()
|
|
|
519
520
|
if ((right+5)>=window.innerWidth) left=window.innerWidth-this.DivDialog.offsetWidth-5;
|
|
520
521
|
if ((bottom+5)>=window.innerHeight) top=window.innerHeight-this.DivDialog.offsetHeight-5;
|
|
521
522
|
|
|
522
|
-
this.DivDialog.style.left = left + 'px'
|
|
523
|
-
this.DivDialog.style.top = top + 'px'
|
|
523
|
+
this.DivDialog.style.left = left + 'px';
|
|
524
|
+
this.DivDialog.style.top = top + 'px';
|
|
525
|
+
|
|
526
|
+
if(e.preventDefault) e.preventDefault();
|
|
524
527
|
}
|
|
525
528
|
|
|
526
529
|
this.DocOnMouseUpTitle=function(e)
|
|
@@ -542,6 +545,200 @@ function JSDialogModifyDraw()
|
|
|
542
545
|
this.DivDialog=null;
|
|
543
546
|
this.HQChart;
|
|
544
547
|
this.ChartPicture;
|
|
548
|
+
this.ColorButton=null;
|
|
549
|
+
|
|
550
|
+
this.RandomLineColor=["rgb(255,69,0)", "rgb(173,255,47)", "rgb(238,154,73)", "rgb(255,105,180)"];
|
|
551
|
+
this.AryButton=
|
|
552
|
+
[
|
|
553
|
+
{ Title:"点击切换颜色", ClassName: 'hqchart_drawtool icon-fangkuai', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID }},
|
|
554
|
+
{ Title:"删除", ClassName: 'hqchart_drawtool icon-recycle_bin', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_DELETE_DRAW_CHART_ID }}
|
|
555
|
+
];
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
this.Inital=function(hqchart)
|
|
559
|
+
{
|
|
560
|
+
this.HQChart=hqchart;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
this.Destroy=function()
|
|
564
|
+
{
|
|
565
|
+
this.ChartPicture=null;
|
|
566
|
+
this.ColorButton=null;
|
|
567
|
+
if (this.DivDialog)
|
|
568
|
+
{
|
|
569
|
+
document.body.remove(this.DivDialog);
|
|
570
|
+
this.DivDialog=null;
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
this.Create=function()
|
|
575
|
+
{
|
|
576
|
+
var divDom=document.createElement("div");
|
|
577
|
+
divDom.className='UMyChart_Draw_Modify_Dialog_Div';
|
|
578
|
+
|
|
579
|
+
var drgDiv=document.createElement("div");
|
|
580
|
+
drgDiv.className="UMyChart_Draw_Modify_Dialog_Drag_Div";
|
|
581
|
+
drgDiv.onmousedown=(e)=>{ this.OnMouseDownTitle(e); }
|
|
582
|
+
divDom.appendChild(drgDiv);
|
|
583
|
+
|
|
584
|
+
var spanDom=document.createElement("span");
|
|
585
|
+
spanDom.className="hqchart_drawtool icon-tuodong";
|
|
586
|
+
spanDom.classList.add("UMyChart_DrawTool_Span");
|
|
587
|
+
drgDiv.appendChild(spanDom);
|
|
588
|
+
|
|
589
|
+
for(var i=0;i<this.AryButton.length;++i)
|
|
590
|
+
{
|
|
591
|
+
var item=this.AryButton[i];
|
|
592
|
+
this.CreateButtonItem(item, divDom);
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
this.DivDialog=divDom;
|
|
596
|
+
document.body.appendChild(divDom);
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
this.CreateButtonItem=function(item, parentDivDom)
|
|
600
|
+
{
|
|
601
|
+
var divItem=document.createElement("div");
|
|
602
|
+
divItem.className="UMyChart_Draw_Modify_Dialog_Button_Div";
|
|
603
|
+
var spanDom=document.createElement("span");
|
|
604
|
+
spanDom.className=item.ClassName;
|
|
605
|
+
spanDom.classList.add("UMyChart_DrawTool_Span");
|
|
606
|
+
divItem.appendChild(spanDom);
|
|
607
|
+
|
|
608
|
+
var data={ Span:spanDom, Parent:parentDivDom, Item:item };
|
|
609
|
+
divItem.onmousedown=(e)=> { this.OnClickButton(e, data); }; //点击
|
|
610
|
+
|
|
611
|
+
if (item.Data.ID==JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID)
|
|
612
|
+
this.ColorButton=data;
|
|
613
|
+
|
|
614
|
+
parentDivDom.appendChild(divItem);
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
this.OnClickButton=function(e, data)
|
|
618
|
+
{
|
|
619
|
+
console.log('[JSDialogModifyDraw::OnClickButton] ', data);
|
|
620
|
+
if (!data.Item || !data.Item.Data) return;
|
|
621
|
+
|
|
622
|
+
var id=data.Item.Data.ID;
|
|
623
|
+
switch(id)
|
|
624
|
+
{
|
|
625
|
+
case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID:
|
|
626
|
+
this.ModifyLineColor();
|
|
627
|
+
break;
|
|
628
|
+
case JS_DRAWTOOL_MENU_ID.CMD_DELETE_DRAW_CHART_ID:
|
|
629
|
+
this.DeleteDrawPicture();
|
|
630
|
+
break;
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
this.Close=function(e)
|
|
635
|
+
{
|
|
636
|
+
if (!this.DivDialog) return;
|
|
637
|
+
|
|
638
|
+
this.ChartPicture=null;
|
|
639
|
+
this.DivDialog.style.visibility='hidden';
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
this.IsShow=function()
|
|
643
|
+
{
|
|
644
|
+
if (!this.DivDialog) return false;
|
|
645
|
+
return this.DivDialog.style.visibility==='visible';
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
this.DeleteDrawPicture=function()
|
|
649
|
+
{
|
|
650
|
+
if (this.ChartPicture && this.HQChart)
|
|
651
|
+
{
|
|
652
|
+
this.HQChart.ClearChartDrawPicture(this.ChartPicture);
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
this.Close();
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
this.ModifyLineColor=function()
|
|
659
|
+
{
|
|
660
|
+
if (!this.ChartPicture || !this.HQChart) return;
|
|
661
|
+
|
|
662
|
+
var color=this.ChartPicture.LineColor;
|
|
663
|
+
var colorIndex=0;
|
|
664
|
+
for(var i=0;i<this.RandomLineColor.length;++i)
|
|
665
|
+
{
|
|
666
|
+
if (color==this.RandomLineColor[i])
|
|
667
|
+
{
|
|
668
|
+
colorIndex=i+1;
|
|
669
|
+
break;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
colorIndex=colorIndex%this.RandomLineColor.length;
|
|
674
|
+
color=this.RandomLineColor[colorIndex];
|
|
675
|
+
|
|
676
|
+
this.ChartPicture.LineColor = color;
|
|
677
|
+
this.ChartPicture.PointColor = color;
|
|
678
|
+
|
|
679
|
+
if (this.ColorButton) this.ColorButton.Span.style['color']=color;
|
|
680
|
+
|
|
681
|
+
if (this.HQChart.ChartDrawStorage) this.HQChart.ChartDrawStorage.SaveDrawData(this.ChartPicture); //保存下
|
|
682
|
+
|
|
683
|
+
this.HQChart.Draw();
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
this.Show=function(x, y)
|
|
687
|
+
{
|
|
688
|
+
if (!this.DivDialog) this.Create();
|
|
689
|
+
|
|
690
|
+
this.DivDialog.style.visibility='visible';
|
|
691
|
+
this.DivDialog.style.top = y + "px";
|
|
692
|
+
this.DivDialog.style.left = x + "px";
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
this.SetChartPicture=function(chart)
|
|
696
|
+
{
|
|
697
|
+
this.ChartPicture=chart;
|
|
698
|
+
if (this.ColorButton)
|
|
699
|
+
{
|
|
700
|
+
this.ColorButton.Span.style['color']=chart.LineColor;
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
this.OnMouseDownTitle=function(e)
|
|
705
|
+
{
|
|
706
|
+
if (!this.DivDialog) return;
|
|
707
|
+
|
|
708
|
+
var dragData={ X:e.clientX, Y:e.clientY };
|
|
709
|
+
dragData.YOffset=e.clientX - this.DivDialog.offsetLeft;
|
|
710
|
+
dragData.XOffset=e.clientY - this.DivDialog.offsetTop;
|
|
711
|
+
this.DragTitle=dragData;
|
|
712
|
+
|
|
713
|
+
document.onmousemove=(e)=>{ this.DocOnMouseMoveTitle(e); }
|
|
714
|
+
document.onmouseup=(e)=>{ this.DocOnMouseUpTitle(e); }
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
this.DocOnMouseMoveTitle=function(e)
|
|
718
|
+
{
|
|
719
|
+
if (!this.DragTitle) return;
|
|
720
|
+
|
|
721
|
+
var left = e.clientX - this.DragTitle.YOffset;
|
|
722
|
+
var top = e.clientY - this.DragTitle.XOffset;
|
|
723
|
+
|
|
724
|
+
var right=left+this.DivDialog.offsetWidth;
|
|
725
|
+
var bottom=top+ this.DivDialog.offsetHeight;
|
|
726
|
+
|
|
727
|
+
if ((right+5)>=window.innerWidth) left=window.innerWidth-this.DivDialog.offsetWidth-5;
|
|
728
|
+
if ((bottom+5)>=window.innerHeight) top=window.innerHeight-this.DivDialog.offsetHeight-5;
|
|
729
|
+
|
|
730
|
+
this.DivDialog.style.left = left + 'px'
|
|
731
|
+
this.DivDialog.style.top = top + 'px'
|
|
732
|
+
|
|
733
|
+
if(e.preventDefault) e.preventDefault();
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
this.DocOnMouseUpTitle=function(e)
|
|
737
|
+
{
|
|
738
|
+
this.DragTitle=null;
|
|
739
|
+
this.onmousemove = null;
|
|
740
|
+
this.onmouseup = null;
|
|
741
|
+
}
|
|
545
742
|
}
|
|
546
743
|
|
|
547
744
|
|
|
@@ -16313,6 +16313,7 @@ JSSymbolData.prototype.JsonDataToFinance=function(data)
|
|
|
16313
16313
|
|
|
16314
16314
|
var JS_EXECUTE_DEBUG_LOG=false;
|
|
16315
16315
|
|
|
16316
|
+
|
|
16316
16317
|
var JS_EXECUTE_JOB_ID=
|
|
16317
16318
|
{
|
|
16318
16319
|
JOB_DOWNLOAD_SYMBOL_DATA:1, //下载股票的K线数据
|
|
@@ -18440,9 +18441,10 @@ function JSExplainer(ast,option)
|
|
|
18440
18441
|
if (!this.AST) this.ThrowError();
|
|
18441
18442
|
if (!this.AST.Body) this.ThrowError();
|
|
18442
18443
|
|
|
18443
|
-
for(
|
|
18444
|
+
for(var i=0; i<this.AST.Body.length; ++i)
|
|
18444
18445
|
{
|
|
18445
|
-
|
|
18446
|
+
//console.log(`[JSExplainer::RunAST] ${i}`);
|
|
18447
|
+
var item =this.AST.Body[i];
|
|
18446
18448
|
this.VisitNode(item);
|
|
18447
18449
|
|
|
18448
18450
|
//输出变量
|
|
@@ -18565,7 +18567,7 @@ function JSExplainer(ast,option)
|
|
|
18565
18567
|
{
|
|
18566
18568
|
varName=itemExpression.Left.Name;
|
|
18567
18569
|
let varValue=this.VarTable.get(varName);
|
|
18568
|
-
this.VarTable.set(varName,varValue); //把常量放到变量表里
|
|
18570
|
+
this.VarTable.set(varName,this.ConvertToShortValue(varValue)); //把常量放到变量表里
|
|
18569
18571
|
}
|
|
18570
18572
|
else if (itemExpression.Type==Syntax.Identifier)
|
|
18571
18573
|
{
|
|
@@ -18603,7 +18605,7 @@ function JSExplainer(ast,option)
|
|
|
18603
18605
|
let varValue=this.ReadVariable(varName,itemExpression);
|
|
18604
18606
|
varName="__temp_si_"+i+"__";
|
|
18605
18607
|
isNoneName=true;
|
|
18606
|
-
this.VarTable.set(varName,varValue); //放到变量表里
|
|
18608
|
+
this.VarTable.set(varName,this.ConvertToShortValue(varValue)); //放到变量表里
|
|
18607
18609
|
}
|
|
18608
18610
|
}
|
|
18609
18611
|
else if(itemExpression.Type==Syntax.Literal) //常量
|
|
@@ -18808,7 +18810,7 @@ function JSExplainer(ast,option)
|
|
|
18808
18810
|
return node.Out;
|
|
18809
18811
|
}
|
|
18810
18812
|
|
|
18811
|
-
JSConsole.Complier.Log('[JSExplainer::VisitCallExpression]' , funcName, '(', args.toString() ,')');
|
|
18813
|
+
if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExplainer::VisitCallExpression]' , funcName, '(', args.toString() ,')');
|
|
18812
18814
|
|
|
18813
18815
|
if (g_JSComplierResource.IsCustomFunction(funcName))
|
|
18814
18816
|
{
|
|
@@ -18835,6 +18837,8 @@ function JSExplainer(ast,option)
|
|
|
18835
18837
|
["BARSLASTCOUNT", { Name:"BARSLASTCOUNT", Param:{ Count:1 }, ToString:function(args) { return `条件${args[0]}连续成立次数`; } } ],
|
|
18836
18838
|
["BARSCOUNT", { Name:"BARSCOUNT", Param:{ Count:1 }, ToString:function(args) { return `${args[0]}有效数据周期数`; } } ],
|
|
18837
18839
|
["BARSLAST", { Name:"BARSLAST", Param:{ Count:1 }, ToString:function(args) { return `上次${args[0]}不为0距今天数`; } } ],
|
|
18840
|
+
["BARSLASTS", { Name:"BARSLASTS", Param:{ Count:2 }, ToString:function(args) { return `倒数第N次成立时距今的周期数`; } } ],
|
|
18841
|
+
|
|
18838
18842
|
["BARSNEXT", { Name:"BARSNEXT", Param:{ Count:1 }, ToString:function(args) { return `下次${args[0]}不为0距今天数`; } } ],
|
|
18839
18843
|
["BARSSINCEN", { Name:"BARSSINCEN", Param:{ Count:2 }, ToString:function(args) { return `在${args[1]}周期内首次${args[0]}距今天数`; } } ],
|
|
18840
18844
|
["BARSSINCE", { Name:"BARSSINCE", Param:{ Count:1 }, ToString:function(args) { return `首次${args[0]}距今天数`; } } ],
|
|
@@ -19002,7 +19006,7 @@ function JSExplainer(ast,option)
|
|
|
19002
19006
|
if (item.Param.Count!=args.length)
|
|
19003
19007
|
this.ThrowUnexpectedNode(node,`函数${funcName}参数个数不正确. 需要${item.Param.Count}个参数`);
|
|
19004
19008
|
}
|
|
19005
|
-
|
|
19009
|
+
|
|
19006
19010
|
return item.ToString(args);
|
|
19007
19011
|
}
|
|
19008
19012
|
|
|
@@ -19279,8 +19283,22 @@ function JSExplainer(ast,option)
|
|
|
19279
19283
|
else if (right.Type==Syntax.UnaryExpression)
|
|
19280
19284
|
value=this.VisitUnaryExpression(right);
|
|
19281
19285
|
|
|
19282
|
-
JSConsole.Complier.Log('[JSExplainer::VisitAssignmentExpression]' , varName, ' = ',value);
|
|
19283
|
-
|
|
19286
|
+
if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExplainer::VisitAssignmentExpression]' , varName, ' = ',value);
|
|
19287
|
+
|
|
19288
|
+
this.VarTable.set(varName,this.ConvertToShortValue(value));
|
|
19289
|
+
}
|
|
19290
|
+
|
|
19291
|
+
this.ConvertToShortValue=function(value)
|
|
19292
|
+
{
|
|
19293
|
+
var maxLength=80;
|
|
19294
|
+
if (value && value.length>=maxLength)
|
|
19295
|
+
{
|
|
19296
|
+
var shortValue=value.slice(0, maxLength-10);
|
|
19297
|
+
shortValue+="......";
|
|
19298
|
+
return shortValue;
|
|
19299
|
+
}
|
|
19300
|
+
|
|
19301
|
+
return value;
|
|
19284
19302
|
}
|
|
19285
19303
|
|
|
19286
19304
|
this.ReadMemberVariable=function(node)
|
|
@@ -19340,7 +19358,7 @@ function JSExplainer(ast,option)
|
|
|
19340
19358
|
let leftValue=this.GetNodeValue(value.Left);
|
|
19341
19359
|
let rightValue=this.GetNodeValue(value.Right);
|
|
19342
19360
|
|
|
19343
|
-
JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] BinaryExpression',value , leftValue, rightValue);
|
|
19361
|
+
if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] BinaryExpression',value , leftValue, rightValue);
|
|
19344
19362
|
value.Out=null; //保存中间值
|
|
19345
19363
|
|
|
19346
19364
|
value.Out=`(${leftValue} ${value.Operator} ${rightValue})`;
|
|
@@ -19357,14 +19375,14 @@ function JSExplainer(ast,option)
|
|
|
19357
19375
|
else if (value.Operator=="=") value.Out='(平盘)';
|
|
19358
19376
|
}
|
|
19359
19377
|
|
|
19360
|
-
JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] BinaryExpression',value);
|
|
19378
|
+
if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] BinaryExpression',value);
|
|
19361
19379
|
}
|
|
19362
19380
|
else if (value.Type==Syntax.LogicalExpression)
|
|
19363
19381
|
{
|
|
19364
19382
|
let leftValue=this.GetNodeValue(value.Left);
|
|
19365
19383
|
let rightValue=this.GetNodeValue(value.Right);
|
|
19366
19384
|
|
|
19367
|
-
JSConsole.Complier.Log('[JSExecute::VisitBinaryExpression] LogicalExpression',value , leftValue, rightValue);
|
|
19385
|
+
if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExecute::VisitBinaryExpression] LogicalExpression',value , leftValue, rightValue);
|
|
19368
19386
|
value.Out=null; //保存中间值
|
|
19369
19387
|
|
|
19370
19388
|
switch(value.Operator)
|
|
@@ -19379,7 +19397,7 @@ function JSExplainer(ast,option)
|
|
|
19379
19397
|
break;
|
|
19380
19398
|
}
|
|
19381
19399
|
|
|
19382
|
-
JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] LogicalExpression',value);
|
|
19400
|
+
if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] LogicalExpression',value);
|
|
19383
19401
|
}
|
|
19384
19402
|
|
|
19385
19403
|
node=temp;
|
package/src/jscommon/umychart.js
CHANGED
|
@@ -1649,6 +1649,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
1649
1649
|
|
|
1650
1650
|
//画图工具
|
|
1651
1651
|
if (option.EnableDrawToolDialogV2===true) chart.InitalDrawToolDialog();
|
|
1652
|
+
if (option.EnableModifyDrawDialogV2===true) chart.InitalModifyDrawDialog();
|
|
1652
1653
|
|
|
1653
1654
|
//注册事件
|
|
1654
1655
|
if (option.EventCallback)
|
|
@@ -2911,6 +2912,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
2911
2912
|
this.IsShowRightMenu=true; //显示右键菜单
|
|
2912
2913
|
|
|
2913
2914
|
this.DialogDrawTool; //画图工具
|
|
2915
|
+
this.DialogModifyDraw; //画图修改
|
|
2914
2916
|
|
|
2915
2917
|
|
|
2916
2918
|
this.ClearStockCache=function()
|
|
@@ -2935,6 +2937,15 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
2935
2937
|
this.DialogDrawTool.Create();
|
|
2936
2938
|
}
|
|
2937
2939
|
|
|
2940
|
+
this.InitalModifyDrawDialog=function()
|
|
2941
|
+
{
|
|
2942
|
+
if ( this.DialogModifyDraw) return;
|
|
2943
|
+
|
|
2944
|
+
this.DialogModifyDraw=new JSDialogModifyDraw();
|
|
2945
|
+
this.DialogModifyDraw.Inital(this);
|
|
2946
|
+
this.DialogModifyDraw.Create();
|
|
2947
|
+
}
|
|
2948
|
+
|
|
2938
2949
|
this.ShowDrawToolDialog=function(x,y)
|
|
2939
2950
|
{
|
|
2940
2951
|
if (!this.DialogDrawTool) return;
|
|
@@ -2957,6 +2968,31 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
2957
2968
|
return this.DialogDrawTool.IsShow();
|
|
2958
2969
|
}
|
|
2959
2970
|
|
|
2971
|
+
this.ShowModifyDrawDialog=function(chart, x,y)
|
|
2972
|
+
{
|
|
2973
|
+
if (!this.DialogModifyDraw) return;
|
|
2974
|
+
|
|
2975
|
+
this.DialogModifyDraw.SetChartPicture(chart);
|
|
2976
|
+
if (this.DialogModifyDraw.IsShow()) return;
|
|
2977
|
+
|
|
2978
|
+
var rtClient=this.UIElement.getBoundingClientRect();
|
|
2979
|
+
var rtScroll=GetScrollPosition();
|
|
2980
|
+
|
|
2981
|
+
var top=this.UIElement.offsetTop+15;
|
|
2982
|
+
var left=(this.UIElement.offsetWidth-this.DialogModifyDraw.DivDialog.offsetWidth)/2;
|
|
2983
|
+
left+=rtClient.left+rtScroll.Left;
|
|
2984
|
+
top+=rtClient.top+rtScroll.Top;
|
|
2985
|
+
|
|
2986
|
+
this.DialogModifyDraw.Show(left, top);
|
|
2987
|
+
}
|
|
2988
|
+
|
|
2989
|
+
this.CloseModifyDrawDialog=function()
|
|
2990
|
+
{
|
|
2991
|
+
if (!this.DialogModifyDraw) return;
|
|
2992
|
+
|
|
2993
|
+
this.DialogModifyDraw.Close();
|
|
2994
|
+
}
|
|
2995
|
+
|
|
2960
2996
|
//obj={ Element:, Canvas: }
|
|
2961
2997
|
this.SetCorssCursorElement=function(obj)
|
|
2962
2998
|
{
|
|
@@ -3636,6 +3672,9 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3636
3672
|
}
|
|
3637
3673
|
}
|
|
3638
3674
|
|
|
3675
|
+
|
|
3676
|
+
if (!this.SelectChartDrawPicture) this.CloseModifyDrawDialog(); //当前没有选中画图 隐藏画图修改框
|
|
3677
|
+
|
|
3639
3678
|
document.onmousemove=(e)=>{ this.DocOnMouseMove(e); }
|
|
3640
3679
|
document.onmouseup=(e)=> { this.DocOnMouseUp(e); }
|
|
3641
3680
|
|
|
@@ -6330,6 +6369,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
6330
6369
|
this.SelectChartDrawPicture=null;
|
|
6331
6370
|
if (this.ChartPictureMenu) this.ChartPictureMenu.Hide();
|
|
6332
6371
|
this.ClearChartDrawPicture(drawPicture); //删除选中的画图工具
|
|
6372
|
+
this.CloseModifyDrawDialog();
|
|
6333
6373
|
}
|
|
6334
6374
|
else if (this.SelectedChart && this.SelectedChart.Selected.Identify)
|
|
6335
6375
|
{
|
|
@@ -8036,11 +8076,23 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
8036
8076
|
this.OnSelectChartPicture=function(chart)
|
|
8037
8077
|
{
|
|
8038
8078
|
JSConsole.Chart.Log('[JSChartContainer::OnSelectChartPicture]',chart);
|
|
8039
|
-
if (!this.ChartPictureMenu) this.ChartPictureMenu=g_DialogFactory.Create('ChartPictureSettingMenu', this.UIElement.parentNode);
|
|
8040
|
-
if (!this.ChartPictureMenu) return;
|
|
8041
8079
|
|
|
8042
|
-
|
|
8043
|
-
|
|
8080
|
+
if (!this.DialogModifyDraw) return;
|
|
8081
|
+
|
|
8082
|
+
if (chart.ClassName=="ChartDrawPictureText" || chart.ClassName=='ChartDrawVolProfile')
|
|
8083
|
+
{
|
|
8084
|
+
this.CloseModifyDrawDialog();
|
|
8085
|
+
|
|
8086
|
+
if (!this.ChartPictureMenu) this.ChartPictureMenu=g_DialogFactory.Create('ChartPictureSettingMenu', this.UIElement.parentNode);
|
|
8087
|
+
if (!this.ChartPictureMenu) return;
|
|
8088
|
+
|
|
8089
|
+
var event={ data: { ChartPicture:chart, HQChart:this}};
|
|
8090
|
+
this.ChartPictureMenu.DoModal(event);
|
|
8091
|
+
}
|
|
8092
|
+
else
|
|
8093
|
+
{
|
|
8094
|
+
this.ShowModifyDrawDialog(chart);
|
|
8095
|
+
}
|
|
8044
8096
|
}
|
|
8045
8097
|
|
|
8046
8098
|
this.FinishMoveChartDrawPicture=function()
|
|
@@ -60467,7 +60519,6 @@ function ChartDrawMonitorLine()
|
|
|
60467
60519
|
LineDash:[3,5],
|
|
60468
60520
|
}
|
|
60469
60521
|
|
|
60470
|
-
|
|
60471
60522
|
this.SetOption=function(option)
|
|
60472
60523
|
{
|
|
60473
60524
|
if (option.LineColor) this.LineColor=option.LineColor;
|
|
@@ -60481,8 +60532,8 @@ function ChartDrawMonitorLine()
|
|
|
60481
60532
|
if (item.LineDash) dest.LineDash=item.LineDash;
|
|
60482
60533
|
if (IFrameSplitOperator.IsNumber(item.YTextOffset)) dest.YTextOffset=item.YTextOffset;
|
|
60483
60534
|
}
|
|
60484
|
-
|
|
60485
|
-
if (option.
|
|
60535
|
+
|
|
60536
|
+
if (option.FormatLabelTextCallback) this.FormatLabelTextCallback=option.FormatLabelTextCallback;
|
|
60486
60537
|
}
|
|
60487
60538
|
|
|
60488
60539
|
this.Draw=function()
|
|
@@ -1437,7 +1437,42 @@ input[type="color"] {
|
|
|
1437
1437
|
|
|
1438
1438
|
|
|
1439
1439
|
|
|
1440
|
+
/*
|
|
1441
|
+
Copyright (c) 2018 jones
|
|
1442
|
+
|
|
1443
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
1444
|
+
|
|
1445
|
+
开源项目 https://github.com/jones2000/HQChart
|
|
1446
|
+
|
|
1447
|
+
jones_2000@163.com
|
|
1448
|
+
|
|
1449
|
+
内置画图属性修改对话框
|
|
1450
|
+
*/
|
|
1451
|
+
|
|
1452
|
+
.UMyChart_Draw_Modify_Dialog_Div
|
|
1453
|
+
{
|
|
1454
|
+
font-family: "微软雅黑";
|
|
1455
|
+
/*display: flex;*/
|
|
1456
|
+
border: 2px solid;
|
|
1457
|
+
width:fit-content;
|
|
1458
|
+
border-color: rgb(204,204,204);
|
|
1459
|
+
visibility:hidden;
|
|
1460
|
+
position: absolute;
|
|
1461
|
+
background-color: rgba(250,250,250,1);
|
|
1462
|
+
left:1px;
|
|
1463
|
+
top:1px;
|
|
1464
|
+
display: flex;
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
.UMyChart_Draw_Modify_Dialog_Drag_Div
|
|
1468
|
+
{
|
|
1469
|
+
width:24px;
|
|
1470
|
+
}
|
|
1440
1471
|
|
|
1472
|
+
.UMyChart_Draw_Modify_Dialog_Button_Div
|
|
1473
|
+
{
|
|
1474
|
+
|
|
1475
|
+
}
|
|
1441
1476
|
|
|
1442
1477
|
|
|
1443
1478
|
|
|
@@ -54,6 +54,12 @@
|
|
|
54
54
|
<div class="content unicode" style="display: block;">
|
|
55
55
|
<ul class="icon_lists dib-box">
|
|
56
56
|
|
|
57
|
+
<li class="dib">
|
|
58
|
+
<span class="icon hqchart_drawtool"></span>
|
|
59
|
+
<div class="name">拖动</div>
|
|
60
|
+
<div class="code-name">&#xe6ff;</div>
|
|
61
|
+
</li>
|
|
62
|
+
|
|
57
63
|
<li class="dib">
|
|
58
64
|
<span class="icon hqchart_drawtool"></span>
|
|
59
65
|
<div class="name">监测</div>
|
|
@@ -408,9 +414,9 @@
|
|
|
408
414
|
<pre><code class="language-css"
|
|
409
415
|
>@font-face {
|
|
410
416
|
font-family: 'hqchart_drawtool';
|
|
411
|
-
src: url('iconfont.woff2?t=
|
|
412
|
-
url('iconfont.woff?t=
|
|
413
|
-
url('iconfont.ttf?t=
|
|
417
|
+
src: url('iconfont.woff2?t=1715878738024') format('woff2'),
|
|
418
|
+
url('iconfont.woff?t=1715878738024') format('woff'),
|
|
419
|
+
url('iconfont.ttf?t=1715878738024') format('truetype');
|
|
414
420
|
}
|
|
415
421
|
</code></pre>
|
|
416
422
|
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
|
|
@@ -436,6 +442,15 @@
|
|
|
436
442
|
<div class="content font-class">
|
|
437
443
|
<ul class="icon_lists dib-box">
|
|
438
444
|
|
|
445
|
+
<li class="dib">
|
|
446
|
+
<span class="icon hqchart_drawtool icon-tuodong"></span>
|
|
447
|
+
<div class="name">
|
|
448
|
+
拖动
|
|
449
|
+
</div>
|
|
450
|
+
<div class="code-name">.icon-tuodong
|
|
451
|
+
</div>
|
|
452
|
+
</li>
|
|
453
|
+
|
|
439
454
|
<li class="dib">
|
|
440
455
|
<span class="icon hqchart_drawtool icon-jiance"></span>
|
|
441
456
|
<div class="name">
|
|
@@ -967,6 +982,14 @@
|
|
|
967
982
|
<div class="content symbol">
|
|
968
983
|
<ul class="icon_lists dib-box">
|
|
969
984
|
|
|
985
|
+
<li class="dib">
|
|
986
|
+
<svg class="icon svg-icon" aria-hidden="true">
|
|
987
|
+
<use xlink:href="#icon-tuodong"></use>
|
|
988
|
+
</svg>
|
|
989
|
+
<div class="name">拖动</div>
|
|
990
|
+
<div class="code-name">#icon-tuodong</div>
|
|
991
|
+
</li>
|
|
992
|
+
|
|
970
993
|
<li class="dib">
|
|
971
994
|
<svg class="icon svg-icon" aria-hidden="true">
|
|
972
995
|
<use xlink:href="#icon-jiance"></use>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
@font-face {
|
|
2
2
|
font-family: "hqchart_drawtool"; /* Project id 4529603 */
|
|
3
|
-
src: url('iconfont.woff2?t=
|
|
4
|
-
url('iconfont.woff?t=
|
|
5
|
-
url('iconfont.ttf?t=
|
|
3
|
+
src: url('iconfont.woff2?t=1715878738024') format('woff2'),
|
|
4
|
+
url('iconfont.woff?t=1715878738024') format('woff'),
|
|
5
|
+
url('iconfont.ttf?t=1715878738024') format('truetype');
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.hqchart_drawtool {
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
-moz-osx-font-smoothing: grayscale;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
.icon-tuodong:before {
|
|
17
|
+
content: "\e6ff";
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
.icon-jiance:before {
|
|
17
21
|
content: "\e936";
|
|
18
22
|
}
|