hqchart 1.1.13263 → 1.1.13265

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.
@@ -2071,6 +2071,7 @@ this.XYSplit=true;//XY轴坐标信息改变
2071
2071
  this.XSplit=true;//X轴变化
2072
2072
  this.HorizontalMax;//Y轴最大值
2073
2073
  this.HorizontalMin;//Y轴最小值
2074
+ this.HorizontalReserved=null;//Y轴预留高度 { Top:上, Bottom:下 }
2074
2075
  this.XPointCount=10;//X轴数据个数
2075
2076
  this.ClientBGColor;//客户区背景色
2076
2077
  //Y轴原始的最大值 最小值
@@ -5157,7 +5158,10 @@ coordinate.Message[1]=IFrameSplitOperator.FormatValueString(value,floatPrecision
5157
5158
  //this.Frame.HorizontalInfo[i].TextColor="rgb(100,0,200)";
5158
5159
  //this.Frame.HorizontalInfo[i].LineColor="rgb(220,220,220)";
5159
5160
  }}this.FilterIgnoreYValue();this.CustomCoordinate();if(this.SplitType!=1)this.Frame.HorizontalInfo=this.Filter(this.Frame.HorizontalInfo,splitData.Max>0&&splitData.Min<0);this.RightFrameSplitY();this.MainOverlayFrameSplitY();//主图Y轴绑定叠加Y轴坐标
5160
- this.CallAcutionSplitY(this.SplitCount,splitData);if(this.EnableRemoveZero)this.RemoveZero(this.Frame.HorizontalInfo);this.DynamicMessageText();this.Frame.HorizontalMax=splitData.Max;this.Frame.HorizontalMin=splitData.Min;if(this.EnableZoomUpDown==true&&!this.FixedYMaxMin)this.FixedYMaxMin={Max:splitData.Max,Min:splitData.Min};if(this.GetEventCallback){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_SPLIT_YCOORDINATE);if(event&&event.Callback){var data={ID:this.Frame.Identify,Frame:this.Frame};if(this.OverlayIdentify)data.OverlayIdentify=this.OverlayIdentify;event.Callback(event,data,this);}}};this.FormatValueString=function(value){var text;if(this.StringFormat==1)//手机端格式 如果有万,亿单位了 去掉小数
5161
+ this.CallAcutionSplitY(this.SplitCount,splitData);if(this.EnableRemoveZero)this.RemoveZero(this.Frame.HorizontalInfo);this.DynamicMessageText();this.Frame.HorizontalMax=splitData.Max;this.Frame.HorizontalMin=splitData.Min;if(this.EnableZoomUpDown==true&&!this.FixedYMaxMin)this.FixedYMaxMin={Max:splitData.Max,Min:splitData.Min};this.ReservedHeight(splitData);//预留高度
5162
+ if(this.GetEventCallback){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_SPLIT_YCOORDINATE);if(event&&event.Callback){var data={ID:this.Frame.Identify,Frame:this.Frame};if(this.OverlayIdentify)data.OverlayIdentify=this.OverlayIdentify;event.Callback(event,data,this);}}};this.ReservedHeight=function(splitData){if(this.Frame.IsHScreen)return;//横屏以后再搞
5163
+ var yReserved=this.Frame.HorizontalReserved;if(!yReserved)return;var reservedHeight=0;if(IFrameSplitOperator.IsPlusNumber(yReserved.Top))reservedHeight+=yReserved.Top;if(IFrameSplitOperator.IsPlusNumber(yReserved.Bottom))reservedHeight+=yReserved.Bottom;if(reservedHeight<=0)return;var border=this.Frame.GetBorder();var top=border.TopEx;var bottom=border.BottomEx;var srcHeight=bottom-top;if(srcHeight<reservedHeight)return;var max=splitData.Max;var min=splitData.Min;if(IFrameSplitOperator.IsPlusNumber(yReserved.Top))top-=yReserved.Top;if(IFrameSplitOperator.IsPlusNumber(yReserved.Bottom))bottom+=yReserved.Bottom;var value=(max-min)/(bottom-top);//1个像素点对应的数值
5164
+ if(IFrameSplitOperator.IsPlusNumber(yReserved.Top)){var topValue=value*yReserved.Top;max+=topValue;}if(IFrameSplitOperator.IsPlusNumber(yReserved.Bottom)){var bottomValue=value*yReserved.Bottom;min-=bottomValue;}splitData.Max=max;splitData.Min=min;this.Frame.HorizontalMax=splitData.Max;this.Frame.HorizontalMin=splitData.Min;};this.FormatValueString=function(value){var text;if(this.StringFormat==1)//手机端格式 如果有万,亿单位了 去掉小数
5161
5165
  {var floatPrecision=this.FloatPrecision;if(IFrameSplitOperator.IsNumber(value)&&Math.abs(value)>1000)floatPrecision=0;text=IFrameSplitOperator.FormatValueString(value,floatPrecision,this.LanguageID);}else if(this.StringFormat==2)//原始数据输出
5162
5166
  {text=''+value.toFixed(this.FloatPrecision);}else{var absValue=Math.abs(value);if(absValue<0.0000000001){text=0;}else if(absValue<this.FLOATPRECISION_RANGE[this.FLOATPRECISION_RANGE.length-1]){text=value.toExponential(2).toString();}else{var floatPrecision=this.GetFloatPrecision(absValue,this.FloatPrecision);//数据比小数位数还小, 调整小数位数
5163
5167
  text=IFrameSplitOperator.FormatValueString(value,floatPrecision,this.LanguageID);}}return text;};this.FilterIgnoreYValue=function(){if(!this.IgnoreYValue||this.IgnoreYValue.length<=0)return;var setValue=new _set2.default(this.IgnoreYValue);this.Frame.HorizontalInfo=this.Frame.HorizontalInfo.filter(function(item){return!setValue.has(item.Value);});};this.DynamicMessageText=function(){if(this.SplitType==2){for(var i=0;i<this.Frame.HorizontalInfo.length;++i){var item=this.Frame.HorizontalInfo[i];if(item.Message[0])item.Message[0]+='%';if(item.Message[1])item.Message[1]+='%';}}};this.CallAcutionSplitY=function(count,splitData){if(this.Frame.Identify!=1)return null;var aryCallAcution=this.GetCallAcutionSplitY(count,splitData);if(!aryCallAcution)return;for(var i=0;i<this.Frame.HorizontalInfo.length;++i)//把显示的数据迁移到 Message[2] Message[3]
@@ -13203,7 +13207,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
13203
13207
  this.ExecuteScript(item,data);}this.Status=0;}};this.OnExecuteFinish=function(data,indexInfo,jsExectute,jobInfo){var message={Data:data,IndexInfo:indexInfo,ID:JSCHART_WORKER_MESSAGE_ID.FINISH_EXECUTE_SCRIPT,JobInfo:jobInfo};postMessage(message);};this.OnExecuteError=function(error,indexInfo,jobData){var message={IndexInfo:indexInfo,ID:JSCHART_WORKER_MESSAGE_ID.ERROR_EXECUTE_SCRIPT,Error:error};postMessage(message);};}/********************************************************************************
13204
13208
  * 版本信息输出
13205
13209
  *
13206
- */var HQCHART_VERSION="1.1.13262";function PrintHQChartVersion(){var log='*************************************************************************************************************\n*\n* HQChart Ver: '+HQCHART_VERSION+' \n* \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n*************************************************************************************************************\n';console.log(log);}PrintHQChartVersion();//把给外界调用的方法暴露出来
13210
+ */var HQCHART_VERSION="1.1.13264";function PrintHQChartVersion(){var log='*************************************************************************************************************\n*\n* HQChart Ver: '+HQCHART_VERSION+' \n* \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n*************************************************************************************************************\n';console.log(log);}PrintHQChartVersion();//把给外界调用的方法暴露出来
13207
13211
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
13208
13212
  // BaseIndex:BaseIndex,
13209
13213
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.13263",
3
+ "version": "1.1.13265",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -9976,6 +9976,7 @@ function IChartFramePainting()
9976
9976
 
9977
9977
  this.HorizontalMax; //Y轴最大值
9978
9978
  this.HorizontalMin; //Y轴最小值
9979
+ this.HorizontalReserved=null; //Y轴预留高度 { Top:上, Bottom:下 }
9979
9980
  this.XPointCount=10; //X轴数据个数
9980
9981
 
9981
9982
  this.ClientBGColor; //客户区背景色
@@ -46690,12 +46691,15 @@ function FrameSplitY()
46690
46691
  if (this.EnableRemoveZero) this.RemoveZero(this.Frame.HorizontalInfo);
46691
46692
 
46692
46693
  this.DynamicMessageText();
46694
+
46693
46695
  this.Frame.HorizontalMax=splitData.Max;
46694
46696
  this.Frame.HorizontalMin=splitData.Min;
46695
46697
 
46696
46698
  if (this.EnableZoomUpDown==true && !this.FixedYMaxMin)
46697
46699
  this.FixedYMaxMin={ Max:splitData.Max, Min:splitData.Min };
46698
46700
 
46701
+ this.ReservedHeight(splitData); //预留高度
46702
+
46699
46703
  if (this.GetEventCallback)
46700
46704
  {
46701
46705
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_SPLIT_YCOORDINATE);
@@ -46708,6 +46712,49 @@ function FrameSplitY()
46708
46712
  }
46709
46713
  }
46710
46714
 
46715
+ this.ReservedHeight=function(splitData)
46716
+ {
46717
+ if (this.Frame.IsHScreen) return; //横屏以后再搞
46718
+
46719
+ var yReserved=this.Frame.HorizontalReserved;
46720
+ if (!yReserved) return;
46721
+
46722
+ var reservedHeight=0;
46723
+ if (IFrameSplitOperator.IsPlusNumber(yReserved.Top)) reservedHeight+=yReserved.Top;
46724
+ if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom)) reservedHeight+=yReserved.Bottom;
46725
+ if (reservedHeight<=0) return;
46726
+
46727
+ var border=this.Frame.GetBorder();
46728
+ var top=border.TopEx;
46729
+ var bottom=border.BottomEx;
46730
+ var srcHeight=bottom-top;
46731
+ if (srcHeight<reservedHeight) return;
46732
+
46733
+ var max=splitData.Max;
46734
+ var min=splitData.Min;
46735
+ if (IFrameSplitOperator.IsPlusNumber(yReserved.Top)) top-=yReserved.Top;
46736
+ if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom)) bottom+=yReserved.Bottom;
46737
+
46738
+ var value=(max-min)/(bottom-top); //1个像素点对应的数值
46739
+ if (IFrameSplitOperator.IsPlusNumber(yReserved.Top))
46740
+ {
46741
+ var topValue=value*yReserved.Top;
46742
+ max+=topValue;
46743
+ }
46744
+
46745
+ if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom))
46746
+ {
46747
+ var bottomValue=value*yReserved.Bottom;
46748
+ min-=bottomValue;
46749
+ }
46750
+
46751
+ splitData.Max=max;
46752
+ splitData.Min=min;
46753
+
46754
+ this.Frame.HorizontalMax=splitData.Max;
46755
+ this.Frame.HorizontalMin=splitData.Min;
46756
+ }
46757
+
46711
46758
 
46712
46759
  this.FormatValueString=function(value)
46713
46760
  {
@@ -13868,6 +13868,7 @@ function IChartFramePainting()
13868
13868
 
13869
13869
  this.HorizontalMax; //Y轴最大值
13870
13870
  this.HorizontalMin; //Y轴最小值
13871
+ this.HorizontalReserved=null; //Y轴预留高度 { Top:上, Bottom:下 }
13871
13872
  this.XPointCount=10; //X轴数据个数
13872
13873
 
13873
13874
  this.ClientBGColor; //客户区背景色
@@ -50582,12 +50583,15 @@ function FrameSplitY()
50582
50583
  if (this.EnableRemoveZero) this.RemoveZero(this.Frame.HorizontalInfo);
50583
50584
 
50584
50585
  this.DynamicMessageText();
50586
+
50585
50587
  this.Frame.HorizontalMax=splitData.Max;
50586
50588
  this.Frame.HorizontalMin=splitData.Min;
50587
50589
 
50588
50590
  if (this.EnableZoomUpDown==true && !this.FixedYMaxMin)
50589
50591
  this.FixedYMaxMin={ Max:splitData.Max, Min:splitData.Min };
50590
50592
 
50593
+ this.ReservedHeight(splitData); //预留高度
50594
+
50591
50595
  if (this.GetEventCallback)
50592
50596
  {
50593
50597
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_SPLIT_YCOORDINATE);
@@ -50600,6 +50604,49 @@ function FrameSplitY()
50600
50604
  }
50601
50605
  }
50602
50606
 
50607
+ this.ReservedHeight=function(splitData)
50608
+ {
50609
+ if (this.Frame.IsHScreen) return; //横屏以后再搞
50610
+
50611
+ var yReserved=this.Frame.HorizontalReserved;
50612
+ if (!yReserved) return;
50613
+
50614
+ var reservedHeight=0;
50615
+ if (IFrameSplitOperator.IsPlusNumber(yReserved.Top)) reservedHeight+=yReserved.Top;
50616
+ if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom)) reservedHeight+=yReserved.Bottom;
50617
+ if (reservedHeight<=0) return;
50618
+
50619
+ var border=this.Frame.GetBorder();
50620
+ var top=border.TopEx;
50621
+ var bottom=border.BottomEx;
50622
+ var srcHeight=bottom-top;
50623
+ if (srcHeight<reservedHeight) return;
50624
+
50625
+ var max=splitData.Max;
50626
+ var min=splitData.Min;
50627
+ if (IFrameSplitOperator.IsPlusNumber(yReserved.Top)) top-=yReserved.Top;
50628
+ if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom)) bottom+=yReserved.Bottom;
50629
+
50630
+ var value=(max-min)/(bottom-top); //1个像素点对应的数值
50631
+ if (IFrameSplitOperator.IsPlusNumber(yReserved.Top))
50632
+ {
50633
+ var topValue=value*yReserved.Top;
50634
+ max+=topValue;
50635
+ }
50636
+
50637
+ if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom))
50638
+ {
50639
+ var bottomValue=value*yReserved.Bottom;
50640
+ min-=bottomValue;
50641
+ }
50642
+
50643
+ splitData.Max=max;
50644
+ splitData.Min=min;
50645
+
50646
+ this.Frame.HorizontalMax=splitData.Max;
50647
+ this.Frame.HorizontalMin=splitData.Min;
50648
+ }
50649
+
50603
50650
 
50604
50651
  this.FormatValueString=function(value)
50605
50652
  {
@@ -132067,7 +132114,7 @@ function ScrollBarBGChart()
132067
132114
 
132068
132115
 
132069
132116
 
132070
- var HQCHART_VERSION="1.1.13262";
132117
+ var HQCHART_VERSION="1.1.13264";
132071
132118
 
132072
132119
  function PrintHQChartVersion()
132073
132120
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.13262";
8
+ var HQCHART_VERSION="1.1.13264";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -13912,6 +13912,7 @@ function IChartFramePainting()
13912
13912
 
13913
13913
  this.HorizontalMax; //Y轴最大值
13914
13914
  this.HorizontalMin; //Y轴最小值
13915
+ this.HorizontalReserved=null; //Y轴预留高度 { Top:上, Bottom:下 }
13915
13916
  this.XPointCount=10; //X轴数据个数
13916
13917
 
13917
13918
  this.ClientBGColor; //客户区背景色
@@ -50626,12 +50627,15 @@ function FrameSplitY()
50626
50627
  if (this.EnableRemoveZero) this.RemoveZero(this.Frame.HorizontalInfo);
50627
50628
 
50628
50629
  this.DynamicMessageText();
50630
+
50629
50631
  this.Frame.HorizontalMax=splitData.Max;
50630
50632
  this.Frame.HorizontalMin=splitData.Min;
50631
50633
 
50632
50634
  if (this.EnableZoomUpDown==true && !this.FixedYMaxMin)
50633
50635
  this.FixedYMaxMin={ Max:splitData.Max, Min:splitData.Min };
50634
50636
 
50637
+ this.ReservedHeight(splitData); //预留高度
50638
+
50635
50639
  if (this.GetEventCallback)
50636
50640
  {
50637
50641
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_SPLIT_YCOORDINATE);
@@ -50644,6 +50648,49 @@ function FrameSplitY()
50644
50648
  }
50645
50649
  }
50646
50650
 
50651
+ this.ReservedHeight=function(splitData)
50652
+ {
50653
+ if (this.Frame.IsHScreen) return; //横屏以后再搞
50654
+
50655
+ var yReserved=this.Frame.HorizontalReserved;
50656
+ if (!yReserved) return;
50657
+
50658
+ var reservedHeight=0;
50659
+ if (IFrameSplitOperator.IsPlusNumber(yReserved.Top)) reservedHeight+=yReserved.Top;
50660
+ if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom)) reservedHeight+=yReserved.Bottom;
50661
+ if (reservedHeight<=0) return;
50662
+
50663
+ var border=this.Frame.GetBorder();
50664
+ var top=border.TopEx;
50665
+ var bottom=border.BottomEx;
50666
+ var srcHeight=bottom-top;
50667
+ if (srcHeight<reservedHeight) return;
50668
+
50669
+ var max=splitData.Max;
50670
+ var min=splitData.Min;
50671
+ if (IFrameSplitOperator.IsPlusNumber(yReserved.Top)) top-=yReserved.Top;
50672
+ if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom)) bottom+=yReserved.Bottom;
50673
+
50674
+ var value=(max-min)/(bottom-top); //1个像素点对应的数值
50675
+ if (IFrameSplitOperator.IsPlusNumber(yReserved.Top))
50676
+ {
50677
+ var topValue=value*yReserved.Top;
50678
+ max+=topValue;
50679
+ }
50680
+
50681
+ if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom))
50682
+ {
50683
+ var bottomValue=value*yReserved.Bottom;
50684
+ min-=bottomValue;
50685
+ }
50686
+
50687
+ splitData.Max=max;
50688
+ splitData.Min=min;
50689
+
50690
+ this.Frame.HorizontalMax=splitData.Max;
50691
+ this.Frame.HorizontalMin=splitData.Min;
50692
+ }
50693
+
50647
50694
 
50648
50695
  this.FormatValueString=function(value)
50649
50696
  {
@@ -135476,7 +135523,7 @@ function HQChartScriptWorker()
135476
135523
 
135477
135524
 
135478
135525
 
135479
- var HQCHART_VERSION="1.1.13262";
135526
+ var HQCHART_VERSION="1.1.13264";
135480
135527
 
135481
135528
  function PrintHQChartVersion()
135482
135529
  {