hqchart 1.1.14643 → 1.1.14648

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.14642";
8
+ var HQCHART_VERSION="1.1.14647";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -57549,6 +57549,8 @@ HQData.Report_APIIndex=function(data, callback)
57549
57549
  HQData.APIIndex_SCATTER_PLOT_V2(data, callback);
57550
57550
  else if (request.Data.indexname=="API_KLINE_TABLE")
57551
57551
  HQData.APIIndex_KLINE_TABLE(data, callback);
57552
+ else if (request.Data.indexname=="API_DRAWSVG")
57553
+ HQData.APIIndex_DRAWSVG(data, callback);
57552
57554
  }
57553
57555
 
57554
57556
 
@@ -58721,6 +58723,105 @@ HQData.APIIndex_KLINE_TABLE=function(data, callback)
58721
58723
  }
58722
58724
 
58723
58725
 
58726
+ HQData.APIIndex_DRAWSVG=function(data, callback)
58727
+ {
58728
+ data.PreventDefault=true;
58729
+ var hqchart=data.HQChart;
58730
+ var kData=hqchart.GetKData();
58731
+ var kCount=kData.Data.length;
58732
+
58733
+ var SVGData=
58734
+ {
58735
+ name:'买卖图标', type:1,
58736
+ Draw:
58737
+ {
58738
+ DrawType:'DRAWSVG',
58739
+ Family:'iconfont',
58740
+ TextFont:`${12*GetDevicePixelRatio()}px 微软雅黑`,
58741
+ EnableClick:true,
58742
+ EnalbeDetailNoOverlap:true,
58743
+ Data:
58744
+ [
58745
+ /*
58746
+ { Date:kData.Data[kCount-30].Date, Value:15.5, Text:'15.5' , Guid:"jj_1"},
58747
+ */
58748
+ ],
58749
+
58750
+ /*
58751
+ BuildKeyCallback:(item)=>
58752
+ {
58753
+ return `${item.Date}`;
58754
+ }
58755
+ */
58756
+ } //绘制文字
58757
+ };
58758
+
58759
+ var TEST_ICON_COLOR=["rgb(240,0,0)", "rgb(240,100,30)", "rgb(138,43, 226)", "rgb(151,255,255)", "rgb(255, 20, 147)"];
58760
+
58761
+ var count=1;
58762
+ for(var i=0 ;i<kCount;++i)
58763
+ {
58764
+ var item=kData.Data[i];
58765
+ if (i%10!=3) continue;
58766
+ count++;
58767
+
58768
+ var text=`提示信息:<br>日期:${IFrameSplitOperator.FormatDateString(item.Date)}<br>信息描述:太极(Tai Chi),即是阐明宇宙从无极而太极,以至万物化生的过程。`;
58769
+ if (IFrameSplitOperator.IsNumber(item.Time)) text=`提示信息:<br>日期:${IFrameSplitOperator.FormatDateString(item.Date)}<br>时间:${item.Time}`;
58770
+
58771
+ var colorIndex=Math.ceil(Math.random()*10) % (TEST_ICON_COLOR.length-1);
58772
+
58773
+ var drawItem=
58774
+ {
58775
+ Date:item.Date, Time:item.Time, Value:"H", ID:count,
58776
+ Text:{Content:`${count}`, Color:"rgb(0,0,0)", YOffset:-14},
58777
+ SVG: { Symbol:"\ue6a7", Color:TEST_ICON_COLOR[colorIndex], Size:32*GetDevicePixelRatio(),YOffset:-5 },
58778
+ Tooltip:
58779
+ {
58780
+ Text:text,
58781
+ Ver:2.0,
58782
+ AryText:
58783
+ [
58784
+ { Text:"提示信息", TextColor:"rgb(255,215,0)"},
58785
+ { Text:`ID:${count}`, TextColor:"rgb(255,215,0)"},
58786
+ { Title:"日期", Text:`${IFrameSplitOperator.FormatDateString(item.Date)}`},
58787
+ { Title:"信息描述", Text:`太极生两仪,两仪生四象!!!`, TextColor:"rgb(255,0,255)"}
58788
+ ]
58789
+ },
58790
+ Line: { Color:"rgb(255,0,255)", Dash:[5,5], Value:"C", Width:1, SVGBlank:4 },
58791
+
58792
+ Detail:
58793
+ {
58794
+ Content:
58795
+ [
58796
+ {Text:"买:11.99", Color:"rgb(255,100,100)" },
58797
+ {Text:"涨幅:90.0%", Color:"rgb(230,230,0)"}
58798
+ ] ,
58799
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
58800
+ ItemSpace:3,
58801
+ YOffset:-5,
58802
+ XOffset:2,
58803
+ BGColor:"rgba(0, 0, 0, 0.8)",
58804
+ BorderColor:"rgb(255, 185, 15)" ,
58805
+ LeftMargin:3,
58806
+ RightMargin:4
58807
+ },
58808
+ };
58809
+
58810
+ SVGData.Draw.Data.push(drawItem);
58811
+ }
58812
+
58813
+ var apiData=
58814
+ {
58815
+ code:0,
58816
+ stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
58817
+ outdata: { date:kData.GetDate(), time:kData.GetTime(), outvar:[SVGData] }
58818
+ };
58819
+
58820
+ console.log('[HQData.APIIndex_DRAWSVG] apiData ', apiData);
58821
+ callback(apiData);
58822
+ }
58823
+
58824
+
58724
58825
  HQData.RequestVolumeProfileData=function(data, callback)
58725
58826
  {
58726
58827
  var request=data.Request;