hqchart 1.1.14995 → 1.1.15000
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 +8 -6
- package/package.json +1 -1
- package/src/jscommon/umychart.js +24 -4
- package/src/jscommon/umychart.report.js +1 -1
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +26 -6
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +26 -6
package/lib/umychart.vue.js
CHANGED
|
@@ -2573,9 +2573,11 @@ if(this.BorderLine==null){if(this.IsDrawRightBorder||this.IsDrawLeftBorder){this
|
|
|
2573
2573
|
this.Canvas.stroke();
|
|
2574
2574
|
}
|
|
2575
2575
|
*/};//画标题背景色
|
|
2576
|
-
this.DrawTitleBG=function(){if(this.ChartBorder.TitleHeight<=0)return;var border=this.GetBorder();var left=ToFixedPoint(border.Left);var top=ToFixedPoint(border.Top);var right=ToFixedPoint(border.Right);var bottom=ToFixedPoint(this.ChartBorder.GetTopTitle());var width=right-left;var height=bottom-top;this.Canvas.fillStyle=this.TitleBGColor;this.Canvas.fillRect(left,top,width,height);if(this.IsDrawTitleBottomLine){this.Canvas.strokeStyle=this.PenBorder;this.Canvas.beginPath();this.Canvas.moveTo(left,ToFixedPoint(border.TopTitle));this.Canvas.lineTo(right,ToFixedPoint(border.TopTitle));this.Canvas.stroke();}};this.DrawLock=function(){if(this.IsLocked){if(this.LockPaint==null)this.LockPaint=
|
|
2576
|
+
this.DrawTitleBG=function(){if(this.ChartBorder.TitleHeight<=0)return;var border=this.GetBorder();var left=ToFixedPoint(border.Left);var top=ToFixedPoint(border.Top);var right=ToFixedPoint(border.Right);var bottom=ToFixedPoint(this.ChartBorder.GetTopTitle());var width=right-left;var height=bottom-top;this.Canvas.fillStyle=this.TitleBGColor;this.Canvas.fillRect(left,top,width,height);if(this.IsDrawTitleBottomLine){this.Canvas.strokeStyle=this.PenBorder;this.Canvas.beginPath();this.Canvas.moveTo(left,ToFixedPoint(border.TopTitle));this.Canvas.lineTo(right,ToFixedPoint(border.TopTitle));this.Canvas.stroke();}};this.DrawLock=function(){if(this.IsLocked){if(this.LockPaint==null)this.LockPaint=g_ChartPaintFactory.Create("ChartLock");//new ChartLock();
|
|
2577
|
+
this.LockPaint.Canvas=this.Canvas;this.LockPaint.ChartBorder=this.ChartBorder;this.LockPaint.ChartFrame=this;this.LockPaint.Draw(true);}};this.DrawLogo=function(){var border=this.GetBorder();var text=g_JSChartResource.FrameLogo.Text;if(!IFrameSplitOperator.IsString(text))return;this.Canvas.font=this.LogoTextFont;this.Canvas.textAlign='left';this.Canvas.textBaseline='bottom';var height=this.Canvas.measureText("擎").width;var width=this.Canvas.measureText(text).width;if(this.IsHScreen){var x=border.Left+5;var y=border.Top+5;this.Canvas.save();this.Canvas.translate(x,y);this.Canvas.rotate(90*Math.PI/180);var rtBG={Left:0,Bottom:0,Width:width+4,Height:height+4};rtBG.Top=rtBG.Bottom-rtBG.Height;rtBG.Right=rtBG.Left+rtBG.Width;if(this.LogoBGColor){this.Canvas.fillStyle=this.LogoBGColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}this.Canvas.fillStyle=this.LogoTextColor;this.Canvas.fillText(text,1,0);this.Canvas.restore();}else{var rtBG={Left:border.Left+5,Bottom:border.Bottom-5,Width:width+4,Height:height+4};rtBG.Top=rtBG.Bottom-rtBG.Height;rtBG.Right=rtBG.Left+rtBG.Width;if(this.LogoBGColor){this.Canvas.fillStyle=this.LogoBGColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}var x=rtBG.Left+1;var y=rtBG.Bottom-1;this.Canvas.fillStyle=this.LogoTextColor;this.Canvas.fillText(text,x,y);}};this.CalculateLock=function(){if(this.IsLocked){if(this.LockPaint==null)this.LockPaint=g_ChartPaintFactory.Create("ChartLock");// new ChartLock();
|
|
2578
|
+
this.LockPaint.Canvas=this.Canvas;this.LockPaint.ChartBorder=this.ChartBorder;this.LockPaint.ChartFrame=this;this.LockPaint.Draw(false);}};//设施上锁
|
|
2577
2579
|
this.SetLock=function(lockData){if(!lockData)//空数据不上锁
|
|
2578
|
-
{this.IsLocked=false;return;}this.IsLocked=true;if(!this.LockPaint)this.LockPaint=new ChartLock()
|
|
2580
|
+
{this.IsLocked=false;return;}this.IsLocked=true;if(!this.LockPaint)this.LockPaint=g_ChartPaintFactory.Create("ChartLock");//new ChartLock(); //创建锁
|
|
2579
2581
|
if(lockData.Callback)this.LockPaint.Callback=lockData.Callback;//回调
|
|
2580
2582
|
if(lockData.IndexName)this.LockPaint.IndexName=lockData.IndexName;//指标名字
|
|
2581
2583
|
if(lockData.ID)this.LockPaint.LockID=lockData.ID;//锁ID
|
|
@@ -3623,7 +3625,7 @@ ChartData.GetPeriodName=function(period){var mapName=new _map2.default([[0,'日
|
|
|
3623
3625
|
function ChartPaintFactory(){//[key:name, { Create:function(option) { return new class(); }} ]
|
|
3624
3626
|
this.DataMap=new _map2.default([["ChartKLine",{Create:function Create(option){return new ChartKLine();}}],//K线图
|
|
3625
3627
|
["ChartMinuteVolumBar",{Create:function Create(option){return new ChartMinuteVolumBar();}}],//分时成交量柱子
|
|
3626
|
-
["ChartMinutePriceLine",{Create:function Create(option){return new ChartMinutePriceLine();}}],["ChartMinuteBuySellBar",{Create:function Create(option){return new ChartMinuteBuySellBar();}}],["ChartMinuteBarCallAuction",{Create:function Create(option){return new ChartMinuteBarCallAuction();}}]]);this.Create=function(name,option){if(!this.DataMap.has(name)){JSConsole.Chart.Warn('[ChartPaintFactory::Create] can\'t find class='+name+'.');return null;}var item=this.DataMap.get(name);return item.Create(option);};this.Add=function(name,option){this.DataMap.set(name,{Create:option.Create});};}var g_ChartPaintFactory=new ChartPaintFactory();//图新画法接口类
|
|
3628
|
+
["ChartMinutePriceLine",{Create:function Create(option){return new ChartMinutePriceLine();}}],["ChartMinuteBuySellBar",{Create:function Create(option){return new ChartMinuteBuySellBar();}}],["ChartMinuteBarCallAuction",{Create:function Create(option){return new ChartMinuteBarCallAuction();}}],["ChartLock",{Create:function Create(option){return new ChartLock();}}]]);this.Create=function(name,option){if(!this.DataMap.has(name)){JSConsole.Chart.Warn('[ChartPaintFactory::Create] can\'t find class='+name+'.');return null;}var item=this.DataMap.get(name);return item.Create(option);};this.Add=function(name,option){this.DataMap.set(name,{Create:option.Create});};}var g_ChartPaintFactory=new ChartPaintFactory();//图新画法接口类
|
|
3627
3629
|
function IChartPainting(){this.Canvas;//画布
|
|
3628
3630
|
this.ChartBorder;//边框信息
|
|
3629
3631
|
this.ChartFrame;//框架画法
|
|
@@ -9340,7 +9342,7 @@ IsShowCorss:this.ChartCorssCursor.IsShowCorss,//是否显示十字线
|
|
|
9340
9342
|
MinItem:minuteItem,Symbol:this.Symbol,Name:this.Name,LastValue:this.ChartCorssCursor.LastValue};this.DialogTooltip.Update(sendData);return true;};this.DrawSelectRectDialog=function(e){if(!this.DialogSelectRect)return;this.UpdateSelectRectDialog(e);};this.UpdateSelectRectDialog=function(e){if(!this.DialogSelectRect)return false;var data=e.data;//区间统计数据
|
|
9341
9343
|
var x,y;if(data&&IFrameSplitOperator.IsNumber(data.X)&&IFrameSplitOperator.IsNumber(data.Y)){var pixelRatio=GetDevicePixelRatio();var rtClient=this.UIElement.getBoundingClientRect();var rtScroll=GetScrollPosition();x=data.X;y=data.Y;x+=rtClient.left+rtScroll.Left;y+=rtClient.top+rtScroll.Top;}var sendData={Symbol:this.Symbol,Name:this.Name,SelectData:data.SelectData,X:x,Y:y,e:e};this.DialogSelectRect.Update(sendData);};this.GetKData=function(){if(!this.SourceData)return null;var data=this.SourceData;if(!data)return null;return data;};//获取最新的一条盘前数据
|
|
9342
9344
|
this.GetLatestBeforeOpenItem=function(){var lastItem=null;if(this.DayCount>1){if(!IFrameSplitOperator.IsNonEmptyArray(this.MultiDayBeforeOpenData))return null;var dayItem=this.MultiDayBeforeOpenData[this.MultiDayBeforeOpenData.length-1];if(!dayItem||!IFrameSplitOperator.IsNonEmptyArray(dayItem.Data))return null;var finder=dayItem.Data.findLast(function(element){return element&&IFrameSplitOperator.IsNumber(element.Price);});if(finder)lastItem=finder;}else{if(!this.BeforeOpenData||!IFrameSplitOperator.IsNonEmptyArray(this.BeforeOpenData.Data))return null;var finder=this.BeforeOpenData.Data.findLast(function(element){return element&&IFrameSplitOperator.IsNumber(element.Price);});if(finder)lastItem=finder;}return lastItem;};//获取最新的一条盘后数据
|
|
9343
|
-
this.GetLatestAfterCloseItem=function(){var lastItem=null;if(this.DayCount>1){if(!IFrameSplitOperator.IsNonEmptyArray(this.MultiDayAfterCloseData))return null;var dayItem=this.MultiDayAfterCloseData[this.MultiDayAfterCloseData.length-1];if(!dayItem||!IFrameSplitOperator.IsNonEmptyArray(dayItem.Data))return null;var finder=dayItem.Data.findLast(function(element){return element&&IFrameSplitOperator.IsNumber(element.Price);});if(finder)lastItem=finder;}else{if(!this.AfterCloseData||!IFrameSplitOperator.IsNonEmptyArray(this.AfterCloseData.Data))return null;var finder=this.AfterCloseData.Data.findLast(function(element){return element&&IFrameSplitOperator.IsNumber(element.Price);});if(finder)lastItem=finder;}return lastItem;};this.IsCallAuctionFrame=function(frameID){if(!IFrameSplitOperator.IsNonEmptyArray(this.ChartPaintEx))return false;if(!IFrameSplitOperator.IsNonEmptyArray(this.Frame.SubFrame))return false;if(frameID<0||frameID>=this.Frame.SubFrame.length)return false;var subItem=this.Frame.SubFrame[frameID];if(!subItem||!subItem.Frame)return false;var subFrame=subItem.Frame;for(var i=0;i<this.ChartPaintEx.length;++i){var item=this.ChartPaintEx[i];if(item.ChartFrame&&item.ChartFrame.Guid==subFrame.Guid)return true;}return false;};}//盘前数据
|
|
9345
|
+
this.GetLatestAfterCloseItem=function(){var lastItem=null;if(this.DayCount>1){if(!IFrameSplitOperator.IsNonEmptyArray(this.MultiDayAfterCloseData))return null;var dayItem=this.MultiDayAfterCloseData[this.MultiDayAfterCloseData.length-1];if(!dayItem||!IFrameSplitOperator.IsNonEmptyArray(dayItem.Data))return null;var finder=dayItem.Data.findLast(function(element){return element&&IFrameSplitOperator.IsNumber(element.Price);});if(finder)lastItem=finder;}else{if(!this.AfterCloseData||!IFrameSplitOperator.IsNonEmptyArray(this.AfterCloseData.Data))return null;var finder=this.AfterCloseData.Data.findLast(function(element){return element&&IFrameSplitOperator.IsNumber(element.Price);});if(finder)lastItem=finder;}return lastItem;};this.IsCallAuctionFrame=function(frameID){if(!IFrameSplitOperator.IsNonEmptyArray(this.ChartPaintEx))return false;if(!IFrameSplitOperator.IsNonEmptyArray(this.Frame.SubFrame))return false;if(frameID<0||frameID>=this.Frame.SubFrame.length)return false;var subItem=this.Frame.SubFrame[frameID];if(!subItem||!subItem.Frame)return false;var subFrame=subItem.Frame;for(var i=0;i<this.ChartPaintEx.length;++i){var item=this.ChartPaintEx[i];if(item.ChartFrame&&item.ChartFrame.Guid==subFrame.Guid)return true;}return false;};this.TryClickLock=function(x,y){for(var i=0;i<this.Frame.SubFrame.length;++i){var item=this.Frame.SubFrame[i];if(!item.Frame.IsLocked)continue;if(!item.Frame.LockPaint)continue;var tooltip=new TooltipData();if(!item.Frame.LockPaint.GetTooltipData(x,y,tooltip))continue;tooltip.HQChart=this;if(tooltip.Data.Callback)tooltip.Data.Callback(tooltip);return true;}return false;};}//盘前数据
|
|
9344
9346
|
MinuteChartContainer.JsonDataToBeforeOpenData=function(data){var symbol=data.stock[0].symbol;var upperSymbol=symbol.toUpperCase();var isSHSZ=MARKET_SUFFIX_NAME.IsSHSZ(upperSymbol);var unit=MARKET_SUFFIX_NAME.GetVolUnit(upperSymbol);var yClose=data.stock[0].yclose;var preClose=data.stock[0].yclose;//前一个数据价格
|
|
9345
9347
|
var stockData=data.stock[0];var date=stockData.date;//日期
|
|
9346
9348
|
var beforeOpenData={Data:[],TotalCount:15,Ver:1.0,Date:date,YClose:stockData.yclose,YClearing:stockData.yclearing};var extendDataIndex=JSCHART_DATA_FIELD_ID.MINUTE_BEFOREOPEN_EXTENDDATA;//扩展数据序号
|
|
@@ -13878,7 +13880,7 @@ if(drawInfo.Tooltip){//Type:1=数据截断 4=提示信息
|
|
|
13878
13880
|
var tooltipData={Rect:rtItem,Stock:stock,Index:index,Column:column,RowType:rowType,Type:drawInfo.Tooltip.Type,Data:drawInfo.Tooltip.Data};this.TooltipRect.push(tooltipData);}else if(column.ChartTooltip&&column.ChartTooltip.Enable&&IFrameSplitOperator.IsNumber(column.ChartTooltip.Type))//Type 20分时图 21K线图
|
|
13879
13881
|
{var tooltipData={Rect:rtItem,Stock:stock,Index:index,Column:column,RowType:rowType,Type:column.ChartTooltip.Type};this.TooltipRect.push(tooltipData);}if(drawInfo.Botton){var buttonData={Stock:stock,Index:index,ColumnIndex:columnIndex,Column:column,Rect:drawInfo.Botton.Rect,Type:drawInfo.Botton.Type,Data:drawInfo.Data};this.ButtonRect.push(buttonData);}};this.FormatDrawInfoEvent=function(stock,data,column,drawInfo){if(!column.EnableFormatDrawInfoEvent)return;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_FORMAT_DRAW_INFO);if(!event||!event.Callback)return;var sendData={Stock:stock,Column:column,Data:data,DrawInfo:drawInfo};event.Callback(event,sendData,this);};this.IsReserveProgressBarColumn=function(value){var ARARY_TYPE=[REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR1_ID,REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR2_ID,REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR3_ID,REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR4_ID,REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR5_ID,REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR6_ID,REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR7_ID,REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR8_ID,REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR9_ID,REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR10_ID];return ARARY_TYPE.includes(value);};this.IsReserveButtonColumn=function(value){var ARARY_TYPE=[REPORT_COLUMN_ID.RESERVE_BUTTON1_ID,REPORT_COLUMN_ID.RESERVE_BUTTON2_ID,REPORT_COLUMN_ID.RESERVE_BUTTON3_ID,REPORT_COLUMN_ID.RESERVE_BUTTON4_ID,REPORT_COLUMN_ID.RESERVE_BUTTON5_ID,REPORT_COLUMN_ID.RESERVE_BUTTON6_ID,REPORT_COLUMN_ID.RESERVE_BUTTON7_ID,REPORT_COLUMN_ID.RESERVE_BUTTON8_ID,REPORT_COLUMN_ID.RESERVE_BUTTON9_ID,REPORT_COLUMN_ID.RESERVE_BUTTON10_ID];return ARARY_TYPE.includes(value);};this.IsReserveNumber=function(value){var ARARY_TYPE=[REPORT_COLUMN_ID.RESERVE_NUMBER1_ID,REPORT_COLUMN_ID.RESERVE_NUMBER2_ID,REPORT_COLUMN_ID.RESERVE_NUMBER3_ID,REPORT_COLUMN_ID.RESERVE_NUMBER4_ID,REPORT_COLUMN_ID.RESERVE_NUMBER5_ID,REPORT_COLUMN_ID.RESERVE_NUMBER6_ID,REPORT_COLUMN_ID.RESERVE_NUMBER7_ID,REPORT_COLUMN_ID.RESERVE_NUMBER8_ID,REPORT_COLUMN_ID.RESERVE_NUMBER9_ID,REPORT_COLUMN_ID.RESERVE_NUMBER10_ID,REPORT_COLUMN_ID.RESERVE_NUMBER11_ID,REPORT_COLUMN_ID.RESERVE_NUMBER12_ID,REPORT_COLUMN_ID.RESERVE_NUMBER13_ID,REPORT_COLUMN_ID.RESERVE_NUMBER14_ID,REPORT_COLUMN_ID.RESERVE_NUMBER15_ID,REPORT_COLUMN_ID.RESERVE_NUMBER16_ID,REPORT_COLUMN_ID.RESERVE_NUMBER17_ID,REPORT_COLUMN_ID.RESERVE_NUMBER18_ID,REPORT_COLUMN_ID.RESERVE_NUMBER19_ID,REPORT_COLUMN_ID.RESERVE_NUMBER20_ID];return ARARY_TYPE.includes(value);};this.IsReserveString=function(value){var ARARY_TYPE=[REPORT_COLUMN_ID.RESERVE_STRING1_ID,REPORT_COLUMN_ID.RESERVE_STRING2_ID,REPORT_COLUMN_ID.RESERVE_STRING3_ID,REPORT_COLUMN_ID.RESERVE_STRING4_ID,REPORT_COLUMN_ID.RESERVE_STRING5_ID,REPORT_COLUMN_ID.RESERVE_STRING6_ID,REPORT_COLUMN_ID.RESERVE_STRING7_ID,REPORT_COLUMN_ID.RESERVE_STRING8_ID,REPORT_COLUMN_ID.RESERVE_STRING9_ID,REPORT_COLUMN_ID.RESERVE_STRING10_ID,REPORT_COLUMN_ID.RESERVE_STRING11_ID,REPORT_COLUMN_ID.RESERVE_STRING12_ID,REPORT_COLUMN_ID.RESERVE_STRING13_ID,REPORT_COLUMN_ID.RESERVE_STRING14_ID,REPORT_COLUMN_ID.RESERVE_STRING15_ID,REPORT_COLUMN_ID.RESERVE_STRING16_ID,REPORT_COLUMN_ID.RESERVE_STRING17_ID,REPORT_COLUMN_ID.RESERVE_STRING18_ID,REPORT_COLUMN_ID.RESERVE_STRING19_ID,REPORT_COLUMN_ID.RESERVE_STRING20_ID];return ARARY_TYPE.includes(value);};this.IsReserveDateTime=function(value){var ARARY_TYPE=[REPORT_COLUMN_ID.RESERVE_DATETIME1_ID,REPORT_COLUMN_ID.RESERVE_DATETIME2_ID,REPORT_COLUMN_ID.RESERVE_DATETIME3_ID,REPORT_COLUMN_ID.RESERVE_DATETIME4_ID,REPORT_COLUMN_ID.RESERVE_DATETIME5_ID,REPORT_COLUMN_ID.RESERVE_DATETIME6_ID,REPORT_COLUMN_ID.RESERVE_DATETIME7_ID,REPORT_COLUMN_ID.RESERVE_DATETIME8_ID,REPORT_COLUMN_ID.RESERVE_DATETIME9_ID,REPORT_COLUMN_ID.RESERVE_DATETIME10_ID];return ARARY_TYPE.includes(value);};//AryText=[ { Text:, Color,}, .... ]
|
|
13880
13882
|
this.DrawComplexText=function(drawInfo,column,left,top,cellWidth){//计算大小
|
|
13881
|
-
var aryText=[];var textWidth=0;for(var i=0;i<drawInfo.AryText.length;++i){var item=drawInfo.AryText[i];if(!item.Text)continue;var itemWidth=this.Canvas.measureText(item.Text).width;var newItem={Text:item.Text,Margin:{Left:0,Right:0},TextColor:drawInfo.TextColor};if(item.Color)newItem.TextColor=item.Color;if(item.Margin){var margin=item.Margin;if(IFrameSplitOperator.IsNumber(margin.Left)){itemWidth+=margin.Left;newItem.Left=margin.Left;}if(IFrameSplitOperator.IsNumber(margin.Right)){itemWidth+=margin.Right;newItem.Right=margin.Right;;}}newItem.Width=itemWidth;aryText.push(newItem);textWidth+=itemWidth;}if(!IFrameSplitOperator.IsNonEmptyArray(aryText))return;var x=left;var y=top+this.RowHeight-this.ItemMergin.Bottom;if(drawInfo.TextAlign=='center'){x=left+cellWidth/2-textWidth/2;}else if(drawInfo.TextAlign=='right'){x=left+cellWidth-textWidth;}var bClip=false;if(textWidth>=cellWidth)//长度超过单元格 裁剪
|
|
13883
|
+
var aryText=[];var textWidth=0;for(var i=0;i<drawInfo.AryText.length;++i){var item=drawInfo.AryText[i];if(!item||!item.Text)continue;var itemWidth=this.Canvas.measureText(item.Text).width;var newItem={Text:item.Text,Margin:{Left:0,Right:0},TextColor:drawInfo.TextColor};if(item.Color)newItem.TextColor=item.Color;if(item.Margin){var margin=item.Margin;if(IFrameSplitOperator.IsNumber(margin.Left)){itemWidth+=margin.Left;newItem.Left=margin.Left;}if(IFrameSplitOperator.IsNumber(margin.Right)){itemWidth+=margin.Right;newItem.Right=margin.Right;;}}newItem.Width=itemWidth;aryText.push(newItem);textWidth+=itemWidth;}if(!IFrameSplitOperator.IsNonEmptyArray(aryText))return;var x=left;var y=top+this.RowHeight-this.ItemMergin.Bottom;if(drawInfo.TextAlign=='center'){x=left+cellWidth/2-textWidth/2;}else if(drawInfo.TextAlign=='right'){x=left+cellWidth-textWidth;}var bClip=false;if(textWidth>=cellWidth)//长度超过单元格 裁剪
|
|
13882
13884
|
{this.Canvas.save();bClip=true;var rtCell={Left:left,Top:top+this.ItemMergin.Top,Width:cellWidth,Height:this.RowHeight};this.Canvas.beginPath();this.Canvas.rect(rtCell.Left,rtCell.Top,rtCell.Width,rtCell.Height);//this.Canvas.stroke(); //调试用
|
|
13883
13885
|
this.Canvas.clip();//数据截断提示信息
|
|
13884
13886
|
if(!drawInfo.Tooltip&&drawInfo.Text){drawInfo.Tooltip={Type:1,Data:{AryText:[{Text:drawInfo.Text}]}};}}this.Canvas.textBaseline="bottom";this.Canvas.textAlign="left";for(var i=0;i<aryText.length;++i){var item=aryText[i];this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(item.Text,x+item.Margin.Left,y);x+=item.Width;}if(bClip)this.Canvas.restore();};this.DrawReserveString=function(drawInfo,column,left,top,cellWidth){if(IFrameSplitOperator.IsNonEmptyArray(drawInfo.AryText)){this.DrawComplexText(drawInfo,column,left,top,cellWidth);return;}if(!drawInfo.Text)return;var text=drawInfo.Text;var x=left;if(drawInfo.TextAlign=='center'){x=left+cellWidth/2;this.Canvas.textAlign="center";}else if(drawInfo.TextAlign=='right'){x=left+cellWidth-2;this.Canvas.textAlign="right";}else{x+=2;this.Canvas.textAlign="left";}var textWidth=this.Canvas.measureText(text).width+1;var bClip=false;if(textWidth>=cellWidth)//长度超过单元格 裁剪
|
|
@@ -15269,7 +15271,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
15269
15271
|
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);};}/********************************************************************************
|
|
15270
15272
|
* 版本信息输出
|
|
15271
15273
|
*
|
|
15272
|
-
*/var HQCHART_VERSION="1.1.
|
|
15274
|
+
*/var HQCHART_VERSION="1.1.14999";function PrintHQChartVersion(){var logo='\n\n*************************************************************************************************************************************************************************** \n* \n* :%@@- \n* :@@@@- \n* =@@@@ :#@@@ .:+#@@@#=: :=*@@@@@@#+-. *@@@@. \n* :@@@@@ .@@@@@ .#@@@@@@@@@@@- +@@@@@@@@@@@@@+ @@@@@ -%@@* \n* +@@@@% #@@@@# *@@@@@@@@@@@@@@%. =@@@@@@@@@@@@@@@- @@@@@ -@@@@+ \n* %@@@@* @@@@@+ .%@@@@@@@@@@@@@@@@%: #@@@@@@@@@@@@@@@% @@@@# *@@@@= \n* @@@@@= @@@@@- .%@@@@@@@*++*%@@@@@@% .%@@@@@@@%*+==+**= -@@@@+ #@@@@- \n* @@@@@. @@@@@. #@@@@@%= =@@@@@@* %@@@@@@#: *@@@@- :::. .-+*###+: ::: .+##+: -%%@@@@@%%%% \n* .@@@@@ .@@@@@. +@@@@@% .@@@@@@ *@@@@@@: %@@@@: +@@@@@%. :%@@@@@@@@@@: *@@@ :@@@@@* @@@@@@@@@@@@ \n* :@@@@@ :@@@@@ @@@@@% :@@@@@+ @@@@@@: %@@@@-@@@@@@@@@. @@@@@@@@@@@@@. :@@@%-@@@@@@.:@@@@@@@@@@@# \n* -@@@@% -@@@@@ =@@@@@. %@@@@% %@@@@@- %@@@@@@@@@@@@@@* %@@@@@@@@@@@@+ -@@@@@@@@@@# -@@@@@@@@@@@. \n* +@@@@%=========#@@@@% @@@@@# :@@@@@ .@@@@@% @@@@@@@@%@@@@@@@ -%+:. .#@@@@* +@@@@@@@%%@. .::+@@@@#:: \n* #@@@@@@@@@@@@@@@@@@@# .@@@@@ .@@@@@ :@@@@@. @@@@@@#. #@@@@@. -@@@@* #@@@@@@: *@@@@+ \n* %@@@@@@@@@@@@@@@@@@@+ :@@@@@ .@@@@@ -@@@@@ @@@@@+ @@@@@. :@@@@* @@@@@% #@@@@- \n* @@@@@@@@@@@@@@@@@@@@: :@@@@% :@@@@@ +@@@@% -@@@@+ @@@@@ -@@@@+ @@@@@. @@@@@. \n* .@@@@@@@@@@@@@@@@@@@@ :@@@@% -@@@@% *@@@@% #@@@@. @@@@@ .=*#%%%@@@@@= :@@@@# @@@@@. \n* -@@@@@:::::::::=@@@@@ :@@@@@ @@@@@* +@@@@% @@@@@ @@@@% -#@@@@@@@@@@@@: -@@@@* @@@@@ \n* =@@@@% =@@@@% .@@@@@ :@@@@@. -@@@@% @@@@@ .@@@@* +@@@@@@@@@@@@@@. =@@@@+ .@@@@@ \n* +@@@@# +@@@@# @@@@@# %@@@@% :@@@@@ .@@@@% =@@@@= -@@@@@*-:..%@@@@ +@@@@= :@@@@# \n* *@@@@* *@@@@* +@@@@@: #@@@@@+ .@@@@@@ :@@@@% *@@@@- @@@@@. @@@@% #@@@@: =@@@@+ \n* %@@@@= %@@@@+ @@@@@@- .%@@@@@# #@@@@@# :@@@@% #@@@@: @@@@% @@@@* %@@@@. #@@@@- \n* @@@@@- @@@@@= =@@@@@@#=...-*@@@@@@@: @@@@@@%=. :+**. :@@@@* %@@@@. .@@@@* *@@@@= @@@@@ %@@@@+ \n* .@@@@@: .@@@@@: *@@@@@@@@@@@@@@@@@@@# =@@@@@@@@%%%@@@@@@ +@@@@- @@@@@ .@@@@@: :%@@@@@- .@@@@% %@@@@@*+- \n* :@@@@@ :@@@@@ +@@@@@@@@@@@@@@@@@@@# =@@@@@@@@@@@@@@@@% %@@@@ @@@@@ @@@@@@@@@@@@@@@: -@@@@* *@@@@@@@@- \n* =@@@@@ -@@@@@ :@@@@@@@@@@@@@@@@@@@# :@@@@@@@@@@@@@@@% @@@@@ %@@@% #@@@@@@@@@#@@@@. +@@@@- .@@@@@@@@# \n* *@@@@# =@@@@% :#@@@@@@@#: :@@@@@= =@@@@@@@@@@@+. @@@@@ :@@@+ *@@@@@@@- %@@@ *@@@= =@@@@@@@* \n* =++++- -++++= .:::. .=*+: :-=+++=:. ****= .=+. .-++=: :+++ -+=: .-=+=:. \n* \n* \n* HQChart \n* Ver: '+HQCHART_VERSION+' \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n************************************************************************************************************************************************************************** \n ';console.log(logo);}PrintHQChartVersion();//把给外界调用的方法暴露出来
|
|
15273
15275
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
15274
15276
|
// BaseIndex:BaseIndex,
|
|
15275
15277
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
package/src/jscommon/umychart.js
CHANGED
|
@@ -13122,7 +13122,7 @@ function IChartFramePainting()
|
|
|
13122
13122
|
if (this.IsLocked)
|
|
13123
13123
|
{
|
|
13124
13124
|
if (this.LockPaint == null)
|
|
13125
|
-
this.LockPaint = new ChartLock();
|
|
13125
|
+
this.LockPaint = g_ChartPaintFactory.Create("ChartLock");//new ChartLock();
|
|
13126
13126
|
this.LockPaint.Canvas=this.Canvas;
|
|
13127
13127
|
this.LockPaint.ChartBorder=this.ChartBorder;
|
|
13128
13128
|
this.LockPaint.ChartFrame=this;
|
|
@@ -13188,7 +13188,7 @@ function IChartFramePainting()
|
|
|
13188
13188
|
if (this.IsLocked)
|
|
13189
13189
|
{
|
|
13190
13190
|
if (this.LockPaint == null)
|
|
13191
|
-
this.LockPaint = new ChartLock();
|
|
13191
|
+
this.LockPaint = g_ChartPaintFactory.Create("ChartLock"); // new ChartLock();
|
|
13192
13192
|
this.LockPaint.Canvas=this.Canvas;
|
|
13193
13193
|
this.LockPaint.ChartBorder=this.ChartBorder;
|
|
13194
13194
|
this.LockPaint.ChartFrame=this;
|
|
@@ -13206,7 +13206,7 @@ function IChartFramePainting()
|
|
|
13206
13206
|
}
|
|
13207
13207
|
|
|
13208
13208
|
this.IsLocked=true;
|
|
13209
|
-
if (!this.LockPaint) this.LockPaint=new ChartLock(); //创建锁
|
|
13209
|
+
if (!this.LockPaint) this.LockPaint=g_ChartPaintFactory.Create("ChartLock"); //new ChartLock(); //创建锁
|
|
13210
13210
|
|
|
13211
13211
|
if (lockData.Callback) this.LockPaint.Callback=lockData.Callback; //回调
|
|
13212
13212
|
if (lockData.IndexName) this.LockPaint.IndexName=lockData.IndexName; //指标名字
|
|
@@ -26393,7 +26393,8 @@ function ChartPaintFactory()
|
|
|
26393
26393
|
["ChartMinuteVolumBar",{ Create:function(option) { return new ChartMinuteVolumBar(); } }], //分时成交量柱子
|
|
26394
26394
|
["ChartMinutePriceLine",{ Create:function(option) { return new ChartMinutePriceLine();} }],
|
|
26395
26395
|
["ChartMinuteBuySellBar", { Create:function(option){ return new ChartMinuteBuySellBar(); }}],
|
|
26396
|
-
["ChartMinuteBarCallAuction", { Create:function(option){ return new ChartMinuteBarCallAuction(); }}]
|
|
26396
|
+
["ChartMinuteBarCallAuction", { Create:function(option){ return new ChartMinuteBarCallAuction(); }}],
|
|
26397
|
+
["ChartLock",{ Create:function(option){ return new ChartLock(); }}]
|
|
26397
26398
|
]);
|
|
26398
26399
|
|
|
26399
26400
|
this.Create=function(name, option)
|
|
@@ -95469,6 +95470,25 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
95469
95470
|
|
|
95470
95471
|
return false;
|
|
95471
95472
|
}
|
|
95473
|
+
|
|
95474
|
+
this.TryClickLock=function(x,y)
|
|
95475
|
+
{
|
|
95476
|
+
for(var i=0;i<this.Frame.SubFrame.length; ++i)
|
|
95477
|
+
{
|
|
95478
|
+
var item=this.Frame.SubFrame[i];
|
|
95479
|
+
if (!item.Frame.IsLocked) continue;
|
|
95480
|
+
if (!item.Frame.LockPaint) continue;
|
|
95481
|
+
|
|
95482
|
+
var tooltip=new TooltipData();
|
|
95483
|
+
if (!item.Frame.LockPaint.GetTooltipData(x,y,tooltip)) continue;
|
|
95484
|
+
|
|
95485
|
+
tooltip.HQChart=this;
|
|
95486
|
+
if (tooltip.Data.Callback) tooltip.Data.Callback(tooltip);
|
|
95487
|
+
return true;
|
|
95488
|
+
}
|
|
95489
|
+
|
|
95490
|
+
return false;
|
|
95491
|
+
}
|
|
95472
95492
|
}
|
|
95473
95493
|
|
|
95474
95494
|
//盘前数据
|
|
@@ -7327,7 +7327,7 @@ function ChartReport()
|
|
|
7327
7327
|
for(var i=0;i<drawInfo.AryText.length;++i)
|
|
7328
7328
|
{
|
|
7329
7329
|
var item=drawInfo.AryText[i];
|
|
7330
|
-
if (!item.Text) continue;
|
|
7330
|
+
if (!item || !item.Text) continue;
|
|
7331
7331
|
var itemWidth=this.Canvas.measureText(item.Text).width;
|
|
7332
7332
|
|
|
7333
7333
|
var newItem={ Text:item.Text, Margin:{ Left:0, Right:0 }, TextColor:drawInfo.TextColor };
|
|
@@ -17218,7 +17218,7 @@ function IChartFramePainting()
|
|
|
17218
17218
|
if (this.IsLocked)
|
|
17219
17219
|
{
|
|
17220
17220
|
if (this.LockPaint == null)
|
|
17221
|
-
this.LockPaint = new ChartLock();
|
|
17221
|
+
this.LockPaint = g_ChartPaintFactory.Create("ChartLock");//new ChartLock();
|
|
17222
17222
|
this.LockPaint.Canvas=this.Canvas;
|
|
17223
17223
|
this.LockPaint.ChartBorder=this.ChartBorder;
|
|
17224
17224
|
this.LockPaint.ChartFrame=this;
|
|
@@ -17284,7 +17284,7 @@ function IChartFramePainting()
|
|
|
17284
17284
|
if (this.IsLocked)
|
|
17285
17285
|
{
|
|
17286
17286
|
if (this.LockPaint == null)
|
|
17287
|
-
this.LockPaint = new ChartLock();
|
|
17287
|
+
this.LockPaint = g_ChartPaintFactory.Create("ChartLock"); // new ChartLock();
|
|
17288
17288
|
this.LockPaint.Canvas=this.Canvas;
|
|
17289
17289
|
this.LockPaint.ChartBorder=this.ChartBorder;
|
|
17290
17290
|
this.LockPaint.ChartFrame=this;
|
|
@@ -17302,7 +17302,7 @@ function IChartFramePainting()
|
|
|
17302
17302
|
}
|
|
17303
17303
|
|
|
17304
17304
|
this.IsLocked=true;
|
|
17305
|
-
if (!this.LockPaint) this.LockPaint=new ChartLock(); //创建锁
|
|
17305
|
+
if (!this.LockPaint) this.LockPaint=g_ChartPaintFactory.Create("ChartLock"); //new ChartLock(); //创建锁
|
|
17306
17306
|
|
|
17307
17307
|
if (lockData.Callback) this.LockPaint.Callback=lockData.Callback; //回调
|
|
17308
17308
|
if (lockData.IndexName) this.LockPaint.IndexName=lockData.IndexName; //指标名字
|
|
@@ -30489,7 +30489,8 @@ function ChartPaintFactory()
|
|
|
30489
30489
|
["ChartMinuteVolumBar",{ Create:function(option) { return new ChartMinuteVolumBar(); } }], //分时成交量柱子
|
|
30490
30490
|
["ChartMinutePriceLine",{ Create:function(option) { return new ChartMinutePriceLine();} }],
|
|
30491
30491
|
["ChartMinuteBuySellBar", { Create:function(option){ return new ChartMinuteBuySellBar(); }}],
|
|
30492
|
-
["ChartMinuteBarCallAuction", { Create:function(option){ return new ChartMinuteBarCallAuction(); }}]
|
|
30492
|
+
["ChartMinuteBarCallAuction", { Create:function(option){ return new ChartMinuteBarCallAuction(); }}],
|
|
30493
|
+
["ChartLock",{ Create:function(option){ return new ChartLock(); }}]
|
|
30493
30494
|
]);
|
|
30494
30495
|
|
|
30495
30496
|
this.Create=function(name, option)
|
|
@@ -99565,6 +99566,25 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
99565
99566
|
|
|
99566
99567
|
return false;
|
|
99567
99568
|
}
|
|
99569
|
+
|
|
99570
|
+
this.TryClickLock=function(x,y)
|
|
99571
|
+
{
|
|
99572
|
+
for(var i=0;i<this.Frame.SubFrame.length; ++i)
|
|
99573
|
+
{
|
|
99574
|
+
var item=this.Frame.SubFrame[i];
|
|
99575
|
+
if (!item.Frame.IsLocked) continue;
|
|
99576
|
+
if (!item.Frame.LockPaint) continue;
|
|
99577
|
+
|
|
99578
|
+
var tooltip=new TooltipData();
|
|
99579
|
+
if (!item.Frame.LockPaint.GetTooltipData(x,y,tooltip)) continue;
|
|
99580
|
+
|
|
99581
|
+
tooltip.HQChart=this;
|
|
99582
|
+
if (tooltip.Data.Callback) tooltip.Data.Callback(tooltip);
|
|
99583
|
+
return true;
|
|
99584
|
+
}
|
|
99585
|
+
|
|
99586
|
+
return false;
|
|
99587
|
+
}
|
|
99568
99588
|
}
|
|
99569
99589
|
|
|
99570
99590
|
//盘前数据
|
|
@@ -145999,7 +146019,7 @@ function ChartReport()
|
|
|
145999
146019
|
for(var i=0;i<drawInfo.AryText.length;++i)
|
|
146000
146020
|
{
|
|
146001
146021
|
var item=drawInfo.AryText[i];
|
|
146002
|
-
if (!item.Text) continue;
|
|
146022
|
+
if (!item || !item.Text) continue;
|
|
146003
146023
|
var itemWidth=this.Canvas.measureText(item.Text).width;
|
|
146004
146024
|
|
|
146005
146025
|
var newItem={ Text:item.Text, Margin:{ Left:0, Right:0 }, TextColor:drawInfo.TextColor };
|
|
@@ -152450,7 +152470,7 @@ function ScrollBarBGChart()
|
|
|
152450
152470
|
|
|
152451
152471
|
|
|
152452
152472
|
|
|
152453
|
-
var HQCHART_VERSION="1.1.
|
|
152473
|
+
var HQCHART_VERSION="1.1.14999";
|
|
152454
152474
|
|
|
152455
152475
|
function PrintHQChartVersion()
|
|
152456
152476
|
{
|
|
@@ -17262,7 +17262,7 @@ function IChartFramePainting()
|
|
|
17262
17262
|
if (this.IsLocked)
|
|
17263
17263
|
{
|
|
17264
17264
|
if (this.LockPaint == null)
|
|
17265
|
-
this.LockPaint = new ChartLock();
|
|
17265
|
+
this.LockPaint = g_ChartPaintFactory.Create("ChartLock");//new ChartLock();
|
|
17266
17266
|
this.LockPaint.Canvas=this.Canvas;
|
|
17267
17267
|
this.LockPaint.ChartBorder=this.ChartBorder;
|
|
17268
17268
|
this.LockPaint.ChartFrame=this;
|
|
@@ -17328,7 +17328,7 @@ function IChartFramePainting()
|
|
|
17328
17328
|
if (this.IsLocked)
|
|
17329
17329
|
{
|
|
17330
17330
|
if (this.LockPaint == null)
|
|
17331
|
-
this.LockPaint = new ChartLock();
|
|
17331
|
+
this.LockPaint = g_ChartPaintFactory.Create("ChartLock"); // new ChartLock();
|
|
17332
17332
|
this.LockPaint.Canvas=this.Canvas;
|
|
17333
17333
|
this.LockPaint.ChartBorder=this.ChartBorder;
|
|
17334
17334
|
this.LockPaint.ChartFrame=this;
|
|
@@ -17346,7 +17346,7 @@ function IChartFramePainting()
|
|
|
17346
17346
|
}
|
|
17347
17347
|
|
|
17348
17348
|
this.IsLocked=true;
|
|
17349
|
-
if (!this.LockPaint) this.LockPaint=new ChartLock(); //创建锁
|
|
17349
|
+
if (!this.LockPaint) this.LockPaint=g_ChartPaintFactory.Create("ChartLock"); //new ChartLock(); //创建锁
|
|
17350
17350
|
|
|
17351
17351
|
if (lockData.Callback) this.LockPaint.Callback=lockData.Callback; //回调
|
|
17352
17352
|
if (lockData.IndexName) this.LockPaint.IndexName=lockData.IndexName; //指标名字
|
|
@@ -30533,7 +30533,8 @@ function ChartPaintFactory()
|
|
|
30533
30533
|
["ChartMinuteVolumBar",{ Create:function(option) { return new ChartMinuteVolumBar(); } }], //分时成交量柱子
|
|
30534
30534
|
["ChartMinutePriceLine",{ Create:function(option) { return new ChartMinutePriceLine();} }],
|
|
30535
30535
|
["ChartMinuteBuySellBar", { Create:function(option){ return new ChartMinuteBuySellBar(); }}],
|
|
30536
|
-
["ChartMinuteBarCallAuction", { Create:function(option){ return new ChartMinuteBarCallAuction(); }}]
|
|
30536
|
+
["ChartMinuteBarCallAuction", { Create:function(option){ return new ChartMinuteBarCallAuction(); }}],
|
|
30537
|
+
["ChartLock",{ Create:function(option){ return new ChartLock(); }}]
|
|
30537
30538
|
]);
|
|
30538
30539
|
|
|
30539
30540
|
this.Create=function(name, option)
|
|
@@ -99609,6 +99610,25 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
99609
99610
|
|
|
99610
99611
|
return false;
|
|
99611
99612
|
}
|
|
99613
|
+
|
|
99614
|
+
this.TryClickLock=function(x,y)
|
|
99615
|
+
{
|
|
99616
|
+
for(var i=0;i<this.Frame.SubFrame.length; ++i)
|
|
99617
|
+
{
|
|
99618
|
+
var item=this.Frame.SubFrame[i];
|
|
99619
|
+
if (!item.Frame.IsLocked) continue;
|
|
99620
|
+
if (!item.Frame.LockPaint) continue;
|
|
99621
|
+
|
|
99622
|
+
var tooltip=new TooltipData();
|
|
99623
|
+
if (!item.Frame.LockPaint.GetTooltipData(x,y,tooltip)) continue;
|
|
99624
|
+
|
|
99625
|
+
tooltip.HQChart=this;
|
|
99626
|
+
if (tooltip.Data.Callback) tooltip.Data.Callback(tooltip);
|
|
99627
|
+
return true;
|
|
99628
|
+
}
|
|
99629
|
+
|
|
99630
|
+
return false;
|
|
99631
|
+
}
|
|
99612
99632
|
}
|
|
99613
99633
|
|
|
99614
99634
|
//盘前数据
|
|
@@ -146043,7 +146063,7 @@ function ChartReport()
|
|
|
146043
146063
|
for(var i=0;i<drawInfo.AryText.length;++i)
|
|
146044
146064
|
{
|
|
146045
146065
|
var item=drawInfo.AryText[i];
|
|
146046
|
-
if (!item.Text) continue;
|
|
146066
|
+
if (!item || !item.Text) continue;
|
|
146047
146067
|
var itemWidth=this.Canvas.measureText(item.Text).width;
|
|
146048
146068
|
|
|
146049
146069
|
var newItem={ Text:item.Text, Margin:{ Left:0, Right:0 }, TextColor:drawInfo.TextColor };
|
|
@@ -163829,7 +163849,7 @@ function HQChartScriptWorker()
|
|
|
163829
163849
|
|
|
163830
163850
|
|
|
163831
163851
|
|
|
163832
|
-
var HQCHART_VERSION="1.1.
|
|
163852
|
+
var HQCHART_VERSION="1.1.14999";
|
|
163833
163853
|
|
|
163834
163854
|
function PrintHQChartVersion()
|
|
163835
163855
|
{
|