hqchart 1.1.14523 → 1.1.14538

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.
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.14522";
8
+ var HQCHART_VERSION="1.1.14536";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -55714,6 +55714,13 @@ HQData.NetworkFilter=function(data, callback)
55714
55714
  HQData.Report_APIIndex(data, callback);
55715
55715
  break;
55716
55716
 
55717
+
55718
+ /////////////////////////////////////////////////////////////////
55719
+ //
55720
+ case "KLineChartContainer::RequestVolumeProfileData": //成交量分布图
55721
+ HQData.RequestVolumeProfileData(data, callback);
55722
+ break;
55723
+
55717
55724
  }
55718
55725
  }
55719
55726
 
@@ -56812,7 +56819,7 @@ HQData.Report_RequestStockData=function(data, callback)
56812
56819
  newItem[33]=kData;
56813
56820
 
56814
56821
 
56815
- newItem[101]=HQData.GetRandomTestData(-90,1000);
56822
+ newItem[101]=HQData.GetRandomTestData(-9990,10000000);
56816
56823
  newItem[201]=`A-[${HQData.GetRandomTestData(-90,90)}]-B`;
56817
56824
 
56818
56825
 
@@ -58458,6 +58465,67 @@ HQData.APIIndex_TITLE=function(data, callback)
58458
58465
  }
58459
58466
 
58460
58467
 
58468
+ HQData.RequestVolumeProfileData=function(data, callback)
58469
+ {
58470
+ var request=data.Request;
58471
+ var startIndex=request.Start.DataIndex;
58472
+ var endIndex=request.End.DataIndex;
58473
+
58474
+ var hqchart=data.Self;
58475
+ var kData=hqchart.GetKData();
58476
+
58477
+ var maxPrice=null,minPrice=null;
58478
+ for(var i=startIndex;i<=endIndex && i<kData.Data.length; ++i)
58479
+ {
58480
+ var kItem=kData.Data[i];
58481
+ if (!kItem) continue;
58482
+
58483
+ if (maxPrice==null || maxPrice<kItem.High) maxPrice=kItem.High;
58484
+ if (minPrice==null || minPrice>kItem.Low) minPrice=kItem.Low;
58485
+ }
58486
+
58487
+ var aryData=[];
58488
+ var step=0.1;
58489
+ for(var i=minPrice, j=0;i<=maxPrice; i+=step, ++j)
58490
+ {
58491
+ var item=
58492
+ {
58493
+ Price:i,
58494
+ Vol:
58495
+ [
58496
+ {
58497
+ Value:HQData.GetRandomTestData(0,500)*1000,
58498
+ //Color:"rgba(103,179,238,0.8)",
58499
+ ColorID:0,
58500
+ },
58501
+ {
58502
+ Value:HQData.GetRandomTestData(0,500)*1000,
58503
+ //Color:"rgba(237,208,105,0.8)",
58504
+ ColorID:1,
58505
+ }
58506
+ ]
58507
+ };
58508
+
58509
+ item.TotalVol={ Value:item.Vol[0].Value+ item.Vol[1].Value, ColorID:0 };
58510
+
58511
+ if (j>5)
58512
+ {
58513
+ item.Vol[0].ColorID=2;
58514
+ item.Vol[1].ColorID=3;
58515
+ item.TotalVol.ColorID=2;
58516
+ }
58517
+
58518
+ aryData.push(item);
58519
+ }
58520
+
58521
+ var hqchartData={ Data:aryData, MaxPrice:maxPrice, MinPrice:minPrice, PriceOffset:step, code:0 };
58522
+
58523
+ console.log('[HQData.RequestVolumeProfileData] hqchartData=', hqchartData);
58524
+
58525
+ callback(hqchartData);
58526
+ }
58527
+
58528
+
58461
58529
 
58462
58530
 
58463
58531
  /*暴露外部用的方法*/