hqchart 1.1.14991 → 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 +15 -8
- package/package.json +1 -1
- package/src/jscommon/umychart.js +24 -4
- package/src/jscommon/umychart.report.js +94 -3
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +119 -8
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +119 -8
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;//扩展数据序号
|
|
@@ -13873,10 +13875,15 @@ if(stock){this.DrawLimitPriceBorder(stock.Open,stock,left,top,column.Width);this
|
|
|
13873
13875
|
if(stock){this.DrawLimitPriceBorder(stock.High,stock,left,top,column.Width);this.GetPriceDrawInfo(stock.High,stock,data,drawInfo,{LimitBG:true});}this.FormatDrawInfo(column,stock,drawInfo,data);}else if(column.Type==REPORT_COLUMN_ID.LOW_ID){//如果行情最低价为跌停价,则对内容加灰框
|
|
13874
13876
|
if(stock){this.DrawLimitPriceBorder(stock.Low,stock,left,top,column.Width);this.GetPriceDrawInfo(stock.Low,stock,data,drawInfo,{LimitBG:true});}this.FormatDrawInfo(column,stock,drawInfo,data);}else if(column.Type==REPORT_COLUMN_ID.YCLOSE_ID){if(stock)this.GetPriceDrawInfo(stock.YClose,stock,data,drawInfo);this.FormatDrawInfo(column,stock,drawInfo,data);}else if(column.Type==REPORT_COLUMN_ID.BUY_PRICE_ID){if(stock)this.GetPriceDrawInfo(stock.BuyPrice,stock,data,drawInfo);this.FormatDrawInfo(column,stock,drawInfo,data);}else if(column.Type==REPORT_COLUMN_ID.FUTURES_CLOSE_ID||column.Type==REPORT_COLUMN_ID.FUTURES_YCLOSE_ID){var fieldName=MAP_COLUMN_FIELD.get(column.Type);if(stock&&IFrameSplitOperator.IsNumber(stock[fieldName])){var value=stock[fieldName];this.GetPriceDrawInfo(value,stock,data,drawInfo);}this.FormatDrawInfo(column,stock,drawInfo,data);}else if(column.Type==REPORT_COLUMN_ID.SELL_PRICE_ID){if(stock)this.GetPriceDrawInfo(stock.SellPrice,stock,data,drawInfo);this.FormatDrawInfo(column,stock,drawInfo,data);}else if(column.Type==REPORT_COLUMN_ID.AVERAGE_PRICE_ID){if(stock)this.GetPriceDrawInfo(stock.AvPrice,stock,data,drawInfo);this.FormatDrawInfo(column,stock,drawInfo,data);}else if(column.Type==REPORT_COLUMN_ID.EXCHANGE_RATE_ID){if(stock&&IFrameSplitOperator.IsNumber(stock.Exchange))drawInfo.Text=stock.Exchange.toFixed(2);this.FormatDrawInfo(column,stock,drawInfo,data);}else if(column.Type==REPORT_COLUMN_ID.BUY_VOL_ID){if(stock&&IFrameSplitOperator.IsNumber(stock.BuyVol))drawInfo.Text=this.FormatVolString(stock.BuyVol);this.FormatDrawInfo(column,stock,drawInfo,data);}else if(column.Type==REPORT_COLUMN_ID.SELL_VOL_ID){if(stock&&IFrameSplitOperator.IsNumber(stock.SellVol))drawInfo.Text=this.FormatVolString(stock.SellVol);this.FormatDrawInfo(column,stock,drawInfo,data);}else if(column.Type==REPORT_COLUMN_ID.VOL_ID){if(stock&&IFrameSplitOperator.IsNumber(stock.Vol))drawInfo.Text=this.FormatVolString(stock.Vol);this.FormatDrawInfo(column,stock,drawInfo,data);}else if(column.Type==REPORT_COLUMN_ID.VOL_IN_ID){if(stock&&IFrameSplitOperator.IsNumber(stock.VolIn))drawInfo.Text=this.FormatVolString(stock.VolIn);this.FormatDrawInfo(column,stock,drawInfo,data);}else if(column.Type==REPORT_COLUMN_ID.VOL_OUT_ID){if(stock&&IFrameSplitOperator.IsNumber(stock.VolOut))drawInfo.Text=this.FormatVolString(stock.VolOut);this.FormatDrawInfo(column,stock,drawInfo,data);}else if(column.Type==REPORT_COLUMN_ID.TOTAL_SHARES_ID){if(stock&&IFrameSplitOperator.IsNumber(stock.TotalShares))drawInfo.Text=this.FormatVolString(stock.TotalShares);this.FormatDrawInfo(column,stock,drawInfo,data);}else if(column.Type==REPORT_COLUMN_ID.OUTSTANDING_SHARES_ID){if(stock&&IFrameSplitOperator.IsNumber(stock.OutShares))drawInfo.Text=this.FormatVolString(stock.OutShares);this.FormatDrawInfo(column,stock,drawInfo,data);}else if(column.Type==REPORT_COLUMN_ID.CIRC_MARKET_VALUE_ID||column.Type==REPORT_COLUMN_ID.MARKET_VALUE_ID||column.Type==REPORT_COLUMN_ID.AMOUNT_ID){var fieldName=MAP_COLUMN_FIELD.get(column.Type);if(stock&&IFrameSplitOperator.IsNumber(stock[fieldName]))drawInfo.Text=this.FormatVolString(stock[fieldName]);this.FormatDrawInfo(column,stock,drawInfo,data);}else if(column.Type==REPORT_COLUMN_ID.INCREASE_ID||column.Type==REPORT_COLUMN_ID.AMPLITUDE_ID||column.Type==REPORT_COLUMN_ID.UPDOWN_ID||column.Type==REPORT_COLUMN_ID.RISING_SPEED_1M_ID||column.Type==REPORT_COLUMN_ID.RISING_SPEED_3M_ID||column.Type==REPORT_COLUMN_ID.RISING_SPEED_5M_ID||column.Type==REPORT_COLUMN_ID.RISING_SPEED_10M_ID||column.Type==REPORT_COLUMN_ID.RISING_SPEED_15M_ID){var fieldName=MAP_COLUMN_FIELD.get(column.Type);if(stock&&IFrameSplitOperator.IsNumber(stock[fieldName])){var value=stock[fieldName];drawInfo.Text=value.toFixed(2);drawInfo.TextColor=this.GetUpDownColor(value,0);}this.FormatDrawInfo(column,stock,drawInfo,data);}else if(column.Type==REPORT_COLUMN_ID.FUTURES_POSITION_ID||column.Type==REPORT_COLUMN_ID.FUTURES_OPEN_POSITION_ID||column.Type==REPORT_COLUMN_ID.FUTURES_CLOSE_POSITION_ID){//持仓量原始值输出
|
|
13875
13877
|
var fieldName=MAP_COLUMN_FIELD.get(column.Type);if(stock&&IFrameSplitOperator.IsNumber(stock[fieldName])){var value=stock[fieldName];drawInfo.Text=value.toFixed(0);}this.FormatDrawInfo(column,stock,drawInfo,data);}else if(column.Type==REPORT_COLUMN_ID.CUSTOM_STRING_TEXT_ID){this.GetCustomStringDrawInfo(data,column,drawInfo);}else if(column.Type==REPORT_COLUMN_ID.CUSTOM_NUMBER_TEXT_ID){this.GetCustomNumberDrawInfo(data,column,drawInfo);this.FormatDrawInfoEvent(stock,data,column,drawInfo);}else if(column.Type==REPORT_COLUMN_ID.CUSTOM_DATETIME_TEXT_ID){this.GetCustomDateTimeDrawInfo(data,column,drawInfo);this.FormatDrawInfoEvent(stock,data,column,drawInfo);}else if(column.Type==REPORT_COLUMN_ID.CUSTOM_ICON_ID){this.GetCustomIconDrawInfo(data,column,drawInfo);}else if(column.Type==REPORT_COLUMN_ID.CLOSE_LINE_ID){var rtItem={Left:left,Top:top,Width:column.Width,Height:this.RowHeight};rtItem.Right=rtItem.Left+rtItem.Width;rtItem.Bottom=rtItem.Top+rtItem.Height;if(stock)this.DrawLine(stock.CloseLine,column,rtItem);}else if(column.Type==REPORT_COLUMN_ID.KLINE_ID){var rtItem={Left:left,Top:top,Width:column.Width,Height:this.RowHeight};rtItem.Right=rtItem.Left+rtItem.Width;rtItem.Bottom=rtItem.Top+rtItem.Height;this.DrawKLine(stock.KLine,column,rtItem,data);}else if(column.Type==REPORT_COLUMN_ID.TIME_ID){this.FormaTimeDrawInfo(column,stock,drawInfo,data);this.FormatDrawInfoEvent(stock,data,column,drawInfo);}else if(column.Type==REPORT_COLUMN_ID.DATE_ID){this.FormaDateDrawInfo(column,stock,drawInfo,data);this.FormatDrawInfoEvent(stock,data,column,drawInfo);}else if(column.Type==REPORT_COLUMN_ID.CHECKBOX_ID){rtItem={Left:left,Top:top,Width:column.Width,Height:this.RowHeight};rtItem.Right=rtItem.Left+rtItem.Width;rtItem.Bottom=rtItem.Top+rtItem.Height;drawInfo.Rect=rtItem;drawInfo.Checked=false;drawInfo.Enable=true;drawInfo.CheckBox=this.CheckBoxConfig;drawInfo.Data=stock;if(stock&&IFrameSplitOperator.IsBool(stock.Checked))drawInfo.Checked=stock.Checked;}else if(column.Type==REPORT_COLUMN_ID.CUSTOM_CHECKBOX_ID){rtItem={Left:left,Top:top,Width:column.Width,Height:this.RowHeight};rtItem.Right=rtItem.Left+rtItem.Width;rtItem.Bottom=rtItem.Top+rtItem.Height;drawInfo.Rect=rtItem;this.GetCustomCheckBoxDrawInfo(data,column,drawInfo);}else if(column.Type==REPORT_COLUMN_ID.CUSTOM_BUTTON_ID){rtItem={Left:left,Top:top,Width:column.Width,Height:this.RowHeight};rtItem.Right=rtItem.Left+rtItem.Width;rtItem.Bottom=rtItem.Top+rtItem.Height;drawInfo.Rect=rtItem;this.GetCustomButtonDrawInfo(data,column,drawInfo);}else if(column.Type==REPORT_COLUMN_ID.CUSTOM_PROGRESS_ID){rtItem={Left:left,Top:top,Width:column.Width,Height:this.RowHeight};rtItem.Right=rtItem.Left+rtItem.Width;rtItem.Bottom=rtItem.Top+rtItem.Height;drawInfo.Rect=rtItem;this.GetCustomProgressBarDrawInfo(data,column,drawInfo);}else if(column.Type==REPORT_COLUMN_ID.CUSTOM_LINK_ID){this.GetCustomLinkDrawInfo(data,column,drawInfo);}else if(this.IsReserveNumber(column.Type)){this.FormatReserveNumber(column,stock,drawInfo);this.FormatDrawInfoEvent(stock,data,column,drawInfo);}else if(this.IsReserveString(column.Type)){this.FormatReserveString(column,stock,drawInfo);this.FormatDrawInfoEvent(stock,data,column,drawInfo);}else if(this.IsReserveDateTime(column.Type)){this.FormatReserveDateTime(column,stock,drawInfo);this.FormatDrawInfoEvent(stock,data,column,drawInfo);}else if(this.IsReserveProgressBarColumn(column.Type)){this.FormatReserveProgressBar(column,stock,drawInfo);}else if(this.IsReserveButtonColumn(column.Type)){this.FormatReserveButton(column,stock,drawInfo);}else if(column.Type==REPORT_COLUMN_ID.MULTI_LINE_CONTAINER){if(IFrameSplitOperator.IsNonEmptyArray(column.AryField)){var yBottom=rtItem.Bottom-this.ItemMergin.Bottom-(column.AryField.length-1)*this.ItemFontHeight;var rtText={Left:left+this.ItemMergin.Left,Width:textWidth,Height:this.ItemFontHeight,Bottom:yBottom};rtText.Right=rtText.Left+rtText.Width;rtText.Top=rtText.Bottom-rtText.Height;for(var k=0;k<column.AryField.length;++k){drawInfo.Text=null;var subItem=column.AryField[k];this.BuildSubCellTextData(subItem,column,stock,drawInfo,data);this.DrawSubCellText(drawInfo,column,rtText);rtText.Bottom+=this.ItemFontHeight;rtText.Top+=this.ItemFontHeight;}}}//拖拽行颜色
|
|
13876
|
-
if(rowType==3)drawInfo.TextColor=this.DragRowTextColor;if(drawInfo.Symbol){this.DrawItemTextEx(drawInfo,x,top,textWidth);}else if(column.Type==REPORT_COLUMN_ID.CUSTOM_ICON_ID){this.DrawIconItem(drawInfo,x,top,textWidth);}else if(column.Type==REPORT_COLUMN_ID.CHECKBOX_ID||column.Type==REPORT_COLUMN_ID.CUSTOM_CHECKBOX_ID){this.DrawCheckbox(drawInfo,left,top,itemWidth);}else if(column.Type==REPORT_COLUMN_ID.CUSTOM_BUTTON_ID||this.IsReserveButtonColumn(column.Type)){this.DrawButton(drawInfo,left,top,itemWidth);}else if(column.Type==REPORT_COLUMN_ID.CUSTOM_PROGRESS_ID||this.IsReserveProgressBarColumn(column.Type)){this.DrawProgressBar(drawInfo,left,top,itemWidth);}else if(column.Type==REPORT_COLUMN_ID.CUSTOM_LINK_ID){this.DrawLinkText(drawInfo,x,top,textWidth);}else if(column.Type==REPORT_COLUMN_ID.MULTI_LINE_CONTAINER){}else{if(data.FlashBG&&data.FlashBG.Data&&column.ID!=undefined){if(data.FlashBG.Data.has(column.ID)){var flashItem=data.FlashBG.Data.get(column.ID);var drawBG={Rect:drawInfo.Rect,BGColor:flashItem.Color};--flashItem.Count;this.DrawItemBG(drawBG);if(this.GlobalOption)++this.GlobalOption.FlashBGCount;}}this.DrawItemBG(drawInfo);if(column.Type==REPORT_COLUMN_ID.CUSTOM_STRING_TEXT_ID||this.IsReserveString(column.Type))this.
|
|
13878
|
+
if(rowType==3)drawInfo.TextColor=this.DragRowTextColor;if(drawInfo.Symbol){this.DrawItemTextEx(drawInfo,x,top,textWidth);}else if(column.Type==REPORT_COLUMN_ID.CUSTOM_ICON_ID){this.DrawIconItem(drawInfo,x,top,textWidth);}else if(column.Type==REPORT_COLUMN_ID.CHECKBOX_ID||column.Type==REPORT_COLUMN_ID.CUSTOM_CHECKBOX_ID){this.DrawCheckbox(drawInfo,left,top,itemWidth);}else if(column.Type==REPORT_COLUMN_ID.CUSTOM_BUTTON_ID||this.IsReserveButtonColumn(column.Type)){this.DrawButton(drawInfo,left,top,itemWidth);}else if(column.Type==REPORT_COLUMN_ID.CUSTOM_PROGRESS_ID||this.IsReserveProgressBarColumn(column.Type)){this.DrawProgressBar(drawInfo,left,top,itemWidth);}else if(column.Type==REPORT_COLUMN_ID.CUSTOM_LINK_ID){this.DrawLinkText(drawInfo,x,top,textWidth);}else if(column.Type==REPORT_COLUMN_ID.MULTI_LINE_CONTAINER){}else{if(data.FlashBG&&data.FlashBG.Data&&column.ID!=undefined){if(data.FlashBG.Data.has(column.ID)){var flashItem=data.FlashBG.Data.get(column.ID);var drawBG={Rect:drawInfo.Rect,BGColor:flashItem.Color};--flashItem.Count;this.DrawItemBG(drawBG);if(this.GlobalOption)++this.GlobalOption.FlashBGCount;}}this.DrawItemBG(drawInfo);if(column.Type==REPORT_COLUMN_ID.CUSTOM_STRING_TEXT_ID||this.IsReserveString(column.Type))this.DrawReserveString(drawInfo,column,x,top,textWidth);else this.DrawItemText(drawInfo.Text,drawInfo.TextColor,drawInfo.TextAlign,x,top,textWidth,drawInfo.BGColor);}//tooltip提示
|
|
13877
13879
|
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
|
-
{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);}
|
|
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,}, .... ]
|
|
13882
|
+
this.DrawComplexText=function(drawInfo,column,left,top,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)//长度超过单元格 裁剪
|
|
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(); //调试用
|
|
13885
|
+
this.Canvas.clip();//数据截断提示信息
|
|
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)//长度超过单元格 裁剪
|
|
13880
13887
|
{if(column.FormatType==2){var count=text.length+5;text="";for(var i=0;i<count;++i){text+="#";}}else if(column.FormatType==1){text=this.TextEllipsis(text,cellWidth,column.MaxText);}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(); //调试用
|
|
13881
13888
|
this.Canvas.clip();//数据截断提示信息
|
|
13882
13889
|
if(!drawInfo.Tooltip){drawInfo.Tooltip={Type:1,Data:{AryText:[{Text:drawInfo.Text}]}};}}this.Canvas.textBaseline="bottom";this.Canvas.fillStyle=drawInfo.TextColor;this.Canvas.fillText(text,x,top+this.RowHeight-this.ItemMergin.Bottom);if(bClip)this.Canvas.restore();};this.DrawSymbolName=function(data,column,left,top,rowType){var stock=data.Stock;var symbol=IFrameSplitOperator.RemoveMarketSuffix(data.Symbol);var name;if(stock){symbol=stock.Symbol;name=stock.Name;}if(!symbol&&!name)return;var y=top+this.ItemMergin.Top+this.ItemNameHeight;var textLeft=left+this.ItemMergin.Left;var x=textLeft;var width=column.Width-this.ItemMergin.Left-this.ItemMergin.Right;var textAlign=column.TextAlign;if(textAlign=='center'){x=textLeft+width/2;this.Canvas.textAlign="center";}else if(textAlign=='right'){x=textLeft+width-2;this.Canvas.textAlign="right";}else{x+=2;this.Canvas.textAlign="left";}var textColor=this.GetNameColor(column,symbol,rowType);var text=name;if(text){this.Canvas.textBaseline="bottom";this.Canvas.fillStyle=textColor;this.Canvas.font=this.ItemNameFont;text=this.TextEllipsis(text,width,column.MaxText);if(text)this.Canvas.fillText(text,x,y);}text=symbol;if(text){this.Canvas.textBaseline="bottom";this.Canvas.font=this.ItemSymbolFont;this.Canvas.fillStyle=textColor;this.Canvas.fillText(text,x,y+this.ItemSymbolHeight);}this.Canvas.font=this.ItemFont;//还原字体
|
|
@@ -13887,7 +13894,7 @@ switch(column.ColorType){case 1:drawInfo.TextColor=this.GetUpDownColor(value,0);
|
|
|
13887
13894
|
{this.GetCustomIconData(column,data.Symbol,drawInfo,data);return;}};this.GetCustomCheckBoxDrawInfo=function(data,column,drawInfo){var checkData=this.GetExtendData(data,column);if(!checkData)return;if(!IFrameSplitOperator.IsBool(checkData.Checked))return;drawInfo.Checked=checkData.Checked;drawInfo.Enable=true;drawInfo.Data=checkData;if(IFrameSplitOperator.IsBool(checkData.DisableCheckBox))drawInfo.Enable=!checkData.DisableCheckBox;drawInfo.CheckBox=column.CheckBox;};this.GetCustomButtonDrawInfo=function(data,column,drawInfo){var buttonData=this.GetExtendData(data,column);if(!buttonData)return;drawInfo.Text=buttonData.Title;drawInfo.Button=column.Button;drawInfo.Font=column.Button.Font;drawInfo.Enable=true;drawInfo.Data=buttonData;if(IFrameSplitOperator.IsBool(buttonData.Enable))drawInfo.Enable=buttonData.Enable;};this.GetCustomProgressBarDrawInfo=function(data,column,drawInfo){var barData=this.GetExtendData(data,column);if(!barData)return;drawInfo.Text=barData.Title;drawInfo.ProgressBar=column.ProgressBar;drawInfo.Enable=true;drawInfo.Value=barData.Value;//占比
|
|
13888
13895
|
drawInfo.Data=barData;if(IFrameSplitOperator.IsBool(barData.Enable))drawInfo.Enable=barData.Enable;if(barData.TextColor)drawInfo.TextColor=barData.TextColor;if(barData.BarColor)drawInfo.BarColor=barData.BarColor;if(barData.BGColor)drawInfo.BGColor=barData.BGColor;};this.GetCustomLinkDrawInfo=function(data,column,drawInfo){var linkData=this.GetExtendData(data,column);if(!linkData)return;drawInfo.Text=linkData.Title;drawInfo.Link=column.Link;drawInfo.Enable=true;drawInfo.Data=linkData;drawInfo.MaxText=column.MaxText;if(IFrameSplitOperator.IsBool(linkData.Enable))drawInfo.Enable=linkData.Enable;if(linkData.TextColor)drawInfo.TextColor=linkData.TextColor;};this.FormatReserveNumber=function(column,data,drawInfo){if(column.DefaultText)drawInfo.Text=column.DefaultText;var fieldName=MAP_COLUMN_FIELD.get(column.Type);if(!data||!fieldName)return;var value=data[fieldName];if(!IFrameSplitOperator.IsNumber(value))return;if(IFrameSplitOperator.IsNumber(column.ColorType)){if(column.ColorType==1){drawInfo.TextColor=this.GetUpDownColor(value,0);}else if(column.ColorType==2){drawInfo.TextColor=this.GetUpDownColorV2(value,0);}else if(column.ColorType==3){drawInfo.TextColor=this.GetUpDownColor(value,data.YClose);}}var text=value.toFixed(column.FloatPrecision);if(column.Format&&IFrameSplitOperator.IsNumber(column.Format.Type)){var format=column.Format;switch(format.Type){case 1://原始数据
|
|
13889
13896
|
text=value.toFixed(column.FloatPrecision);break;case 2://千分位分割
|
|
13890
|
-
text=IFrameSplitOperator.FormatValueThousandsString(value,column.FloatPrecision);break;case 3:var exfloatPrecision=1;if(IFrameSplitOperator.IsNumber(format.ExFloatPrecision))exfloatPrecision=format.ExFloatPrecision;text=IFrameSplitOperator.FormatValueStringV2(value,column.FloatPrecision,exfloatPrecision);break;}}if(column.StringFormat&&text){text=column.StringFormat.replace("{0}",text);}drawInfo.Text=text;};this.FormatReserveString=function(column,data,drawInfo){if(column.DefaultText)drawInfo.Text=column.DefaultText;var fieldName=MAP_COLUMN_FIELD.get(column.Type);if(!data||!fieldName)return;var item=data[fieldName];if(IFrameSplitOperator.IsObject(item)){if(item.Text)drawInfo.Text=item.Text;if(item.TextColor)drawInfo.TextColor=item.TextColor;if(item.BGColor)drawInfo.BGColor=item.BGColor;if(item.Tooltip&&IFrameSplitOperator.IsNonEmptyArray(item.Tooltip.AryText)){drawInfo.Tooltip={Type:4,Data:{AryText:item.Tooltip.AryText,EnableCallback:item.Tooltip.EnableCallback}};}}else if(IFrameSplitOperator.IsString(item)){drawInfo.Text=item;}};this.GetReserveDateTimePreItem=function(colIndex){if(!this.CreateTempCache)return null;if(!this.TempCache.MapReserveDateTime)return null;var mapData=this.TempCache.MapReserveDateTime;if(!mapData.has(colIndex))return null;return mapData.get(colIndex);};this.SetReserveDateTimePreItem=function(colIndex,data){if(!this.CreateTempCache)return false;if(!this.TempCache.MapReserveDateTime)return false;var mapData=this.TempCache.MapReserveDateTime;if(mapData.has(colIndex)){var item=mapData.get(colIndex);item.PreItem.Date=data.Date;}else{mapData.set(colIndex,{PreItem:{Date:data.Date}});}return true;};this.FormatReserveDateTime=function(column,data,drawInfo){if(column.DefaultText)drawInfo.Text=column.DefaultText;var fieldName=MAP_COLUMN_FIELD.get(column.Type);if(!data||!fieldName)return;var item=data[fieldName];if(!IFrameSplitOperator.IsObject(item))return;var cacheItem=this.GetReserveDateTimePreItem(drawInfo.ColumnIndex);if(item.DateTime){var date=item.DateTime.getFullYear()*10000+(item.DateTime.getMonth()+1)*100+item.DateTime.getDate();var format=column.DateTimeFormat;if(cacheItem&&cacheItem.PreItem&&date==cacheItem.PreItem.Date){if(column.SubDateTimeFormat)format=column.SubDateTimeFormat;}else{this.SetReserveDateTimePreItem(drawInfo.ColumnIndex,{Date:date});}drawInfo.Text=IFrameSplitOperator.FormatDateTimeStringV2(item.DateTime,format);}if(item.TextColor)drawInfo.TextColor=item.TextColor;if(item.BGColor)drawInfo.BGColor=item.BGColor;};this.FormatReserveProgressBar=function(column,data,drawInfo){var fieldName=MAP_COLUMN_FIELD.get(column.Type);if(!data||!fieldName)return;var item=data[fieldName];if(IFrameSplitOperator.IsNumber(item)){drawInfo.ProgressBar=column.ProgressBar;drawInfo.Enable=true;drawInfo.Value=item;//占比
|
|
13897
|
+
text=IFrameSplitOperator.FormatValueThousandsString(value,column.FloatPrecision);break;case 3:var exfloatPrecision=1;if(IFrameSplitOperator.IsNumber(format.ExFloatPrecision))exfloatPrecision=format.ExFloatPrecision;text=IFrameSplitOperator.FormatValueStringV2(value,column.FloatPrecision,exfloatPrecision);break;}}if(column.StringFormat&&text){text=column.StringFormat.replace("{0}",text);}drawInfo.Text=text;};this.FormatReserveString=function(column,data,drawInfo){if(column.DefaultText)drawInfo.Text=column.DefaultText;var fieldName=MAP_COLUMN_FIELD.get(column.Type);if(!data||!fieldName)return;var item=data[fieldName];if(IFrameSplitOperator.IsObject(item)){if(item.Text)drawInfo.Text=item.Text;if(item.TextColor)drawInfo.TextColor=item.TextColor;if(item.BGColor)drawInfo.BGColor=item.BGColor;if(IFrameSplitOperator.IsNonEmptyArray(item.AryText))drawInfo.AryText=item.AryText;if(item.Tooltip&&IFrameSplitOperator.IsNonEmptyArray(item.Tooltip.AryText)){drawInfo.Tooltip={Type:4,Data:{AryText:item.Tooltip.AryText,EnableCallback:item.Tooltip.EnableCallback}};}}else if(IFrameSplitOperator.IsString(item)){drawInfo.Text=item;}};this.GetReserveDateTimePreItem=function(colIndex){if(!this.CreateTempCache)return null;if(!this.TempCache.MapReserveDateTime)return null;var mapData=this.TempCache.MapReserveDateTime;if(!mapData.has(colIndex))return null;return mapData.get(colIndex);};this.SetReserveDateTimePreItem=function(colIndex,data){if(!this.CreateTempCache)return false;if(!this.TempCache.MapReserveDateTime)return false;var mapData=this.TempCache.MapReserveDateTime;if(mapData.has(colIndex)){var item=mapData.get(colIndex);item.PreItem.Date=data.Date;}else{mapData.set(colIndex,{PreItem:{Date:data.Date}});}return true;};this.FormatReserveDateTime=function(column,data,drawInfo){if(column.DefaultText)drawInfo.Text=column.DefaultText;var fieldName=MAP_COLUMN_FIELD.get(column.Type);if(!data||!fieldName)return;var item=data[fieldName];if(!IFrameSplitOperator.IsObject(item))return;var cacheItem=this.GetReserveDateTimePreItem(drawInfo.ColumnIndex);if(item.DateTime){var date=item.DateTime.getFullYear()*10000+(item.DateTime.getMonth()+1)*100+item.DateTime.getDate();var format=column.DateTimeFormat;if(cacheItem&&cacheItem.PreItem&&date==cacheItem.PreItem.Date){if(column.SubDateTimeFormat)format=column.SubDateTimeFormat;}else{this.SetReserveDateTimePreItem(drawInfo.ColumnIndex,{Date:date});}drawInfo.Text=IFrameSplitOperator.FormatDateTimeStringV2(item.DateTime,format);}if(item.TextColor)drawInfo.TextColor=item.TextColor;if(item.BGColor)drawInfo.BGColor=item.BGColor;};this.FormatReserveProgressBar=function(column,data,drawInfo){var fieldName=MAP_COLUMN_FIELD.get(column.Type);if(!data||!fieldName)return;var item=data[fieldName];if(IFrameSplitOperator.IsNumber(item)){drawInfo.ProgressBar=column.ProgressBar;drawInfo.Enable=true;drawInfo.Value=item;//占比
|
|
13891
13898
|
drawInfo.Data={Value:item};}else if(IFrameSplitOperator.IsObject(item)){if(item.Title)drawInfo.Text=item.Title;drawInfo.ProgressBar=column.ProgressBar;drawInfo.Enable=true;drawInfo.Value=item.Value;//占比
|
|
13892
13899
|
drawInfo.Data=item;if(IFrameSplitOperator.IsBool(item.Enable))drawInfo.Enable=item.Enable;if(item.TextColor)drawInfo.TextColor=item.TextColor;if(item.BarColor)drawInfo.BarColor=item.BarColor;if(item.BGColor)drawInfo.BGColor=item.BGColor;}};this.FormatReserveButton=function(column,data,drawInfo){var fieldName=MAP_COLUMN_FIELD.get(column.Type);if(!data||!fieldName)return;var item=data[fieldName];if(!item)return;drawInfo.Text=item.Title;drawInfo.Button=column.Button;drawInfo.Font=column.Button.Font;drawInfo.Enable=true;drawInfo.Data=item;if(IFrameSplitOperator.IsBool(item.Enable))drawInfo.Enable=item.Enable;};this.FormaTimeDrawInfo=function(column,stock,drawInfo,data){if(!IFrameSplitOperator.IsNumber(stock.Time))return;if(column.ValueType==0)//0=hhmm 1=hhmmss 2=hhmmss.fff
|
|
13893
13900
|
{drawInfo.Text=IFrameSplitOperator.FormatTimeString(stock.Time,"HH:MM");}else if(column.ValueType==1){drawInfo.Text=IFrameSplitOperator.FormatTimeString(stock.Time,"HH:MM:SS");}else if(column.ValueType==2){drawInfo.Text=IFrameSplitOperator.FormatTimeString(stock.Time,"HH:MM:SS.fff");}};this.FormaDateDrawInfo=function(column,stock,drawInfo,data){if(!IFrameSplitOperator.IsNumber(stock.Date))return;if(column.FormatType==0)drawInfo.Text=IFrameSplitOperator.FormatDateString(stock.Date,"YYYY-MM-DD");else if(column.FormatType==1)drawInfo.Text=IFrameSplitOperator.FormatDateString(stock.Date,"YYYY/MM/DD");else if(column.FormatType==2)drawInfo.Text=IFrameSplitOperator.FormatDateString(stock.Date,"YYYY/MM/DD/W");else if(column.FormatType==3)drawInfo.Text=IFrameSplitOperator.FormatDateString(stock.Date,"YYYY-MM");else if(column.FormatType==4)drawInfo.Text=IFrameSplitOperator.FormatDateString(stock.Date,"MM/DD");else if(column.FormatType==4)drawInfo.Text=IFrameSplitOperator.FormatDateString(stock.Date,"MM-DD");};//自定义图标
|
|
@@ -15264,7 +15271,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
15264
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);};}/********************************************************************************
|
|
15265
15272
|
* 版本信息输出
|
|
15266
15273
|
*
|
|
15267
|
-
*/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();//把给外界调用的方法暴露出来
|
|
15268
15275
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
15269
15276
|
// BaseIndex:BaseIndex,
|
|
15270
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
|
//盘前数据
|
|
@@ -7209,7 +7209,7 @@ function ChartReport()
|
|
|
7209
7209
|
this.DrawItemBG(drawInfo);
|
|
7210
7210
|
|
|
7211
7211
|
if (column.Type==REPORT_COLUMN_ID.CUSTOM_STRING_TEXT_ID || this.IsReserveString(column.Type))
|
|
7212
|
-
this.
|
|
7212
|
+
this.DrawReserveString(drawInfo,column, x, top, textWidth);
|
|
7213
7213
|
else
|
|
7214
7214
|
this.DrawItemText(drawInfo.Text, drawInfo.TextColor, drawInfo.TextAlign, x, top, textWidth, drawInfo.BGColor);
|
|
7215
7215
|
}
|
|
@@ -7318,10 +7318,100 @@ function ChartReport()
|
|
|
7318
7318
|
return ARARY_TYPE.includes(value);
|
|
7319
7319
|
}
|
|
7320
7320
|
|
|
7321
|
-
|
|
7321
|
+
//AryText=[ { Text:, Color,}, .... ]
|
|
7322
|
+
this.DrawComplexText=function(drawInfo, column, left, top, cellWidth)
|
|
7323
|
+
{
|
|
7324
|
+
//计算大小
|
|
7325
|
+
var aryText=[];
|
|
7326
|
+
var textWidth=0;
|
|
7327
|
+
for(var i=0;i<drawInfo.AryText.length;++i)
|
|
7328
|
+
{
|
|
7329
|
+
var item=drawInfo.AryText[i];
|
|
7330
|
+
if (!item || !item.Text) continue;
|
|
7331
|
+
var itemWidth=this.Canvas.measureText(item.Text).width;
|
|
7332
|
+
|
|
7333
|
+
var newItem={ Text:item.Text, Margin:{ Left:0, Right:0 }, TextColor:drawInfo.TextColor };
|
|
7334
|
+
if (item.Color) newItem.TextColor=item.Color;
|
|
7335
|
+
if (item.Margin)
|
|
7336
|
+
{
|
|
7337
|
+
var margin=item.Margin;
|
|
7338
|
+
if (IFrameSplitOperator.IsNumber(margin.Left))
|
|
7339
|
+
{
|
|
7340
|
+
itemWidth+=margin.Left;
|
|
7341
|
+
newItem.Left=margin.Left;
|
|
7342
|
+
}
|
|
7343
|
+
if (IFrameSplitOperator.IsNumber(margin.Right))
|
|
7344
|
+
{
|
|
7345
|
+
itemWidth+=margin.Right;
|
|
7346
|
+
newItem.Right=margin.Right;;
|
|
7347
|
+
}
|
|
7348
|
+
}
|
|
7349
|
+
newItem.Width=itemWidth;
|
|
7350
|
+
|
|
7351
|
+
aryText.push(newItem)
|
|
7352
|
+
|
|
7353
|
+
textWidth+=itemWidth;
|
|
7354
|
+
}
|
|
7355
|
+
|
|
7356
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(aryText)) return;
|
|
7357
|
+
|
|
7358
|
+
var x=left;
|
|
7359
|
+
var y=top+this.RowHeight-this.ItemMergin.Bottom;
|
|
7360
|
+
if (drawInfo.TextAlign=='center')
|
|
7361
|
+
{
|
|
7362
|
+
x=left+cellWidth/2-textWidth/2;
|
|
7363
|
+
}
|
|
7364
|
+
else if (drawInfo.TextAlign=='right')
|
|
7365
|
+
{
|
|
7366
|
+
x=left+cellWidth-textWidth;
|
|
7367
|
+
}
|
|
7368
|
+
|
|
7369
|
+
var bClip=false;
|
|
7370
|
+
if (textWidth>=cellWidth) //长度超过单元格 裁剪
|
|
7371
|
+
{
|
|
7372
|
+
this.Canvas.save();
|
|
7373
|
+
bClip=true;
|
|
7322
7374
|
|
|
7323
|
-
|
|
7375
|
+
var rtCell={ Left:left, Top:top+this.ItemMergin.Top, Width:cellWidth, Height:this.RowHeight };
|
|
7376
|
+
this.Canvas.beginPath();
|
|
7377
|
+
this.Canvas.rect(rtCell.Left, rtCell.Top, rtCell.Width, rtCell.Height);
|
|
7378
|
+
//this.Canvas.stroke(); //调试用
|
|
7379
|
+
this.Canvas.clip();
|
|
7380
|
+
|
|
7381
|
+
//数据截断提示信息
|
|
7382
|
+
if (!drawInfo.Tooltip && drawInfo.Text)
|
|
7383
|
+
{
|
|
7384
|
+
drawInfo.Tooltip=
|
|
7385
|
+
{
|
|
7386
|
+
Type:1,
|
|
7387
|
+
Data:{ AryText:[ {Text:drawInfo.Text} ] }
|
|
7388
|
+
}
|
|
7389
|
+
}
|
|
7390
|
+
}
|
|
7391
|
+
|
|
7392
|
+
this.Canvas.textBaseline="bottom";
|
|
7393
|
+
this.Canvas.textAlign="left";
|
|
7394
|
+
for(var i=0;i<aryText.length;++i)
|
|
7395
|
+
{
|
|
7396
|
+
var item=aryText[i];
|
|
7397
|
+
this.Canvas.fillStyle=item.TextColor;
|
|
7398
|
+
|
|
7399
|
+
this.Canvas.fillText(item.Text,x+item.Margin.Left,y);
|
|
7400
|
+
x+=item.Width;
|
|
7401
|
+
}
|
|
7402
|
+
|
|
7403
|
+
|
|
7404
|
+
if (bClip) this.Canvas.restore();
|
|
7405
|
+
}
|
|
7406
|
+
|
|
7407
|
+
this.DrawReserveString=function(drawInfo, column, left, top, cellWidth)
|
|
7324
7408
|
{
|
|
7409
|
+
if (IFrameSplitOperator.IsNonEmptyArray(drawInfo.AryText))
|
|
7410
|
+
{
|
|
7411
|
+
this.DrawComplexText(drawInfo, column, left, top, cellWidth);
|
|
7412
|
+
return;
|
|
7413
|
+
}
|
|
7414
|
+
|
|
7325
7415
|
if (!drawInfo.Text) return;
|
|
7326
7416
|
|
|
7327
7417
|
var text=drawInfo.Text;
|
|
@@ -7746,6 +7836,7 @@ function ChartReport()
|
|
|
7746
7836
|
if (item.Text) drawInfo.Text=item.Text;
|
|
7747
7837
|
if (item.TextColor) drawInfo.TextColor=item.TextColor;
|
|
7748
7838
|
if (item.BGColor) drawInfo.BGColor=item.BGColor;
|
|
7839
|
+
if (IFrameSplitOperator.IsNonEmptyArray(item.AryText)) drawInfo.AryText=item.AryText;
|
|
7749
7840
|
|
|
7750
7841
|
if (item.Tooltip && IFrameSplitOperator.IsNonEmptyArray(item.Tooltip.AryText))
|
|
7751
7842
|
{
|
|
@@ -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
|
//盘前数据
|
|
@@ -145881,7 +145901,7 @@ function ChartReport()
|
|
|
145881
145901
|
this.DrawItemBG(drawInfo);
|
|
145882
145902
|
|
|
145883
145903
|
if (column.Type==REPORT_COLUMN_ID.CUSTOM_STRING_TEXT_ID || this.IsReserveString(column.Type))
|
|
145884
|
-
this.
|
|
145904
|
+
this.DrawReserveString(drawInfo,column, x, top, textWidth);
|
|
145885
145905
|
else
|
|
145886
145906
|
this.DrawItemText(drawInfo.Text, drawInfo.TextColor, drawInfo.TextAlign, x, top, textWidth, drawInfo.BGColor);
|
|
145887
145907
|
}
|
|
@@ -145990,10 +146010,100 @@ function ChartReport()
|
|
|
145990
146010
|
return ARARY_TYPE.includes(value);
|
|
145991
146011
|
}
|
|
145992
146012
|
|
|
145993
|
-
|
|
146013
|
+
//AryText=[ { Text:, Color,}, .... ]
|
|
146014
|
+
this.DrawComplexText=function(drawInfo, column, left, top, cellWidth)
|
|
146015
|
+
{
|
|
146016
|
+
//计算大小
|
|
146017
|
+
var aryText=[];
|
|
146018
|
+
var textWidth=0;
|
|
146019
|
+
for(var i=0;i<drawInfo.AryText.length;++i)
|
|
146020
|
+
{
|
|
146021
|
+
var item=drawInfo.AryText[i];
|
|
146022
|
+
if (!item || !item.Text) continue;
|
|
146023
|
+
var itemWidth=this.Canvas.measureText(item.Text).width;
|
|
146024
|
+
|
|
146025
|
+
var newItem={ Text:item.Text, Margin:{ Left:0, Right:0 }, TextColor:drawInfo.TextColor };
|
|
146026
|
+
if (item.Color) newItem.TextColor=item.Color;
|
|
146027
|
+
if (item.Margin)
|
|
146028
|
+
{
|
|
146029
|
+
var margin=item.Margin;
|
|
146030
|
+
if (IFrameSplitOperator.IsNumber(margin.Left))
|
|
146031
|
+
{
|
|
146032
|
+
itemWidth+=margin.Left;
|
|
146033
|
+
newItem.Left=margin.Left;
|
|
146034
|
+
}
|
|
146035
|
+
if (IFrameSplitOperator.IsNumber(margin.Right))
|
|
146036
|
+
{
|
|
146037
|
+
itemWidth+=margin.Right;
|
|
146038
|
+
newItem.Right=margin.Right;;
|
|
146039
|
+
}
|
|
146040
|
+
}
|
|
146041
|
+
newItem.Width=itemWidth;
|
|
146042
|
+
|
|
146043
|
+
aryText.push(newItem)
|
|
145994
146044
|
|
|
145995
|
-
|
|
146045
|
+
textWidth+=itemWidth;
|
|
146046
|
+
}
|
|
146047
|
+
|
|
146048
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(aryText)) return;
|
|
146049
|
+
|
|
146050
|
+
var x=left;
|
|
146051
|
+
var y=top+this.RowHeight-this.ItemMergin.Bottom;
|
|
146052
|
+
if (drawInfo.TextAlign=='center')
|
|
146053
|
+
{
|
|
146054
|
+
x=left+cellWidth/2-textWidth/2;
|
|
146055
|
+
}
|
|
146056
|
+
else if (drawInfo.TextAlign=='right')
|
|
146057
|
+
{
|
|
146058
|
+
x=left+cellWidth-textWidth;
|
|
146059
|
+
}
|
|
146060
|
+
|
|
146061
|
+
var bClip=false;
|
|
146062
|
+
if (textWidth>=cellWidth) //长度超过单元格 裁剪
|
|
146063
|
+
{
|
|
146064
|
+
this.Canvas.save();
|
|
146065
|
+
bClip=true;
|
|
146066
|
+
|
|
146067
|
+
var rtCell={ Left:left, Top:top+this.ItemMergin.Top, Width:cellWidth, Height:this.RowHeight };
|
|
146068
|
+
this.Canvas.beginPath();
|
|
146069
|
+
this.Canvas.rect(rtCell.Left, rtCell.Top, rtCell.Width, rtCell.Height);
|
|
146070
|
+
//this.Canvas.stroke(); //调试用
|
|
146071
|
+
this.Canvas.clip();
|
|
146072
|
+
|
|
146073
|
+
//数据截断提示信息
|
|
146074
|
+
if (!drawInfo.Tooltip && drawInfo.Text)
|
|
146075
|
+
{
|
|
146076
|
+
drawInfo.Tooltip=
|
|
146077
|
+
{
|
|
146078
|
+
Type:1,
|
|
146079
|
+
Data:{ AryText:[ {Text:drawInfo.Text} ] }
|
|
146080
|
+
}
|
|
146081
|
+
}
|
|
146082
|
+
}
|
|
146083
|
+
|
|
146084
|
+
this.Canvas.textBaseline="bottom";
|
|
146085
|
+
this.Canvas.textAlign="left";
|
|
146086
|
+
for(var i=0;i<aryText.length;++i)
|
|
146087
|
+
{
|
|
146088
|
+
var item=aryText[i];
|
|
146089
|
+
this.Canvas.fillStyle=item.TextColor;
|
|
146090
|
+
|
|
146091
|
+
this.Canvas.fillText(item.Text,x+item.Margin.Left,y);
|
|
146092
|
+
x+=item.Width;
|
|
146093
|
+
}
|
|
146094
|
+
|
|
146095
|
+
|
|
146096
|
+
if (bClip) this.Canvas.restore();
|
|
146097
|
+
}
|
|
146098
|
+
|
|
146099
|
+
this.DrawReserveString=function(drawInfo, column, left, top, cellWidth)
|
|
145996
146100
|
{
|
|
146101
|
+
if (IFrameSplitOperator.IsNonEmptyArray(drawInfo.AryText))
|
|
146102
|
+
{
|
|
146103
|
+
this.DrawComplexText(drawInfo, column, left, top, cellWidth);
|
|
146104
|
+
return;
|
|
146105
|
+
}
|
|
146106
|
+
|
|
145997
146107
|
if (!drawInfo.Text) return;
|
|
145998
146108
|
|
|
145999
146109
|
var text=drawInfo.Text;
|
|
@@ -146418,6 +146528,7 @@ function ChartReport()
|
|
|
146418
146528
|
if (item.Text) drawInfo.Text=item.Text;
|
|
146419
146529
|
if (item.TextColor) drawInfo.TextColor=item.TextColor;
|
|
146420
146530
|
if (item.BGColor) drawInfo.BGColor=item.BGColor;
|
|
146531
|
+
if (IFrameSplitOperator.IsNonEmptyArray(item.AryText)) drawInfo.AryText=item.AryText;
|
|
146421
146532
|
|
|
146422
146533
|
if (item.Tooltip && IFrameSplitOperator.IsNonEmptyArray(item.Tooltip.AryText))
|
|
146423
146534
|
{
|
|
@@ -152359,7 +152470,7 @@ function ScrollBarBGChart()
|
|
|
152359
152470
|
|
|
152360
152471
|
|
|
152361
152472
|
|
|
152362
|
-
var HQCHART_VERSION="1.1.
|
|
152473
|
+
var HQCHART_VERSION="1.1.14999";
|
|
152363
152474
|
|
|
152364
152475
|
function PrintHQChartVersion()
|
|
152365
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
|
//盘前数据
|
|
@@ -145925,7 +145945,7 @@ function ChartReport()
|
|
|
145925
145945
|
this.DrawItemBG(drawInfo);
|
|
145926
145946
|
|
|
145927
145947
|
if (column.Type==REPORT_COLUMN_ID.CUSTOM_STRING_TEXT_ID || this.IsReserveString(column.Type))
|
|
145928
|
-
this.
|
|
145948
|
+
this.DrawReserveString(drawInfo,column, x, top, textWidth);
|
|
145929
145949
|
else
|
|
145930
145950
|
this.DrawItemText(drawInfo.Text, drawInfo.TextColor, drawInfo.TextAlign, x, top, textWidth, drawInfo.BGColor);
|
|
145931
145951
|
}
|
|
@@ -146034,10 +146054,100 @@ function ChartReport()
|
|
|
146034
146054
|
return ARARY_TYPE.includes(value);
|
|
146035
146055
|
}
|
|
146036
146056
|
|
|
146037
|
-
|
|
146057
|
+
//AryText=[ { Text:, Color,}, .... ]
|
|
146058
|
+
this.DrawComplexText=function(drawInfo, column, left, top, cellWidth)
|
|
146059
|
+
{
|
|
146060
|
+
//计算大小
|
|
146061
|
+
var aryText=[];
|
|
146062
|
+
var textWidth=0;
|
|
146063
|
+
for(var i=0;i<drawInfo.AryText.length;++i)
|
|
146064
|
+
{
|
|
146065
|
+
var item=drawInfo.AryText[i];
|
|
146066
|
+
if (!item || !item.Text) continue;
|
|
146067
|
+
var itemWidth=this.Canvas.measureText(item.Text).width;
|
|
146068
|
+
|
|
146069
|
+
var newItem={ Text:item.Text, Margin:{ Left:0, Right:0 }, TextColor:drawInfo.TextColor };
|
|
146070
|
+
if (item.Color) newItem.TextColor=item.Color;
|
|
146071
|
+
if (item.Margin)
|
|
146072
|
+
{
|
|
146073
|
+
var margin=item.Margin;
|
|
146074
|
+
if (IFrameSplitOperator.IsNumber(margin.Left))
|
|
146075
|
+
{
|
|
146076
|
+
itemWidth+=margin.Left;
|
|
146077
|
+
newItem.Left=margin.Left;
|
|
146078
|
+
}
|
|
146079
|
+
if (IFrameSplitOperator.IsNumber(margin.Right))
|
|
146080
|
+
{
|
|
146081
|
+
itemWidth+=margin.Right;
|
|
146082
|
+
newItem.Right=margin.Right;;
|
|
146083
|
+
}
|
|
146084
|
+
}
|
|
146085
|
+
newItem.Width=itemWidth;
|
|
146086
|
+
|
|
146087
|
+
aryText.push(newItem)
|
|
146038
146088
|
|
|
146039
|
-
|
|
146089
|
+
textWidth+=itemWidth;
|
|
146090
|
+
}
|
|
146091
|
+
|
|
146092
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(aryText)) return;
|
|
146093
|
+
|
|
146094
|
+
var x=left;
|
|
146095
|
+
var y=top+this.RowHeight-this.ItemMergin.Bottom;
|
|
146096
|
+
if (drawInfo.TextAlign=='center')
|
|
146097
|
+
{
|
|
146098
|
+
x=left+cellWidth/2-textWidth/2;
|
|
146099
|
+
}
|
|
146100
|
+
else if (drawInfo.TextAlign=='right')
|
|
146101
|
+
{
|
|
146102
|
+
x=left+cellWidth-textWidth;
|
|
146103
|
+
}
|
|
146104
|
+
|
|
146105
|
+
var bClip=false;
|
|
146106
|
+
if (textWidth>=cellWidth) //长度超过单元格 裁剪
|
|
146107
|
+
{
|
|
146108
|
+
this.Canvas.save();
|
|
146109
|
+
bClip=true;
|
|
146110
|
+
|
|
146111
|
+
var rtCell={ Left:left, Top:top+this.ItemMergin.Top, Width:cellWidth, Height:this.RowHeight };
|
|
146112
|
+
this.Canvas.beginPath();
|
|
146113
|
+
this.Canvas.rect(rtCell.Left, rtCell.Top, rtCell.Width, rtCell.Height);
|
|
146114
|
+
//this.Canvas.stroke(); //调试用
|
|
146115
|
+
this.Canvas.clip();
|
|
146116
|
+
|
|
146117
|
+
//数据截断提示信息
|
|
146118
|
+
if (!drawInfo.Tooltip && drawInfo.Text)
|
|
146119
|
+
{
|
|
146120
|
+
drawInfo.Tooltip=
|
|
146121
|
+
{
|
|
146122
|
+
Type:1,
|
|
146123
|
+
Data:{ AryText:[ {Text:drawInfo.Text} ] }
|
|
146124
|
+
}
|
|
146125
|
+
}
|
|
146126
|
+
}
|
|
146127
|
+
|
|
146128
|
+
this.Canvas.textBaseline="bottom";
|
|
146129
|
+
this.Canvas.textAlign="left";
|
|
146130
|
+
for(var i=0;i<aryText.length;++i)
|
|
146131
|
+
{
|
|
146132
|
+
var item=aryText[i];
|
|
146133
|
+
this.Canvas.fillStyle=item.TextColor;
|
|
146134
|
+
|
|
146135
|
+
this.Canvas.fillText(item.Text,x+item.Margin.Left,y);
|
|
146136
|
+
x+=item.Width;
|
|
146137
|
+
}
|
|
146138
|
+
|
|
146139
|
+
|
|
146140
|
+
if (bClip) this.Canvas.restore();
|
|
146141
|
+
}
|
|
146142
|
+
|
|
146143
|
+
this.DrawReserveString=function(drawInfo, column, left, top, cellWidth)
|
|
146040
146144
|
{
|
|
146145
|
+
if (IFrameSplitOperator.IsNonEmptyArray(drawInfo.AryText))
|
|
146146
|
+
{
|
|
146147
|
+
this.DrawComplexText(drawInfo, column, left, top, cellWidth);
|
|
146148
|
+
return;
|
|
146149
|
+
}
|
|
146150
|
+
|
|
146041
146151
|
if (!drawInfo.Text) return;
|
|
146042
146152
|
|
|
146043
146153
|
var text=drawInfo.Text;
|
|
@@ -146462,6 +146572,7 @@ function ChartReport()
|
|
|
146462
146572
|
if (item.Text) drawInfo.Text=item.Text;
|
|
146463
146573
|
if (item.TextColor) drawInfo.TextColor=item.TextColor;
|
|
146464
146574
|
if (item.BGColor) drawInfo.BGColor=item.BGColor;
|
|
146575
|
+
if (IFrameSplitOperator.IsNonEmptyArray(item.AryText)) drawInfo.AryText=item.AryText;
|
|
146465
146576
|
|
|
146466
146577
|
if (item.Tooltip && IFrameSplitOperator.IsNonEmptyArray(item.Tooltip.AryText))
|
|
146467
146578
|
{
|
|
@@ -163738,7 +163849,7 @@ function HQChartScriptWorker()
|
|
|
163738
163849
|
|
|
163739
163850
|
|
|
163740
163851
|
|
|
163741
|
-
var HQCHART_VERSION="1.1.
|
|
163852
|
+
var HQCHART_VERSION="1.1.14999";
|
|
163742
163853
|
|
|
163743
163854
|
function PrintHQChartVersion()
|
|
163744
163855
|
{
|