hqchart 1.1.13313 → 1.1.13324

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.
@@ -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
- var event={ data: { ChartPicture:chart, HQChart:this}};
11979
- this.ChartPictureMenu.DoModal(event);
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.FormatLabelText) this.FormatLabelTextCallback=option.FormatLabelText;
64471
+
64472
+ if (option.FormatLabelTextCallback) this.FormatLabelTextCallback=option.FormatLabelTextCallback;
64422
64473
  }
64423
64474
 
64424
64475
  this.Draw=function()
@@ -100322,6 +100373,35 @@ function JSAlgorithm(errorHandler,symbolData)
100322
100373
  return result;
100323
100374
  }
100324
100375
 
100376
+ //反向过滤连续出现的信号.
100377
+ //用法:FILTERX(X,N):X满足条件后,将其前N周期内的数据置为0,N为常量.
100378
+ //例如:FILTERX(CLOSE>OPEN,5)查找阳线,前5天内出现过的阳线不被记录在内
100379
+ this.FILTERX=function(data, n, node)
100380
+ {
100381
+ var result=[];
100382
+ for(let i=0,j=0; i<data.length; ++i)
100383
+ {
100384
+ if (data[i])
100385
+ {
100386
+ result[i]=1;
100387
+ for(j=0;j<n && i-j-1>=0;++j)
100388
+ {
100389
+ result[i-j-1]=0;
100390
+ }
100391
+ i+=n;
100392
+ }
100393
+ else
100394
+ {
100395
+ result[i]=0;
100396
+ }
100397
+ }
100398
+
100399
+ return result;
100400
+ }
100401
+
100402
+ //上一次条件成立到当前的周期数.
100403
+ //用法:BARSLAST(X):上一次X不为0到现在的周期数
100404
+ //例如:BARSLAST(CLOSE/REF(CLOSE,1)>=1.1)表示上一个涨停板到当前的周期数
100325
100405
  this.BARSLAST=function(data)
100326
100406
  {
100327
100407
  var result=[];
@@ -100341,6 +100421,52 @@ function JSAlgorithm(errorHandler,symbolData)
100341
100421
  return result;
100342
100422
  }
100343
100423
 
100424
+ //倒数第N次成立时距今的周期数.
100425
+ //用法:BARSLASTS(X,N):X倒数第N满足到现在的周期数,N支持变量
100426
+ this.BARSLASTS=function(data, n, node)
100427
+ {
100428
+ var result=[];
100429
+ if (!data) return result;
100430
+ if (n<=0) n=data.length;
100431
+
100432
+ var day=null;
100433
+ var SingleValue=0; //单词数
100434
+ var periodCount=0;
100435
+ for(let i=0;i<data.length;++i)
100436
+ {
100437
+ result[i]=null;
100438
+ var value=data[i];
100439
+
100440
+ if (value>0)
100441
+ {
100442
+ if (day==null)
100443
+ {
100444
+ day=0;
100445
+ ++periodCount;
100446
+ }
100447
+ else
100448
+ {
100449
+ ++periodCount;
100450
+ if (periodCount>n) day-=SingleValue;
100451
+ }
100452
+
100453
+ SingleValue=0;
100454
+ }
100455
+ else
100456
+ {
100457
+ if (day!=null)
100458
+ {
100459
+ ++day;
100460
+ ++SingleValue;
100461
+ }
100462
+ }
100463
+
100464
+ if (day!=null) result[i]=day;
100465
+ }
100466
+
100467
+ return result;
100468
+ }
100469
+
100344
100470
  /*
100345
100471
  N周期内第一个条件成立到当前的周期数.
100346
100472
  用法:
@@ -104362,10 +104488,15 @@ function JSAlgorithm(errorHandler,symbolData)
104362
104488
  return this.FILTER(args[0],args[1]);
104363
104489
  case 'TFILTER':
104364
104490
  return this.TFILTER(args[0],args[1],args[2]);
104491
+ case "FILTERX":
104492
+ return this.FILTERX(args[0],args[1],node);
104365
104493
  case 'SLOPE':
104366
104494
  return this.SLOPE(args[0],args[1]);
104367
104495
  case 'BARSLAST':
104368
104496
  return this.BARSLAST(args[0]);
104497
+ case "BARSLASTS":
104498
+ //this.ThrowUnexpectedNode(node,`函数'BARSLASTS'还在开发中`, name);
104499
+ return this.BARSLASTS(args[0],args[1],node);
104369
104500
  case 'BARSCOUNT':
104370
104501
  return this.BARSCOUNT(args[0]);
104371
104502
  case 'BARSSINCEN':
@@ -111788,6 +111919,7 @@ JSSymbolData.prototype.JsonDataToFinance=function(data)
111788
111919
 
111789
111920
  var JS_EXECUTE_DEBUG_LOG=false;
111790
111921
 
111922
+
111791
111923
  var JS_EXECUTE_JOB_ID=
111792
111924
  {
111793
111925
  JOB_DOWNLOAD_SYMBOL_DATA:1, //下载股票的K线数据
@@ -113815,6 +113947,7 @@ function JSExplainer(ast,option)
113815
113947
  this.JobList=[]; //执行的任务队列
113816
113948
  this.VarTable=new Map(); //变量表
113817
113949
  this.OutVarTable=[]; //输出变量
113950
+ this.MaxValueLength=150; //最长的字符
113818
113951
 
113819
113952
  //脚本自动变量表, 只读
113820
113953
  this.ConstVarTable=new Map(
@@ -113915,9 +114048,10 @@ function JSExplainer(ast,option)
113915
114048
  if (!this.AST) this.ThrowError();
113916
114049
  if (!this.AST.Body) this.ThrowError();
113917
114050
 
113918
- for(let i in this.AST.Body)
114051
+ for(var i=0; i<this.AST.Body.length; ++i)
113919
114052
  {
113920
- let item =this.AST.Body[i];
114053
+ //console.log(`[JSExplainer::RunAST] ${i}`);
114054
+ var item =this.AST.Body[i];
113921
114055
  this.VisitNode(item);
113922
114056
 
113923
114057
  //输出变量
@@ -114040,7 +114174,7 @@ function JSExplainer(ast,option)
114040
114174
  {
114041
114175
  varName=itemExpression.Left.Name;
114042
114176
  let varValue=this.VarTable.get(varName);
114043
- this.VarTable.set(varName,varValue); //把常量放到变量表里
114177
+ this.VarTable.set(varName,this.ConvertToShortValue(varValue)); //把常量放到变量表里
114044
114178
  }
114045
114179
  else if (itemExpression.Type==Syntax.Identifier)
114046
114180
  {
@@ -114078,7 +114212,7 @@ function JSExplainer(ast,option)
114078
114212
  let varValue=this.ReadVariable(varName,itemExpression);
114079
114213
  varName="__temp_si_"+i+"__";
114080
114214
  isNoneName=true;
114081
- this.VarTable.set(varName,varValue); //放到变量表里
114215
+ this.VarTable.set(varName,this.ConvertToShortValue(varValue)); //放到变量表里
114082
114216
  }
114083
114217
  }
114084
114218
  else if(itemExpression.Type==Syntax.Literal) //常量
@@ -114283,7 +114417,7 @@ function JSExplainer(ast,option)
114283
114417
  return node.Out;
114284
114418
  }
114285
114419
 
114286
- JSConsole.Complier.Log('[JSExplainer::VisitCallExpression]' , funcName, '(', args.toString() ,')');
114420
+ if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExplainer::VisitCallExpression]' , funcName, '(', args.toString() ,')');
114287
114421
 
114288
114422
  if (g_JSComplierResource.IsCustomFunction(funcName))
114289
114423
  {
@@ -114310,6 +114444,8 @@ function JSExplainer(ast,option)
114310
114444
  ["BARSLASTCOUNT", { Name:"BARSLASTCOUNT", Param:{ Count:1 }, ToString:function(args) { return `条件${args[0]}连续成立次数`; } } ],
114311
114445
  ["BARSCOUNT", { Name:"BARSCOUNT", Param:{ Count:1 }, ToString:function(args) { return `${args[0]}有效数据周期数`; } } ],
114312
114446
  ["BARSLAST", { Name:"BARSLAST", Param:{ Count:1 }, ToString:function(args) { return `上次${args[0]}不为0距今天数`; } } ],
114447
+ ["BARSLASTS", { Name:"BARSLASTS", Param:{ Count:2 }, ToString:function(args) { return `倒数第N次成立时距今的周期数`; } } ],
114448
+
114313
114449
  ["BARSNEXT", { Name:"BARSNEXT", Param:{ Count:1 }, ToString:function(args) { return `下次${args[0]}不为0距今天数`; } } ],
114314
114450
  ["BARSSINCEN", { Name:"BARSSINCEN", Param:{ Count:2 }, ToString:function(args) { return `在${args[1]}周期内首次${args[0]}距今天数`; } } ],
114315
114451
  ["BARSSINCE", { Name:"BARSSINCE", Param:{ Count:1 }, ToString:function(args) { return `首次${args[0]}距今天数`; } } ],
@@ -114477,7 +114613,7 @@ function JSExplainer(ast,option)
114477
114613
  if (item.Param.Count!=args.length)
114478
114614
  this.ThrowUnexpectedNode(node,`函数${funcName}参数个数不正确. 需要${item.Param.Count}个参数`);
114479
114615
  }
114480
-
114616
+
114481
114617
  return item.ToString(args);
114482
114618
  }
114483
114619
 
@@ -114754,8 +114890,22 @@ function JSExplainer(ast,option)
114754
114890
  else if (right.Type==Syntax.UnaryExpression)
114755
114891
  value=this.VisitUnaryExpression(right);
114756
114892
 
114757
- JSConsole.Complier.Log('[JSExplainer::VisitAssignmentExpression]' , varName, ' = ',value);
114758
- this.VarTable.set(varName,value);
114893
+ if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExplainer::VisitAssignmentExpression]' , varName, ' = ',value);
114894
+
114895
+ this.VarTable.set(varName,this.ConvertToShortValue(value));
114896
+ }
114897
+
114898
+ this.ConvertToShortValue=function(value)
114899
+ {
114900
+ var maxLength=this.MaxValueLength;
114901
+ if (value && value.length>=maxLength)
114902
+ {
114903
+ var shortValue=value.slice(0, maxLength-10);
114904
+ shortValue+="......";
114905
+ return shortValue;
114906
+ }
114907
+
114908
+ return value;
114759
114909
  }
114760
114910
 
114761
114911
  this.ReadMemberVariable=function(node)
@@ -114815,7 +114965,7 @@ function JSExplainer(ast,option)
114815
114965
  let leftValue=this.GetNodeValue(value.Left);
114816
114966
  let rightValue=this.GetNodeValue(value.Right);
114817
114967
 
114818
- JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] BinaryExpression',value , leftValue, rightValue);
114968
+ if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] BinaryExpression',value , leftValue, rightValue);
114819
114969
  value.Out=null; //保存中间值
114820
114970
 
114821
114971
  value.Out=`(${leftValue} ${value.Operator} ${rightValue})`;
@@ -114832,14 +114982,14 @@ function JSExplainer(ast,option)
114832
114982
  else if (value.Operator=="=") value.Out='(平盘)';
114833
114983
  }
114834
114984
 
114835
- JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] BinaryExpression',value);
114985
+ if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] BinaryExpression',value);
114836
114986
  }
114837
114987
  else if (value.Type==Syntax.LogicalExpression)
114838
114988
  {
114839
114989
  let leftValue=this.GetNodeValue(value.Left);
114840
114990
  let rightValue=this.GetNodeValue(value.Right);
114841
114991
 
114842
- JSConsole.Complier.Log('[JSExecute::VisitBinaryExpression] LogicalExpression',value , leftValue, rightValue);
114992
+ if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExecute::VisitBinaryExpression] LogicalExpression',value , leftValue, rightValue);
114843
114993
  value.Out=null; //保存中间值
114844
114994
 
114845
114995
  switch(value.Operator)
@@ -114854,7 +115004,7 @@ function JSExplainer(ast,option)
114854
115004
  break;
114855
115005
  }
114856
115006
 
114857
- JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] LogicalExpression',value);
115007
+ if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] LogicalExpression',value);
114858
115008
  }
114859
115009
 
114860
115010
  node=temp;
@@ -135565,6 +135715,7 @@ var JS_DRAWTOOL_MENU_ID=
135565
135715
  CMD_DELETE_ALL_DRAW_CHART_ID:3,
135566
135716
  CMD_ERASE_DRAW_CHART_ID:4,
135567
135717
  CMD_ENABLE_MAGNET_ID:5, //画图工具磁体功能
135718
+ CMD_DELETE_DRAW_CHART_ID:6,
135568
135719
  };
135569
135720
 
135570
135721
  function JSDialogDrawTool()
@@ -136067,8 +136218,10 @@ function JSDialogDrawTool()
136067
136218
  if ((right+5)>=window.innerWidth) left=window.innerWidth-this.DivDialog.offsetWidth-5;
136068
136219
  if ((bottom+5)>=window.innerHeight) top=window.innerHeight-this.DivDialog.offsetHeight-5;
136069
136220
 
136070
- this.DivDialog.style.left = left + 'px'
136071
- this.DivDialog.style.top = top + 'px'
136221
+ this.DivDialog.style.left = left + 'px';
136222
+ this.DivDialog.style.top = top + 'px';
136223
+
136224
+ if(e.preventDefault) e.preventDefault();
136072
136225
  }
136073
136226
 
136074
136227
  this.DocOnMouseUpTitle=function(e)
@@ -136090,6 +136243,200 @@ function JSDialogModifyDraw()
136090
136243
  this.DivDialog=null;
136091
136244
  this.HQChart;
136092
136245
  this.ChartPicture;
136246
+ this.ColorButton=null;
136247
+
136248
+ this.RandomLineColor=["rgb(255,69,0)", "rgb(173,255,47)", "rgb(238,154,73)", "rgb(255,105,180)"];
136249
+ this.AryButton=
136250
+ [
136251
+ { Title:"点击切换颜色", ClassName: 'hqchart_drawtool icon-fangkuai', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID }},
136252
+ { Title:"删除", ClassName: 'hqchart_drawtool icon-recycle_bin', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_DELETE_DRAW_CHART_ID }}
136253
+ ];
136254
+
136255
+
136256
+ this.Inital=function(hqchart)
136257
+ {
136258
+ this.HQChart=hqchart;
136259
+ }
136260
+
136261
+ this.Destroy=function()
136262
+ {
136263
+ this.ChartPicture=null;
136264
+ this.ColorButton=null;
136265
+ if (this.DivDialog)
136266
+ {
136267
+ document.body.remove(this.DivDialog);
136268
+ this.DivDialog=null;
136269
+ }
136270
+ }
136271
+
136272
+ this.Create=function()
136273
+ {
136274
+ var divDom=document.createElement("div");
136275
+ divDom.className='UMyChart_Draw_Modify_Dialog_Div';
136276
+
136277
+ var drgDiv=document.createElement("div");
136278
+ drgDiv.className="UMyChart_Draw_Modify_Dialog_Drag_Div";
136279
+ drgDiv.onmousedown=(e)=>{ this.OnMouseDownTitle(e); }
136280
+ divDom.appendChild(drgDiv);
136281
+
136282
+ var spanDom=document.createElement("span");
136283
+ spanDom.className="hqchart_drawtool icon-tuodong";
136284
+ spanDom.classList.add("UMyChart_DrawTool_Span");
136285
+ drgDiv.appendChild(spanDom);
136286
+
136287
+ for(var i=0;i<this.AryButton.length;++i)
136288
+ {
136289
+ var item=this.AryButton[i];
136290
+ this.CreateButtonItem(item, divDom);
136291
+ }
136292
+
136293
+ this.DivDialog=divDom;
136294
+ document.body.appendChild(divDom);
136295
+ }
136296
+
136297
+ this.CreateButtonItem=function(item, parentDivDom)
136298
+ {
136299
+ var divItem=document.createElement("div");
136300
+ divItem.className="UMyChart_Draw_Modify_Dialog_Button_Div";
136301
+ var spanDom=document.createElement("span");
136302
+ spanDom.className=item.ClassName;
136303
+ spanDom.classList.add("UMyChart_DrawTool_Span");
136304
+ divItem.appendChild(spanDom);
136305
+
136306
+ var data={ Span:spanDom, Parent:parentDivDom, Item:item };
136307
+ divItem.onmousedown=(e)=> { this.OnClickButton(e, data); }; //点击
136308
+
136309
+ if (item.Data.ID==JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID)
136310
+ this.ColorButton=data;
136311
+
136312
+ parentDivDom.appendChild(divItem);
136313
+ }
136314
+
136315
+ this.OnClickButton=function(e, data)
136316
+ {
136317
+ console.log('[JSDialogModifyDraw::OnClickButton] ', data);
136318
+ if (!data.Item || !data.Item.Data) return;
136319
+
136320
+ var id=data.Item.Data.ID;
136321
+ switch(id)
136322
+ {
136323
+ case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID:
136324
+ this.ModifyLineColor();
136325
+ break;
136326
+ case JS_DRAWTOOL_MENU_ID.CMD_DELETE_DRAW_CHART_ID:
136327
+ this.DeleteDrawPicture();
136328
+ break;
136329
+ }
136330
+ }
136331
+
136332
+ this.Close=function(e)
136333
+ {
136334
+ if (!this.DivDialog) return;
136335
+
136336
+ this.ChartPicture=null;
136337
+ this.DivDialog.style.visibility='hidden';
136338
+ }
136339
+
136340
+ this.IsShow=function()
136341
+ {
136342
+ if (!this.DivDialog) return false;
136343
+ return this.DivDialog.style.visibility==='visible';
136344
+ }
136345
+
136346
+ this.DeleteDrawPicture=function()
136347
+ {
136348
+ if (this.ChartPicture && this.HQChart)
136349
+ {
136350
+ this.HQChart.ClearChartDrawPicture(this.ChartPicture);
136351
+ }
136352
+
136353
+ this.Close();
136354
+ }
136355
+
136356
+ this.ModifyLineColor=function()
136357
+ {
136358
+ if (!this.ChartPicture || !this.HQChart) return;
136359
+
136360
+ var color=this.ChartPicture.LineColor;
136361
+ var colorIndex=0;
136362
+ for(var i=0;i<this.RandomLineColor.length;++i)
136363
+ {
136364
+ if (color==this.RandomLineColor[i])
136365
+ {
136366
+ colorIndex=i+1;
136367
+ break;
136368
+ }
136369
+ }
136370
+
136371
+ colorIndex=colorIndex%this.RandomLineColor.length;
136372
+ color=this.RandomLineColor[colorIndex];
136373
+
136374
+ this.ChartPicture.LineColor = color;
136375
+ this.ChartPicture.PointColor = color;
136376
+
136377
+ if (this.ColorButton) this.ColorButton.Span.style['color']=color;
136378
+
136379
+ if (this.HQChart.ChartDrawStorage) this.HQChart.ChartDrawStorage.SaveDrawData(this.ChartPicture); //保存下
136380
+
136381
+ this.HQChart.Draw();
136382
+ }
136383
+
136384
+ this.Show=function(x, y)
136385
+ {
136386
+ if (!this.DivDialog) this.Create();
136387
+
136388
+ this.DivDialog.style.visibility='visible';
136389
+ this.DivDialog.style.top = y + "px";
136390
+ this.DivDialog.style.left = x + "px";
136391
+ }
136392
+
136393
+ this.SetChartPicture=function(chart)
136394
+ {
136395
+ this.ChartPicture=chart;
136396
+ if (this.ColorButton)
136397
+ {
136398
+ this.ColorButton.Span.style['color']=chart.LineColor;
136399
+ }
136400
+ }
136401
+
136402
+ this.OnMouseDownTitle=function(e)
136403
+ {
136404
+ if (!this.DivDialog) return;
136405
+
136406
+ var dragData={ X:e.clientX, Y:e.clientY };
136407
+ dragData.YOffset=e.clientX - this.DivDialog.offsetLeft;
136408
+ dragData.XOffset=e.clientY - this.DivDialog.offsetTop;
136409
+ this.DragTitle=dragData;
136410
+
136411
+ document.onmousemove=(e)=>{ this.DocOnMouseMoveTitle(e); }
136412
+ document.onmouseup=(e)=>{ this.DocOnMouseUpTitle(e); }
136413
+ }
136414
+
136415
+ this.DocOnMouseMoveTitle=function(e)
136416
+ {
136417
+ if (!this.DragTitle) return;
136418
+
136419
+ var left = e.clientX - this.DragTitle.YOffset;
136420
+ var top = e.clientY - this.DragTitle.XOffset;
136421
+
136422
+ var right=left+this.DivDialog.offsetWidth;
136423
+ var bottom=top+ this.DivDialog.offsetHeight;
136424
+
136425
+ if ((right+5)>=window.innerWidth) left=window.innerWidth-this.DivDialog.offsetWidth-5;
136426
+ if ((bottom+5)>=window.innerHeight) top=window.innerHeight-this.DivDialog.offsetHeight-5;
136427
+
136428
+ this.DivDialog.style.left = left + 'px'
136429
+ this.DivDialog.style.top = top + 'px'
136430
+
136431
+ if(e.preventDefault) e.preventDefault();
136432
+ }
136433
+
136434
+ this.DocOnMouseUpTitle=function(e)
136435
+ {
136436
+ this.DragTitle=null;
136437
+ this.onmousemove = null;
136438
+ this.onmouseup = null;
136439
+ }
136093
136440
  }
136094
136441
 
136095
136442
 
@@ -136217,7 +136564,7 @@ function HQChartScriptWorker()
136217
136564
 
136218
136565
 
136219
136566
 
136220
- var HQCHART_VERSION="1.1.13312";
136567
+ var HQCHART_VERSION="1.1.13323";
136221
136568
 
136222
136569
  function PrintHQChartVersion()
136223
136570
  {