hqchart 1.1.13355 → 1.1.13358
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.
package/lib/umychart.vue.js
CHANGED
|
@@ -2811,7 +2811,7 @@ if(x>=left&&x<=right&&y>bottom&&y<chartHeight)return-3;return-1;};this.PtInChart
|
|
|
2811
2811
|
}}return-1;};this.PtInButtons=function(x,y){for(var i=0;i<this.SubFrame.length;++i){var item=this.SubFrame[i];if(item.Height<=0)continue;var button=item.Frame.PtInButtons(x,y);if(button){button.Frame=item.Frame;button.FrameID=i;return button;}for(var j=0;j<item.OverlayIndex.length;++j){var overlayItem=item.OverlayIndex[j];var overlayFrame=overlayItem.Frame;if(!overlayFrame||!overlayFrame.PtInButtons)continue;var button=overlayFrame.PtInButtons(x,y);if(button){button.IndexID=overlayItem.Identify;button.FrameID=i;button.OverlayFrame=overlayFrame;button.Frame=item.Frame;return button;}}}return null;};//是否在X轴坐标上
|
|
2812
2812
|
this.PtInFrameBottom=function(x,y){var left=this.ChartBorder.GetLeft();var top=this.ChartBorder.GetBottom();var width=this.ChartBorder.GetWidth();var height=this.ChartBorder.Bottom;this.Canvas.beginPath();this.Canvas.rect(left,top,width,height);if(this.Canvas.isPointInPath(x,y))return true;return false;};this.PtInFrameVertical=function(x,y){for(var i=0;i<this.SubFrame.length;++i){var item=this.SubFrame[i];if(item.Height<=0)continue;if(!item.Frame.PtInVertical)continue;if(item.Frame.PtInVertical(x,y)){return{Frame:item.Frame};}}return null;};this.GetXFromIndex=function(index){return this.SubFrame[0].Frame.GetXFromIndex(index);};this.GetYFromData=function(value){return this.SubFrame[0].Frame.GetYFromData(value);};this.ZoomUp=function(cursorIndex){var result=this.SubFrame[0].Frame.ZoomUp(cursorIndex);this.UpdateAllFrame();return result;};this.ZoomDown=function(cursorIndex,option){var result=this.SubFrame[0].Frame.ZoomDown(cursorIndex,option);this.UpdateAllFrame();return result;};this.SetXShowCount=function(showCount){var result=this.SubFrame[0].Frame.SetXShowCount(showCount);this.UpdateAllFrame();return result;};this.GetXShowCount=function(){var xPointcount=-1;if(!IFrameSplitOperator.IsNonEmptyArray(this.SubFrame))return xPointcount;var subFrame=this.SubFrame[0];if(!subFrame.Frame)return xPointcount;xPointcount=subFrame.Frame.XPointCount;return xPointcount;};this.XCoordinateZoom=function(step,isMoveLeft){var result=this.SubFrame[0].Frame.XCoordinateZoom(step,isMoveLeft);this.UpdateAllFrame();return result;};//设置重新计算刻度坐标
|
|
2813
2813
|
this.ResetXYSplit=function(){for(var _i in this.SubFrame){this.SubFrame[_i].Frame.XYSplit=true;}};this.ResetXSplit=function(){for(var _i2 in this.SubFrame){this.SubFrame[_i2].Frame.XSplit=true;}};//清空Y轴坐标的最大最小值
|
|
2814
|
-
this.ClearYCoordinateMaxMin=function(windowIndex){if(IFrameSplitOperator.IsNumber(windowIndex)){var subItem=this.SubFrame[windowIndex];if(!subItem||!subItem.Frame)return;if(frame.YMaxMin){frame.YMaxMin.Max=null;frame.YMaxMin.Min=null;}}else{for(var i=0;i<this.SubFrame.length;++i){var subItem=this.SubFrame[i];var frame=subItem.Frame;if(frame.YMaxMin){frame.YMaxMin.Max=null;frame.YMaxMin.Min=null;}}}};this.SetLanguage=function(languageID){for(var _i3 in this.SubFrame){var item=this.SubFrame[_i3];if(item&&item.Frame){if(item.Frame.YSplitOperator)item.Frame.YSplitOperator.LanguageID=languageID;if(item.Frame.XSplitOperator)item.Frame.XSplitOperator.LanguageID=languageID;}}};this.GetCurrentPageSize=function()//获取当前页显示的数据个数
|
|
2814
|
+
this.ClearYCoordinateMaxMin=function(windowIndex){if(IFrameSplitOperator.IsNumber(windowIndex)){var subItem=this.SubFrame[windowIndex];if(!subItem||!subItem.Frame)return;var frame=subItem.Frame;if(frame.YMaxMin){frame.YMaxMin.Max=null;frame.YMaxMin.Min=null;}}else{for(var i=0;i<this.SubFrame.length;++i){var subItem=this.SubFrame[i];var frame=subItem.Frame;if(frame.YMaxMin){frame.YMaxMin.Max=null;frame.YMaxMin.Min=null;}}}};this.SetLanguage=function(languageID){for(var _i3 in this.SubFrame){var item=this.SubFrame[_i3];if(item&&item.Frame){if(item.Frame.YSplitOperator)item.Frame.YSplitOperator.LanguageID=languageID;if(item.Frame.XSplitOperator)item.Frame.XSplitOperator.LanguageID=languageID;}}};this.GetCurrentPageSize=function()//获取当前页显示的数据个数
|
|
2815
2815
|
{if(this.SubFrame.length<=0)return null;var item=this.SubFrame[0];if(!item||!item.Frame)return null;return item.Frame.XPointCount;};this.OnSize=function(){var obj={};this.SubFrame[0].Frame.OnSize(obj);this.UpdateAllFrame();return obj;};this.SetDataWidth=function(dataWidth){var obj=this.SubFrame[0].Frame.SetDataWidth(dataWidth);this.UpdateAllFrame();return obj;};this.UpdateAllFrame=function(){var mainFrame=this.SubFrame[0].Frame;for(var i=0;i<this.SubFrame.length;++i){var item=this.SubFrame[i];if(i>0)//第1个窗口主坐标已经算好了
|
|
2816
2816
|
{item.Frame.XPointCount=mainFrame.XPointCount;item.Frame.ZoomIndex=mainFrame.ZoomIndex;item.Frame.DataWidth=mainFrame.DataWidth;item.Frame.DistanceWidth=mainFrame.DistanceWidth;item.Frame.LastCalculateStatus.Width=mainFrame.LastCalculateStatus.Width;item.Frame.LastCalculateStatus.XPointCount=mainFrame.LastCalculateStatus.XPointCount;}for(var j in item.OverlayIndex){var overlayItem=this.SubFrame[i].OverlayIndex[j];overlayItem.Frame.XPointCount=mainFrame.XPointCount;overlayItem.Frame.ZoomIndex=mainFrame.ZoomIndex;overlayItem.Frame.DataWidth=mainFrame.DataWidth;overlayItem.Frame.DistanceWidth=mainFrame.DistanceWidth;overlayItem.Frame.LastCalculateStatus.Width=mainFrame.LastCalculateStatus.Width;overlayItem.Frame.LastCalculateStatus.XPointCount=mainFrame.LastCalculateStatus.XPointCount;}}};//鼠标是否在边框上
|
|
2817
2817
|
this.PtInFrameBorder=function(x,y){var height=this.DragBorderHeight;for(var i=0;i<this.SubFrame.length-1;++i){var item=this.SubFrame[i];if(item.Frame.Heigh<=0)continue;var bottom=item.Frame.ChartBorder.GetBottom();var left=item.Frame.ChartBorder.GetLeft();var right=item.Frame.ChartBorder.GetRight();item.Frame.Canvas.beginPath();item.Frame.Canvas.rect(left,bottom-height/2,right-left,height);if(item.Frame.Canvas.isPointInPath(x,y)){return{Index:i,Bottom:true};}}return null;};this.IsEnableDragY=function(index){if(!this.SubFrame)return false;var item=this.SubFrame[index];if(!item||!item.Frame||!item.Frame.YSplitOperator)return false;var split=item.Frame.YSplitOperator;if(typeof split.IsEnableDragY!='function')return false;return split.IsEnableDragY();};this.IsEnableOverlayDragY=function(index,overlayIndex){if(!this.SubFrame)return false;var item=this.SubFrame[index];var overlayItem=item.OverlayIndex[overlayIndex];if(!overlayItem||!overlayItem.Frame)return false;var split=overlayItem.Frame.YSplitOperator;if(overlayItem.Frame.IsShareY)split=overlayItem.Frame.MainFrame.YSplitOperator;if(!split||typeof split.IsEnableDragY!='function')return false;return split.IsEnableDragY();};this.PtInFrameY=function(x,y){var rightExtendWith=0;if(this.GetExtendChartByClassName){var finder=this.GetExtendChartByClassName("StockChip");if(finder&&finder.Chart)rightExtendWith=finder.Chart.Width;}for(var i=0;i<this.SubFrame.length;++i){var item=this.SubFrame[i];if(item.Frame.Heigh<=0)continue;var rightWidth=item.Frame.ChartBorder.Right;rightWidth-=rightExtendWith;var border=item.Frame.ChartBorder.GetBorder();var bottom=border.Bottom;var top=border.TopTitle;var left=border.Left;var right=border.Right;var maxTopHegith=30;var barHegith=bottom-top;if(barHegith/3>maxTopHegith){var barTop=top+maxTopHegith;var barBottom=bottom-maxTopHegith;}else{var internal=barHegith/3;var barTop=top+internal;var barBottom=bottom-internal;}var position=0;if(y<barTop)position=1;else if(y>barBottom)position=2;if(rightWidth>=10){if(IFrameSplitOperator.IsNonEmptyArray(item.OverlayIndex)){var overlayItem=item.OverlayIndex[0];var rightOffset=overlayItem.Frame.RightOffset;item.Frame.Canvas.beginPath();item.Frame.Canvas.rect(right,top,rightOffset,bottom-top);if(item.Frame.Canvas.isPointInPath(x,y)){return{Index:i,Right:true,Left:false,Position:position,IsOverlay:false};//Position 1=上面 2 下面 0=中间(TODO)
|
|
@@ -7382,7 +7382,7 @@ frame.DrawToolbar();}};this.SetFrameAttribute=function(windowIndex,attr){if(!win
|
|
|
7382
7382
|
if(IFrameSplitOperator.IsNumber(attr.TitleHeight))frame.ChartBorder.TitleHeight=attr.TitleHeight;//指标标题高度
|
|
7383
7383
|
};this.ResetFrameAttribute=function(windowIndex){if(!window||!this.Frame.SubFrame[windowIndex]||!this.Frame.SubFrame[windowIndex].Frame)return;var frame=this.Frame.SubFrame[windowIndex].Frame;frame.HorizontalReserved=null;};//切换成 脚本指标
|
|
7384
7384
|
this.ChangeScriptIndex=function(windowIndex,indexData,option){this.DeleteIndexPaint(windowIndex,true);this.WindowIndex[windowIndex]=new ScriptIndex(indexData.Name,indexData.Script,indexData.Args,indexData);//脚本执行
|
|
7385
|
-
this.ResetFrameAttribute(windowIndex);if(option){if(option.Window){this.SetFrameToolbar(windowIndex,option.Window);this.SetFrameAttribute(windowIndex,option.Window);//窗口属性
|
|
7385
|
+
this.ResetFrameAttribute(windowIndex);this.Frame.ClearYCoordinateMaxMin(windowIndex);if(option){if(option.Window){this.SetFrameToolbar(windowIndex,option.Window);this.SetFrameAttribute(windowIndex,option.Window);//窗口属性
|
|
7386
7386
|
}}this.OnChangeIndexEvent(windowIndex,{ID:indexData.ID,Name:indexData.Name,FunctionName:"ChangeScriptIndex"});this.Frame.ClearUpDonwFrameYData({Index:windowIndex});var bindData=this.ChartPaint[0].Data;this.BindIndexData(windowIndex,bindData);//执行脚本
|
|
7387
7387
|
this.UpdataDataoffset();//更新数据偏移
|
|
7388
7388
|
this.UpdateFrameMaxMin();//调整坐标最大 最小值
|
|
@@ -7390,7 +7390,7 @@ this.Draw();};this.OnKLinePageChange=function(eventid){if(!this.ChartPaint[0])re
|
|
|
7390
7390
|
}//叠加指标
|
|
7391
7391
|
for(var i=0;i<this.Frame.SubFrame.length;++i){var item=this.Frame.SubFrame[i];for(var j=0;j<item.OverlayIndex.length;++j){var overlayItem=item.OverlayIndex[j];if(overlayItem&&overlayItem.Script&&overlayItem.Script.IsUsePageData==true)this.BindOverlayIndexData(overlayItem,i,bindData);}}};//切换api指标
|
|
7392
7392
|
this.ChangeAPIIndex=function(windowIndex,indexData){this.DeleteIndexPaint(windowIndex,true);//使用API挂接指标数据 API:{ Name:指标名字, Script:指标脚本可以为空, Args:参数可以为空, Url:指标执行地址 }
|
|
7393
|
-
var apiItem=indexData.API;this.WindowIndex[windowIndex]=new APIScriptIndex(apiItem.Name,apiItem.Script,apiItem.Args,indexData);this.ResetFrameAttribute(windowIndex);this.OnChangeIndexEvent(windowIndex,{ID:indexData.ID,Name:indexData.Name,FunctionName:"ChangeAPIIndex"});if(indexData){if(indexData.Window){this.SetFrameToolbar(windowIndex,indexData.Window);this.SetFrameAttribute(windowIndex,indexData.Window);//窗口属性
|
|
7393
|
+
var apiItem=indexData.API;this.WindowIndex[windowIndex]=new APIScriptIndex(apiItem.Name,apiItem.Script,apiItem.Args,indexData);this.ResetFrameAttribute(windowIndex);this.Frame.ClearYCoordinateMaxMin(windowIndex);this.OnChangeIndexEvent(windowIndex,{ID:indexData.ID,Name:indexData.Name,FunctionName:"ChangeAPIIndex"});if(indexData){if(indexData.Window){this.SetFrameToolbar(windowIndex,indexData.Window);this.SetFrameAttribute(windowIndex,indexData.Window);//窗口属性
|
|
7394
7394
|
}}this.Frame.ClearUpDonwFrameYData({Index:windowIndex});var bindData=this.ChartPaint[0].Data;this.BindIndexData(windowIndex,bindData);//执行脚本
|
|
7395
7395
|
this.UpdataDataoffset();//更新数据偏移
|
|
7396
7396
|
this.UpdateFrameMaxMin();//调整坐标最大 最小值
|
|
@@ -13328,7 +13328,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
13328
13328
|
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);};}/********************************************************************************
|
|
13329
13329
|
* 版本信息输出
|
|
13330
13330
|
*
|
|
13331
|
-
*/var HQCHART_VERSION="1.1.
|
|
13331
|
+
*/var HQCHART_VERSION="1.1.13357";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();//把给外界调用的方法暴露出来
|
|
13332
13332
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
13333
13333
|
// BaseIndex:BaseIndex,
|
|
13334
13334
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
package/src/jscommon/umychart.js
CHANGED
|
@@ -19041,6 +19041,8 @@ function HQTradeFrame()
|
|
|
19041
19041
|
{
|
|
19042
19042
|
var subItem=this.SubFrame[windowIndex];
|
|
19043
19043
|
if (!subItem || !subItem.Frame) return;
|
|
19044
|
+
|
|
19045
|
+
var frame=subItem.Frame;
|
|
19044
19046
|
if (frame.YMaxMin)
|
|
19045
19047
|
{
|
|
19046
19048
|
frame.YMaxMin.Max=null;
|
|
@@ -71868,6 +71870,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
71868
71870
|
this.DeleteIndexPaint(windowIndex, true);
|
|
71869
71871
|
this.WindowIndex[windowIndex]=new ScriptIndex(indexData.Name,indexData.Script,indexData.Args,indexData); //脚本执行
|
|
71870
71872
|
this.ResetFrameAttribute(windowIndex);
|
|
71873
|
+
this.Frame.ClearYCoordinateMaxMin(windowIndex);
|
|
71871
71874
|
|
|
71872
71875
|
if (option)
|
|
71873
71876
|
{
|
|
@@ -71923,6 +71926,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
71923
71926
|
var apiItem=indexData.API;
|
|
71924
71927
|
this.WindowIndex[windowIndex]=new APIScriptIndex(apiItem.Name,apiItem.Script,apiItem.Args,indexData);
|
|
71925
71928
|
this.ResetFrameAttribute(windowIndex);
|
|
71929
|
+
this.Frame.ClearYCoordinateMaxMin(windowIndex);
|
|
71926
71930
|
|
|
71927
71931
|
this.OnChangeIndexEvent(windowIndex, { ID:indexData.ID, Name:indexData.Name, FunctionName:"ChangeAPIIndex" });
|
|
71928
71932
|
|
|
@@ -22933,6 +22933,8 @@ function HQTradeFrame()
|
|
|
22933
22933
|
{
|
|
22934
22934
|
var subItem=this.SubFrame[windowIndex];
|
|
22935
22935
|
if (!subItem || !subItem.Frame) return;
|
|
22936
|
+
|
|
22937
|
+
var frame=subItem.Frame;
|
|
22936
22938
|
if (frame.YMaxMin)
|
|
22937
22939
|
{
|
|
22938
22940
|
frame.YMaxMin.Max=null;
|
|
@@ -75760,6 +75762,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
75760
75762
|
this.DeleteIndexPaint(windowIndex, true);
|
|
75761
75763
|
this.WindowIndex[windowIndex]=new ScriptIndex(indexData.Name,indexData.Script,indexData.Args,indexData); //脚本执行
|
|
75762
75764
|
this.ResetFrameAttribute(windowIndex);
|
|
75765
|
+
this.Frame.ClearYCoordinateMaxMin(windowIndex);
|
|
75763
75766
|
|
|
75764
75767
|
if (option)
|
|
75765
75768
|
{
|
|
@@ -75815,6 +75818,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
75815
75818
|
var apiItem=indexData.API;
|
|
75816
75819
|
this.WindowIndex[windowIndex]=new APIScriptIndex(apiItem.Name,apiItem.Script,apiItem.Args,indexData);
|
|
75817
75820
|
this.ResetFrameAttribute(windowIndex);
|
|
75821
|
+
this.Frame.ClearYCoordinateMaxMin(windowIndex);
|
|
75818
75822
|
|
|
75819
75823
|
this.OnChangeIndexEvent(windowIndex, { ID:indexData.ID, Name:indexData.Name, FunctionName:"ChangeAPIIndex" });
|
|
75820
75824
|
|
|
@@ -133267,7 +133271,7 @@ function ScrollBarBGChart()
|
|
|
133267
133271
|
|
|
133268
133272
|
|
|
133269
133273
|
|
|
133270
|
-
var HQCHART_VERSION="1.1.
|
|
133274
|
+
var HQCHART_VERSION="1.1.13357";
|
|
133271
133275
|
|
|
133272
133276
|
function PrintHQChartVersion()
|
|
133273
133277
|
{
|
|
@@ -22977,6 +22977,8 @@ function HQTradeFrame()
|
|
|
22977
22977
|
{
|
|
22978
22978
|
var subItem=this.SubFrame[windowIndex];
|
|
22979
22979
|
if (!subItem || !subItem.Frame) return;
|
|
22980
|
+
|
|
22981
|
+
var frame=subItem.Frame;
|
|
22980
22982
|
if (frame.YMaxMin)
|
|
22981
22983
|
{
|
|
22982
22984
|
frame.YMaxMin.Max=null;
|
|
@@ -75804,6 +75806,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
75804
75806
|
this.DeleteIndexPaint(windowIndex, true);
|
|
75805
75807
|
this.WindowIndex[windowIndex]=new ScriptIndex(indexData.Name,indexData.Script,indexData.Args,indexData); //脚本执行
|
|
75806
75808
|
this.ResetFrameAttribute(windowIndex);
|
|
75809
|
+
this.Frame.ClearYCoordinateMaxMin(windowIndex);
|
|
75807
75810
|
|
|
75808
75811
|
if (option)
|
|
75809
75812
|
{
|
|
@@ -75859,6 +75862,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
75859
75862
|
var apiItem=indexData.API;
|
|
75860
75863
|
this.WindowIndex[windowIndex]=new APIScriptIndex(apiItem.Name,apiItem.Script,apiItem.Args,indexData);
|
|
75861
75864
|
this.ResetFrameAttribute(windowIndex);
|
|
75865
|
+
this.Frame.ClearYCoordinateMaxMin(windowIndex);
|
|
75862
75866
|
|
|
75863
75867
|
this.OnChangeIndexEvent(windowIndex, { ID:indexData.ID, Name:indexData.Name, FunctionName:"ChangeAPIIndex" });
|
|
75864
75868
|
|
|
@@ -137136,7 +137140,7 @@ function HQChartScriptWorker()
|
|
|
137136
137140
|
|
|
137137
137141
|
|
|
137138
137142
|
|
|
137139
|
-
var HQCHART_VERSION="1.1.
|
|
137143
|
+
var HQCHART_VERSION="1.1.13357";
|
|
137140
137144
|
|
|
137141
137145
|
function PrintHQChartVersion()
|
|
137142
137146
|
{
|