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
|
@@ -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()
|
|
@@ -64403,7 +64455,6 @@ function ChartDrawMonitorLine()
|
|
|
64403
64455
|
LineDash:[3,5],
|
|
64404
64456
|
}
|
|
64405
64457
|
|
|
64406
|
-
|
|
64407
64458
|
this.SetOption=function(option)
|
|
64408
64459
|
{
|
|
64409
64460
|
if (option.LineColor) this.LineColor=option.LineColor;
|
|
@@ -64417,8 +64468,8 @@ function ChartDrawMonitorLine()
|
|
|
64417
64468
|
if (item.LineDash) dest.LineDash=item.LineDash;
|
|
64418
64469
|
if (IFrameSplitOperator.IsNumber(item.YTextOffset)) dest.YTextOffset=item.YTextOffset;
|
|
64419
64470
|
}
|
|
64420
|
-
|
|
64421
|
-
if (option.
|
|
64471
|
+
|
|
64472
|
+
if (option.FormatLabelTextCallback) this.FormatLabelTextCallback=option.FormatLabelTextCallback;
|
|
64422
64473
|
}
|
|
64423
64474
|
|
|
64424
64475
|
this.Draw=function()
|
|
@@ -111788,6 +111839,7 @@ JSSymbolData.prototype.JsonDataToFinance=function(data)
|
|
|
111788
111839
|
|
|
111789
111840
|
var JS_EXECUTE_DEBUG_LOG=false;
|
|
111790
111841
|
|
|
111842
|
+
|
|
111791
111843
|
var JS_EXECUTE_JOB_ID=
|
|
111792
111844
|
{
|
|
111793
111845
|
JOB_DOWNLOAD_SYMBOL_DATA:1, //下载股票的K线数据
|
|
@@ -113915,9 +113967,10 @@ function JSExplainer(ast,option)
|
|
|
113915
113967
|
if (!this.AST) this.ThrowError();
|
|
113916
113968
|
if (!this.AST.Body) this.ThrowError();
|
|
113917
113969
|
|
|
113918
|
-
for(
|
|
113970
|
+
for(var i=0; i<this.AST.Body.length; ++i)
|
|
113919
113971
|
{
|
|
113920
|
-
|
|
113972
|
+
//console.log(`[JSExplainer::RunAST] ${i}`);
|
|
113973
|
+
var item =this.AST.Body[i];
|
|
113921
113974
|
this.VisitNode(item);
|
|
113922
113975
|
|
|
113923
113976
|
//输出变量
|
|
@@ -114040,7 +114093,7 @@ function JSExplainer(ast,option)
|
|
|
114040
114093
|
{
|
|
114041
114094
|
varName=itemExpression.Left.Name;
|
|
114042
114095
|
let varValue=this.VarTable.get(varName);
|
|
114043
|
-
this.VarTable.set(varName,varValue); //把常量放到变量表里
|
|
114096
|
+
this.VarTable.set(varName,this.ConvertToShortValue(varValue)); //把常量放到变量表里
|
|
114044
114097
|
}
|
|
114045
114098
|
else if (itemExpression.Type==Syntax.Identifier)
|
|
114046
114099
|
{
|
|
@@ -114078,7 +114131,7 @@ function JSExplainer(ast,option)
|
|
|
114078
114131
|
let varValue=this.ReadVariable(varName,itemExpression);
|
|
114079
114132
|
varName="__temp_si_"+i+"__";
|
|
114080
114133
|
isNoneName=true;
|
|
114081
|
-
this.VarTable.set(varName,varValue); //放到变量表里
|
|
114134
|
+
this.VarTable.set(varName,this.ConvertToShortValue(varValue)); //放到变量表里
|
|
114082
114135
|
}
|
|
114083
114136
|
}
|
|
114084
114137
|
else if(itemExpression.Type==Syntax.Literal) //常量
|
|
@@ -114283,7 +114336,7 @@ function JSExplainer(ast,option)
|
|
|
114283
114336
|
return node.Out;
|
|
114284
114337
|
}
|
|
114285
114338
|
|
|
114286
|
-
JSConsole.Complier.Log('[JSExplainer::VisitCallExpression]' , funcName, '(', args.toString() ,')');
|
|
114339
|
+
if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExplainer::VisitCallExpression]' , funcName, '(', args.toString() ,')');
|
|
114287
114340
|
|
|
114288
114341
|
if (g_JSComplierResource.IsCustomFunction(funcName))
|
|
114289
114342
|
{
|
|
@@ -114310,6 +114363,8 @@ function JSExplainer(ast,option)
|
|
|
114310
114363
|
["BARSLASTCOUNT", { Name:"BARSLASTCOUNT", Param:{ Count:1 }, ToString:function(args) { return `条件${args[0]}连续成立次数`; } } ],
|
|
114311
114364
|
["BARSCOUNT", { Name:"BARSCOUNT", Param:{ Count:1 }, ToString:function(args) { return `${args[0]}有效数据周期数`; } } ],
|
|
114312
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
|
+
|
|
114313
114368
|
["BARSNEXT", { Name:"BARSNEXT", Param:{ Count:1 }, ToString:function(args) { return `下次${args[0]}不为0距今天数`; } } ],
|
|
114314
114369
|
["BARSSINCEN", { Name:"BARSSINCEN", Param:{ Count:2 }, ToString:function(args) { return `在${args[1]}周期内首次${args[0]}距今天数`; } } ],
|
|
114315
114370
|
["BARSSINCE", { Name:"BARSSINCE", Param:{ Count:1 }, ToString:function(args) { return `首次${args[0]}距今天数`; } } ],
|
|
@@ -114477,7 +114532,7 @@ function JSExplainer(ast,option)
|
|
|
114477
114532
|
if (item.Param.Count!=args.length)
|
|
114478
114533
|
this.ThrowUnexpectedNode(node,`函数${funcName}参数个数不正确. 需要${item.Param.Count}个参数`);
|
|
114479
114534
|
}
|
|
114480
|
-
|
|
114535
|
+
|
|
114481
114536
|
return item.ToString(args);
|
|
114482
114537
|
}
|
|
114483
114538
|
|
|
@@ -114754,8 +114809,22 @@ function JSExplainer(ast,option)
|
|
|
114754
114809
|
else if (right.Type==Syntax.UnaryExpression)
|
|
114755
114810
|
value=this.VisitUnaryExpression(right);
|
|
114756
114811
|
|
|
114757
|
-
JSConsole.Complier.Log('[JSExplainer::VisitAssignmentExpression]' , varName, ' = ',value);
|
|
114758
|
-
|
|
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;
|
|
114759
114828
|
}
|
|
114760
114829
|
|
|
114761
114830
|
this.ReadMemberVariable=function(node)
|
|
@@ -114815,7 +114884,7 @@ function JSExplainer(ast,option)
|
|
|
114815
114884
|
let leftValue=this.GetNodeValue(value.Left);
|
|
114816
114885
|
let rightValue=this.GetNodeValue(value.Right);
|
|
114817
114886
|
|
|
114818
|
-
JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] BinaryExpression',value , leftValue, rightValue);
|
|
114887
|
+
if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] BinaryExpression',value , leftValue, rightValue);
|
|
114819
114888
|
value.Out=null; //保存中间值
|
|
114820
114889
|
|
|
114821
114890
|
value.Out=`(${leftValue} ${value.Operator} ${rightValue})`;
|
|
@@ -114832,14 +114901,14 @@ function JSExplainer(ast,option)
|
|
|
114832
114901
|
else if (value.Operator=="=") value.Out='(平盘)';
|
|
114833
114902
|
}
|
|
114834
114903
|
|
|
114835
|
-
JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] BinaryExpression',value);
|
|
114904
|
+
if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] BinaryExpression',value);
|
|
114836
114905
|
}
|
|
114837
114906
|
else if (value.Type==Syntax.LogicalExpression)
|
|
114838
114907
|
{
|
|
114839
114908
|
let leftValue=this.GetNodeValue(value.Left);
|
|
114840
114909
|
let rightValue=this.GetNodeValue(value.Right);
|
|
114841
114910
|
|
|
114842
|
-
JSConsole.Complier.Log('[JSExecute::VisitBinaryExpression] LogicalExpression',value , leftValue, rightValue);
|
|
114911
|
+
if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExecute::VisitBinaryExpression] LogicalExpression',value , leftValue, rightValue);
|
|
114843
114912
|
value.Out=null; //保存中间值
|
|
114844
114913
|
|
|
114845
114914
|
switch(value.Operator)
|
|
@@ -114854,7 +114923,7 @@ function JSExplainer(ast,option)
|
|
|
114854
114923
|
break;
|
|
114855
114924
|
}
|
|
114856
114925
|
|
|
114857
|
-
JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] LogicalExpression',value);
|
|
114926
|
+
if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] LogicalExpression',value);
|
|
114858
114927
|
}
|
|
114859
114928
|
|
|
114860
114929
|
node=temp;
|
|
@@ -135565,6 +135634,7 @@ var JS_DRAWTOOL_MENU_ID=
|
|
|
135565
135634
|
CMD_DELETE_ALL_DRAW_CHART_ID:3,
|
|
135566
135635
|
CMD_ERASE_DRAW_CHART_ID:4,
|
|
135567
135636
|
CMD_ENABLE_MAGNET_ID:5, //画图工具磁体功能
|
|
135637
|
+
CMD_DELETE_DRAW_CHART_ID:6,
|
|
135568
135638
|
};
|
|
135569
135639
|
|
|
135570
135640
|
function JSDialogDrawTool()
|
|
@@ -136067,8 +136137,10 @@ function JSDialogDrawTool()
|
|
|
136067
136137
|
if ((right+5)>=window.innerWidth) left=window.innerWidth-this.DivDialog.offsetWidth-5;
|
|
136068
136138
|
if ((bottom+5)>=window.innerHeight) top=window.innerHeight-this.DivDialog.offsetHeight-5;
|
|
136069
136139
|
|
|
136070
|
-
this.DivDialog.style.left = left + 'px'
|
|
136071
|
-
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();
|
|
136072
136144
|
}
|
|
136073
136145
|
|
|
136074
136146
|
this.DocOnMouseUpTitle=function(e)
|
|
@@ -136090,6 +136162,200 @@ function JSDialogModifyDraw()
|
|
|
136090
136162
|
this.DivDialog=null;
|
|
136091
136163
|
this.HQChart;
|
|
136092
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
|
+
}
|
|
136093
136359
|
}
|
|
136094
136360
|
|
|
136095
136361
|
|
|
@@ -136217,7 +136483,7 @@ function HQChartScriptWorker()
|
|
|
136217
136483
|
|
|
136218
136484
|
|
|
136219
136485
|
|
|
136220
|
-
var HQCHART_VERSION="1.1.
|
|
136486
|
+
var HQCHART_VERSION="1.1.13317";
|
|
136221
136487
|
|
|
136222
136488
|
function PrintHQChartVersion()
|
|
136223
136489
|
{
|