hqchart 1.1.13350 → 1.1.13355
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 +16 -10
- package/package.json +1 -1
- package/src/jscommon/umychart.DialogDrawTool.js +2 -1
- package/src/jscommon/umychart.js +80 -47
- package/src/jscommon/umychart.resource/css/tools.css +1 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +81 -48
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +83 -49
package/lib/umychart.vue.js
CHANGED
|
@@ -5002,7 +5002,10 @@ if(!pageInfo)return;if(!this.OverlayIndex)return;if(!IFrameSplitOperator.IsNonEm
|
|
|
5002
5002
|
info.IsLast=pageInfo.IsLast;//是否是最后一个数据
|
|
5003
5003
|
if(IFrameSplitOperator.IsNumber(option.LineType))info.LineType=option.LineType;info.Value=item.Value;var text=IFrameSplitOperator.FormatValueString(item.Value,floatPrecision,this.LanguageID);if(option.Position=='left')info.Message[0]=text;else info.Message[1]=text;if(!pageInfo.IsLast){var config={};if(!pageInfo.IsLast)config.EmptyBGColor=g_JSChartResource.FrameLatestPrice.EmptyBGColor;info.ExtendData={Custom:config};}if(event){var sendData={PreventDefault:false,Label:info,Data:item,IndexName:chart.IndexName,OverlayIdentify:this.OverlayIndex.Identify};event.Callback(event,sendData,this);if(sendData.PreventDefault)continue;}this.Frame.CustomHorizontalInfo.push(info);}}},//回调外部处理自定义Y轴刻度
|
|
5004
5004
|
this.InvokeCustomYCoordinateCallback=function(){if(!this.GetEventCallback)return null;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CREATE_CUSTOM_Y_COORDINATE);if(!event||!event.Callback)return null;var data={ID:this.Frame.Identify,Frame:this.Frame,PreventDefault:false,Custom:this.Custom};if(this.OverlayIdentify)data.OverlayIdentify=this.OverlayIdentify;event.Callback(event,data,this);return data;};this.Reset=function()//重置
|
|
5005
|
-
{};this.SetOption=function(option){}
|
|
5005
|
+
{};this.SetOption=function(option){};//计算上下预留
|
|
5006
|
+
this.ReservedHeight=function(splitData){if(!this.Frame)return;if(this.Frame.IsHScreen)return;//横屏以后再搞
|
|
5007
|
+
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个像素点对应的数值
|
|
5008
|
+
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;};}//字符串格式化 千分位分割
|
|
5006
5009
|
IFrameSplitOperator.FormatValueThousandsString=function(value,floatPrecision){if(value==null||isNaN(value)){if(floatPrecision>0){var nullText='-.';for(var i=0;i<floatPrecision;++i){nullText+='-';}return nullText;}return'--';}var result='';var num=value.toFixed(floatPrecision);if(floatPrecision>0){var numFloat=num.split('.')[1];var numM=num.split('.')[0];while(numM.length>3){result=','+numM.slice(-3)+result;numM=numM.slice(0,numM.length-3);}if(numM){result=numM+result+'.'+numFloat;}}else{while(num.length>3){result=','+num.slice(-3)+result;num=num.slice(0,num.length-3);}if(num){result=num+result;}}return result;};//数据输出格式化 floatPrecision=小数位数
|
|
5007
5010
|
IFrameSplitOperator.FormatValueString=function(value,floatPrecision,languageID){/*
|
|
5008
5011
|
if (value==null || isNaN(value))
|
|
@@ -5110,7 +5113,8 @@ if(this.SplitLogarithmic(splitData,defaultfloatPrecision)){bFilter=false;}else{t
|
|
|
5110
5113
|
{
|
|
5111
5114
|
JSConsole.Chart.Log(`[FrameSplitKLinePriceY::Operator] ${i}=${this.Frame.HorizontalInfo[i].Message[0]}`);
|
|
5112
5115
|
}
|
|
5113
|
-
*/
|
|
5116
|
+
*/this.ReservedHeight(splitData);//预留高度
|
|
5117
|
+
JSConsole.Chart.Log('[FrameSplitKLinePriceY::Operator] fixed . Max='+splitData.Max+' Min='+splitData.Min+' Count='+splitData.Count);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};event.Callback(event,data,this);}}};this.SplitTickData=function(splitData,floatPrecision){switch(this.CoordinateType){case 1://百分比
|
|
5114
5118
|
if(!this.SplitPercentage(splitData,floatPrecision,splitData.IsFixedMaxMin)){this.SplitDefault(splitData,floatPrecision,splitData.IsFixedMaxMin);}else{this.Frame.MultiTextFormat=this.PercentageTextFormat;splitData.IsFilter=false;}break;default:if(this.SplitType==3){this.SplitTickPrice(splitData,floatPrecision);}else{this.SplitDefault(splitData,floatPrecision,splitData.IsFixedMaxMin);}}};this.SplitTickPrice=function(splitData,floatPrecision){var aryPrice=this.KLineChart.GetAllPrice();this.Frame.HorizontalInfo=[];for(var i in aryPrice){var value=aryPrice[i];this.Frame.HorizontalInfo[i]=new CoordinateInfo();this.Frame.HorizontalInfo[i].Value=value;if(this.IsShowLeftText)this.Frame.HorizontalInfo[i].Message[0]=value.toFixed(floatPrecision);if(this.IsShowRightText)this.Frame.HorizontalInfo[i].Message[1]=value.toFixed(floatPrecision);}};this.SplitPercentage=function(splitData,floatPrecision,isFixedMaxMin)//百分比坐标
|
|
5115
5119
|
{var firstOpenPrice=this.GetFirstOpenPrice();if(!IFrameSplitOperator.IsNumber(firstOpenPrice))return false;splitData.Max=(splitData.Max-firstOpenPrice)/firstOpenPrice;splitData.Min=(splitData.Min-firstOpenPrice)/firstOpenPrice;splitData.Interval=(splitData.Max-splitData.Min)/(splitData.Count-1);if(!isFixedMaxMin)this.IntegerCoordinateSplit2(splitData);var minValue=(1+splitData.Min)*firstOpenPrice;var maxValue=(1+splitData.Max)*firstOpenPrice;var textColor;if(g_JSChartResource.Frame&&g_JSChartResource.Frame.PercentageText){var item=g_JSChartResource.Frame.PercentageText;textColor={PriceColor:item.PriceColor,PercentageColor:item.PercentageColor,SplitColor:item.SplitColor,Font:item.Font};}var aryHorizontal=[];for(var value=0;value<=splitData.Max;value+=splitData.Interval){var price=(value+1)*firstOpenPrice;var item=new CoordinateInfo();item.Value=price;if(this.IsShowLeftText)item.Message[0]=price.toFixed(floatPrecision);//左边价格坐标
|
|
5116
5120
|
if(this.IsShowRightText){var strPrice=price.toFixed(floatPrecision);var text=(value*100).toFixed(2);//右边百分比
|
|
@@ -5181,9 +5185,7 @@ coordinate.Message[1]=IFrameSplitOperator.FormatValueString(value,floatPrecision
|
|
|
5181
5185
|
//this.Frame.HorizontalInfo[i].LineColor="rgb(220,220,220)";
|
|
5182
5186
|
}}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轴坐标
|
|
5183
5187
|
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);//预留高度
|
|
5184
|
-
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.
|
|
5185
|
-
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个像素点对应的数值
|
|
5186
|
-
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)//手机端格式 如果有万,亿单位了 去掉小数
|
|
5188
|
+
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)//手机端格式 如果有万,亿单位了 去掉小数
|
|
5187
5189
|
{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)//原始数据输出
|
|
5188
5190
|
{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);//数据比小数位数还小, 调整小数位数
|
|
5189
5191
|
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]
|
|
@@ -7376,16 +7378,20 @@ var title=this.TitlePaint[1];if(title){title.TradeIndex=null;title.ColorIndex=nu
|
|
|
7376
7378
|
this.UpdateFrameMaxMin();//调整坐标最大 最小值
|
|
7377
7379
|
this.Draw();};this.SetFrameToolbar=function(windowIndex,window){if(!window||!this.Frame.SubFrame[windowIndex]||!this.Frame.SubFrame[windowIndex].Frame)return;var frame=this.Frame.SubFrame[windowIndex].Frame;var bChanged=false;if(IFrameSplitOperator.IsBool(window.Modify)){frame.ModifyIndex=window.Modify;bChanged=true;}if(IFrameSplitOperator.IsBool(window.Change)){frame.ChangeIndex=window.Change;bChanged=true;}if(IFrameSplitOperator.IsBool(window.Close)){frame.CloseIndex=window.Close;bChanged=true;}if(IFrameSplitOperator.IsBool(window.Overlay)){frame.OverlayIndex=window.Overlay;bChanged=true;}//工具栏变 先刷新工具栏
|
|
7378
7380
|
if(bChanged){frame.SizeChange=true;frame.ToolbarRect=null;//清空工具栏缓存
|
|
7379
|
-
frame.DrawToolbar();}}
|
|
7381
|
+
frame.DrawToolbar();}};this.SetFrameAttribute=function(windowIndex,attr){if(!window||!this.Frame.SubFrame[windowIndex]||!this.Frame.SubFrame[windowIndex].Frame)return;if(!attr)return;var frame=this.Frame.SubFrame[windowIndex].Frame;if(!IFrameSplitOperator.IsUndefined(attr.HorizontalReserved))frame.HorizontalReserved=attr.HorizontalReserved;//Y轴上下预留
|
|
7382
|
+
if(IFrameSplitOperator.IsNumber(attr.TitleHeight))frame.ChartBorder.TitleHeight=attr.TitleHeight;//指标标题高度
|
|
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;};//切换成 脚本指标
|
|
7380
7384
|
this.ChangeScriptIndex=function(windowIndex,indexData,option){this.DeleteIndexPaint(windowIndex,true);this.WindowIndex[windowIndex]=new ScriptIndex(indexData.Name,indexData.Script,indexData.Args,indexData);//脚本执行
|
|
7381
|
-
if(option){if(option.Window)this.SetFrameToolbar(windowIndex,option.Window);
|
|
7385
|
+
this.ResetFrameAttribute(windowIndex);if(option){if(option.Window){this.SetFrameToolbar(windowIndex,option.Window);this.SetFrameAttribute(windowIndex,option.Window);//窗口属性
|
|
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);//执行脚本
|
|
7382
7387
|
this.UpdataDataoffset();//更新数据偏移
|
|
7383
7388
|
this.UpdateFrameMaxMin();//调整坐标最大 最小值
|
|
7384
7389
|
this.Draw();};this.OnKLinePageChange=function(eventid){if(!this.ChartPaint[0])return;var bindData=this.ChartPaint[0].Data;for(var i=0;i<this.WindowIndex.length;++i){var item=this.WindowIndex[i];if(!item)continue;if(item.IsUsePageData===true)this.BindIndexData(i,bindData,{Type:1});//执行脚本
|
|
7385
7390
|
}//叠加指标
|
|
7386
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指标
|
|
7387
7392
|
this.ChangeAPIIndex=function(windowIndex,indexData){this.DeleteIndexPaint(windowIndex,true);//使用API挂接指标数据 API:{ Name:指标名字, Script:指标脚本可以为空, Args:参数可以为空, Url:指标执行地址 }
|
|
7388
|
-
var apiItem=indexData.API;this.WindowIndex[windowIndex]=new APIScriptIndex(apiItem.Name,apiItem.Script,apiItem.Args,indexData);this.OnChangeIndexEvent(windowIndex,{ID:indexData.ID,Name:indexData.Name,FunctionName:"ChangeAPIIndex"});if(indexData){if(indexData.Window)this.SetFrameToolbar(windowIndex,indexData.Window);
|
|
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);//窗口属性
|
|
7394
|
+
}}this.Frame.ClearUpDonwFrameYData({Index:windowIndex});var bindData=this.ChartPaint[0].Data;this.BindIndexData(windowIndex,bindData);//执行脚本
|
|
7389
7395
|
this.UpdataDataoffset();//更新数据偏移
|
|
7390
7396
|
this.UpdateFrameMaxMin();//调整坐标最大 最小值
|
|
7391
7397
|
this.Draw();};this.OnChangeIndexEvent=function(windowIndex,indexInfo){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CHANGE_INDEX);if(event&&event.Callback){var data={IndexInfo:indexInfo,WindowIndex:windowIndex};event.Callback(event,data,this);}};//切换指标 指定切换窗口指标
|
|
@@ -13310,7 +13316,7 @@ this.AryButton=[{Title:"点击线段颜色",ClassName:'hqchart_drawtool icon-hua
|
|
|
13310
13316
|
switch(item.Data.ID){case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID:this.ColorButton=data;break;case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BG_COLOR_ID:this.BGColorButton=data;divItem.style.display="none";break;case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_FONT_COLOR_ID:this.FontColorButton=data;divItem.style.display="none";break;}parentDivDom.appendChild(divItem);};this.OnClickButton=function(e,data){console.log('[JSDialogModifyDraw::OnClickButton] ',data);if(!data.Item||!data.Item.Data)return;var id=data.Item.Data.ID;switch(id){case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID:this.ModifyLineColor();break;case JS_DRAWTOOL_MENU_ID.CMD_DELETE_DRAW_CHART_ID:this.DeleteDrawPicture();break;case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BG_COLOR_ID:this.ModifyBGColor();break;case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_FONT_COLOR_ID:this.ModifyFontColor();break;}};this.Close=function(e){if(!this.DivDialog)return;this.ChartPicture=null;this.DivDialog.style.visibility='hidden';};this.IsShow=function(){if(!this.DivDialog)return false;return this.DivDialog.style.visibility==='visible';};this.DeleteDrawPicture=function(){if(this.ChartPicture&&this.HQChart){this.HQChart.ClearChartDrawPicture(this.ChartPicture);}this.Close();};this.ShowButton=function(dom,diaplay){if(dom.style.display==diaplay)return;dom.style.display=diaplay;};this.GetRandomColor=function(currentColor,randomLineColor){var colorIndex=0;for(var i=0;i<randomLineColor.length;++i){if(currentColor==randomLineColor[i]){colorIndex=i+1;break;}}colorIndex=colorIndex%randomLineColor.length;var color=randomLineColor[colorIndex];return color;};this.ModifyLineColor=function(){if(!this.ChartPicture||!this.HQChart)return;var color=this.GetRandomColor(this.ChartPicture.LineColor,this.RandomLineColor);this.ChartPicture.LineColor=color;this.ChartPicture.PointColor=color;if(this.ColorButton)this.ColorButton.Span.style['color']=color;if(this.HQChart.ChartDrawStorage)this.HQChart.ChartDrawStorage.SaveDrawData(this.ChartPicture);//保存下
|
|
13311
13317
|
this.HQChart.Draw();};this.ModifyFontColor=function(){if(!this.ChartPicture||!this.HQChart)return;if(this.ChartPicture.ClassName=="ChartDrawNote"){var color=this.GetRandomColor(this.ChartPicture.NoteTextColor,this.RandomFontColor);this.ChartPicture.NoteTextColor=color;}else{var color=this.GetRandomColor(this.ChartPicture.TextColor,this.RandomFontColor);this.ChartPicture.TextColor=color;}if(this.FontColorButton)this.FontColorButton.Span.style['color']=color;if(this.HQChart.ChartDrawStorage)this.HQChart.ChartDrawStorage.SaveDrawData(this.ChartPicture);//保存下
|
|
13312
13318
|
this.HQChart.Draw();};this.ModifyBGColor=function(){if(!this.ChartPicture||!this.HQChart)return;if(this.ChartPicture.ClassName=="ChartDrawNote"){var color=this.GetRandomColor(this.ChartPicture.NoteBGColor,this.RandomBGColor);this.ChartPicture.NoteBGColor=color;}else{var color=this.GetRandomColor(this.ChartPicture.BGColor,this.RandomBGColor);this.ChartPicture.BGColor=color;}if(this.BGColorButton)this.BGColorButton.Span.style['color']=color;if(this.HQChart.ChartDrawStorage)this.HQChart.ChartDrawStorage.SaveDrawData(this.ChartPicture);//保存下
|
|
13313
|
-
this.HQChart.Draw();};this.Show=function(x,y){if(!this.DivDialog)this.Create();this.DivDialog.style.visibility='visible';this.DivDialog.style.top=y+"px";this.DivDialog.style.left=x+"px";};this.SetChartPicture=function(chart){this.ChartPicture=chart;var bShowLineColor=true,bShowBGColor=false,bShowFontColor=false;var bgColor=null,fontColor=null;var ARRAY_TEXT_CHART=['ChartDrawPriceLabel',"ChartDrawAnchoredText","ChartDrawPriceNote"];if(ARRAY_TEXT_CHART.includes(chart.ClassName)){bShowBGColor=true;bShowFontColor=true;bgColor=chart.BGColor;fontColor=chart.TextColor;}else if(chart.ClassName=="ChartDrawNote"){bShowBGColor=true;bShowFontColor=true;bgColor=chart.NoteBGColor;fontColor=chart.NoteTextColor;}if(this.ColorButton){var item=this.ColorButton;this.ShowButton(item.Div,bShowLineColor?"block":"none");if(bShowLineColor){item.Span.style['color']=chart.LineColor;}}if(this.BGColorButton){var item=this.BGColorButton;this.ShowButton(item.Div,bShowBGColor?"block":"none");if(bShowBGColor){item.Span.style['color']=bgColor;}}if(this.FontColorButton){var item=this.FontColorButton;this.ShowButton(item.Div,bShowFontColor?"block":"none");if(bShowFontColor){item.Span.style['color']=fontColor;}}};this.OnMouseDownTitle=function(e){var _this76=this;if(!this.DivDialog)return;var dragData={X:e.clientX,Y:e.clientY};dragData.YOffset=e.clientX-this.DivDialog.offsetLeft;dragData.XOffset=e.clientY-this.DivDialog.offsetTop;this.DragTitle=dragData;document.onmousemove=function(e){_this76.DocOnMouseMoveTitle(e);};document.onmouseup=function(e){_this76.DocOnMouseUpTitle(e);};};this.DocOnMouseMoveTitle=function(e){if(!this.DragTitle)return;var left=e.clientX-this.DragTitle.YOffset;var top=e.clientY-this.DragTitle.XOffset;var right=left+this.DivDialog.offsetWidth;var bottom=top+this.DivDialog.offsetHeight;if(right+5>=window.innerWidth)left=window.innerWidth-this.DivDialog.offsetWidth-5;if(bottom+5>=window.innerHeight)top=window.innerHeight-this.DivDialog.offsetHeight-5;this.DivDialog.style.left=left+'px';this.DivDialog.style.top=top+'px';if(e.preventDefault)e.preventDefault();};this.DocOnMouseUpTitle=function(e){this.DragTitle=null;this.onmousemove=null;this.onmouseup=null;};}///////////////////////////////////////////////////////////////////////////////////
|
|
13319
|
+
this.HQChart.Draw();};this.Show=function(x,y){if(!this.DivDialog)this.Create();this.DivDialog.style.visibility='visible';this.DivDialog.style.top=y+"px";this.DivDialog.style.left=x+"px";};this.SetChartPicture=function(chart){this.ChartPicture=chart;var bShowLineColor=true,bShowBGColor=false,bShowFontColor=false;var bgColor=null,fontColor=null;var ARRAY_TEXT_CHART=['ChartDrawPriceLabel',"ChartDrawAnchoredText","ChartDrawPriceNote"];if(ARRAY_TEXT_CHART.includes(chart.ClassName)){bShowBGColor=true;bShowFontColor=true;bgColor=chart.BGColor;fontColor=chart.TextColor;}else if(chart.ClassName=="ChartDrawNote"){bShowBGColor=true;bShowFontColor=true;bgColor=chart.NoteBGColor;fontColor=chart.NoteTextColor;}if(this.ColorButton){var item=this.ColorButton;this.ShowButton(item.Div,bShowLineColor?"block":"none");if(bShowLineColor){item.Span.style['color']=chart.LineColor;}}if(this.BGColorButton){var item=this.BGColorButton;this.ShowButton(item.Div,bShowBGColor?"block":"none");if(bShowBGColor){item.Span.style['color']=bgColor;}}if(this.FontColorButton){var item=this.FontColorButton;this.ShowButton(item.Div,bShowFontColor?"block":"none");if(bShowFontColor){item.Span.style['color']=fontColor;}}};this.OnMouseDownTitle=function(e){var _this76=this;if(!this.DivDialog)return;var dragData={X:e.clientX,Y:e.clientY};dragData.YOffset=e.clientX-this.DivDialog.offsetLeft;dragData.XOffset=e.clientY-this.DivDialog.offsetTop;this.DragTitle=dragData;document.onmousemove=function(e){_this76.DocOnMouseMoveTitle(e);};document.onmouseup=function(e){_this76.DocOnMouseUpTitle(e);};};this.DocOnMouseMoveTitle=function(e){if(!this.DragTitle)return;var left=e.clientX-this.DragTitle.YOffset;var top=e.clientY-this.DragTitle.XOffset;var right=left+this.DivDialog.offsetWidth;var bottom=top+this.DivDialog.offsetHeight;if(right+5>=window.innerWidth)left=window.innerWidth-this.DivDialog.offsetWidth-5;if(bottom+5>=window.innerHeight)top=window.innerHeight-this.DivDialog.offsetHeight-5;this.DivDialog.style.left=left+'px';this.DivDialog.style.top=top+'px';if(e.preventDefault)e.preventDefault();if(e.stopPropagation)e.stopPropagation();};this.DocOnMouseUpTitle=function(e){this.DragTitle=null;this.onmousemove=null;this.onmouseup=null;};}///////////////////////////////////////////////////////////////////////////////////
|
|
13314
13320
|
// 工作线程计算指标示例
|
|
13315
13321
|
//
|
|
13316
13322
|
//
|
|
@@ -13322,7 +13328,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
13322
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);};}/********************************************************************************
|
|
13323
13329
|
* 版本信息输出
|
|
13324
13330
|
*
|
|
13325
|
-
*/var HQCHART_VERSION="1.1.
|
|
13331
|
+
*/var HQCHART_VERSION="1.1.13354";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();//把给外界调用的方法暴露出来
|
|
13326
13332
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
13327
13333
|
// BaseIndex:BaseIndex,
|
|
13328
13334
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
|
@@ -919,7 +919,8 @@ function JSDialogModifyDraw()
|
|
|
919
919
|
this.DivDialog.style.left = left + 'px'
|
|
920
920
|
this.DivDialog.style.top = top + 'px'
|
|
921
921
|
|
|
922
|
-
if(e.preventDefault) e.preventDefault();
|
|
922
|
+
if (e.preventDefault) e.preventDefault();
|
|
923
|
+
if (e.stopPropagation) e.stopPropagation();
|
|
923
924
|
}
|
|
924
925
|
|
|
925
926
|
this.DocOnMouseUpTitle=function(e)
|
package/src/jscommon/umychart.js
CHANGED
|
@@ -45425,6 +45425,51 @@ function IFrameSplitOperator()
|
|
|
45425
45425
|
}
|
|
45426
45426
|
|
|
45427
45427
|
this.SetOption=function(option) { }
|
|
45428
|
+
|
|
45429
|
+
//计算上下预留
|
|
45430
|
+
this.ReservedHeight=function(splitData)
|
|
45431
|
+
{
|
|
45432
|
+
if (!this.Frame) return;
|
|
45433
|
+
if (this.Frame.IsHScreen) return; //横屏以后再搞
|
|
45434
|
+
|
|
45435
|
+
var yReserved=this.Frame.HorizontalReserved;
|
|
45436
|
+
if (!yReserved) return;
|
|
45437
|
+
|
|
45438
|
+
var reservedHeight=0;
|
|
45439
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top)) reservedHeight+=yReserved.Top;
|
|
45440
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom)) reservedHeight+=yReserved.Bottom;
|
|
45441
|
+
if (reservedHeight<=0) return;
|
|
45442
|
+
|
|
45443
|
+
var border=this.Frame.GetBorder();
|
|
45444
|
+
var top=border.TopEx;
|
|
45445
|
+
var bottom=border.BottomEx;
|
|
45446
|
+
var srcHeight=bottom-top;
|
|
45447
|
+
if (srcHeight<reservedHeight) return;
|
|
45448
|
+
|
|
45449
|
+
var max=splitData.Max;
|
|
45450
|
+
var min=splitData.Min;
|
|
45451
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top)) top-=yReserved.Top;
|
|
45452
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom)) bottom+=yReserved.Bottom;
|
|
45453
|
+
|
|
45454
|
+
var value=(max-min)/(bottom-top); //1个像素点对应的数值
|
|
45455
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top))
|
|
45456
|
+
{
|
|
45457
|
+
var topValue=value*yReserved.Top;
|
|
45458
|
+
max+=topValue;
|
|
45459
|
+
}
|
|
45460
|
+
|
|
45461
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom))
|
|
45462
|
+
{
|
|
45463
|
+
var bottomValue=value*yReserved.Bottom;
|
|
45464
|
+
min-=bottomValue;
|
|
45465
|
+
}
|
|
45466
|
+
|
|
45467
|
+
splitData.Max=max;
|
|
45468
|
+
splitData.Min=min;
|
|
45469
|
+
|
|
45470
|
+
this.Frame.HorizontalMax=splitData.Max;
|
|
45471
|
+
this.Frame.HorizontalMin=splitData.Min;
|
|
45472
|
+
}
|
|
45428
45473
|
}
|
|
45429
45474
|
|
|
45430
45475
|
//字符串格式化 千分位分割
|
|
@@ -46077,6 +46122,8 @@ function FrameSplitKLinePriceY()
|
|
|
46077
46122
|
}
|
|
46078
46123
|
*/
|
|
46079
46124
|
|
|
46125
|
+
this.ReservedHeight(splitData); //预留高度
|
|
46126
|
+
|
|
46080
46127
|
JSConsole.Chart.Log(`[FrameSplitKLinePriceY::Operator] fixed . Max=${splitData.Max} Min=${splitData.Min} Count=${splitData.Count}`);
|
|
46081
46128
|
|
|
46082
46129
|
if (this.GetEventCallback)
|
|
@@ -46915,50 +46962,6 @@ function FrameSplitY()
|
|
|
46915
46962
|
}
|
|
46916
46963
|
}
|
|
46917
46964
|
|
|
46918
|
-
this.ReservedHeight=function(splitData)
|
|
46919
|
-
{
|
|
46920
|
-
if (this.Frame.IsHScreen) return; //横屏以后再搞
|
|
46921
|
-
|
|
46922
|
-
var yReserved=this.Frame.HorizontalReserved;
|
|
46923
|
-
if (!yReserved) return;
|
|
46924
|
-
|
|
46925
|
-
var reservedHeight=0;
|
|
46926
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top)) reservedHeight+=yReserved.Top;
|
|
46927
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom)) reservedHeight+=yReserved.Bottom;
|
|
46928
|
-
if (reservedHeight<=0) return;
|
|
46929
|
-
|
|
46930
|
-
var border=this.Frame.GetBorder();
|
|
46931
|
-
var top=border.TopEx;
|
|
46932
|
-
var bottom=border.BottomEx;
|
|
46933
|
-
var srcHeight=bottom-top;
|
|
46934
|
-
if (srcHeight<reservedHeight) return;
|
|
46935
|
-
|
|
46936
|
-
var max=splitData.Max;
|
|
46937
|
-
var min=splitData.Min;
|
|
46938
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top)) top-=yReserved.Top;
|
|
46939
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom)) bottom+=yReserved.Bottom;
|
|
46940
|
-
|
|
46941
|
-
var value=(max-min)/(bottom-top); //1个像素点对应的数值
|
|
46942
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top))
|
|
46943
|
-
{
|
|
46944
|
-
var topValue=value*yReserved.Top;
|
|
46945
|
-
max+=topValue;
|
|
46946
|
-
}
|
|
46947
|
-
|
|
46948
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom))
|
|
46949
|
-
{
|
|
46950
|
-
var bottomValue=value*yReserved.Bottom;
|
|
46951
|
-
min-=bottomValue;
|
|
46952
|
-
}
|
|
46953
|
-
|
|
46954
|
-
splitData.Max=max;
|
|
46955
|
-
splitData.Min=min;
|
|
46956
|
-
|
|
46957
|
-
this.Frame.HorizontalMax=splitData.Max;
|
|
46958
|
-
this.Frame.HorizontalMin=splitData.Min;
|
|
46959
|
-
}
|
|
46960
|
-
|
|
46961
|
-
|
|
46962
46965
|
this.FormatValueString=function(value)
|
|
46963
46966
|
{
|
|
46964
46967
|
var text;
|
|
@@ -71839,15 +71842,40 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
71839
71842
|
}
|
|
71840
71843
|
}
|
|
71841
71844
|
|
|
71845
|
+
this.SetFrameAttribute=function(windowIndex, attr)
|
|
71846
|
+
{
|
|
71847
|
+
if (!window || !this.Frame.SubFrame[windowIndex] || !this.Frame.SubFrame[windowIndex].Frame) return;
|
|
71848
|
+
if (!attr) return;
|
|
71849
|
+
|
|
71850
|
+
var frame=this.Frame.SubFrame[windowIndex].Frame;
|
|
71851
|
+
|
|
71852
|
+
if (!IFrameSplitOperator.IsUndefined(attr.HorizontalReserved)) frame.HorizontalReserved=attr.HorizontalReserved; //Y轴上下预留
|
|
71853
|
+
if (IFrameSplitOperator.IsNumber(attr.TitleHeight)) frame.ChartBorder.TitleHeight=attr.TitleHeight; //指标标题高度
|
|
71854
|
+
}
|
|
71855
|
+
|
|
71856
|
+
this.ResetFrameAttribute=function(windowIndex)
|
|
71857
|
+
{
|
|
71858
|
+
if (!window || !this.Frame.SubFrame[windowIndex] || !this.Frame.SubFrame[windowIndex].Frame) return;
|
|
71859
|
+
var frame=this.Frame.SubFrame[windowIndex].Frame;
|
|
71860
|
+
|
|
71861
|
+
frame.HorizontalReserved=null;
|
|
71862
|
+
}
|
|
71863
|
+
|
|
71864
|
+
|
|
71842
71865
|
//切换成 脚本指标
|
|
71843
71866
|
this.ChangeScriptIndex=function(windowIndex,indexData,option)
|
|
71844
71867
|
{
|
|
71845
71868
|
this.DeleteIndexPaint(windowIndex, true);
|
|
71846
71869
|
this.WindowIndex[windowIndex]=new ScriptIndex(indexData.Name,indexData.Script,indexData.Args,indexData); //脚本执行
|
|
71870
|
+
this.ResetFrameAttribute(windowIndex);
|
|
71847
71871
|
|
|
71848
71872
|
if (option)
|
|
71849
71873
|
{
|
|
71850
|
-
if (option.Window)
|
|
71874
|
+
if (option.Window)
|
|
71875
|
+
{
|
|
71876
|
+
this.SetFrameToolbar(windowIndex,option.Window);
|
|
71877
|
+
this.SetFrameAttribute(windowIndex,option.Window); //窗口属性
|
|
71878
|
+
}
|
|
71851
71879
|
}
|
|
71852
71880
|
|
|
71853
71881
|
this.OnChangeIndexEvent(windowIndex, { ID:indexData.ID, Name:indexData.Name, FunctionName:"ChangeScriptIndex" });
|
|
@@ -71894,14 +71922,19 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
71894
71922
|
//使用API挂接指标数据 API:{ Name:指标名字, Script:指标脚本可以为空, Args:参数可以为空, Url:指标执行地址 }
|
|
71895
71923
|
var apiItem=indexData.API;
|
|
71896
71924
|
this.WindowIndex[windowIndex]=new APIScriptIndex(apiItem.Name,apiItem.Script,apiItem.Args,indexData);
|
|
71925
|
+
this.ResetFrameAttribute(windowIndex);
|
|
71897
71926
|
|
|
71898
71927
|
this.OnChangeIndexEvent(windowIndex, { ID:indexData.ID, Name:indexData.Name, FunctionName:"ChangeAPIIndex" });
|
|
71899
71928
|
|
|
71900
71929
|
if (indexData)
|
|
71901
71930
|
{
|
|
71902
|
-
if (indexData.Window)
|
|
71931
|
+
if (indexData.Window)
|
|
71932
|
+
{
|
|
71933
|
+
this.SetFrameToolbar(windowIndex,indexData.Window);
|
|
71934
|
+
this.SetFrameAttribute(windowIndex,indexData.Window); //窗口属性
|
|
71935
|
+
}
|
|
71903
71936
|
}
|
|
71904
|
-
|
|
71937
|
+
|
|
71905
71938
|
this.Frame.ClearUpDonwFrameYData({ Index:windowIndex });
|
|
71906
71939
|
var bindData=this.ChartPaint[0].Data;
|
|
71907
71940
|
this.BindIndexData(windowIndex,bindData); //执行脚本
|
|
@@ -49317,6 +49317,51 @@ function IFrameSplitOperator()
|
|
|
49317
49317
|
}
|
|
49318
49318
|
|
|
49319
49319
|
this.SetOption=function(option) { }
|
|
49320
|
+
|
|
49321
|
+
//计算上下预留
|
|
49322
|
+
this.ReservedHeight=function(splitData)
|
|
49323
|
+
{
|
|
49324
|
+
if (!this.Frame) return;
|
|
49325
|
+
if (this.Frame.IsHScreen) return; //横屏以后再搞
|
|
49326
|
+
|
|
49327
|
+
var yReserved=this.Frame.HorizontalReserved;
|
|
49328
|
+
if (!yReserved) return;
|
|
49329
|
+
|
|
49330
|
+
var reservedHeight=0;
|
|
49331
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top)) reservedHeight+=yReserved.Top;
|
|
49332
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom)) reservedHeight+=yReserved.Bottom;
|
|
49333
|
+
if (reservedHeight<=0) return;
|
|
49334
|
+
|
|
49335
|
+
var border=this.Frame.GetBorder();
|
|
49336
|
+
var top=border.TopEx;
|
|
49337
|
+
var bottom=border.BottomEx;
|
|
49338
|
+
var srcHeight=bottom-top;
|
|
49339
|
+
if (srcHeight<reservedHeight) return;
|
|
49340
|
+
|
|
49341
|
+
var max=splitData.Max;
|
|
49342
|
+
var min=splitData.Min;
|
|
49343
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top)) top-=yReserved.Top;
|
|
49344
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom)) bottom+=yReserved.Bottom;
|
|
49345
|
+
|
|
49346
|
+
var value=(max-min)/(bottom-top); //1个像素点对应的数值
|
|
49347
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top))
|
|
49348
|
+
{
|
|
49349
|
+
var topValue=value*yReserved.Top;
|
|
49350
|
+
max+=topValue;
|
|
49351
|
+
}
|
|
49352
|
+
|
|
49353
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom))
|
|
49354
|
+
{
|
|
49355
|
+
var bottomValue=value*yReserved.Bottom;
|
|
49356
|
+
min-=bottomValue;
|
|
49357
|
+
}
|
|
49358
|
+
|
|
49359
|
+
splitData.Max=max;
|
|
49360
|
+
splitData.Min=min;
|
|
49361
|
+
|
|
49362
|
+
this.Frame.HorizontalMax=splitData.Max;
|
|
49363
|
+
this.Frame.HorizontalMin=splitData.Min;
|
|
49364
|
+
}
|
|
49320
49365
|
}
|
|
49321
49366
|
|
|
49322
49367
|
//字符串格式化 千分位分割
|
|
@@ -49969,6 +50014,8 @@ function FrameSplitKLinePriceY()
|
|
|
49969
50014
|
}
|
|
49970
50015
|
*/
|
|
49971
50016
|
|
|
50017
|
+
this.ReservedHeight(splitData); //预留高度
|
|
50018
|
+
|
|
49972
50019
|
JSConsole.Chart.Log(`[FrameSplitKLinePriceY::Operator] fixed . Max=${splitData.Max} Min=${splitData.Min} Count=${splitData.Count}`);
|
|
49973
50020
|
|
|
49974
50021
|
if (this.GetEventCallback)
|
|
@@ -50807,50 +50854,6 @@ function FrameSplitY()
|
|
|
50807
50854
|
}
|
|
50808
50855
|
}
|
|
50809
50856
|
|
|
50810
|
-
this.ReservedHeight=function(splitData)
|
|
50811
|
-
{
|
|
50812
|
-
if (this.Frame.IsHScreen) return; //横屏以后再搞
|
|
50813
|
-
|
|
50814
|
-
var yReserved=this.Frame.HorizontalReserved;
|
|
50815
|
-
if (!yReserved) return;
|
|
50816
|
-
|
|
50817
|
-
var reservedHeight=0;
|
|
50818
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top)) reservedHeight+=yReserved.Top;
|
|
50819
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom)) reservedHeight+=yReserved.Bottom;
|
|
50820
|
-
if (reservedHeight<=0) return;
|
|
50821
|
-
|
|
50822
|
-
var border=this.Frame.GetBorder();
|
|
50823
|
-
var top=border.TopEx;
|
|
50824
|
-
var bottom=border.BottomEx;
|
|
50825
|
-
var srcHeight=bottom-top;
|
|
50826
|
-
if (srcHeight<reservedHeight) return;
|
|
50827
|
-
|
|
50828
|
-
var max=splitData.Max;
|
|
50829
|
-
var min=splitData.Min;
|
|
50830
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top)) top-=yReserved.Top;
|
|
50831
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom)) bottom+=yReserved.Bottom;
|
|
50832
|
-
|
|
50833
|
-
var value=(max-min)/(bottom-top); //1个像素点对应的数值
|
|
50834
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top))
|
|
50835
|
-
{
|
|
50836
|
-
var topValue=value*yReserved.Top;
|
|
50837
|
-
max+=topValue;
|
|
50838
|
-
}
|
|
50839
|
-
|
|
50840
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom))
|
|
50841
|
-
{
|
|
50842
|
-
var bottomValue=value*yReserved.Bottom;
|
|
50843
|
-
min-=bottomValue;
|
|
50844
|
-
}
|
|
50845
|
-
|
|
50846
|
-
splitData.Max=max;
|
|
50847
|
-
splitData.Min=min;
|
|
50848
|
-
|
|
50849
|
-
this.Frame.HorizontalMax=splitData.Max;
|
|
50850
|
-
this.Frame.HorizontalMin=splitData.Min;
|
|
50851
|
-
}
|
|
50852
|
-
|
|
50853
|
-
|
|
50854
50857
|
this.FormatValueString=function(value)
|
|
50855
50858
|
{
|
|
50856
50859
|
var text;
|
|
@@ -75731,15 +75734,40 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
75731
75734
|
}
|
|
75732
75735
|
}
|
|
75733
75736
|
|
|
75737
|
+
this.SetFrameAttribute=function(windowIndex, attr)
|
|
75738
|
+
{
|
|
75739
|
+
if (!window || !this.Frame.SubFrame[windowIndex] || !this.Frame.SubFrame[windowIndex].Frame) return;
|
|
75740
|
+
if (!attr) return;
|
|
75741
|
+
|
|
75742
|
+
var frame=this.Frame.SubFrame[windowIndex].Frame;
|
|
75743
|
+
|
|
75744
|
+
if (!IFrameSplitOperator.IsUndefined(attr.HorizontalReserved)) frame.HorizontalReserved=attr.HorizontalReserved; //Y轴上下预留
|
|
75745
|
+
if (IFrameSplitOperator.IsNumber(attr.TitleHeight)) frame.ChartBorder.TitleHeight=attr.TitleHeight; //指标标题高度
|
|
75746
|
+
}
|
|
75747
|
+
|
|
75748
|
+
this.ResetFrameAttribute=function(windowIndex)
|
|
75749
|
+
{
|
|
75750
|
+
if (!window || !this.Frame.SubFrame[windowIndex] || !this.Frame.SubFrame[windowIndex].Frame) return;
|
|
75751
|
+
var frame=this.Frame.SubFrame[windowIndex].Frame;
|
|
75752
|
+
|
|
75753
|
+
frame.HorizontalReserved=null;
|
|
75754
|
+
}
|
|
75755
|
+
|
|
75756
|
+
|
|
75734
75757
|
//切换成 脚本指标
|
|
75735
75758
|
this.ChangeScriptIndex=function(windowIndex,indexData,option)
|
|
75736
75759
|
{
|
|
75737
75760
|
this.DeleteIndexPaint(windowIndex, true);
|
|
75738
75761
|
this.WindowIndex[windowIndex]=new ScriptIndex(indexData.Name,indexData.Script,indexData.Args,indexData); //脚本执行
|
|
75762
|
+
this.ResetFrameAttribute(windowIndex);
|
|
75739
75763
|
|
|
75740
75764
|
if (option)
|
|
75741
75765
|
{
|
|
75742
|
-
if (option.Window)
|
|
75766
|
+
if (option.Window)
|
|
75767
|
+
{
|
|
75768
|
+
this.SetFrameToolbar(windowIndex,option.Window);
|
|
75769
|
+
this.SetFrameAttribute(windowIndex,option.Window); //窗口属性
|
|
75770
|
+
}
|
|
75743
75771
|
}
|
|
75744
75772
|
|
|
75745
75773
|
this.OnChangeIndexEvent(windowIndex, { ID:indexData.ID, Name:indexData.Name, FunctionName:"ChangeScriptIndex" });
|
|
@@ -75786,14 +75814,19 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
75786
75814
|
//使用API挂接指标数据 API:{ Name:指标名字, Script:指标脚本可以为空, Args:参数可以为空, Url:指标执行地址 }
|
|
75787
75815
|
var apiItem=indexData.API;
|
|
75788
75816
|
this.WindowIndex[windowIndex]=new APIScriptIndex(apiItem.Name,apiItem.Script,apiItem.Args,indexData);
|
|
75817
|
+
this.ResetFrameAttribute(windowIndex);
|
|
75789
75818
|
|
|
75790
75819
|
this.OnChangeIndexEvent(windowIndex, { ID:indexData.ID, Name:indexData.Name, FunctionName:"ChangeAPIIndex" });
|
|
75791
75820
|
|
|
75792
75821
|
if (indexData)
|
|
75793
75822
|
{
|
|
75794
|
-
if (indexData.Window)
|
|
75823
|
+
if (indexData.Window)
|
|
75824
|
+
{
|
|
75825
|
+
this.SetFrameToolbar(windowIndex,indexData.Window);
|
|
75826
|
+
this.SetFrameAttribute(windowIndex,indexData.Window); //窗口属性
|
|
75827
|
+
}
|
|
75795
75828
|
}
|
|
75796
|
-
|
|
75829
|
+
|
|
75797
75830
|
this.Frame.ClearUpDonwFrameYData({ Index:windowIndex });
|
|
75798
75831
|
var bindData=this.ChartPaint[0].Data;
|
|
75799
75832
|
this.BindIndexData(windowIndex,bindData); //执行脚本
|
|
@@ -133234,7 +133267,7 @@ function ScrollBarBGChart()
|
|
|
133234
133267
|
|
|
133235
133268
|
|
|
133236
133269
|
|
|
133237
|
-
var HQCHART_VERSION="1.1.
|
|
133270
|
+
var HQCHART_VERSION="1.1.13354";
|
|
133238
133271
|
|
|
133239
133272
|
function PrintHQChartVersion()
|
|
133240
133273
|
{
|
|
@@ -49361,6 +49361,51 @@ function IFrameSplitOperator()
|
|
|
49361
49361
|
}
|
|
49362
49362
|
|
|
49363
49363
|
this.SetOption=function(option) { }
|
|
49364
|
+
|
|
49365
|
+
//计算上下预留
|
|
49366
|
+
this.ReservedHeight=function(splitData)
|
|
49367
|
+
{
|
|
49368
|
+
if (!this.Frame) return;
|
|
49369
|
+
if (this.Frame.IsHScreen) return; //横屏以后再搞
|
|
49370
|
+
|
|
49371
|
+
var yReserved=this.Frame.HorizontalReserved;
|
|
49372
|
+
if (!yReserved) return;
|
|
49373
|
+
|
|
49374
|
+
var reservedHeight=0;
|
|
49375
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top)) reservedHeight+=yReserved.Top;
|
|
49376
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom)) reservedHeight+=yReserved.Bottom;
|
|
49377
|
+
if (reservedHeight<=0) return;
|
|
49378
|
+
|
|
49379
|
+
var border=this.Frame.GetBorder();
|
|
49380
|
+
var top=border.TopEx;
|
|
49381
|
+
var bottom=border.BottomEx;
|
|
49382
|
+
var srcHeight=bottom-top;
|
|
49383
|
+
if (srcHeight<reservedHeight) return;
|
|
49384
|
+
|
|
49385
|
+
var max=splitData.Max;
|
|
49386
|
+
var min=splitData.Min;
|
|
49387
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top)) top-=yReserved.Top;
|
|
49388
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom)) bottom+=yReserved.Bottom;
|
|
49389
|
+
|
|
49390
|
+
var value=(max-min)/(bottom-top); //1个像素点对应的数值
|
|
49391
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top))
|
|
49392
|
+
{
|
|
49393
|
+
var topValue=value*yReserved.Top;
|
|
49394
|
+
max+=topValue;
|
|
49395
|
+
}
|
|
49396
|
+
|
|
49397
|
+
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom))
|
|
49398
|
+
{
|
|
49399
|
+
var bottomValue=value*yReserved.Bottom;
|
|
49400
|
+
min-=bottomValue;
|
|
49401
|
+
}
|
|
49402
|
+
|
|
49403
|
+
splitData.Max=max;
|
|
49404
|
+
splitData.Min=min;
|
|
49405
|
+
|
|
49406
|
+
this.Frame.HorizontalMax=splitData.Max;
|
|
49407
|
+
this.Frame.HorizontalMin=splitData.Min;
|
|
49408
|
+
}
|
|
49364
49409
|
}
|
|
49365
49410
|
|
|
49366
49411
|
//字符串格式化 千分位分割
|
|
@@ -50013,6 +50058,8 @@ function FrameSplitKLinePriceY()
|
|
|
50013
50058
|
}
|
|
50014
50059
|
*/
|
|
50015
50060
|
|
|
50061
|
+
this.ReservedHeight(splitData); //预留高度
|
|
50062
|
+
|
|
50016
50063
|
JSConsole.Chart.Log(`[FrameSplitKLinePriceY::Operator] fixed . Max=${splitData.Max} Min=${splitData.Min} Count=${splitData.Count}`);
|
|
50017
50064
|
|
|
50018
50065
|
if (this.GetEventCallback)
|
|
@@ -50851,50 +50898,6 @@ function FrameSplitY()
|
|
|
50851
50898
|
}
|
|
50852
50899
|
}
|
|
50853
50900
|
|
|
50854
|
-
this.ReservedHeight=function(splitData)
|
|
50855
|
-
{
|
|
50856
|
-
if (this.Frame.IsHScreen) return; //横屏以后再搞
|
|
50857
|
-
|
|
50858
|
-
var yReserved=this.Frame.HorizontalReserved;
|
|
50859
|
-
if (!yReserved) return;
|
|
50860
|
-
|
|
50861
|
-
var reservedHeight=0;
|
|
50862
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top)) reservedHeight+=yReserved.Top;
|
|
50863
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom)) reservedHeight+=yReserved.Bottom;
|
|
50864
|
-
if (reservedHeight<=0) return;
|
|
50865
|
-
|
|
50866
|
-
var border=this.Frame.GetBorder();
|
|
50867
|
-
var top=border.TopEx;
|
|
50868
|
-
var bottom=border.BottomEx;
|
|
50869
|
-
var srcHeight=bottom-top;
|
|
50870
|
-
if (srcHeight<reservedHeight) return;
|
|
50871
|
-
|
|
50872
|
-
var max=splitData.Max;
|
|
50873
|
-
var min=splitData.Min;
|
|
50874
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top)) top-=yReserved.Top;
|
|
50875
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom)) bottom+=yReserved.Bottom;
|
|
50876
|
-
|
|
50877
|
-
var value=(max-min)/(bottom-top); //1个像素点对应的数值
|
|
50878
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Top))
|
|
50879
|
-
{
|
|
50880
|
-
var topValue=value*yReserved.Top;
|
|
50881
|
-
max+=topValue;
|
|
50882
|
-
}
|
|
50883
|
-
|
|
50884
|
-
if (IFrameSplitOperator.IsPlusNumber(yReserved.Bottom))
|
|
50885
|
-
{
|
|
50886
|
-
var bottomValue=value*yReserved.Bottom;
|
|
50887
|
-
min-=bottomValue;
|
|
50888
|
-
}
|
|
50889
|
-
|
|
50890
|
-
splitData.Max=max;
|
|
50891
|
-
splitData.Min=min;
|
|
50892
|
-
|
|
50893
|
-
this.Frame.HorizontalMax=splitData.Max;
|
|
50894
|
-
this.Frame.HorizontalMin=splitData.Min;
|
|
50895
|
-
}
|
|
50896
|
-
|
|
50897
|
-
|
|
50898
50901
|
this.FormatValueString=function(value)
|
|
50899
50902
|
{
|
|
50900
50903
|
var text;
|
|
@@ -75775,15 +75778,40 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
75775
75778
|
}
|
|
75776
75779
|
}
|
|
75777
75780
|
|
|
75781
|
+
this.SetFrameAttribute=function(windowIndex, attr)
|
|
75782
|
+
{
|
|
75783
|
+
if (!window || !this.Frame.SubFrame[windowIndex] || !this.Frame.SubFrame[windowIndex].Frame) return;
|
|
75784
|
+
if (!attr) return;
|
|
75785
|
+
|
|
75786
|
+
var frame=this.Frame.SubFrame[windowIndex].Frame;
|
|
75787
|
+
|
|
75788
|
+
if (!IFrameSplitOperator.IsUndefined(attr.HorizontalReserved)) frame.HorizontalReserved=attr.HorizontalReserved; //Y轴上下预留
|
|
75789
|
+
if (IFrameSplitOperator.IsNumber(attr.TitleHeight)) frame.ChartBorder.TitleHeight=attr.TitleHeight; //指标标题高度
|
|
75790
|
+
}
|
|
75791
|
+
|
|
75792
|
+
this.ResetFrameAttribute=function(windowIndex)
|
|
75793
|
+
{
|
|
75794
|
+
if (!window || !this.Frame.SubFrame[windowIndex] || !this.Frame.SubFrame[windowIndex].Frame) return;
|
|
75795
|
+
var frame=this.Frame.SubFrame[windowIndex].Frame;
|
|
75796
|
+
|
|
75797
|
+
frame.HorizontalReserved=null;
|
|
75798
|
+
}
|
|
75799
|
+
|
|
75800
|
+
|
|
75778
75801
|
//切换成 脚本指标
|
|
75779
75802
|
this.ChangeScriptIndex=function(windowIndex,indexData,option)
|
|
75780
75803
|
{
|
|
75781
75804
|
this.DeleteIndexPaint(windowIndex, true);
|
|
75782
75805
|
this.WindowIndex[windowIndex]=new ScriptIndex(indexData.Name,indexData.Script,indexData.Args,indexData); //脚本执行
|
|
75806
|
+
this.ResetFrameAttribute(windowIndex);
|
|
75783
75807
|
|
|
75784
75808
|
if (option)
|
|
75785
75809
|
{
|
|
75786
|
-
if (option.Window)
|
|
75810
|
+
if (option.Window)
|
|
75811
|
+
{
|
|
75812
|
+
this.SetFrameToolbar(windowIndex,option.Window);
|
|
75813
|
+
this.SetFrameAttribute(windowIndex,option.Window); //窗口属性
|
|
75814
|
+
}
|
|
75787
75815
|
}
|
|
75788
75816
|
|
|
75789
75817
|
this.OnChangeIndexEvent(windowIndex, { ID:indexData.ID, Name:indexData.Name, FunctionName:"ChangeScriptIndex" });
|
|
@@ -75830,14 +75858,19 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
75830
75858
|
//使用API挂接指标数据 API:{ Name:指标名字, Script:指标脚本可以为空, Args:参数可以为空, Url:指标执行地址 }
|
|
75831
75859
|
var apiItem=indexData.API;
|
|
75832
75860
|
this.WindowIndex[windowIndex]=new APIScriptIndex(apiItem.Name,apiItem.Script,apiItem.Args,indexData);
|
|
75861
|
+
this.ResetFrameAttribute(windowIndex);
|
|
75833
75862
|
|
|
75834
75863
|
this.OnChangeIndexEvent(windowIndex, { ID:indexData.ID, Name:indexData.Name, FunctionName:"ChangeAPIIndex" });
|
|
75835
75864
|
|
|
75836
75865
|
if (indexData)
|
|
75837
75866
|
{
|
|
75838
|
-
if (indexData.Window)
|
|
75867
|
+
if (indexData.Window)
|
|
75868
|
+
{
|
|
75869
|
+
this.SetFrameToolbar(windowIndex,indexData.Window);
|
|
75870
|
+
this.SetFrameAttribute(windowIndex,indexData.Window); //窗口属性
|
|
75871
|
+
}
|
|
75839
75872
|
}
|
|
75840
|
-
|
|
75873
|
+
|
|
75841
75874
|
this.Frame.ClearUpDonwFrameYData({ Index:windowIndex });
|
|
75842
75875
|
var bindData=this.ChartPaint[0].Data;
|
|
75843
75876
|
this.BindIndexData(windowIndex,bindData); //执行脚本
|
|
@@ -136966,7 +136999,8 @@ function JSDialogModifyDraw()
|
|
|
136966
136999
|
this.DivDialog.style.left = left + 'px'
|
|
136967
137000
|
this.DivDialog.style.top = top + 'px'
|
|
136968
137001
|
|
|
136969
|
-
if(e.preventDefault) e.preventDefault();
|
|
137002
|
+
if (e.preventDefault) e.preventDefault();
|
|
137003
|
+
if (e.stopPropagation) e.stopPropagation();
|
|
136970
137004
|
}
|
|
136971
137005
|
|
|
136972
137006
|
this.DocOnMouseUpTitle=function(e)
|
|
@@ -137102,7 +137136,7 @@ function HQChartScriptWorker()
|
|
|
137102
137136
|
|
|
137103
137137
|
|
|
137104
137138
|
|
|
137105
|
-
var HQCHART_VERSION="1.1.
|
|
137139
|
+
var HQCHART_VERSION="1.1.13354";
|
|
137106
137140
|
|
|
137107
137141
|
function PrintHQChartVersion()
|
|
137108
137142
|
{
|