hqchart 1.1.15002 → 1.1.15006

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.
@@ -282,35 +282,69 @@ HQData.Minute_RequestMinuteData=function(data, callback)
282
282
  }
283
283
  */
284
284
 
285
- var before=[];
286
- var beforeinfo={ totalcount:60*10, ver:2.0, TimeConfig:{ AryTime:[{ Start:91500, End:92459, Date:srcStock.date }]} }; //9:15-9:25 集合竞价15分钟 1s一个数据
287
- var price=srcStock.yclose+0.01;
285
+ if (symbol=="000001.sh") //指数
286
+ {
287
+ var before=[];
288
+ var beforeinfo={ totalcount:60*10, ver:3.0, TimeConfig:{ AryTime:[{ Start:91500, End:92459, Date:srcStock.date }]} }; //9:15-9:25 集合竞价15分钟 1s一个数据
289
+ var price=srcStock.yclose+0.01;
290
+ var vol=0;
288
291
 
289
- var date=new Date(2021,5,2, 9,15, 0);
290
- before=
291
- [
292
- [91505,price+0.01, 400, 300, 1, 800],
293
- [91550,price+0.02, 550, 600, 0, 1500],
294
- [91603,price+0.03, 300, 600, 1, 3600],
295
- [91613,price+0.03, 150, 320, 1, 3600],
296
- [91623,price+0.04, 200, 400, 1, 3600],
297
- [91635,price+0.05, 100, 100, 1, 3600],
298
- [91640,price+0.03, 350, 210, 2, 1600],
299
- [91711,price+0.02, 3210, 350, 2, 3700],
300
- [91731,price+0.04, 110, 450, 1, 3700],
301
- [91825,price-0.01, 210, 650, 2, 3700],
302
- [91855,price-0.02, 330, 440, 1, 1000],
303
- [91915,price-0.03, 630, 640, 1, 1200],
304
- [92022,price+0.01, 260, 550, 2, 1000],
305
- [92304,price-0.02, 300, 100, 2, 1000],
306
- [92314,price-0.03, 550, 150, 2, 1000],
307
- [92344,price-0.04, 550, 150, 1, 1000],
308
- [92357,price-0.05, 250, 750, 1, 1500],
309
- [92405,price-0.07, 450, 50, 2, 1000],
310
- [92435,price-0.08, 650, 250, 1, 1000],
311
- [92458,price-0.12, 350, 350, 2, 1000],
312
- ];
313
-
292
+ var date=new Date(2021,5,2, 9,15, 0);
293
+ var testData={ Up:1, Max:srcStock.yclose*1.02, Min:srcStock.yclose*0.98 };
294
+
295
+ for(var i=0;i<beforeinfo.totalcount; ++i) //3s一个数据
296
+ {
297
+ var time=date.getHours()*10000+date.getMinutes()*100+date.getSeconds();
298
+ vol=HQData.GetRandomTestData(100,500)*1000;
299
+ var item=[ time, price, price+0.04, vol, 3, vol*1.3 ];
300
+ before.push(item);
301
+
302
+ if (price>testData.Max && testData.Up===1)
303
+ testData.Up=0;
304
+ else if (price<testData.Min && testData.Up===0)
305
+ testData.Up=1;
306
+
307
+ var value=HQData.GetRandomTestData(1,10)/100;
308
+ if (testData.Up==1) price+=value;
309
+ else price-=value;
310
+
311
+ date.setSeconds(date.getSeconds()+3);
312
+ time=date.getHours()*10000+date.getMinutes()*100+date.getSeconds();
313
+ if (time>92500) break;
314
+ }
315
+
316
+ }
317
+ else //股票
318
+ {
319
+ var before=[];
320
+ var beforeinfo={ totalcount:60*10, ver:2.0, TimeConfig:{ AryTime:[{ Start:91500, End:92459, Date:srcStock.date }]} }; //9:15-9:25 集合竞价15分钟 1s一个数据
321
+ var price=srcStock.yclose+0.01;
322
+
323
+ var date=new Date(2021,5,2, 9,15, 0);
324
+ before=
325
+ [
326
+ [91505,price+0.01, 400, 300, 1, 800],
327
+ [91550,price+0.02, 550, 600, 0, 1500],
328
+ [91603,price+0.03, 300, 600, 1, 3600],
329
+ [91613,price+0.03, 150, 320, 1, 3600],
330
+ [91623,price+0.04, 200, 400, 1, 3600],
331
+ [91635,price+0.05, 100, 100, 1, 3600],
332
+ [91640,price+0.03, 350, 210, 2, 1600],
333
+ [91711,price+0.02, 3210, 350, 2, 3700],
334
+ [91731,price+0.04, 110, 450, 1, 3700],
335
+ [91825,price-0.01, 210, 650, 2, 3700],
336
+ [91855,price-0.02, 330, 440, 1, 1000],
337
+ [91915,price-0.03, 630, 640, 1, 1200],
338
+ [92022,price+0.01, 260, 550, 2, 1000],
339
+ [92304,price-0.02, 300, 100, 2, 1000],
340
+ [92314,price-0.03, 550, 150, 2, 1000],
341
+ [92344,price-0.04, 550, 150, 1, 1000],
342
+ [92357,price-0.05, 250, 750, 1, 1500],
343
+ [92405,price-0.07, 450, 50, 2, 1000],
344
+ [92435,price-0.08, 650, 250, 1, 1000],
345
+ [92458,price-0.12, 350, 350, 2, 1000],
346
+ ];
347
+ }
314
348
 
315
349
  stockItem.before=before;
316
350
  stockItem.beforeinfo=beforeinfo;
@@ -393,27 +427,51 @@ HQData.Minute_RequestMinuteData=function(data, callback)
393
427
  }
394
428
  */
395
429
 
396
- var afterData=[]
397
- var afterInfo={ ver:2.0, totalcount:60*3, TimeConfig:{ AryTime:[{ Start:145700, End:145959, Date:srcStock.date }]} } //14:57-15:00
398
- if (stockItem.minute.length>=240)
430
+ if (symbol=="000001.sh") //指数
399
431
  {
400
- afterData=
401
- [
402
- [145708,price+0.01, 400, 300, 1, 800],
403
- [145718,price+0.02, 550, 600, 0, 1500],
404
- [145738,price+0.02, 150, 800, 0, 1500],
405
- [145748,price+0.02, 150, 800, 0, 1500],
406
- [145803,price+0.03, 300, 600, 1, 3600],
407
- [145815,price+0.03, 350, 210, 2, 1600],
408
- [145826,price+0.02, 1210, 350, 2, 2700],
409
- [145833,price+0.01, 260, 550, 2, 1000],
410
- [145845,price+0.02, 160, 750, 2, 1000],
411
- [145858,price-0.01, 460, 650, 2, 1500],
412
- [145905,price-0.02, 160, 450, 1, 1500],
413
- [145928,price-0.02, 260, 250, 1, 1500],
414
- [145948,price-0.02, 860, 150, 1, 1500],
415
- ];
432
+ var afterData=[]
433
+ var afterInfo={ ver:3.0, totalcount:60*3, TimeConfig:{ AryTime:[{ Start:145700, End:145959, Date:srcStock.date }]} } //14:57-15:00
434
+ var date=new Date(2021,5,2, 14,57, 0);
435
+ var vol=0;
436
+ for(var i=0;i<afterInfo.totalcount; ++i) //1s一个数据
437
+ {
438
+ var time=date.getHours()*10000+date.getMinutes()*100+date.getSeconds();
439
+
440
+ vol=HQData.GetRandomTestData(100,500)*1000;
441
+ var item=[ time, price, price+0.04, vol, 3, vol*1.3 ];
442
+
443
+ afterData.push(item);
444
+
445
+ date.setSeconds(date.getSeconds()+3);
446
+ var time=date.getHours()*10000+date.getMinutes()*100+date.getSeconds();
447
+ if (time>145959) break;
448
+ }
449
+ }
450
+ else
451
+ {
452
+ var afterData=[]
453
+ var afterInfo={ ver:2.0, totalcount:60*3, TimeConfig:{ AryTime:[{ Start:145700, End:145959, Date:srcStock.date }]} } //14:57-15:00
454
+ if (stockItem.minute.length>=240)
455
+ {
456
+ afterData=
457
+ [
458
+ [145708,price+0.01, 400, 300, 1, 800],
459
+ [145718,price+0.02, 550, 600, 0, 1500],
460
+ [145738,price+0.02, 150, 800, 0, 1500],
461
+ [145748,price+0.02, 150, 800, 0, 1500],
462
+ [145803,price+0.03, 300, 600, 1, 3600],
463
+ [145815,price+0.03, 350, 210, 2, 1600],
464
+ [145826,price+0.02, 1210, 350, 2, 2700],
465
+ [145833,price+0.01, 260, 550, 2, 1000],
466
+ [145845,price+0.02, 160, 750, 2, 1000],
467
+ [145858,price-0.01, 460, 650, 2, 1500],
468
+ [145905,price-0.02, 160, 450, 1, 1500],
469
+ [145928,price-0.02, 260, 250, 1, 1500],
470
+ [145948,price-0.02, 860, 150, 1, 1500],
471
+ ];
472
+ }
416
473
  }
474
+
417
475
  stockItem.after=afterData;
418
476
  stockItem.afterinfo=afterInfo;
419
477
  }
@@ -467,16 +525,50 @@ HQData.Minute_RequestMinuteUpdateData=function(data, callback)
467
525
 
468
526
  if (callcation.Before)
469
527
  {
470
- var beforeinfo={ totalcount:60*10, ver:2.0, TimeConfig:{ AryTime:[{ Start:91500, End:92459, Date:srcStock.date }]} }; //9:15-9:25 集合竞价15分钟 1s一个数据
471
- var price=srcStock.yclose-0.01;
472
- var before=
473
- [
474
- [92344,price-0.03, 150, 150, 2, 1000],
475
- [92357,price-0.04, 250, 250, 2, 1500],
476
- [92405,price-0.05, 350, 350, 1, 1000],
477
- [92435,price-0.06, 450, 450, 1, 1000],
478
- [92458,price-0.07, 550, 550, 2, 1000],
479
- ];
528
+ if (symbol=="000001.sh") //指数
529
+ {
530
+ var before=[];
531
+ var beforeinfo={ totalcount:60*10, ver:3.0, TimeConfig:{ AryTime:[{ Start:91500, End:92459, Date:srcStock.date }]} }; //9:15-9:25 集合竞价15分钟 1s一个数据
532
+ var price=srcStock.yclose+0.01;
533
+ var vol=0;
534
+
535
+ var date=new Date(2021,5,2, 9,15, 0);
536
+ var testData={ Value:0.01, Up:1, Max:srcStock.yclose*1.02, Min:srcStock.yclose*0.98 };
537
+
538
+ for(var i=0;i<beforeinfo.totalcount; ++i) //3s一个数据
539
+ {
540
+ vol=HQData.GetRandomTestData(100,500)*1000;
541
+ var time=date.getHours()*10000+date.getMinutes()*100+date.getSeconds();
542
+ var item=[ time, price, price+0.04, vol, 3, vol*1.3 ];
543
+ before.push(item);
544
+
545
+ if (price>testData.Max && testData.Up===1)
546
+ testData.Up=0;
547
+ else if (price<testData.Min && testData.Up===0)
548
+ testData.Up=1;
549
+
550
+ var value=HQData.GetRandomTestData(1,10)/100;
551
+ if (testData.Up==1) price+=value;
552
+ else price-=value;
553
+
554
+ date.setSeconds(date.getSeconds()+3);
555
+ time=date.getHours()*10000+date.getMinutes()*100+date.getSeconds();
556
+ if (time>92500) break;
557
+ }
558
+ }
559
+ else
560
+ {
561
+ var beforeinfo={ totalcount:60*10, ver:2.0, TimeConfig:{ AryTime:[{ Start:91500, End:92459, Date:srcStock.date }]} }; //9:15-9:25 集合竞价15分钟 1s一个数据
562
+ var price=srcStock.yclose-0.01;
563
+ var before=
564
+ [
565
+ [92344,price-0.03, 150, 150, 2, 1000],
566
+ [92357,price-0.04, 250, 250, 2, 1500],
567
+ [92405,price-0.05, 350, 350, 1, 1000],
568
+ [92435,price-0.06, 450, 450, 1, 1000],
569
+ [92458,price-0.07, 550, 550, 2, 1000],
570
+ ];
571
+ }
480
572
 
481
573
  stockItem.before=before;
482
574
  stockItem.beforeinfo=beforeinfo;
@@ -484,30 +576,57 @@ HQData.Minute_RequestMinuteUpdateData=function(data, callback)
484
576
 
485
577
  if (callcation.After)
486
578
  {
487
- var afterInfo={ totalcount:60*10, ver:2.0, TimeConfig:{ AryTime:[{ Start:145700, End:145959, Date:srcStock.date }]} }; //9:15-9:25 集合竞价15分钟 1s一个数据
488
- var afterData=[];
489
-
490
- if (IFrameSplitOperator.IsNonEmptyArray(lastItem) && lastItem[1]>=1457)
579
+ if (symbol=="000001.sh") //指数
491
580
  {
492
- var price=lastItem[5];
493
- afterData=
494
- [
495
- [145708,price+0.01, 400, 300, 1, 800],
496
- [145718,price+0.02, 550, 600, 0, 1500],
497
- [145738,price+0.02, 150, 800, 0, 1500],
498
- [145748,price+0.02, 150, 800, 0, 1500],
499
- [145803,price+0.03, 300, 600, 1, 3600],
500
- [145815,price+0.03, 350, 210, 2, 1600],
501
- [145826,price+0.02, 1210, 350, 2, 2700],
502
- [145833,price+0.01, 260, 550, 2, 1000],
503
- [145845,price+0.02, 160, 750, 2, 1000],
504
- [145858,price-0.01, 460, 650, 2, 1500],
505
- [145905,price-0.02, 160, 450, 1, 1500],
506
- [145928,price-0.02, 260, 250, 1, 1500],
507
- [145948,price-0.02, 860, 150, 1, 1500],
508
- ];
581
+ var afterData=[]
582
+ var afterInfo={ ver:3.0, totalcount:60*3, TimeConfig:{ AryTime:[{ Start:145700, End:145959, Date:srcStock.date }]} } //14:57-15:00
583
+ if (IFrameSplitOperator.IsNonEmptyArray(lastItem) && lastItem[1]>=1457)
584
+ {
585
+ var price=lastItem[5];
586
+ var date=new Date(2021,5,2, 14,57, 0);
587
+ var vol=0;
588
+ for(var i=0;i<afterInfo.totalcount; ++i) //1s一个数据
589
+ {
590
+ var time=date.getHours()*10000+date.getMinutes()*100+date.getSeconds();
591
+
592
+ vol=HQData.GetRandomTestData(100,500)*1000;
593
+ var item=[ time, price, price+0.04, vol, 3, vol*1.3 ];
594
+
595
+ afterData.push(item);
596
+
597
+ date.setSeconds(date.getSeconds()+3);
598
+ var time=date.getHours()*10000+date.getMinutes()*100+date.getSeconds();
599
+ if (time>145959) break;
600
+ }
601
+ }
509
602
  }
603
+ else
604
+ {
605
+ var afterInfo={ totalcount:60*10, ver:2.0, TimeConfig:{ AryTime:[{ Start:145700, End:145959, Date:srcStock.date }]} }; //9:15-9:25 集合竞价15分钟 1s一个数据
606
+ var afterData=[];
510
607
 
608
+ if (IFrameSplitOperator.IsNonEmptyArray(lastItem) && lastItem[1]>=1457)
609
+ {
610
+ var price=lastItem[5];
611
+ afterData=
612
+ [
613
+ [145708,price+0.01, 400, 300, 1, 800],
614
+ [145718,price+0.02, 550, 600, 0, 1500],
615
+ [145738,price+0.02, 150, 800, 0, 1500],
616
+ [145748,price+0.02, 150, 800, 0, 1500],
617
+ [145803,price+0.03, 300, 600, 1, 3600],
618
+ [145815,price+0.03, 350, 210, 2, 1600],
619
+ [145826,price+0.02, 1210, 350, 2, 2700],
620
+ [145833,price+0.01, 260, 550, 2, 1000],
621
+ [145845,price+0.02, 160, 750, 2, 1000],
622
+ [145858,price-0.01, 460, 650, 2, 1500],
623
+ [145905,price-0.02, 160, 450, 1, 1500],
624
+ [145928,price-0.02, 260, 250, 1, 1500],
625
+ [145948,price-0.02, 860, 150, 1, 1500],
626
+ ];
627
+ }
628
+ }
629
+
511
630
  stockItem.after=afterData;
512
631
  stockItem.afterinfo=afterInfo;
513
632
  }
@@ -17621,6 +17621,7 @@ function AverageWidthFrame()
17621
17621
  {
17622
17622
  var x=mouseOnToolbar.Point.X;
17623
17623
  var y=mouseOnToolbar.Point.Y+20;
17624
+ if (y+textHeight>border.ChartHeight) y=mouseOnToolbar.Point.Y-5-textHeight;
17624
17625
  }
17625
17626
  else if (JSCHART_BUTTON_ID.CLOSE_BEFOREOPEN_ID==mouseOnToolbar.Item.ID)
17626
17627
  {
@@ -138893,10 +138894,18 @@ function JSReportChart(divElement)
138893
138894
  if (IFrameSplitOperator.IsBool(option.EnableDragRow)) chart.EnableDragRow=option.EnableDragRow;
138894
138895
  if (IFrameSplitOperator.IsNumber(option.DragRowType)) chart.DragRowType=option.DragRowType;
138895
138896
  if (IFrameSplitOperator.IsBool(option.EnableDragHeader)) chart.EnableDragHeader=option.EnableDragHeader;
138896
- if (IFrameSplitOperator.IsNumber(option.WheelPageType)) chart.WheelPageType=option.WheelPageType;
138897
+ if (IFrameSplitOperator.IsNumber(option.WheelPageType)) chart.WheelPageConfig.Type=option.WheelPageType;
138897
138898
  if (IFrameSplitOperator.IsBool(option.PageUpDownCycle)) chart.PageUpDownCycle=option.PageUpDownCycle;
138898
138899
  if (IFrameSplitOperator.IsBool(option.EnablePageUpdate)) chart.EnablePageUpdate=option.EnablePageUpdate;
138899
138900
 
138901
+ if (option.WheelPage)
138902
+ {
138903
+ var item=option.WheelPage;
138904
+ if (IFrameSplitOperator.IsNumber(item.Type)) chart.WheelPageConfig.Type=item.Type;
138905
+ if (IFrameSplitOperator.IsPlusNumber(item.RowStep)) chart.WheelPageConfig.RowStep=item.RowStep;
138906
+ if (IFrameSplitOperator.IsBool(item.EnableCtrlTurn)) chart.WheelPageConfig.EnableCtrlTurn=item.EnableCtrlTurn;
138907
+ }
138908
+
138900
138909
  //数据下载提示信息
138901
138910
  if (IFrameSplitOperator.IsObject(option.SplashTitle))
138902
138911
  {
@@ -139187,7 +139196,13 @@ function JSReportChartContainer(uielement)
139187
139196
 
139188
139197
  this.PageUpDownCycle=true; //翻页循环
139189
139198
  this.DragPageCycle=true; //手机翻页循环
139190
- this.WheelPageType=0; //鼠标滚轴翻页模式 0=一页一页翻 1=一条一条翻
139199
+ //this.WheelPageType=0; //鼠标滚轴翻页模式 0=一页一页翻 1=一条一条翻
139200
+
139201
+ //鼠标滚轴配置
139202
+ // Type:0=一页一页翻 1=一条一条翻,
139203
+ // RowStep:单条数据滚动步长
139204
+ // EnableCtrlTurn Ctrl+滚轴翻页
139205
+ this.WheelPageConfig={ Type:0, RowStep:1, EnableCtrlTurn:false }
139191
139206
 
139192
139207
  //拖拽滚动条
139193
139208
  this.DragXScroll=null; //{Start:{x,y}, End:{x, y}}
@@ -140702,14 +140717,17 @@ function JSReportChartContainer(uielement)
140702
140717
  if (!IFrameSplitOperator.IsObjectExist(e.wheelDelta))
140703
140718
  wheelValue=e.deltaY* -0.01;
140704
140719
 
140705
- if (this.WheelPageType==1)
140720
+ var type=this.WheelPageConfig.Type;
140721
+ if (this.WheelPageConfig.EnableCtrlTurn && e && e.ctrlKey) type=0; //ctrl 翻页
140722
+
140723
+ if (type)
140706
140724
  {
140707
- console.log(`[OnWheel] wheelValue=${wheelValue}`);
140725
+ var step=this.WheelPageConfig.RowStep;
140708
140726
  if (wheelValue<0) //下
140709
140727
  {
140710
140728
  this.LastMouseStatus.TooltipStatus=null;
140711
140729
  this.HideAllTooltip();
140712
- if (this.GotoNextItem(1))
140730
+ if (this.GotoNextItem(step))
140713
140731
  {
140714
140732
  this.Draw();
140715
140733
  this.DelayUpdateStockData();
@@ -140719,7 +140737,7 @@ function JSReportChartContainer(uielement)
140719
140737
  {
140720
140738
  this.LastMouseStatus.TooltipStatus=null;
140721
140739
  this.HideAllTooltip();
140722
- if (this.GotoNextItem(-1))
140740
+ if (this.GotoNextItem(step*-1))
140723
140741
  {
140724
140742
  this.Draw();
140725
140743
  this.DelayUpdateStockData();
@@ -152481,7 +152499,7 @@ function ScrollBarBGChart()
152481
152499
 
152482
152500
 
152483
152501
 
152484
- var HQCHART_VERSION="1.1.15001";
152502
+ var HQCHART_VERSION="1.1.15005";
152485
152503
 
152486
152504
  function PrintHQChartVersion()
152487
152505
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.15001";
8
+ var HQCHART_VERSION="1.1.15005";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {