hqchart 1.1.13210 → 1.1.13213

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.
@@ -1893,7 +1893,8 @@ drawPicture.PointToValue();if(this.ChartDrawStorage)this.ChartDrawStorage.SaveDr
1893
1893
  {var dargInfo=this.SelectChartDrawPicture.DragInfo;if(dargInfo.Click&&dargInfo.Move){if(dargInfo.Click.X!=dargInfo.Move.X||dargInfo.Click.Y!=dargInfo.Move.Y){//通知上层画好了
1894
1894
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_FINISH_MOVE_DRAWPICTURE);//完成画图工具事件
1895
1895
  if(event&&event.Callback){var sendData={DrawPicture:drawPicture};event.Callback(event,sendData,this);}if(drawPicture.OnMoveFinish)drawPicture.OnMoveFinish();}}}return true;};//清空所有的画线工具 option={ Draw:false/true }
1896
- this.ClearChartDrawPicture=function(drawPicture,option){var bDraw=true;if(!drawPicture){this.ChartDrawPicture=[];if(this.ChartDrawStorage)this.ChartDrawStorage.Clear();if(option&&option.Draw==false)bDraw=false;if(bDraw)this.Draw();}else{for(var i in this.ChartDrawPicture){if(this.ChartDrawPicture[i]==drawPicture){if(this.ChartDrawStorage)this.ChartDrawStorage.DeleteDrawData(drawPicture);this.ChartDrawPicture.splice(i,1);if(option&&option.Draw==false)bDraw=false;if(bDraw)this.Draw();}}}};//获取画图工具当前选中图形的Guid
1896
+ this.ClearChartDrawPicture=function(drawPicture,option){var bDraw=true;if(!drawPicture){this.ChartDrawPicture=[];if(this.ChartDrawStorage)this.ChartDrawStorage.Clear();this.SelectChartDrawPicture=null;if(option&&option.Draw==false)bDraw=false;if(bDraw)this.Draw();}else{for(var i=0;i<this.ChartDrawPicture.length;++i){var item=this.ChartDrawPicture[i];if(item.Guid==drawPicture.Guid||item==drawPicture){if(this.ChartDrawStorage)this.ChartDrawStorage.DeleteDrawData(drawPicture);this.ChartDrawPicture.splice(i,1);if(this.SelectChartDrawPicture)//去掉选中
1897
+ {if(this.SelectChartDrawPicture.Guid==drawPicture.Guid||this.SelectChartDrawPicture==drawPicture)this.SelectChartDrawPicture=null;}if(option&&option.Draw==false)bDraw=false;if(bDraw)this.Draw();}}}};//获取画图工具当前选中图形的Guid
1897
1898
  this.GetActiveDrawPicture=function(){var result={Move:{Guid:null},Select:{Guid:null},MoveOn:{Guid:null}};if(this.CurrentChartDrawPicture)result.Move={Guid:this.CurrentChartDrawPicture.Guid};if(this.SelectChartDrawPicture)result.Select={Guid:this.SelectChartDrawPicture.Guid,Chart:this.SelectChartDrawPicture};if(this.MoveOnChartDrawPicture)result.MoveOn={Guid:this.MoveOnChartDrawPicture.Guid};return result;};this.SetChartDrawOption=function(option){if(IFrameSplitOperator.IsBool(option.IsLockScreen))this.ChartDrawOption.IsLockScreen=option.IsLockScreen;if(IFrameSplitOperator.IsNumber(option.Zoom)&&option.Zoom>=0)this.ChartDrawOption.Zoom=option.Zoom;if(option.Magnet){var item=option.Magnet;if(!this.ChartDrawOption.Magnet)this.ChartDrawOption.Magnet={Type:0,Distance:20*GetDevicePixelRatio(),Enable:false};if(IFrameSplitOperator.IsBool(item.Enable))this.ChartDrawOption.Magnet.Enable=item.Enable;if(IFrameSplitOperator.IsNumber(item.Type))this.ChartDrawOption.Magnet.Type=item.Type;if(IFrameSplitOperator.IsNumber(item.Distance))this.ChartDrawOption.Magnet.Distance=opitemion.Distance;}};//是否显示十字光标的十字线
1898
1899
  this.EnableShowCorssCursorLine=function(bShow){if(!this.ChartCorssCursor)return;this.ChartCorssCursor.IsShowCorss=bShow;};//获取扩展画法
1899
1900
  this.GetExtendChartByClassName=function(name){for(var i=0;i<this.ExtendChartPaint.length;++i){var item=this.ExtendChartPaint[i];if(item.ClassName==name)return{Index:i,Chart:item};}return null;};//获取多个扩展画法
@@ -1904,7 +1905,8 @@ this.DeleteExtendChartByID=function(id){for(var i=0;i<this.ExtendChartPaint.leng
1904
1905
  this.EnableSplashScreen=function(enable,option){if(!this.ChartSplashPaint)return;this.ChartSplashPaint.EnableSplash(enable);if(option&&option.Draw===false)return;if(enable)this.DrawSplashScreen(option);else this.Draw();};//设置指标窗口属性 windowItem=SetOption.Windows[i], frameItem=SetOption.Frames[i];
1905
1906
  this.SetSubFrameAttribute=function(subFrame,windowItem,frameItem){if(!subFrame||!subFrame.Frame)return;var frame=subFrame.Frame;if(windowItem){if(IFrameSplitOperator.IsBool(windowItem.Modify))frame.ModifyIndex=windowItem.Modify;if(IFrameSplitOperator.IsBool(windowItem.Change))frame.ChangeIndex=windowItem.Change;if(IFrameSplitOperator.IsBool(windowItem.Close))frame.CloseIndex=windowItem.Close;if(IFrameSplitOperator.IsBool(windowItem.Overlay))frame.OverlayIndex=windowItem.Overlay;if(IFrameSplitOperator.IsBool(windowItem.IsDrawTitleBG))frame.IsDrawTitleBG=windowItem.IsDrawTitleBG;if(IFrameSplitOperator.IsNumber(windowItem.TitleHeight))frame.ChartBorder.TitleHeight=windowItem.TitleHeight;else windowItem.TitleHeight=frame.ChartBorder.TitleHeight;if(IFrameSplitOperator.IsBool(windowItem.IsShowTitleArrow))frame.IsShowTitleArrow=windowItem.IsShowTitleArrow;if(IFrameSplitOperator.IsBool(windowItem.IsShowIndexName))frame.IsShowIndexName=windowItem.IsShowIndexName;if(IFrameSplitOperator.IsNumber(windowItem.IndexParamSpace))frame.IndexParamSpace=windowItem.IndexParamSpace;if(IFrameSplitOperator.IsNumber(windowItem.IndexTitleSpace))frame.IndexTitleSpace=windowItem.IndexTitleSpace;}if(frameItem){if(frameItem.SplitCount)frame.YSplitOperator.SplitCount=frameItem.SplitCount;if(IFrameSplitOperator.IsBool(frameItem.IsShowXLine))frame.IsShowXLine=frameItem.IsShowXLine;if(IFrameSplitOperator.IsBool(frameItem.IsShowYLine))frame.IsShowYLine=frameItem.IsShowYLine;if(IFrameSplitOperator.IsBool(frameItem.IsShowLeftText)){frame.IsShowYText[0]=frameItem.IsShowLeftText;frame.YSplitOperator.IsShowLeftText=frameItem.IsShowLeftText;//显示左边刻度
1906
1907
  }if(IFrameSplitOperator.IsBool(frameItem.IsShowRightText)){frame.IsShowYText[1]=frameItem.IsShowRightText;frame.YSplitOperator.IsShowRightText=frameItem.IsShowRightText;//显示右边刻度
1907
- }if(IFrameSplitOperator.IsNumber(frameItem.Height)&&frameItem.Height>=0)subFrame.Height=frameItem.Height;}};this.SetSubFrameOption=function(subFrame,option){if(!option)return;var frame=subFrame.Frame;if(option.Window){var item=option.Window;if(IFrameSplitOperator.IsBool(item.Modify))frame.ModifyIndex=item.Modify;if(IFrameSplitOperator.IsBool(item.Change))frame.ChangeIndex=item.Change;if(IFrameSplitOperator.IsBool(item.Close))frame.CloseIndex=item.Close;if(IFrameSplitOperator.IsBool(item.Overlay))frame.OverlayIndex=item.Overlay;if(IFrameSplitOperator.IsBool(item.Export))frame.ExportData=item.Export;if(IFrameSplitOperator.IsBool(item.MaxMin))frame.MaxMinWindow=item.MaxMin;if(IFrameSplitOperator.IsBool(item.TitleWindow))frame.TitleWindow=item.TitleWindow;if(IFrameSplitOperator.IsBool(item.IsDrawTitleBG))frame.IsDrawTitleBG=item.IsDrawTitleBG;if(IFrameSplitOperator.IsBool(item.IsShowNameArrow))frame.IsShowNameArrow=item.IsShowNameArrow;if(item.OverlayIndexType){if(IFrameSplitOperator.IsNumber(item.OverlayIndexType.Position))frame.OverlayIndexType.Position=item.OverlayIndexType.Position;if(IFrameSplitOperator.IsNumber(item.OverlayIndexType.LineSpace))frame.OverlayIndexType.LineSpace=item.OverlayIndexType.LineSpace;}}if(IFrameSplitOperator.IsNumber(option.SplitCount))subFrame.Frame.YSplitOperator.SplitCount=option.SplitCount;if(IFrameSplitOperator.IsNumber(option.TitleHeight))subFrame.Frame.ChartBorder.TitleHeight=option.TitleHeight;if(IFrameSplitOperator.IsBool(option.IsShowTitleArrow))subFrame.Frame.IsShowTitleArrow=option.IsShowTitleArrow;if(IFrameSplitOperator.IsBool(option.IsShowIndexName))subFrame.Frame.IsShowIndexName=option.IsShowIndexName;if(IFrameSplitOperator.IsBool(option.IsShowOverlayIndexName))subFrame.Frame.IsShowOverlayIndexName=option.IsShowOverlayIndexName;if(IFrameSplitOperator.IsNumber(option.IndexParamSpace))subFrame.Frame.IndexParamSpace=option.IndexParamSpace;if(IFrameSplitOperator.IsBool(option.IsShowXLine))subFrame.Frame.IsShowXLine=option.IsShowXLine;if(IFrameSplitOperator.IsBool(option.IsShowYLine))subFrame.Frame.IsShowYLine=option.IsShowYLine;if(IFrameSplitOperator.IsBool(option.IsShowIndexTitle))subFrame.Frame.IsShowIndexTitle=option.IsShowIndexTitle;if(IFrameSplitOperator.IsBool(option.IsShowLeftText)){subFrame.Frame.IsShowYText[0]=option.IsShowLeftText;subFrame.Frame.YSplitOperator.IsShowLeftText=option.IsShowLeftText;//显示左边刻度
1908
+ }if(IFrameSplitOperator.IsNumber(frameItem.Height)&&frameItem.Height>=0)subFrame.Height=frameItem.Height;}};this.SetSubFrameOption=function(subFrame,option){if(!option)return;var frame=subFrame.Frame;if(option.Window){var item=option.Window;if(IFrameSplitOperator.IsBool(item.Modify))frame.ModifyIndex=item.Modify;if(IFrameSplitOperator.IsBool(item.Change))frame.ChangeIndex=item.Change;if(IFrameSplitOperator.IsBool(item.Close))frame.CloseIndex=item.Close;if(IFrameSplitOperator.IsBool(item.Overlay))frame.OverlayIndex=item.Overlay;if(IFrameSplitOperator.IsBool(item.Export))frame.ExportData=item.Export;if(IFrameSplitOperator.IsBool(item.MaxMin))frame.MaxMinWindow=item.MaxMin;if(IFrameSplitOperator.IsBool(item.TitleWindow))frame.TitleWindow=item.TitleWindow;if(IFrameSplitOperator.IsBool(item.IsDrawTitleBG))frame.IsDrawTitleBG=item.IsDrawTitleBG;if(IFrameSplitOperator.IsBool(item.IsShowNameArrow))frame.IsShowNameArrow=item.IsShowNameArrow;if(item.OverlayIndexType){if(IFrameSplitOperator.IsNumber(item.OverlayIndexType.Position))frame.OverlayIndexType.Position=item.OverlayIndexType.Position;if(IFrameSplitOperator.IsNumber(item.OverlayIndexType.LineSpace))frame.OverlayIndexType.LineSpace=item.OverlayIndexType.LineSpace;}if(IFrameSplitOperator.IsNonEmptyArray(item.CustomToolbar))//自定义工具按钮
1909
+ {frame.CustomToolbar=item.CustomToolbar.slice();}}if(IFrameSplitOperator.IsNumber(option.SplitCount))subFrame.Frame.YSplitOperator.SplitCount=option.SplitCount;if(IFrameSplitOperator.IsNumber(option.TitleHeight))subFrame.Frame.ChartBorder.TitleHeight=option.TitleHeight;if(IFrameSplitOperator.IsBool(option.IsShowTitleArrow))subFrame.Frame.IsShowTitleArrow=option.IsShowTitleArrow;if(IFrameSplitOperator.IsBool(option.IsShowIndexName))subFrame.Frame.IsShowIndexName=option.IsShowIndexName;if(IFrameSplitOperator.IsBool(option.IsShowOverlayIndexName))subFrame.Frame.IsShowOverlayIndexName=option.IsShowOverlayIndexName;if(IFrameSplitOperator.IsNumber(option.IndexParamSpace))subFrame.Frame.IndexParamSpace=option.IndexParamSpace;if(IFrameSplitOperator.IsBool(option.IsShowXLine))subFrame.Frame.IsShowXLine=option.IsShowXLine;if(IFrameSplitOperator.IsBool(option.IsShowYLine))subFrame.Frame.IsShowYLine=option.IsShowYLine;if(IFrameSplitOperator.IsBool(option.IsShowIndexTitle))subFrame.Frame.IsShowIndexTitle=option.IsShowIndexTitle;if(IFrameSplitOperator.IsBool(option.IsShowLeftText)){subFrame.Frame.IsShowYText[0]=option.IsShowLeftText;subFrame.Frame.YSplitOperator.IsShowLeftText=option.IsShowLeftText;//显示左边刻度
1908
1910
  }if(IFrameSplitOperator.IsBool(option.IsShowRightText)){subFrame.Frame.IsShowYText[1]=option.IsShowRightText;subFrame.Frame.YSplitOperator.IsShowRightText=option.IsShowRightText;//显示右边刻度
1909
1911
  }};this.AddNewSubFrame=function(option){var _this12=this;var index=this.Frame.SubFrame.length;var subFrame=this.CreateSubFrameItem(index);var pixelRatio=GetDevicePixelRatio();subFrame.Frame.ChartBorder.TitleHeight*=pixelRatio;this.Frame.SubFrame[index]=subFrame;var titlePaint=new DynamicChartTitlePainting();titlePaint.Frame=this.Frame.SubFrame[index].Frame;titlePaint.Canvas=this.Canvas;titlePaint.LanguageID=this.LanguageID;titlePaint.GetEventCallback=function(id){return _this12.GetEventCallback(id);};this.TitlePaint[index+1]=titlePaint;this.SetSubFrameOption(subFrame,option);//最后一个显示X轴坐标
1910
1912
  for(var i=0;i<this.Frame.SubFrame.length;++i){var item=this.Frame.SubFrame[i].Frame;if(i==this.Frame.SubFrame.length-1)item.XSplitOperator.ShowText=true;else item.XSplitOperator.ShowText=false;}this.UpdataDataoffset();//更新数据偏移
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.13210",
3
+ "version": "1.1.13213",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -8011,19 +8011,27 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
8011
8011
  {
8012
8012
  this.ChartDrawPicture=[];
8013
8013
  if (this.ChartDrawStorage) this.ChartDrawStorage.Clear();
8014
-
8014
+ this.SelectChartDrawPicture=null;
8015
+
8015
8016
  if (option && option.Draw==false) bDraw=false;
8016
8017
  if (bDraw) this.Draw();
8017
8018
  }
8018
8019
  else
8019
8020
  {
8020
- for(var i in this.ChartDrawPicture)
8021
+ for(var i=0; i<this.ChartDrawPicture.length; ++i)
8021
8022
  {
8022
- if (this.ChartDrawPicture[i]==drawPicture)
8023
+ var item=this.ChartDrawPicture[i];
8024
+ if (item.Guid==drawPicture.Guid || item==drawPicture)
8023
8025
  {
8024
8026
  if (this.ChartDrawStorage) this.ChartDrawStorage.DeleteDrawData(drawPicture);
8025
8027
  this.ChartDrawPicture.splice(i,1);
8026
8028
 
8029
+ if (this.SelectChartDrawPicture) //去掉选中
8030
+ {
8031
+ if (this.SelectChartDrawPicture.Guid==drawPicture.Guid || this.SelectChartDrawPicture==drawPicture)
8032
+ this.SelectChartDrawPicture=null;
8033
+ }
8034
+
8027
8035
  if (option && option.Draw==false) bDraw=false;
8028
8036
  if (bDraw) this.Draw();
8029
8037
  }
@@ -8225,6 +8233,11 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
8225
8233
  if (IFrameSplitOperator.IsNumber(item.OverlayIndexType.Position)) frame.OverlayIndexType.Position=item.OverlayIndexType.Position;
8226
8234
  if (IFrameSplitOperator.IsNumber(item.OverlayIndexType.LineSpace)) frame.OverlayIndexType.LineSpace=item.OverlayIndexType.LineSpace;
8227
8235
  }
8236
+
8237
+ if (IFrameSplitOperator.IsNonEmptyArray(item.CustomToolbar)) //自定义工具按钮
8238
+ {
8239
+ frame.CustomToolbar=item.CustomToolbar.slice();
8240
+ }
8228
8241
  }
8229
8242
 
8230
8243
  if (IFrameSplitOperator.IsNumber(option.SplitCount)) subFrame.Frame.YSplitOperator.SplitCount=option.SplitCount;
@@ -11903,19 +11903,27 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11903
11903
  {
11904
11904
  this.ChartDrawPicture=[];
11905
11905
  if (this.ChartDrawStorage) this.ChartDrawStorage.Clear();
11906
-
11906
+ this.SelectChartDrawPicture=null;
11907
+
11907
11908
  if (option && option.Draw==false) bDraw=false;
11908
11909
  if (bDraw) this.Draw();
11909
11910
  }
11910
11911
  else
11911
11912
  {
11912
- for(var i in this.ChartDrawPicture)
11913
+ for(var i=0; i<this.ChartDrawPicture.length; ++i)
11913
11914
  {
11914
- if (this.ChartDrawPicture[i]==drawPicture)
11915
+ var item=this.ChartDrawPicture[i];
11916
+ if (item.Guid==drawPicture.Guid || item==drawPicture)
11915
11917
  {
11916
11918
  if (this.ChartDrawStorage) this.ChartDrawStorage.DeleteDrawData(drawPicture);
11917
11919
  this.ChartDrawPicture.splice(i,1);
11918
11920
 
11921
+ if (this.SelectChartDrawPicture) //去掉选中
11922
+ {
11923
+ if (this.SelectChartDrawPicture.Guid==drawPicture.Guid || this.SelectChartDrawPicture==drawPicture)
11924
+ this.SelectChartDrawPicture=null;
11925
+ }
11926
+
11919
11927
  if (option && option.Draw==false) bDraw=false;
11920
11928
  if (bDraw) this.Draw();
11921
11929
  }
@@ -12117,6 +12125,11 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
12117
12125
  if (IFrameSplitOperator.IsNumber(item.OverlayIndexType.Position)) frame.OverlayIndexType.Position=item.OverlayIndexType.Position;
12118
12126
  if (IFrameSplitOperator.IsNumber(item.OverlayIndexType.LineSpace)) frame.OverlayIndexType.LineSpace=item.OverlayIndexType.LineSpace;
12119
12127
  }
12128
+
12129
+ if (IFrameSplitOperator.IsNonEmptyArray(item.CustomToolbar)) //自定义工具按钮
12130
+ {
12131
+ frame.CustomToolbar=item.CustomToolbar.slice();
12132
+ }
12120
12133
  }
12121
12134
 
12122
12135
  if (IFrameSplitOperator.IsNumber(option.SplitCount)) subFrame.Frame.YSplitOperator.SplitCount=option.SplitCount;
@@ -11947,19 +11947,27 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11947
11947
  {
11948
11948
  this.ChartDrawPicture=[];
11949
11949
  if (this.ChartDrawStorage) this.ChartDrawStorage.Clear();
11950
-
11950
+ this.SelectChartDrawPicture=null;
11951
+
11951
11952
  if (option && option.Draw==false) bDraw=false;
11952
11953
  if (bDraw) this.Draw();
11953
11954
  }
11954
11955
  else
11955
11956
  {
11956
- for(var i in this.ChartDrawPicture)
11957
+ for(var i=0; i<this.ChartDrawPicture.length; ++i)
11957
11958
  {
11958
- if (this.ChartDrawPicture[i]==drawPicture)
11959
+ var item=this.ChartDrawPicture[i];
11960
+ if (item.Guid==drawPicture.Guid || item==drawPicture)
11959
11961
  {
11960
11962
  if (this.ChartDrawStorage) this.ChartDrawStorage.DeleteDrawData(drawPicture);
11961
11963
  this.ChartDrawPicture.splice(i,1);
11962
11964
 
11965
+ if (this.SelectChartDrawPicture) //去掉选中
11966
+ {
11967
+ if (this.SelectChartDrawPicture.Guid==drawPicture.Guid || this.SelectChartDrawPicture==drawPicture)
11968
+ this.SelectChartDrawPicture=null;
11969
+ }
11970
+
11963
11971
  if (option && option.Draw==false) bDraw=false;
11964
11972
  if (bDraw) this.Draw();
11965
11973
  }
@@ -12161,6 +12169,11 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
12161
12169
  if (IFrameSplitOperator.IsNumber(item.OverlayIndexType.Position)) frame.OverlayIndexType.Position=item.OverlayIndexType.Position;
12162
12170
  if (IFrameSplitOperator.IsNumber(item.OverlayIndexType.LineSpace)) frame.OverlayIndexType.LineSpace=item.OverlayIndexType.LineSpace;
12163
12171
  }
12172
+
12173
+ if (IFrameSplitOperator.IsNonEmptyArray(item.CustomToolbar)) //自定义工具按钮
12174
+ {
12175
+ frame.CustomToolbar=item.CustomToolbar.slice();
12176
+ }
12164
12177
  }
12165
12178
 
12166
12179
  if (IFrameSplitOperator.IsNumber(option.SplitCount)) subFrame.Frame.YSplitOperator.SplitCount=option.SplitCount;