hqchart 1.1.15160 → 1.1.15168

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.
@@ -12643,7 +12643,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
12643
12643
  pt.X=this.Frame.GetXFromIndex(this.CursorIndex); //X轴动态变的
12644
12644
  if (this.ChartCorssCursor)
12645
12645
  {
12646
- if (this.ChartCorssCursor.Status==1)
12646
+ if ((this.ChartCorssCursor.Status&JSCHART_CORSSCURSOR_STATUS_ID.LINE_ID)>0)
12647
12647
  {
12648
12648
 
12649
12649
  }
@@ -14268,6 +14268,60 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
14268
14268
  return true;
14269
14269
  }
14270
14270
 
14271
+ /*
14272
+ //对比画图
14273
+ this.CompareChartDrawPicture=function(aryData)
14274
+ {
14275
+ var mapData=new Map();
14276
+ if (IFrameSplitOperator.IsNonEmptyArray(aryData))
14277
+ {
14278
+ for(var i=0;i<aryData.length;++i)
14279
+ {
14280
+ var item=aryData[i];
14281
+ if (!item.Guid) continue;
14282
+ mapData.set(item.Guid, item);
14283
+ }
14284
+ }
14285
+
14286
+ var mapChart=new Map();
14287
+ if (IFrameSplitOperator.IsNonEmptyArray(this.ChartDrawPicture))
14288
+ {
14289
+ for(var i=0;i<this.ChartDrawPicture.length;++i)
14290
+ {
14291
+ var item=this.ChartDrawPicture[i];
14292
+ mapChart.set(item.Guid, item);
14293
+ }
14294
+ }
14295
+
14296
+ var aryDelete=[], aryEqual=[], aryNew=[];
14297
+
14298
+ for(var mapItem of mapData)
14299
+ {
14300
+ var item=mapItem[1];
14301
+ if (mapChart.has(item.Guid)) //存在的
14302
+ {
14303
+ var chart=mapChart.get(item.Guid);
14304
+ aryEqual.push({ Chart:chart, Data:item });
14305
+ }
14306
+ else
14307
+ {
14308
+ aryNew.push({ Data:item }); //新建
14309
+ }
14310
+ }
14311
+
14312
+ for(var mapItem of mapChart)
14313
+ {
14314
+ var item=mapItem[1];
14315
+ if (!mapData.has(item.Guid))
14316
+ {
14317
+ aryDelete.push({ Chart:item }); //删除的
14318
+ }
14319
+ }
14320
+
14321
+ return { AryDelete:aryDelete, AryNew:aryNew, AryEqual:aryEqual };
14322
+ }
14323
+ */
14324
+
14271
14325
  //清空所有的画线工具 option={ Draw:false/true }
14272
14326
  this.ClearChartDrawPicture=function(drawPicture, option)
14273
14327
  {
@@ -19904,7 +19958,8 @@ function AverageWidthFrame()
19904
19958
  this.Canvas.fillRect(rectLeft,bgTop,itemText.Width,textHeight);
19905
19959
  }
19906
19960
 
19907
- this.Canvas.fillStyle = item.TextColor;
19961
+ if (itemText.TextColor) this.Canvas.fillStyle=itemText.TextColor;
19962
+ else this.Canvas.fillStyle = item.TextColor;
19908
19963
  this.Canvas.fillText(itemText.Text, textLeft - 1*pixelTatio, yText);
19909
19964
  }
19910
19965
 
@@ -19918,7 +19973,8 @@ function AverageWidthFrame()
19918
19973
  }
19919
19974
  }
19920
19975
  }
19921
- else if (item.Message[1]) //右
19976
+
19977
+ if (item.Message[1]) // 右
19922
19978
  {
19923
19979
  if (borderRight<10 || position==1)
19924
19980
  {
@@ -66744,6 +66800,7 @@ function DynamicChartTitlePainting()
66744
66800
  if (option)
66745
66801
  {
66746
66802
  if (option.DynamicTitle===true) this.DynamicTitle={ OutName:null, OutValue:null }; //主图胴动态标题
66803
+ if (option.ArgumentsText===true) this.ArgumentsText=null;
66747
66804
  }
66748
66805
  }
66749
66806
 
@@ -88692,7 +88749,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
88692
88749
 
88693
88750
  this.RecvRealtimeData=function(data)
88694
88751
  {
88695
- if (this.IsOnTouch==true) return; //正在操作手势不更新数据
88752
+ if (this.IsOnTouch==true) return; //正在操作手势不更新数据
88696
88753
  if (this.IsPauseUpdateByKeyboard()) return; //正在操作键盘不更新数据
88697
88754
 
88698
88755
  if (data.Ver==3.0)
@@ -89776,7 +89833,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
89776
89833
  //清空东条标题
89777
89834
  var titleIndex=windowIndex+1;
89778
89835
  var chartTitle=this.TitlePaint[titleIndex];
89779
- if (chartTitle) chartTitle.Clear({ DynamicTitle:true });
89836
+ if (chartTitle) chartTitle.Clear({ DynamicTitle:true , ArgumentsText:true});
89780
89837
  }
89781
89838
 
89782
89839
  //显示隐藏主图K线
@@ -110212,12 +110269,23 @@ var Character =
110212
110269
  return (cp >= 0x30 && cp <= 0x39) || (cp >= 0x41 && cp <= 0x46) || (cp >= 0x61 && cp <= 0x66); // a..f
110213
110270
  },
110214
110271
 
110215
- isOctalDigit: function (cp)
110272
+ IsOctalDigit: function (cp)
110216
110273
  {
110217
110274
  return (cp >= 0x30 && cp <= 0x37); // 0..7
110218
110275
  }
110219
110276
  }
110220
110277
 
110278
+
110279
+ function HexValue(ch)
110280
+ {
110281
+ return '0123456789abcdef'.indexOf(ch.toLowerCase());
110282
+ }
110283
+
110284
+ function OctalValue(ch)
110285
+ {
110286
+ return '01234567'.indexOf(ch);
110287
+ }
110288
+
110221
110289
  var TOKEN_NAME={};
110222
110290
  TOKEN_NAME[1 /* BooleanLiteral */] = 'Boolean';
110223
110291
  TOKEN_NAME[2 /* EOF */] = '<end>';
@@ -110316,6 +110384,7 @@ JSComplierHelper.GetConvertValueName=function(funcName)
110316
110384
  function ErrorHandler()
110317
110385
  {
110318
110386
  this.Error=[];
110387
+ this.IsTolerant=false;
110319
110388
 
110320
110389
  this.RecordError=function(error)
110321
110390
  {
@@ -110342,7 +110411,7 @@ function ErrorHandler()
110342
110411
  return error;
110343
110412
  }
110344
110413
 
110345
- this.CreateError=function(index, line, col, description, word)
110414
+ this.CreateError=function(index, line, col, description, word=null)
110346
110415
  {
110347
110416
  let msg='Line ' + line + ': ' + description;
110348
110417
  let error=this.ConstructError(msg,col);
@@ -110359,6 +110428,13 @@ function ErrorHandler()
110359
110428
  throw error;
110360
110429
  }
110361
110430
 
110431
+ this.TolerateError=function(index, line, col, description)
110432
+ {
110433
+ const error = this.CreateError(index, line, col, description);
110434
+ if (this.IsTolerant) this.RecordError(error);
110435
+ else throw error;
110436
+ }
110437
+
110362
110438
  //重新下载数据
110363
110439
  this.ThrowDownloadJob=function(index, line, col, description,job)
110364
110440
  {
@@ -110396,12 +110472,22 @@ function Scanner(code, ErrorHandler)
110396
110472
  return this.Index>=this.Length;
110397
110473
  }
110398
110474
 
110475
+ this.ThrowUnexpectedToken=function(message=Messages.UnexpectedTokenIllegal)
110476
+ {
110477
+ return this.ErrorHandler.ThrowError(this.Index, this.LineNumber, this.Index - this.LineStart + 1, message);
110478
+ }
110479
+
110480
+ this.TolerateUnexpectedToken=function(message = Messages.UnexpectedTokenIllegal)
110481
+ {
110482
+ this.ErrorHandler.TolerateError(this.Index, this.LineNumber, this.Index - this.LineStart + 1, message);
110483
+ }
110484
+
110399
110485
  this.IsKeyword=function(id)
110400
110486
  {
110401
110487
  return false;
110402
110488
  }
110403
110489
 
110404
- this.CodePointAt = function (i)
110490
+ this.CodePointAt=function (i)
110405
110491
  {
110406
110492
  let cp = this.Source.charCodeAt(i);
110407
110493
  if (cp >= 0xD800 && cp <= 0xDBFF)
@@ -110415,6 +110501,27 @@ function Scanner(code, ErrorHandler)
110415
110501
  return cp;
110416
110502
  }
110417
110503
 
110504
+ //8进制->10进制
110505
+ this.OctalToDecimal=function(ch)
110506
+ {
110507
+ // \0 is not octal escape sequence
110508
+ let octal = (ch !== '0');
110509
+ let code = OctalValue(ch);
110510
+
110511
+ if (!this.IsEOF() && Character.IsOctalDigit(this.Source.charCodeAt(this.Index)))
110512
+ {
110513
+ octal = true;
110514
+ code = code * 8 + OctalValue(this.Source[this.Index++]);
110515
+
110516
+ // 3 digits are only allowed when string starts
110517
+ // with 0, 1, 2, 3
110518
+ if ('0123'.indexOf(ch) >= 0 && !this.IsEOF() && Character.IsOctalDigit(this.Source.charCodeAt(this.Index)))
110519
+ code = code * 8 + OctalValue(this.Source[this.Index++]);
110520
+ }
110521
+
110522
+ return { Code: code, Octal: octal };
110523
+ }
110524
+
110418
110525
  this.Lex=function()
110419
110526
  {
110420
110527
  if (this.IsEOF()) return { Type:2/*EOF*/, Value:'', LineNumber:this.LineNumber, LineStart:this.LineStart, Start:this.Index, End:this.Index };
@@ -110501,6 +110608,123 @@ function Scanner(code, ErrorHandler)
110501
110608
  return this.Source.slice(start,this.Index);
110502
110609
  }
110503
110610
 
110611
+ this.GetComplexIdentifier=function()
110612
+ {
110613
+ let cp = this.CodePointAt(this.Index);
110614
+ let id = Character.FromCodePoint(cp);
110615
+ this.Index += id.length;
110616
+
110617
+ // '\u' (U+005C, U+0075) denotes an escaped character.
110618
+ let ch;
110619
+ if (cp === 0x5C)
110620
+ {
110621
+ if (this.Source.charCodeAt(this.Index) !== 0x75)
110622
+ this.ThrowUnexpectedToken();
110623
+
110624
+ ++this.Index;
110625
+ if (this.Source[this.Index] === '{')
110626
+ {
110627
+ ++this.Index;
110628
+ ch = this.ScanUnicodeCodePointEscape();
110629
+ }
110630
+ else
110631
+ {
110632
+ ch = this.ScanHexEscape('u');
110633
+ if (ch === null || ch === '\\' || !Character.IsIdentifierStart(ch.charCodeAt(0)))
110634
+ this.ThrowUnexpectedToken();
110635
+ }
110636
+ id = ch;
110637
+ }
110638
+
110639
+ while (!this.IsEOF())
110640
+ {
110641
+ cp = this.CodePointAt(this.Index);
110642
+ if (!Character.IsIdentifierPart(cp))
110643
+ break;
110644
+
110645
+ ch = Character.FromCodePoint(cp);
110646
+ id += ch;
110647
+ this.Index += ch.length;
110648
+
110649
+ // '\u' (U+005C, U+0075) denotes an escaped character.
110650
+ if (cp === 0x5C)
110651
+ {
110652
+ id = id.substring(0, id.length - 1);
110653
+ if (this.Source.charCodeAt(this.Index) !== 0x75)
110654
+ this.ThrowUnexpectedToken();
110655
+
110656
+ ++this.Index;
110657
+ if (this.Source[this.Index] === '{')
110658
+ {
110659
+ ++this.Index;
110660
+ ch = this.ScanUnicodeCodePointEscape();
110661
+ }
110662
+ else
110663
+ {
110664
+ ch = this.ScanHexEscape('u');
110665
+ if (ch === null || ch === '\\' || !Character.IsIdentifierPart(ch.charCodeAt(0)))
110666
+ this.ThrowUnexpectedToken();
110667
+ }
110668
+ id += ch;
110669
+ }
110670
+ }
110671
+
110672
+ return id;
110673
+ }
110674
+
110675
+ this.ScanUnicodeCodePointEscape=function()
110676
+ {
110677
+ const result = this.TryToScanUnicodeCodePointEscape();
110678
+ if (result === null)
110679
+ return this.ThrowUnexpectedToken();
110680
+
110681
+ return result;
110682
+ }
110683
+
110684
+ this.TryToScanUnicodeCodePointEscape=function()
110685
+ {
110686
+ let ch = this.Source[this.Index];
110687
+ let code = 0;
110688
+
110689
+ // At least, one hex digit is required.
110690
+ if (ch === '}')
110691
+ return null;
110692
+
110693
+ while (!this.IsEOF())
110694
+ {
110695
+ ch = this.Source[this.Index++];
110696
+ if (!Character.IsHexDigit(ch.charCodeAt(0)))
110697
+ break;
110698
+
110699
+ code = code * 16 + HexValue(ch);
110700
+ }
110701
+
110702
+ if (code > 0x10FFFF || ch !== '}')
110703
+ return null;
110704
+
110705
+ return Character.FromCodePoint(code);
110706
+ }
110707
+
110708
+ this.ScanHexEscape=function(prefix)
110709
+ {
110710
+ const len = (prefix === 'u') ? 4 : 2;
110711
+ let code = 0;
110712
+
110713
+ for (let i = 0; i < len; ++i)
110714
+ {
110715
+ if (!this.IsEOF() && Character.IsHexDigit(this.Source.charCodeAt(this.Index)))
110716
+ {
110717
+ code = code * 16 + HexValue(this.source[this.Index++]);
110718
+ }
110719
+ else
110720
+ {
110721
+ return null;
110722
+ }
110723
+ }
110724
+
110725
+ return String.fromCharCode(code);
110726
+ }
110727
+
110504
110728
  //操作符 https://tc39.github.io/ecma262/#sec-punctuators
110505
110729
  this.ScanPunctuator=function()
110506
110730
  {
@@ -110572,7 +110796,72 @@ function Scanner(code, ErrorHandler)
110572
110796
  }
110573
110797
  else if (ch=='\\') //字符串转义
110574
110798
  {
110575
- throw "not complete";
110799
+ ch = this.Source[this.Index++];
110800
+ if (!ch || !Character.IsLineTerminator(ch.charCodeAt(0)))
110801
+ {
110802
+ switch (ch)
110803
+ {
110804
+ case 'u':
110805
+ if (this.Source[this.Index] === '{')
110806
+ {
110807
+ ++this.Index;
110808
+ str += this.ScanUnicodeCodePointEscape();
110809
+ }
110810
+ else
110811
+ {
110812
+ const unescapedChar = this.ScanHexEscape(ch);
110813
+ if (unescapedChar === null)
110814
+ this.ThrowUnexpectedToken();
110815
+
110816
+ str += unescapedChar;
110817
+ }
110818
+ break;
110819
+ case 'x': //十六进制 它的转义规则:\x<hex>,\x后跟上2位十六进制数
110820
+ const unescaped = this.ScanHexEscape(ch);
110821
+ if (unescaped === null)
110822
+ this.ThrowUnexpectedToken(Messages.InvalidHexEscapeSequence);
110823
+
110824
+ str += unescaped;
110825
+ break;
110826
+ case 'n': //换行符
110827
+ str += '\n';
110828
+ break;
110829
+ case 'r': //回车键
110830
+ str += '\r';
110831
+ break;
110832
+ case 't': //制表符
110833
+ str += '\t';
110834
+ break;
110835
+ case 'b': //后退键
110836
+ str += '\b';
110837
+ break;
110838
+ case 'f': //换页符
110839
+ str += '\f';
110840
+ break;
110841
+ case 'v': //垂直制表符
110842
+ str += '\x0B';
110843
+ break;
110844
+ case '8':
110845
+ case '9':
110846
+ str += ch;
110847
+ this.TolerateUnexpectedToken();
110848
+ break;
110849
+ default:
110850
+ if (ch && Character.IsOctalDigit(ch.charCodeAt(0))) //反斜杠后面跟3位八进制数,就代表一个转义字符
110851
+ {
110852
+ const octToDec = this.OctalToDecimal(ch);
110853
+
110854
+ octal = octToDec.Octal || octal;
110855
+ str += String.fromCharCode(octToDec.Code);
110856
+ }
110857
+ else
110858
+ {
110859
+ str += ch;
110860
+ }
110861
+ break;
110862
+ }
110863
+ }
110864
+
110576
110865
  }
110577
110866
  else if (Character.IsLineTerminator(ch.charCodeAt(0)))
110578
110867
  {
@@ -165816,7 +166105,7 @@ function HQChartScriptWorker()
165816
166105
 
165817
166106
 
165818
166107
 
165819
- var HQCHART_VERSION="1.1.15159";
166108
+ var HQCHART_VERSION="1.1.15167";
165820
166109
 
165821
166110
  function PrintHQChartVersion()
165822
166111
  {