hqchart 1.1.14608 → 1.1.14613
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/umychart.vue.js
CHANGED
|
@@ -12979,7 +12979,7 @@ this.ChartPaint=[];//图形画法
|
|
|
12979
12979
|
this.ChartSplashPaint=null;//等待提示
|
|
12980
12980
|
this.LoadDataSplashTitle="数据加载中";//下载数据提示信息
|
|
12981
12981
|
this.SplashTitle={StockList:"下载码表中.....",MemberList:"下载成分中....."};this.Canvas=uielement.getContext("2d");//画布
|
|
12982
|
-
this.
|
|
12982
|
+
this.Symbol;//板块代码
|
|
12983
12983
|
this.Name;//板块名称
|
|
12984
12984
|
this.NetworkFilter;//数据回调接口
|
|
12985
12985
|
this.Data={XOffset:0,YOffset:0,Data:[],Virtual:{Enable:false,Count:0}};//股票列表 (Virtual 虚拟表)
|
|
@@ -13214,13 +13214,11 @@ if(tooltipData){if(tooltipData.Type==20){if(tooltipData.Stock&&tooltipData.Stock
|
|
|
13214
13214
|
event.Callback(event,sendData,this);
|
|
13215
13215
|
}
|
|
13216
13216
|
*/if(mouseStatus)this.UIElement.style.cursor=mouseStatus.Cursor;if(bDraw||bDrawTab)this.Draw();if(this.LastMouseStatus.TooltipStatus){var xTooltip=e.clientX-this.UIElement.getBoundingClientRect().left;var yTooltip=e.clientY-this.UIElement.getBoundingClientRect().top;this.DrawFloatTooltip({X:xTooltip,Y:yTooltip,YMove:20/pixelTatio},this.LastMouseStatus.TooltipStatus.Data);}else{this.HideFloatTooltip();}if(!bShowKLineTooltip)this.HideKLineChartTooltip();if(!bShowMinuteTooltip)this.HideMinuteChartTooltip();if(bShowMinuteTooltip)this.ShowMinuteChartTooltip(null,null,chartTooltipData);if(bShowKLineTooltip)this.ShowKLineChartTooltip(null,null,chartTooltipData);};this.UIOnMounseOut=function(e){this.HideAllTooltip();var bDraw=false;var tabChart=this.GetTabChart();if(tabChart&&tabChart.MoveOnTabIndex>=0){tabChart.MoveOnTabIndex=-1;bDraw=true;this.Draw();}var scrollbar=this.GetVScrollbarChart();if(scrollbar.Enable){this.IsShowVScrollbar=false;if(!this.DragYScroll){if(scrollbar.LastStatus.Draw)bDraw=true;}}if(bDraw)this.Draw();};this.UIOnMouseleave=function(e){this.HideAllTooltip();var tabChart=this.GetTabChart();if(tabChart&&tabChart.MoveOnTabIndex>=0){tabChart.MoveOnTabIndex=-1;this.Draw();}};this.DocOnMouseMove=function(e){this.DragMove.PreMove.X=this.DragMove.Move.X;this.DragMove.PreMove.Y=this.DragMove.Move.Y;this.DragMove.Move.X=e.clientX;this.DragMove.Move.Y=e.clientX;if(this.DragMove.Move.X!=this.DragMove.PreMove.X||this.DragMove.Move.Y!=this.DragMove.PreMove.Y)this.StopAutoDragScrollTimer();if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;//JSConsole.Chart.Log(`[JSReportChartContainer::DocOnMouseMove] x=${x}, y=${y}`);
|
|
13217
|
-
if(this.DragRow){var drag=this.DragRow;var moveSetpY=drag.LastMove.Y-e.clientY;if(Math.abs(moveSetpY)<2)return;var reportChart=this.GetReportChart();drag.LastMove.X=e.clientX;drag.LastMove.Y=e.clientY;drag.Inside={X:x,Y:y};if(reportChart){var moveRow=reportChart.
|
|
13218
|
-
{if(this.DragHeader.ClickData.Header.IsFixed)return;if(!this.EnableDragHeader)return;var xMove=e.clientX-this.DragHeader.Click.X;var yMove=e.clientY-this.DragHeader.Click.Y;if(Math.abs(yMove)<=1&&Math.abs(xMove)<=1)return;this.DragHeader.LastMove.X=e.clientX;this.DragHeader.LastMove.Y=e.clientY;if(!this.DragHeader.MovePoint){this.DragHeader.MovePoint={X:x,Y:y};}else{this.DragHeader.MovePoint.X=x;this.DragHeader.MovePoint.Y=y;}
|
|
13219
|
-
{var xMove=x-this.DragColumnWidth.ClickPoint.X;if(Math.abs(xMove)<1)return;var fixedWidth=this.DragColumnWidth.ColumnWidth+xMove;if(fixedWidth<=10)return;var index=this.DragColumnWidth.ClickData.Index;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_DRAG_COLUMN_WIDTH);if(event&&event.Callback){var sendData={Index:index,Width:fixedWidth,PreventDefault:false};if(this.DragColumnWidth&&this.DragColumnWidth.ClickData)sendData.Column=this.DragColumnWidth.ClickData.Column;event.Callback(event,sendData,this);if(sendData.PreventDefault)return;}this.SetColumnFixedWidth(index,fixedWidth);this.DragColumnWidth.LastPoint.X=x;this.DragColumnWidth.LastPoint.Y=y;}};this.SetColumnFixedWidth=function(index,width){var chart=this.ChartPaint[0];if(!chart)return;var item=chart.Column[index];if(!item)return;item.FixedWidth=width;this.SetSizeChange(true);this.Draw();};this.
|
|
13220
|
-
{var yHeader=this.DragHeader.ClickPoint.Y;var moveData=chart.OnMouseDown(x,yHeader,e);if(!moveData||!moveData.Header)return;if(moveData.Header.IsFixed)return;if(moveData.Header.Index==clickData.Header.Index)return;this.DragHeader.MoveToData=moveData;console.log('[JSReportChartContainer::OnMoveDragHeader] Click[Index='+clickData.Header.Index+', Title='+clickData.Header.Column.Title+'] => Move[Index='+moveData.Header.Index+', Title='+moveData.Header.Column.Title+']');}};this.ShowDragHeaderTooltip=function(x,y,e){if(!this.DragHeader)return;var drag=this.DragHeader;if(!drag.ClickData||!drag.MovePoint)return;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_DRAG_HEADER_TOOLTIP);if(event){var sendData={PreventDefault:false,e:e,X:x,Y:y,DragHeader:this.DragHeader,Tooltip:this.Tooltip};event.Callback(event,sendData,this);if(sendData.PreventDefault)return;}var title=drag.ClickData.Header.Column.Title;this.Tooltip.className='jchart-chartdrawsvg-tooltip';//ChartDrawSVG指标数据
|
|
13221
|
-
this.Tooltip.style.position="absolute";this.Tooltip.style.left=e.clientX+"px";this.Tooltip.style.top=e.clientY+"px";this.Tooltip.style.width=100+"px";this.Tooltip.style.height=null;this.Tooltip.innerHTML=title;this.Tooltip.style.display="block";};this.HideTooltip=function(){if(this.Tooltip.style.display!="none")this.Tooltip.style.display="none";};this.DocOnMouseUp=function(e){//清空事件
|
|
13217
|
+
if(this.DragRow){var drag=this.DragRow;var moveSetpY=drag.LastMove.Y-e.clientY;if(Math.abs(moveSetpY)<2)return;var reportChart=this.GetReportChart();drag.LastMove.X=e.clientX;drag.LastMove.Y=e.clientY;drag.Inside={X:x,Y:y};if(reportChart){var moveRow=reportChart.OnDragRow(x,y,e);if(moveRow){if(moveRow.Type==2){if(moveRow.Data.DataIndex!=drag.Data.Row.DataIndex){drag.MoveRow=moveRow;}}else if(moveRow.Type==7){var pageStatus=reportChart.GetCurrentPageStatus();if(!pageStatus.IsEnd){this.MoveYOffset(1,false);drag.MoveRow=null;this.EnablePageScroll=true;this.AutoScrollPage(2);}}else if(moveRow.Type==5){if(this.Data.YOffset>0){this.MoveYOffset(-1,false);drag.MoveRow=null;this.EnablePageScroll=true;this.AutoScrollPage(-2);}}}reportChart.DragRow=drag;}this.Draw();}else if(this.DragXScroll){var chart=this.ChartPaint[0];if(!chart||!chart.Tab)return;this.DragXScroll.LastMove.X=x;this.DragXScroll.LastMove.Y=y;var pos=chart.Tab.GetScrollPostionByPoint(x,y);if(this.SetXOffset(pos))this.Draw();}else if(this.DragYScroll){var chart=this.ChartPaint[0];if(!chart||!chart.VScrollbar)return;this.DragYScroll.LastMove.X=x;this.DragYScroll.LastMove.Y=y;var pos=chart.VScrollbar.GetScrollPostionByPoint(x,y);if(this.SetYOffset(pos)){this.Draw();this.DelayUpdateStockData();}}else if(this.DragHeader&&this.DragHeader.ClickData)//表头拖拽
|
|
13218
|
+
{if(this.DragHeader.ClickData.Header.IsFixed)return;if(!this.EnableDragHeader)return;var xMove=e.clientX-this.DragHeader.Click.X;var yMove=e.clientY-this.DragHeader.Click.Y;if(Math.abs(yMove)<=1&&Math.abs(xMove)<=1)return;var reportChart=this.GetReportChart();var clickData=this.DragHeader.ClickData;this.DragHeader.LastMove.X=e.clientX;this.DragHeader.LastMove.Y=e.clientY;if(!this.DragHeader.MovePoint){this.DragHeader.MovePoint={X:x,Y:y};}else{this.DragHeader.MovePoint.X=x;this.DragHeader.MovePoint.Y=y;}var moveData=reportChart.OnDragHeader(x,y,e);if(!moveData)return;if(moveData.Type!=1)return;if(moveData.Header.Index!=clickData.Header.Index){this.DragHeader.MoveToData=moveData;}reportChart.DragHeader=this.DragHeader;this.Draw();}else if(this.DragColumnWidth&&this.DragColumnWidth.ClickData)//列宽度拖拽
|
|
13219
|
+
{var xMove=x-this.DragColumnWidth.ClickPoint.X;if(Math.abs(xMove)<1)return;var fixedWidth=this.DragColumnWidth.ColumnWidth+xMove;if(fixedWidth<=10)return;var index=this.DragColumnWidth.ClickData.Index;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_DRAG_COLUMN_WIDTH);if(event&&event.Callback){var sendData={Index:index,Width:fixedWidth,PreventDefault:false};if(this.DragColumnWidth&&this.DragColumnWidth.ClickData)sendData.Column=this.DragColumnWidth.ClickData.Column;event.Callback(event,sendData,this);if(sendData.PreventDefault)return;}this.SetColumnFixedWidth(index,fixedWidth);this.DragColumnWidth.LastPoint.X=x;this.DragColumnWidth.LastPoint.Y=y;}};this.SetColumnFixedWidth=function(index,width){var chart=this.ChartPaint[0];if(!chart)return;var item=chart.Column[index];if(!item)return;item.FixedWidth=width;this.SetSizeChange(true);this.Draw();};this.DocOnMouseUp=function(e){//清空事件
|
|
13222
13220
|
document.onmousemove=null;document.onmouseup=null;this.StopAutoDragScrollTimer();this.HideAllTooltip();var reportChart=this.GetReportChart();var mouseStatus={Cursor:"default",Name:"Default"};;//鼠标状态
|
|
13223
|
-
var bRedraw=false;if(this.DragRow){if(reportChart){this.OnDragRow();reportChart.DragRow=null;}bRedraw=true;}var dragHeader=this.DragHeader;this.DragHeader=null;this.DragXScroll=null;if(this.DragYScroll){bRedraw=true;this.DragYScroll=null;}this.DragRow=null;this.DragMove=null;this.DragColumnWidth=null;if(bRedraw)this.Draw();if(dragHeader){var clickData=dragHeader.ClickData;var moveToData=dragHeader.MoveToData;if(clickData&&moveToData){this.SwapColumn(clickData.Header.Index,moveToData.Header.Index,{Redraw:true});}else{this.OnClickHeader(clickData,e);}}if(mouseStatus)this.UIElement.style.cursor=mouseStatus.Cursor;};this.OnDragRow=function(){if(!this.SourceData||!IFrameSplitOperator.IsNonEmptyArray(this.SourceData.Data))return;if(!this.DragRow||!this.DragRow.MoveRow)return;var drag=this.DragRow;var srcIndex=drag.Data.Row.DataIndex;var moveIndex=drag.MoveRow.Data.DataIndex;if(srcIndex==moveIndex||srcIndex<0||moveIndex<0)return;var data=this.SourceData.Data;if(srcIndex>=data.length||moveIndex>=data.length)return;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_DRAG_ROW);if(event){var sendData={Symbol:this.Symbol,Src:{Index:srcIndex,Symbol:data[srcIndex]},To:{Index:moveIndex,Symbol:data[moveIndex]},PreventDefault:false//PreventDefault 是否阻止内置的点击处理
|
|
13221
|
+
var bRedraw=false;if(this.DragRow){if(reportChart){this.OnDragRow();reportChart.DragRow=null;}bRedraw=true;}var dragHeader=this.DragHeader;this.DragHeader=null;this.DragXScroll=null;if(this.DragYScroll){bRedraw=true;this.DragYScroll=null;}this.DragRow=null;this.DragMove=null;this.DragColumnWidth=null;if(reportChart.DragHeader){bRedraw=true;reportChart.DragHeader=null;}if(bRedraw)this.Draw();if(dragHeader){var clickData=dragHeader.ClickData;var moveToData=dragHeader.MoveToData;if(clickData&&moveToData){this.SwapColumn(clickData.Header.Index,moveToData.Header.Index,{Redraw:true});}else{this.OnClickHeader(clickData,e);}}if(mouseStatus)this.UIElement.style.cursor=mouseStatus.Cursor;};this.OnDragRow=function(){if(!this.SourceData||!IFrameSplitOperator.IsNonEmptyArray(this.SourceData.Data))return;if(!this.DragRow||!this.DragRow.MoveRow)return;var drag=this.DragRow;var srcIndex=drag.Data.Row.DataIndex;var moveIndex=drag.MoveRow.Data.DataIndex;if(srcIndex==moveIndex||srcIndex<0||moveIndex<0)return;var data=this.SourceData.Data;if(srcIndex>=data.length||moveIndex>=data.length)return;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_DRAG_ROW);if(event){var sendData={Symbol:this.Symbol,Src:{Index:srcIndex,Symbol:data[srcIndex]},To:{Index:moveIndex,Symbol:data[moveIndex]},PreventDefault:false//PreventDefault 是否阻止内置的点击处理
|
|
13224
13222
|
};event.Callback(event,sendData,this);if(sendData.PreventDefault)return;}if(this.DragRowType==1){//原始数据交换顺序
|
|
13225
13223
|
var temp=data[srcIndex];data[srcIndex]=data[moveIndex];data[moveIndex]=temp;this.Data.Data=data.slice(0);}else{//插入模式
|
|
13226
13224
|
var srcItem=data[srcIndex];data.splice(srcIndex,1);data.splice(moveIndex,0,srcItem);this.Data.Data=data.slice(0);}//更新选中行
|
|
@@ -13378,6 +13376,7 @@ this.MultiSelectModel=0;//0=禁用 1=开启
|
|
|
13378
13376
|
this.MultiSelectedRow=[];//选中行
|
|
13379
13377
|
this.ShowSymbol=[];//显示的股票列表 { Index:序号(排序用), Symbol:股票代码 }
|
|
13380
13378
|
this.DragRow;//拖拽行
|
|
13379
|
+
this.DragHeader;//拖拽表头
|
|
13381
13380
|
this.Tab;this.VScrollbar;this.GlobalOption;this.TextOverflowStyle=0;//输出内容比单元格长度大 0=裁剪 1=输出"####"
|
|
13382
13381
|
//涨跌颜色
|
|
13383
13382
|
this.UpColor=g_JSChartResource.Report.UpTextColor;this.DownColor=g_JSChartResource.Report.DownTextColor;this.UnchagneColor=g_JSChartResource.Report.UnchagneTextColor;this.BorderColor=g_JSChartResource.Report.BorderColor;//边框线
|
|
@@ -13413,8 +13412,8 @@ this.ButtonRect=[];this.LastMouseStatus;this.ReloadResource=function(resource){t
|
|
|
13413
13412
|
this.SelectedColor=g_JSChartResource.Report.SelectedColor;//选中行
|
|
13414
13413
|
//表头配置
|
|
13415
13414
|
this.HeaderFontConfig={Size:g_JSChartResource.Report.Header.Font.Size,Name:g_JSChartResource.Report.Header.Font.Name};this.HeaderColor=g_JSChartResource.Report.Header.Color;this.HeaderMergin={Left:g_JSChartResource.Report.Header.Mergin.Left,Right:g_JSChartResource.Report.Header.Mergin.Right,Top:g_JSChartResource.Report.Header.Mergin.Top,Bottom:g_JSChartResource.Report.Header.Mergin.Bottom};//表格内容配置
|
|
13416
|
-
this.ItemFontConfig={Size:g_JSChartResource.Report.Item.Font.Size,Name:g_JSChartResource.Report.Item.Font.Name};this.ItemMergin={Left:g_JSChartResource.Report.Item.Mergin.Left,Right:g_JSChartResource.Report.Item.Mergin.Right,Top:g_JSChartResource.Report.Item.Mergin.Top,Bottom:g_JSChartResource.Report.Item.Mergin.Bottom};this.BarMergin={Top:g_JSChartResource.Report.Item.BarMergin.Top,Left:g_JSChartResource.Report.Item.BarMergin.Left,Right:g_JSChartResource.Report.Item.BarMergin.Right,Bottom:g_JSChartResource.Report.Item.BarMergin.Bottom};this.LimitBorderColor=g_JSChartResource.Report.LimitBorder.Color;this.LimitMergin={Top:g_JSChartResource.Report.LimitBorder.Mergin.Top,Left:g_JSChartResource.Report.LimitBorder.Mergin.Left,Right:g_JSChartResource.Report.LimitBorder.Mergin.Right,Bottom:g_JSChartResource.Report.LimitBorder.Mergin.Bottom
|
|
13417
|
-
|
|
13415
|
+
this.ItemFontConfig={Size:g_JSChartResource.Report.Item.Font.Size,Name:g_JSChartResource.Report.Item.Font.Name};this.ItemMergin={Left:g_JSChartResource.Report.Item.Mergin.Left,Right:g_JSChartResource.Report.Item.Mergin.Right,Top:g_JSChartResource.Report.Item.Mergin.Top,Bottom:g_JSChartResource.Report.Item.Mergin.Bottom};this.BarMergin={Top:g_JSChartResource.Report.Item.BarMergin.Top,Left:g_JSChartResource.Report.Item.BarMergin.Left,Right:g_JSChartResource.Report.Item.BarMergin.Right,Bottom:g_JSChartResource.Report.Item.BarMergin.Bottom};this.LimitBorderColor=g_JSChartResource.Report.LimitBorder.Color;this.LimitMergin={Top:g_JSChartResource.Report.LimitBorder.Mergin.Top,Left:g_JSChartResource.Report.LimitBorder.Mergin.Left,Right:g_JSChartResource.Report.LimitBorder.Mergin.Right,Bottom:g_JSChartResource.Report.LimitBorder.Mergin.Bottom};this.DragRowColor=g_JSChartResource.Report.DragRow.Color;this.DragRowTextColor=g_JSChartResource.Report.DragRow.TextColor;this.DragMoveRowColor=g_JSChartResource.Report.DragRow.MoveRowColor;this.DragSrcRowColor=g_JSChartResource.Report.DragRow.SrcRowColor;//排序图标
|
|
13416
|
+
this.SortConfig={Size:g_JSChartResource.Report.SortIcon.Size,Family:g_JSChartResource.Report.SortIcon.Family,Arrow:g_JSChartResource.Report.SortIcon.Arrow.slice(),Color:g_JSChartResource.Report.SortIcon.Color.slice(),Margin:{Left:g_JSChartResource.Report.SortIcon.Margin.Left,Bottom:g_JSChartResource.Report.SortIcon.Margin.Bottom}};for(var i=0;i<this.Column.length;++i){var item=this.Column[i];if(item.Type==REPORT_COLUMN_ID.INDEX_ID)item.TextColor=g_JSChartResource.Report.FieldColor.Index;else if(item.Type==REPORT_COLUMN_ID.SYMBOL_ID)item.TextColor=g_JSChartResource.Report.FieldColor.Symbol;else if(item.Type==REPORT_COLUMN_ID.NAME_ID)item.TextColor=g_JSChartResource.Report.FieldColor.Name;else if(item.Type==REPORT_COLUMN_ID.VOL_ID)item.TextColor=g_JSChartResource.Report.FieldColor.Vol;else if(item.Type==REPORT_COLUMN_ID.BUY_VOL_ID)item.TextColor=g_JSChartResource.Report.FieldColor.Vol;else if(item.Type==REPORT_COLUMN_ID.SELL_VOL_ID)item.TextColor=g_JSChartResource.Report.FieldColor.Vol;else if(item.Type==REPORT_COLUMN_ID.AMOUNT_ID)item.TextColor=g_JSChartResource.Report.FieldColor.Amount;else if(item.Type==REPORT_COLUMN_ID.VOL_IN_ID)item.TextColor=g_JSChartResource.Report.DownTextColor;else if(item.Type==REPORT_COLUMN_ID.VOL_OUT_ID)item.TextColor=g_JSChartResource.Report.UpTextColor;else item.TextColor=g_JSChartResource.Report.FieldColor.Text;}if(this.Tab)this.Tab.ReloadResource(resource);if(this.VScrollbar)this.VScrollbar.ReloadResource(resource);this.CheckBoxConfig=CloneData(g_JSChartResource.Report.CheckBox);this.LinkConfig=CloneData(g_JSChartResource.Report.Link);this.ProgressBarConfig=CloneData(g_JSChartResource.Report.ProgressBar);};this.CreateColumnItem=function(item){var colItem=this.GetDefaultColunm(item.Type);if(!colItem)return null;if(item.Title)colItem.Title=item.Title;if(IFrameSplitOperator.IsNonEmptyArray(item.AryTitle))colItem.AryTitle=item.AryTitle;if(item.TextAlign)colItem.TextAlign=item.TextAlign;if(item.TextColor)colItem.TextColor=item.TextColor;if(item.HeaderColor)colItem.HeaderColor=item.HeaderColor;if(item.MaxText)colItem.MaxText=item.MaxText;if(item.MaxText2)colItem.MaxText=item.MaxText2;if(IFrameSplitOperator.IsNumber(item.Space))colItem.Space=item.Space;if(item.ID)colItem.ID=item.ID;if(item.FullColBGColor)colItem.FullColBGColor=item.FullColBGColor;//整列背景色
|
|
13418
13417
|
if(item.HeaderBGColor)colItem.HeaderBGColor=item.HeaderBGColor;//表头背景色
|
|
13419
13418
|
if(IFrameSplitOperator.IsNumber(item.Sort))colItem.Sort=item.Sort;if(IFrameSplitOperator.IsNumber(item.FixedWidth))colItem.FixedWidth=item.FixedWidth;if(IFrameSplitOperator.IsBool(item.EnableDragWidth))colItem.EnableDragWidth=item.EnableDragWidth;if(IFrameSplitOperator.IsBool(item.IsDrawCallback))colItem.IsDrawCallback=item.IsDrawCallback;else colItem.IsDrawCallback=false;if(IFrameSplitOperator.IsNumber(item.FloatPrecision))colItem.FloatPrecision=item.FloatPrecision;//小数位数
|
|
13420
13419
|
if(IFrameSplitOperator.IsNumber(item.ColorType))colItem.ColorType=item.ColorType;//0=默认 1=(>0, =0, <0) 2=(>=0, <0)
|
|
@@ -13444,19 +13443,20 @@ if(IFrameSplitOperator.IsNumber(item.BlockIndex))colItem.BlockIndex=item.BlockIn
|
|
|
13444
13443
|
//{ Type:REPORT_COLUMN_ID.CENTER_BAR_ID, Title:"柱子2", TextAlign:"center", Width:null, TextColor:g_JSChartResource.DealList.FieldColor.BarTitle, MaxText:"888888" },
|
|
13445
13444
|
{Type:REPORT_COLUMN_ID.CUSTOM_STRING_TEXT_ID,Title:"自定义",TextAlign:"center",Width:null,TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"擎擎擎擎擎"},{Type:REPORT_COLUMN_ID.CUSTOM_NUMBER_TEXT_ID,Title:"自定义",TextAlign:"center",Width:null,TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"擎擎擎擎擎"},{Type:REPORT_COLUMN_ID.CUSTOM_DATETIME_TEXT_ID,Title:"自定义",TextAlign:"center",Width:null,TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"9999-99-99"},{Type:REPORT_COLUMN_ID.CUSTOM_ICON_ID,Title:" ",TextAlign:"left",FixedWidth:20,TextColor:g_JSChartResource.Report.FieldColor.Text},{Type:REPORT_COLUMN_ID.KLINE_ID,Title:"K线",TextAlign:"left",FixedWidth:50,TextColor:g_JSChartResource.Report.FieldColor.Text},{Type:REPORT_COLUMN_ID.TIME_ID,Title:"时间",TextAlign:"left",ValueType:0,TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"99:99:99.999"},{Type:REPORT_COLUMN_ID.DATE_ID,Title:"日期",TextAlign:"left",FormatType:0,TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"9999-99-99"},{Type:REPORT_COLUMN_ID.CHECKBOX_ID,Title:"",TextAlign:"center",FixedWidth:20*GetDevicePixelRatio()},{Type:REPORT_COLUMN_ID.CUSTOM_CHECKBOX_ID,Title:"",TextAlign:"center",FixedWidth:20*GetDevicePixelRatio()},{Type:REPORT_COLUMN_ID.CUSTOM_BUTTON_ID,Title:"",TextAlign:"center",FixedWidth:50*GetDevicePixelRatio()},{Type:REPORT_COLUMN_ID.CUSTOM_PROGRESS_ID,Title:"进度条",TextAlign:"center",FixedWidth:100*GetDevicePixelRatio()},{Type:REPORT_COLUMN_ID.CUSTOM_LINK_ID,Title:"链接地址",TextAlign:"center",MaxText:"擎擎擎擎擎"},{Type:REPORT_COLUMN_ID.FUTURES_POSITION_ID,Title:"持仓量",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Vol,Width:null,MaxText:"8888888"},{Type:REPORT_COLUMN_ID.FUTURES_CLOSE_ID,Title:"结算价",TextAlign:"right",Width:null,MaxText:"8888888"},{Type:REPORT_COLUMN_ID.FUTURES_YCLOSE_ID,Title:"昨结算价",TextAlign:"right",Width:null,MaxText:"8888888"},{Type:REPORT_COLUMN_ID.FUTURES_OPEN_POSITION_ID,Title:"开仓量",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Text,Width:null,MaxText:"8888888"},{Type:REPORT_COLUMN_ID.FUTURES_CLOSE_POSITION_ID,Title:"平仓量",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Text,Width:null,MaxText:"8888888"},{Type:REPORT_COLUMN_ID.RISING_SPEED_1M_ID,Title:"涨速%",TextAlign:"right",Width:null,MaxText:"-888.88"},{Type:REPORT_COLUMN_ID.RISING_SPEED_3M_ID,Title:"3分涨速%",TextAlign:"right",Width:null,MaxText:"-888.88"},{Type:REPORT_COLUMN_ID.RISING_SPEED_5M_ID,Title:"5分涨速%",TextAlign:"right",Width:null,MaxText:"-888.88"},{Type:REPORT_COLUMN_ID.RISING_SPEED_10M_ID,Title:"10分涨速%",TextAlign:"right",Width:null,MaxText:"-888.88"},{Type:REPORT_COLUMN_ID.RISING_SPEED_15M_ID,Title:"15分涨速%",TextAlign:"right",Width:null,MaxText:"-888.88"},//组合多行字段
|
|
13446
13445
|
{Type:REPORT_COLUMN_ID.MULTI_LINE_CONTAINER,Title:"涨幅",TextAlign:"right",MaxText:"1000.00%",AryField:[{Type:REPORT_COLUMN_ID.PRICE_ID},{Type:REPORT_COLUMN_ID.INCREASE_ID,DynamicFormat:"{Value}%"}]},{Type:REPORT_COLUMN_ID.RESERVE_NUMBER1_ID,Title:"数值1",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"9999.99",FloatPrecision:2},{Type:REPORT_COLUMN_ID.RESERVE_NUMBER2_ID,Title:"数值2",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"9999.99",FloatPrecision:2},{Type:REPORT_COLUMN_ID.RESERVE_NUMBER3_ID,Title:"数值3",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"9999.99",FloatPrecision:2},{Type:REPORT_COLUMN_ID.RESERVE_NUMBER4_ID,Title:"数值4",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"9999.99",FloatPrecision:2},{Type:REPORT_COLUMN_ID.RESERVE_NUMBER5_ID,Title:"数值5",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"9999.99",FloatPrecision:2},{Type:REPORT_COLUMN_ID.RESERVE_NUMBER6_ID,Title:"数值6",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"9999.99",FloatPrecision:2},{Type:REPORT_COLUMN_ID.RESERVE_NUMBER7_ID,Title:"数值7",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"9999.99",FloatPrecision:2},{Type:REPORT_COLUMN_ID.RESERVE_NUMBER8_ID,Title:"数值8",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"9999.99",FloatPrecision:2},{Type:REPORT_COLUMN_ID.RESERVE_NUMBER9_ID,Title:"数值9",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"9999.99",FloatPrecision:2},{Type:REPORT_COLUMN_ID.RESERVE_NUMBER10_ID,Title:"数值10",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"9999.99",FloatPrecision:2},{Type:REPORT_COLUMN_ID.RESERVE_STRING1_ID,Title:"文字1",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"擎擎擎擎擎擎"},{Type:REPORT_COLUMN_ID.RESERVE_STRING2_ID,Title:"文字2",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"擎擎擎擎擎擎"},{Type:REPORT_COLUMN_ID.RESERVE_STRING3_ID,Title:"文字3",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"擎擎擎擎擎擎"},{Type:REPORT_COLUMN_ID.RESERVE_STRING4_ID,Title:"文字4",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"擎擎擎擎擎擎"},{Type:REPORT_COLUMN_ID.RESERVE_STRING5_ID,Title:"文字5",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"擎擎擎擎擎擎"},{Type:REPORT_COLUMN_ID.RESERVE_STRING6_ID,Title:"文字6",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"擎擎擎擎擎擎"},{Type:REPORT_COLUMN_ID.RESERVE_STRING7_ID,Title:"文字7",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"擎擎擎擎擎擎"},{Type:REPORT_COLUMN_ID.RESERVE_STRING8_ID,Title:"文字8",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"擎擎擎擎擎擎"},{Type:REPORT_COLUMN_ID.RESERVE_STRING9_ID,Title:"文字9",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"擎擎擎擎擎擎"},{Type:REPORT_COLUMN_ID.RESERVE_STRING10_ID,Title:"文字10",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"擎擎擎擎擎擎"},{Type:REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR1_ID,Title:"进度条1",TextAlign:"center",FixedWidth:100*GetDevicePixelRatio()},{Type:REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR2_ID,Title:"进度条2",TextAlign:"center",FixedWidth:100*GetDevicePixelRatio()},{Type:REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR3_ID,Title:"进度条3",TextAlign:"center",FixedWidth:100*GetDevicePixelRatio()},{Type:REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR4_ID,Title:"进度条4",TextAlign:"center",FixedWidth:100*GetDevicePixelRatio()},{Type:REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR5_ID,Title:"进度条5",TextAlign:"center",FixedWidth:100*GetDevicePixelRatio()},{Type:REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR6_ID,Title:"进度条6",TextAlign:"center",FixedWidth:100*GetDevicePixelRatio()},{Type:REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR7_ID,Title:"进度条7",TextAlign:"center",FixedWidth:100*GetDevicePixelRatio()},{Type:REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR8_ID,Title:"进度条8",TextAlign:"center",FixedWidth:100*GetDevicePixelRatio()},{Type:REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR9_ID,Title:"进度条9",TextAlign:"center",FixedWidth:100*GetDevicePixelRatio()},{Type:REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR10_ID,Title:"进度条10",TextAlign:"center",FixedWidth:100*GetDevicePixelRatio()},{Type:REPORT_COLUMN_ID.RESERVE_BUTTON1_ID,Title:"按钮1",TextAlign:"center",FixedWidth:50*GetDevicePixelRatio()},{Type:REPORT_COLUMN_ID.RESERVE_BUTTON2_ID,Title:"按钮2",TextAlign:"center",FixedWidth:50*GetDevicePixelRatio()},{Type:REPORT_COLUMN_ID.RESERVE_BUTTON3_ID,Title:"按钮3",TextAlign:"center",FixedWidth:50*GetDevicePixelRatio()},{Type:REPORT_COLUMN_ID.RESERVE_BUTTON4_ID,Title:"按钮4",TextAlign:"center",FixedWidth:50*GetDevicePixelRatio()},{Type:REPORT_COLUMN_ID.RESERVE_BUTTON5_ID,Title:"按钮5",TextAlign:"center",FixedWidth:50*GetDevicePixelRatio()},{Type:REPORT_COLUMN_ID.RESERVE_BUTTON6_ID,Title:"按钮6",TextAlign:"center",FixedWidth:50*GetDevicePixelRatio()},{Type:REPORT_COLUMN_ID.RESERVE_BUTTON7_ID,Title:"按钮7",TextAlign:"center",FixedWidth:50*GetDevicePixelRatio()},{Type:REPORT_COLUMN_ID.RESERVE_BUTTON8_ID,Title:"按钮8",TextAlign:"center",FixedWidth:50*GetDevicePixelRatio()},{Type:REPORT_COLUMN_ID.RESERVE_BUTTON9_ID,Title:"按钮9",TextAlign:"center",FixedWidth:50*GetDevicePixelRatio()},{Type:REPORT_COLUMN_ID.RESERVE_BUTTON10_ID,Title:"按钮10",TextAlign:"center",FixedWidth:50*GetDevicePixelRatio()}];for(var i=0;i<DEFAULT_COLUMN.length;++i){var item=DEFAULT_COLUMN[i];if(item.Type==id)return item;}return null;};this.ClipClient=function(){this.Canvas.save();this.Canvas.beginPath();this.Canvas.rect(this.RectClient.Left,this.RectClient.Top,this.RectClient.Right-this.RectClient.Left,this.RectClient.Bottom-this.RectClient.Top);//this.Canvas.stroke(); //调试用
|
|
13447
|
-
this.Canvas.clip();};this.Draw=function(lastMouseStatus){this.ShowSymbol=[];this.TooltipRect=[];this.ButtonRect=[];this.DevicePixelRatio=GetDevicePixelRatio();this.LastMouseStatus=lastMouseStatus;if(this.GlobalOption)this.GlobalOption.FlashBGCount=0;if(this.SizeChange)this.CalculateSize();else this.UpdateCacheData();this.ClipClient();this.DrawHeader();this.DrawBody();this.Canvas.restore();if(this.Tab&&this.BottomToolbarHeight>0){var bottom=this.ChartBorder.GetBottom();this.Tab.DrawTab(this.RectClient.Left,bottom-this.BottomToolbarHeight,this.RectClient.Right,bottom);this.Tab.DrawScrollbar(this.RectClient.Left,bottom-this.BottomToolbarHeight,this.RectClient.Right,bottom);}this.ClipClient();this.DrawBorder();this.Canvas.restore();this.DrawDragRow();if(this.VScrollbar){var bottom=this.ChartBorder.GetBottom();this.VScrollbar.DrawScrollbar(this.RectClient.Left,this.RectClient.Top+this.HeaderHeight,this.RectClient.Right,bottom-this.BottomToolbarHeight-4);}this.LastMouseStatus=null;this.SizeChange=false;}
|
|
13446
|
+
this.Canvas.clip();};this.Draw=function(lastMouseStatus){this.ShowSymbol=[];this.TooltipRect=[];this.ButtonRect=[];this.DevicePixelRatio=GetDevicePixelRatio();this.LastMouseStatus=lastMouseStatus;if(this.GlobalOption)this.GlobalOption.FlashBGCount=0;if(this.SizeChange)this.CalculateSize();else this.UpdateCacheData();this.ClipClient();this.DrawDragHeaderBG();this.DrawHeader();this.DrawBody();this.Canvas.restore();if(this.Tab&&this.BottomToolbarHeight>0){var bottom=this.ChartBorder.GetBottom();this.Tab.DrawTab(this.RectClient.Left,bottom-this.BottomToolbarHeight,this.RectClient.Right,bottom);this.Tab.DrawScrollbar(this.RectClient.Left,bottom-this.BottomToolbarHeight,this.RectClient.Right,bottom);}this.ClipClient();this.DrawBorder();this.Canvas.restore();this.DrawDragRow();this.DrawDragHeader();if(this.VScrollbar){var bottom=this.ChartBorder.GetBottom();this.VScrollbar.DrawScrollbar(this.RectClient.Left,this.RectClient.Top+this.HeaderHeight,this.RectClient.Right,bottom-this.BottomToolbarHeight-4);}this.LastMouseStatus=null;this.SizeChange=false;};this.DrawDragHeaderBG=function(){if(!this.DragHeader)return;var left=this.RectClient.Left;var right=this.RectClient.Right;var top=this.RectClient.Top;var bottom=top+this.HeaderHeight+this.RowHeight*this.RowCount+this.FixedRowHeight*this.FixedRowCount;//竖线
|
|
13447
|
+
var columnLeft=left;for(var i=0;i<this.FixedColumn&&i<this.Column.length;++i){var item=this.Column[i];columnLeft+=item.Width;}for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i){var item=this.Column[i];if(this.DragHeader){if(this.DragHeader.ClickData){var clickData=this.DragHeader.ClickData;if(clickData.Header.Index==i){var rtBG={Left:columnLeft,Top:top,Bottom:bottom,Right:columnLeft+item.Width};rtBG.Width=rtBG.Right-rtBG.Left;rtBG.Height=rtBG.Bottom-rtBG.Top;this.Canvas.fillStyle=this.DragSrcRowColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}}if(this.DragHeader.MoveToData){var moveToData=this.DragHeader.MoveToData;if(moveToData.Header.Index==i){var rtBG={Left:columnLeft,Top:top,Bottom:bottom,Right:columnLeft+item.Width};rtBG.Width=rtBG.Right-rtBG.Left;rtBG.Height=rtBG.Bottom-rtBG.Top;this.Canvas.fillStyle=this.DragMoveRowColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}}}columnLeft+=item.Width;}};//更新缓存变量
|
|
13448
13448
|
this.UpdateCacheData=function(){this.RectClient.Left=this.ChartBorder.GetLeft();this.RectClient.Right=this.ChartBorder.GetRight();this.RectClient.Top=this.ChartBorder.GetTop();this.RectClient.Bottom=this.ChartBorder.GetBottom()-this.BottomToolbarHeight;};this.GetPageSize=function(recalculate)//recalculate 是否重新计算
|
|
13449
13449
|
{if(recalculate)this.CalculateSize();var size=this.RowCount;return size;};this.GetCurrentPageStatus=function()//{ Start:起始索引, End:结束索引(数据), PageSize:页面可以显示几条记录, IsEnd:是否是最后一页, IsSinglePage:是否只有一页数据}
|
|
13450
13450
|
{var result={Start:this.Data.YOffset,PageSize:this.RowCount,IsEnd:false,SelectedRow:this.SelectedRow,IsSinglePage:false,DataCount:0,MultiSelectModel:this.MultiSelectModel};if(this.MultiSelectModel==1){result.SelectedRow=-1;result.MultiSelectedRow=this.MultiSelectedRow.slice();result.MultiSelectedRow.sort(function(left,right){return left>right;});}if(IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)){result.End=this.Data.YOffset+this.RowCount-1;result.IsSinglePage=this.Data.Data.length<=this.RowCount;result.DataCount=this.Data.Data.length;if(result.End>=this.Data.Data.length-1)result.IsEnd=true;if(result.End>=this.Data.Data.length)result.End=this.Data.Data.length-1;}else{result.Start=0;result.End=0;result.IsEnd=true;result.IsSinglePage=true;}return result;};this.CalculateSize=function()//计算大小
|
|
13451
13451
|
{if(this.Tab&&this.Tab.IsShow){this.Tab.CalculateSize();this.BottomToolbarHeight=this.Tab.Height;}else{this.BottomToolbarHeight=0;}if(this.VScrollbar&&this.VScrollbar.Enable)this.VScrollbar.CalculateSize();this.UpdateCacheData();var pixelRatio=GetDevicePixelRatio();this.HeaderFont=this.HeaderFontConfig.Size*pixelRatio+'px '+this.HeaderFontConfig.Name;this.ItemFont=this.ItemFontConfig.Size*pixelRatio+'px '+this.ItemFontConfig.Name;this.ItemFixedFont=this.ItemFixedFontConfg.Size*pixelRatio+'px '+this.ItemFixedFontConfg.Name;this.ItemSymbolFont=this.ItemSymbolFontConfig.Size*pixelRatio+'px '+this.ItemSymbolFontConfig.Name;this.ItemNameFont=this.ItemNameFontConfg.Size*pixelRatio+'px '+this.ItemNameFontConfg.Name;this.NameSymbolFont.Symbol=this.NameSymbolV2Config.Symbol.Size*pixelRatio+'px '+this.NameSymbolV2Config.Symbol.Name;this.NameSymbolFont.Name=this.ItemSymbolFontConfig.Name.Size*pixelRatio+'px '+this.NameSymbolV2Config.Name.Name;this.ItemFontHeight=this.GetFontHeight(this.ItemFont,"擎");this.RowHeight=this.ItemFontHeight+this.ItemMergin.Top+this.ItemMergin.Bottom;this.ItemTextLines=1;this.FixedRowHeight=this.GetFontHeight(this.ItemFixedFont,"擎")+this.ItemMergin.Top+this.ItemMergin.Bottom;this.SortFont=this.SortConfig.Size*pixelRatio+'px '+this.SortConfig.Family;this.Canvas.font=this.ItemFont;var itemWidth=0;for(var i=0;i<this.Column.length;++i){var item=this.Column[i];if(item.Type==REPORT_COLUMN_ID.SYMBOL_NAME_ID){this.Canvas.font=this.ItemNameFont;var nameWidth=this.Canvas.measureText(item.MaxText).width;var nameHeight=this.GetFontHeight(this.ItemNameFont,"擎");this.ItemNameHeight=nameHeight;this.Canvas.font=this.ItemSymbolFont;var symbolWidth=this.Canvas.measureText(item.MaxText).width;var symboHeight=this.GetFontHeight(this.ItemSymbolFont,"擎");this.ItemSymbolHeight=symboHeight;this.Canvas.font=this.ItemFont;itemWidth=Math.max(nameWidth,symbolWidth);item.Width=itemWidth+4+this.ItemMergin.Left+this.ItemMergin.Right;var rowHeight=nameHeight+symboHeight+this.ItemMergin.Top+this.ItemMergin.Bottom;this.ItemTextLines=2;if(rowHeight>this.RowHeight)this.RowHeight=rowHeight;if(rowHeight>this.FixedRowHeight)this.FixedRowHeight=rowHeight;}else if(item.Type==REPORT_COLUMN_ID.MULTI_LINE_CONTAINER){if(IFrameSplitOperator.IsNumber(item.FixedWidth))itemWidth=item.FixedWidth;else itemWidth=this.Canvas.measureText(item.MaxText).width;item.Width=itemWidth+4+this.ItemMergin.Left+this.ItemMergin.Right;this.ItemTextLines=item.AryField.length;var rowHeight=this.ItemFontHeight*item.AryField.length+this.ItemMergin.Top+this.ItemMergin.Bottom;if(rowHeight>this.RowHeight)this.RowHeight=rowHeight;if(rowHeight>this.FixedRowHeight)this.FixedRowHeight=rowHeight;}else if(item.Type==REPORT_COLUMN_ID.SYMBOL_NAME_V2_ID)//单行显示
|
|
13452
|
-
{this.Canvas.font==this.NameSymbolFont.Name;var nameWidth=this.Canvas.measureText(item.MaxText).width;var nameHeight=this.GetFontHeight(this.ItemNameFont,"擎");this.Canvas.font==this.NameSymbolFont.Symbol;var symbolWidth=this.Canvas.measureText(item.MaxText2).width;var symboHeight=this.GetFontHeight(this.ItemSymbolFont,"擎");this.ItemNameHeight=Math.abs(nameHeight,symboHeight);var space=2;if(IFrameSplitOperator.IsNumber(item.Space))space=item.Space;itemWidth=nameWidth+symbolWidth+space;item.Width=itemWidth+4+this.ItemMergin.Left+this.ItemMergin.Right;}else{if(IFrameSplitOperator.IsNumber(item.FixedWidth))itemWidth=item.FixedWidth;else itemWidth=this.Canvas.measureText(item.MaxText).width;item.Width=itemWidth+4+this.ItemMergin.Left+this.ItemMergin.Right;}if(item.Icon&&item.Icon.Symbol){item.Width+=item.Icon.Size;if(item.Icon.Margin){var margin=item.Icon.Margin;if(IFrameSplitOperator.IsNumber(margin.Left))item.Width+=margin.Left;if(IFrameSplitOperator.IsNumber(margin.Right))item.Width+=margin.Right;}}}this.Canvas.font=this.HeaderFont;for(var i=0;i<this.Column.length;++i){var item=this.Column[i];if(!item.Title||item.Title.length<=0)continue;var text=item.Title;itemWidth=this.Canvas.measureText(text).width;if(item.Sort>0)itemWidth
|
|
13453
|
-
{this.HeaderHeight=this.HeaderFontHeight+(this.HeaderMergin.Top+this.HeaderMergin.Bottom);}else{this.HeaderHeight=this.HeaderFontHeight*this.HeaderRowCount+(this.HeaderMergin.Top+this.HeaderMergin.Bottom);}if(!this.IsShowHeader)this.HeaderHeight=0;if(this.FixedRowCount<=0)this.FixedRowHeight=0;this.RowCount=parseInt((this.RectClient.Bottom-this.RectClient.Top-this.HeaderHeight-this.FixedRowHeight*this.FixedRowCount)/this.RowHeight);var subWidth=0;var reportWidth=this.RectClient.Right-this.RectClient.Left;for(var i=0;i<this.Column.length;++i){var item=this.Column[i];subWidth+=item.Width;}this.IsShowAllColumn=subWidth<reportWidth;};this.DrawHeaderItem=function(column,rtCell,index){if(column.HeaderBGColor)//背景色
|
|
13452
|
+
{this.Canvas.font==this.NameSymbolFont.Name;var nameWidth=this.Canvas.measureText(item.MaxText).width;var nameHeight=this.GetFontHeight(this.ItemNameFont,"擎");this.Canvas.font==this.NameSymbolFont.Symbol;var symbolWidth=this.Canvas.measureText(item.MaxText2).width;var symboHeight=this.GetFontHeight(this.ItemSymbolFont,"擎");this.ItemNameHeight=Math.abs(nameHeight,symboHeight);var space=2;if(IFrameSplitOperator.IsNumber(item.Space))space=item.Space;itemWidth=nameWidth+symbolWidth+space;item.Width=itemWidth+4+this.ItemMergin.Left+this.ItemMergin.Right;}else{if(IFrameSplitOperator.IsNumber(item.FixedWidth))itemWidth=item.FixedWidth;else itemWidth=this.Canvas.measureText(item.MaxText).width;item.Width=itemWidth+4+this.ItemMergin.Left+this.ItemMergin.Right;}if(item.Icon&&item.Icon.Symbol){item.Width+=item.Icon.Size;if(item.Icon.Margin){var margin=item.Icon.Margin;if(IFrameSplitOperator.IsNumber(margin.Left))item.Width+=margin.Left;if(IFrameSplitOperator.IsNumber(margin.Right))item.Width+=margin.Right;}}}this.Canvas.font=this.HeaderFont;for(var i=0;i<this.Column.length;++i){var item=this.Column[i];if(!item.Title||item.Title.length<=0)continue;var text=item.Title;itemWidth=this.Canvas.measureText(text).width;if(item.Sort>0)itemWidth+=this.SortConfig.Size*pixelRatio;itemWidth+=4+this.HeaderMergin.Left+this.HeaderMergin.Right;if(item.Width<itemWidth)item.Width=itemWidth;}this.HeaderFontHeight=this.GetFontHeight(this.HeaderFont,"擎");if(this.HeaderRowCount<=1)//单行
|
|
13453
|
+
{this.HeaderHeight=this.HeaderFontHeight+(this.HeaderMergin.Top+this.HeaderMergin.Bottom);}else{this.HeaderHeight=this.HeaderFontHeight*this.HeaderRowCount+(this.HeaderMergin.Top+this.HeaderMergin.Bottom);}if(!this.IsShowHeader)this.HeaderHeight=0;if(this.FixedRowCount<=0)this.FixedRowHeight=0;this.RowCount=parseInt((this.RectClient.Bottom-this.RectClient.Top-this.HeaderHeight-this.FixedRowHeight*this.FixedRowCount)/this.RowHeight);var subWidth=0;var reportWidth=this.RectClient.Right-this.RectClient.Left;for(var i=0;i<this.Column.length;++i){var item=this.Column[i];subWidth+=item.Width;}this.IsShowAllColumn=subWidth<reportWidth;};this.DrawHeaderItem=function(column,rtCell,index,option){if(column.HeaderBGColor)//背景色
|
|
13454
13454
|
{this.DrawItemBG({Rect:rtCell,BGColor:column.HeaderBGColor});}var textWidth=rtCell.Width-this.HeaderMergin.Left-this.HeaderMergin.Right;//AryText=[ { Text:标题, Sort:{Type:排序}, Icon:图标 }]
|
|
13455
13455
|
var drawInfo={Rect:rtCell,AryText:[{Text:null}],YText:rtCell.Bottom-this.HeaderMergin.Bottom,Index:index,TextWidth:textWidth};if(this.HeaderRowCount>1)//多行
|
|
13456
13456
|
{if(IFrameSplitOperator.IsNonEmptyArray(column.AryTitle)){drawInfo.AryText=[];for(var i=0;i<column.AryTitle.length&&i<this.HeaderRowCount;++i){var text=column.AryTitle[i];drawInfo.AryText.push({Text:text});}drawInfo.YText-=(this.HeaderRowCount-1)*this.HeaderFontHeight;}else{if(column.Title)drawInfo.AryText[0].Text=column.Title;drawInfo.YText=rtCell.Bottom-this.HeaderMergin.Bottom-this.HeaderRowCount*this.HeaderFontHeight/2+this.HeaderFontHeight/2;}}else//单行
|
|
13457
13457
|
{if(column.Title)drawInfo.AryText[0].Text=column.Title;}var lastItem=drawInfo.AryText[drawInfo.AryText.length-1];//排序
|
|
13458
13458
|
var bDrawSortBG=this.IsDrawSortBGIcon();if(this.SortInfo&&this.SortInfo.Field==index&&this.SortInfo.Sort>0)lastItem.Sort={Type:this.SortInfo.Sort};else if(column.Sort>0&&bDrawSortBG&&IFrameSplitOperator.IsNonEmptyArray(column.SortType)&&column.SortType.length>=2)lastItem.Sort={Type:0};//图标
|
|
13459
|
-
if(column.Icon)lastItem.Icon=column.Icon;this.DrawHeaderText(column,drawInfo);};this.DrawHeaderText=function(column,drawInfo){if(column.HeaderColor)this.Canvas.fillStyle=column.HeaderColor;else this.Canvas.fillStyle=this.HeaderColor;var pixelRatio=GetDevicePixelRatio();var cellWidth=drawInfo.Rect.Width;var bDrawSortBG=this.IsDrawSortBGIcon();var y=drawInfo.YText;for(var i=0;i<drawInfo.AryText.length;++i){var x=drawInfo.Rect.Left+this.HeaderMergin.Left;var item=drawInfo.AryText[i];var textSize={TextMaxWidth:drawInfo.TextWidth};var iconWidth=0;if(item.Icon&&item.Icon.Symbol)//图标
|
|
13459
|
+
if(column.Icon)lastItem.Icon=column.Icon;if(option){if(option.HeaderColor)drawInfo.HeaderColor=option.HeaderColor;}this.DrawHeaderText(column,drawInfo);};this.DrawHeaderText=function(column,drawInfo){if(drawInfo.HeaderColor)this.Canvas.fillStyle=drawInfo.HeaderColor;else if(column.HeaderColor)this.Canvas.fillStyle=column.HeaderColor;else this.Canvas.fillStyle=this.HeaderColor;var pixelRatio=GetDevicePixelRatio();var cellWidth=drawInfo.Rect.Width;var bDrawSortBG=this.IsDrawSortBGIcon();var y=drawInfo.YText;for(var i=0;i<drawInfo.AryText.length;++i){var x=drawInfo.Rect.Left+this.HeaderMergin.Left;var item=drawInfo.AryText[i];var textSize={TextMaxWidth:drawInfo.TextWidth};var iconWidth=0;if(item.Icon&&item.Icon.Symbol)//图标
|
|
13460
13460
|
{var iconWidth=item.Icon.Size;if(item.Icon.Margin){var margin=item.Icon.Margin;if(IFrameSplitOperator.IsNumber(margin.Left))iconWidth+=margin.Left;if(IFrameSplitOperator.IsNumber(margin.Right))iconWidth+=margin.Right;}}if(iconWidth>0)textSize.TextMaxWidth-=iconWidth;var sortWidth=0;//排序图标
|
|
13461
13461
|
if(item.Sort&&this.SortConfig&&IFrameSplitOperator.IsPlusNumber(this.SortConfig.Size)){sortWidth=this.SortConfig.Size*pixelRatio;if(this.SortConfig.Margin){var margin=this.SortConfig.Margin;if(IFrameSplitOperator.IsNumber(margin.Left))sortWidth+=margin.Left;if(IFrameSplitOperator.IsNumber(margin.Right))sortWidth+=margin.Right;}}if(sortWidth>0)textSize.TextMaxWidth-=sortWidth;var textWidth=0;if(item.Text){this.Canvas.font=this.HeaderFont;textWidth=this.Canvas.measureText(item.Text).width;}if(column.TextAlign=='center')x=x+(cellWidth-textWidth)/2;else if(column.TextAlign=='right')x=x+textSize.TextMaxWidth-textWidth;if(item.Text)//文字
|
|
13462
13462
|
{this.Canvas.fillText(item.Text,x,y);x+=textWidth;}if(sortWidth>1)//排序
|
|
@@ -13544,14 +13544,18 @@ this.GetNameColor=function(colunmInfo,symbol,rowType){var event=this.GetEventCal
|
|
|
13544
13544
|
{this.OnShiftClickRow(row);}else{if(this.MultiSelectedRow.length==1&&this.MultiSelectedRow[0]==row.DataIndex)bRedraw=false;else this.MultiSelectedRow=[row.DataIndex];}this.SelectedFixedRow=-1;}else{if(this.SelectedModel==0){if(this.SelectedRow==row.Index)bRedraw=false;this.SelectedRow=row.Index;this.SelectedFixedRow=-1;}else{if(this.SelectedRow==row.DataIndex)bRedraw=false;this.SelectedRow=row.DataIndex;this.SelectedFixedRow=-1;}}var eventID=JSCHART_EVENT_ID.ON_CLICK_REPORT_ROW;if(e.button==2)eventID=JSCHART_EVENT_ID.ON_RCLICK_REPORT_ROW;this.SendClickEvent(eventID,{Data:row,X:x,Y:y,e:e,Inside:insidePoint,UIElement:uiElement});return{Type:2,Redraw:bRedraw||btnStatus.Redraw,Row:row};//行
|
|
13545
13545
|
}var header=this.PtInHeader(x,y);if(header){var eventID=JSCHART_EVENT_ID.ON_CLICK_REPORT_HEADER;if(e.button==2){eventID=JSCHART_EVENT_ID.ON_RCLICK_REPORT_HEADER;}else if(e.button==0){eventID=JSCHART_EVENT_ID.ON_CLICK_REPORT_HEADER;}this.SendClickEvent(eventID,{Data:row,X:x,Y:y,e:e,Inside:insidePoint,UIElement:uiElement});return{Type:3,Redraw:bRedraw,Header:header};//表头
|
|
13546
13546
|
}return null;};this.OnShiftClickRow=function(row){if(this.MultiSelectedRow.length<=0){this.MultiSelectedRow.push(row.DataIndex);return;}var max=null,min=null;for(var i=0;i<this.MultiSelectedRow.length;++i){var value=this.MultiSelectedRow[i];if(max==null||max<value)max=value;if(min==null||min>value)min=value;if(value==row.DataIndex)//移除
|
|
13547
|
-
{this.MultiSelectedRow.splice(i,1);return;}}if(max==min){var start=row.DataIndex,end=max;if(start>end){start=max;end=row.DataIndex;}this.MultiSelectedRow=[];for(var i=start;i<=end;++i){this.MultiSelectedRow.push(i);}}else{if(row.DataIndex<=max&&row.DataIndex>=min){this.MultiSelectedRow.push(row.DataIndex);}else{var start=Math.min(row.DataIndex,min);var end=Math.max(row.DataIndex,max);this.MultiSelectedRow=[];for(var i=start;i<=end;++i){this.MultiSelectedRow.push(i);}}}};this.
|
|
13548
|
-
{if(!this.Data)return null;if(!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return null;var topOffset=this.RowHeight/2;var top=this.RectClient.Top+this.HeaderHeight;var right=this.ChartBorder.GetChartWidth();var textTop=top+this.FixedRowHeight*this.FixedRowCount;if(y<textTop+topOffset)return{Type:5};for(var i=this.Data.YOffset,j=0;i<this.Data.Data.length&&j<this.RowCount;++i,++j){var symbol=this.Data.Data[i];var rtRow={Left:0,Top:textTop,Right:right,Bottom:textTop+this.RowHeight};rtRow.Top+=topOffset;rtRow.Bottom+=topOffset;if(x>=rtRow.Left&&x<=rtRow.Right&&y>=rtRow.Top&&y<=rtRow.Bottom){var data={DataIndex:i,Index:j,Symbol:symbol,Pos:0};if(j==0)data.Pos=1;else if(j==this.RowCount-1)data.Pos=2;return{Type:2,Data:data};}textTop+=this.RowHeight;}if(j<this.RowCount)return{Type:6};return{Type:7};};this.
|
|
13547
|
+
{this.MultiSelectedRow.splice(i,1);return;}}if(max==min){var start=row.DataIndex,end=max;if(start>end){start=max;end=row.DataIndex;}this.MultiSelectedRow=[];for(var i=start;i<=end;++i){this.MultiSelectedRow.push(i);}}else{if(row.DataIndex<=max&&row.DataIndex>=min){this.MultiSelectedRow.push(row.DataIndex);}else{var start=Math.min(row.DataIndex,min);var end=Math.max(row.DataIndex,max);this.MultiSelectedRow=[];for(var i=start;i<=end;++i){this.MultiSelectedRow.push(i);}}}};this.OnDragRow=function(x,y,e)//Type: 5=顶部 6=空白行 2=行 7=底部
|
|
13548
|
+
{if(!this.Data)return null;if(!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return null;var topOffset=this.RowHeight/2;var top=this.RectClient.Top+this.HeaderHeight;var right=this.ChartBorder.GetChartWidth();var textTop=top+this.FixedRowHeight*this.FixedRowCount;if(y<textTop+topOffset)return{Type:5};for(var i=this.Data.YOffset,j=0;i<this.Data.Data.length&&j<this.RowCount;++i,++j){var symbol=this.Data.Data[i];var rtRow={Left:0,Top:textTop,Right:right,Bottom:textTop+this.RowHeight};rtRow.Top+=topOffset;rtRow.Bottom+=topOffset;if(x>=rtRow.Left&&x<=rtRow.Right&&y>=rtRow.Top&&y<=rtRow.Bottom){var data={DataIndex:i,Index:j,Symbol:symbol,Pos:0};if(j==0)data.Pos=1;else if(j==this.RowCount-1)data.Pos=2;return{Type:2,Data:data};}textTop+=this.RowHeight;}if(j<this.RowCount)return{Type:6};return{Type:7};};this.OnDragHeader=function(x,y,e)//Type:1=行 2=左边 3=右边 4=空白 5=固定行
|
|
13549
|
+
{if(!this.IsShowHeader)return null;var left=this.RectClient.Left;var right=this.RectClient.Right;var top=this.RectClient.Top;var bottom=top+this.HeaderHeight;if(x<left)return{Type:2};else if(x>right)return{Type:3};var cell=this.PtInItem(x,top+2,top,bottom);if(!cell)return{Type:4};if(cell.IsFixed)return{Type:5};return{Type:1,Header:cell};};this.OnClickButton=function(x,y,e,status){if(e.button!=0)return false;var buttonData=this.GetButtonData(x,y);if(!buttonData)return true;if(buttonData.Type===0)//checkbox
|
|
13549
13550
|
{var sendData={Column:buttonData.Column,Index:buttonData.Index,Stock:buttonData.Stock,ColumnIndex:buttonData.ColumnIndex,Data:buttonData.Data,Value:true,PreventDefault:false};if(IFrameSplitOperator.IsBool(buttonData.Data.Checked))sendData.Value=!buttonData.Data.Checked;this.SendClickEvent(JSCHART_EVENT_ID.ON_CLICK_REPORT_CHECKBOX,sendData);if(!sendData.PreventDefault){if(IFrameSplitOperator.IsBool(buttonData.Data.Checked))buttonData.Data.Checked=!buttonData.Data.Checked;else buttonData.Data.Checked=true;}status.Redraw=true;return true;}else if(buttonData.Type===1)//button
|
|
13550
13551
|
{var sendData={Column:buttonData.Column,Index:buttonData.Index,Stock:buttonData.Stock,ColumnIndex:buttonData.ColumnIndex,Data:buttonData.Data};this.SendClickEvent(JSCHART_EVENT_ID.ON_CLICK_REPORT_BUTTON,sendData);status.Redraw=true;return true;}else if(buttonData.Type===2)//link
|
|
13551
13552
|
{var sendData={Column:buttonData.Column,Index:buttonData.Index,Stock:buttonData.Stock,ColumnIndex:buttonData.ColumnIndex,Data:buttonData.Data};this.SendClickEvent(JSCHART_EVENT_ID.ON_CLICK_REPORT_LINK,sendData);status.Redraw=true;return true;}return false;};this.OnDblClick=function(x,y,e){if(!this.Data)return false;var header=this.PtInHeaderDragBorder(x,y);if(header){this.SendClickEvent(JSCHART_EVENT_ID.ON_DBCLICK_REPORT_DRAG_COLUMN_WIDTH,{Data:header,X:x,Y:y});return true;}var row=this.PtInBody(x,y);if(row){this.SendClickEvent(JSCHART_EVENT_ID.ON_DBCLICK_REPORT_ROW,{Data:row,X:x,Y:y});return true;}return false;};this.PtInClient=function(x,y){if(x>this.RectClient.Left&&x<this.RectClient.Right&&y>this.RectClient.Top&&y<this.RectClient.Bottom)return true;return false;};this.PtInBody=function(x,y){if(!this.Data)return null;if(!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return null;var top=this.RectClient.Top+this.HeaderHeight;var left=this.RectClient.Left;var right=this.RectClient.Right;var rowWidth=this.RectClient.Right-this.RectClient.Left;var textTop=top+this.FixedRowHeight*this.FixedRowCount;for(var i=this.Data.YOffset,j=0;i<this.Data.Data.length&&j<this.RowCount;++i,++j){var symbol=this.Data.Data[i];var rtRow={Left:left,Top:textTop,Right:right,Bottom:textTop+this.RowHeight};if(x>=rtRow.Left&&x<=rtRow.Right&&y>=rtRow.Top&&y<=rtRow.Bottom){var data={Rect:rtRow,DataIndex:i,Index:j,Symbol:symbol};data.Item=this.PtInItem(x,y,rtRow.Top,rtRow.Bottom);return data;}textTop+=this.RowHeight;}return null;};this.PtInFixedBody=function(x,y){if(this.FixedRowCount<=0)return null;var top=this.RectClient.Top+this.HeaderHeight;var left=this.RectClient.Left;var right=this.RectClient.Right;var rowWidth=this.RectClient.Right-this.RectClient.Left;var textTop=top;for(var i=0;i<this.FixedRowCount;++i){var rtRow={Left:left,Top:textTop,Right:right,Bottom:textTop+this.FixedRowHeight};if(x>=rtRow.Left&&x<=rtRow.Right&&y>=rtRow.Top&&y<=rtRow.Bottom){var data={Rect:rtRow,Index:i};data.Item=this.PtInItem(x,y,rtRow.Top,rtRow.Bottom);return data;}textTop+=this.FixedRowHeight;}return null;};this.PtInItem=function(x,y,top,bottom){var left=this.RectClient.Left;var right=this.RectClient.Right;var textLeft=left;//固定列
|
|
13552
13553
|
for(var i=0;i<this.FixedColumn&&i<this.Column.length;++i){var item=this.Column[i];var header={Left:textLeft,Right:textLeft+item.Width,Top:top,Bottom:bottom};if(x>=header.Left&&x<=header.Right&&y>=header.Top&&y<=header.Bottom){return{Rect:header,Column:item,Index:i,IsFixed:true};}textLeft+=item.Width;}for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i){var item=this.Column[i];if(textLeft>=right)break;var header={Left:textLeft,Right:textLeft+item.Width,Top:top,Bottom:bottom};if(x>=header.Left&&x<=header.Right&&y>=header.Top&&y<=header.Bottom){return{Rect:header,Column:item,Index:i,IsFixed:false};}textLeft+=item.Width;}return null;};this.PtInHeader=function(x,y){if(!this.IsShowHeader)return null;var left=this.RectClient.Left;var right=this.RectClient.Right;var top=this.RectClient.Top;var bottom=top+this.HeaderHeight;if(!(x>=left&&x<=right&&y>=top&&y<=bottom))return null;return this.PtInItem(x,y,top,bottom);};this.IsPtInBody=function(x,y){var top=this.RectClient.Top+this.HeaderHeight;var left=this.RectClient.Left;var right=this.RectClient.Right;var bottom=this.RectClient.Bottom;if(x>=left&&x<=right&&y>=top&&y<=bottom)return true;return false;};this.IsPtInHeader=function(x,y){if(!this.IsShowHeader)return false;var left=this.RectClient.Left;var right=this.RectClient.Right;var top=this.RectClient.Top;var bottom=top+this.HeaderHeight;if(x>=left&&x<=right&&y>=top&&y<=bottom)return true;return false;};this.SendClickEvent=function(id,data){var event=this.GetEventCallback(id);if(event&&event.Callback){event.Callback(event,data,this);}};this.DrawDragRow=function(){if(!this.DragRow)return;var drag=this.DragRow;if(!drag.Data||!drag.Inside||!drag.Data.Row)return;var dataIndex=drag.Data.Row.DataIndex;if(!IFrameSplitOperator.IsNumber(dataIndex)||dataIndex<0)return;var textTop=drag.Inside.Y-this.RowHeight/2;var top=textTop;var left=this.RectClient.Left;var rowWidth=this.RectClient.Right-this.RectClient.Left;//背景
|
|
13553
13554
|
this.Canvas.fillStyle=this.DragRowColor;this.Canvas.fillRect(left,textTop,rowWidth,this.RowHeight);var symbol=this.Data.Data[dataIndex];var data={Symbol:symbol,Stock:null,Block:null};if(this.GetStockDataCallback)data.Stock=this.GetStockDataCallback(symbol);if(this.GetBlockDataCallback)data.Block=this.GetBlockDataCallback(symbol);data.Decimal=GetfloatPrecision(symbol);//小数位数
|
|
13554
|
-
var chartRight=this.RectClient.Right;this.Canvas.font=this.ItemFont;for(var i=0;i<this.FixedColumn&&i<this.Column.length;++i){var item=this.Column[i];this.DrawItem(dataIndex,data,item,left,top,3);left+=item.Width;if(left>=chartRight)break;}for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i){var item=this.Column[i];this.DrawItem(dataIndex,data,item,left,top,3);left+=item.Width;if(left>=chartRight)break;}};this.
|
|
13555
|
+
var chartRight=this.RectClient.Right;this.Canvas.font=this.ItemFont;for(var i=0;i<this.FixedColumn&&i<this.Column.length;++i){var item=this.Column[i];this.DrawItem(dataIndex,data,item,left,top,3);left+=item.Width;if(left>=chartRight)break;}for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i){var item=this.Column[i];this.DrawItem(dataIndex,data,item,left,top,3);left+=item.Width;if(left>=chartRight)break;}};this.DrawDragHeader=function(){if(!this.DragHeader)return;var drag=this.DragHeader;var clickData=drag.ClickData;var rtHeader=clickData.Header.Rect;var headerWidth=rtHeader.Right-rtHeader.Left;var rtRow={Left:drag.MovePoint.X-headerWidth/2,Top:this.RectClient.Top+this.HeaderHeight,Width:headerWidth};rtRow.Bottom=rtRow.Top+this.HeaderHeight+this.RowHeight*this.RowCount+this.FixedRowHeight*this.FixedRowCount;rtRow.Right=rtRow.Left+rtRow.Width;rtRow.Height=rtRow.Bottom-rtRow.Top;//背景
|
|
13556
|
+
this.Canvas.fillStyle=this.DragRowColor;this.Canvas.fillRect(rtRow.Left,rtRow.Top,rtRow.Width,rtRow.Height);//文字
|
|
13557
|
+
var cellHeader={Left:rtRow.Left,Top:rtRow.Top,Right:rtRow.Right,Width:rtRow.Width,Height:this.HeaderHeight};cellHeader.Bottom=cellHeader.Top+cellHeader.Height;this.DrawHeaderItem(clickData.Header.Column,cellHeader,clickData.Header.Index,{HeaderColor:this.DragRowTextColor});var textTop=cellHeader.Bottom+this.FixedRowHeight*this.FixedRowCount;this.Canvas.font=this.ItemFont;var dataCount=this.GetAllRowCount();for(var i=this.Data.YOffset,j=0;i<dataCount&&j<this.RowCount;++i,++j){var symbol=this.Data.Data[i];var data={Symbol:symbol,Stock:null,Block:null};if(this.GetStockDataCallback)data.Stock=this.GetStockDataCallback(symbol);if(this.GetBlockDataCallback)data.Block=this.GetBlockDataCallback(symbol);if(this.GetFlashBGDataCallback)data.FlashBG=this.GetFlashBGDataCallback(symbol,Date.now());data.Decimal=GetfloatPrecision(symbol);//小数位数
|
|
13558
|
+
var item=this.Column[clickData.Header.Index];this.DrawItem(i,data,item,cellHeader.Left,textTop,3);textTop+=this.RowHeight;}};this.GetTooltipData=function(x,y){if(!IFrameSplitOperator.IsNonEmptyArray(this.TooltipRect))return null;for(var i=0;i<this.TooltipRect.length;++i){var item=this.TooltipRect[i];var rt=item.Rect;if(!rt)continue;if(x>=rt.Left&&x<=rt.Right&&y>=rt.Top&&y<=rt.Bottom){return{Rect:item.Rect,Stock:item.Stock,Column:item.Column,Index:item.Index,Type:item.Type,Data:item.Data};}}return null;};this.GetButtonData=function(x,y){if(!IFrameSplitOperator.IsNonEmptyArray(this.ButtonRect))return null;for(var i=0;i<this.ButtonRect.length;++i){var item=this.ButtonRect[i];var rt=item.Rect;if(!rt)continue;if(x>=rt.Left&&x<=rt.Right&&y>=rt.Top&&y<=rt.Bottom){return{Rect:item.Rect,Stock:item.Stock,Column:item.Column,Index:item.Index,Type:item.Type,Data:item.Data,ColumnIndex:item.ColumnIndex};}}};this.PtInHeaderDragBorder=function(x,y){if(!this.IsShowHeader)return null;var left=this.RectClient.Left;var right=this.RectClient.Right;var top=this.RectClient.Top;var bottom=top+this.HeaderHeight;if(!(x>=left&&x<=right&&y>=top&&y<=bottom))return null;var textLeft=left;var dragBarWidth=5*GetDevicePixelRatio();//固定列
|
|
13555
13559
|
for(var i=0;i<this.FixedColumn&&i<this.Column.length;++i){var item=this.Column[i];if(item.EnableDragWidth===true){var header={Right:textLeft+item.Width,Top:top,Bottom:bottom};header.Left=header.Right-dragBarWidth;if(x>=header.Left&&x<=header.Right&&y>=header.Top&&y<=header.Bottom){return{Rect:header,Column:item,Index:i,IsFixed:true};}}textLeft+=item.Width;}for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i){var item=this.Column[i];if(textLeft>=right)break;if(item.EnableDragWidth===true){var header={Right:textLeft+item.Width,Top:top,Bottom:bottom};header.Left=header.Right-dragBarWidth;if(x>=header.Left&&x<=header.Right&&y>=header.Top&&y<=header.Bottom){return{Rect:header,Column:item,Index:i,IsFixed:false};}}textLeft+=item.Width;}return null;};//设置选中行 option={ Symbol:, AutoYScroll:true/false Y滚动条自定定位 }
|
|
13556
13560
|
this.SetSelectedRow=function(option){if(!option)return false;if(this.SelectedModel===0)return false;if(option.Symbol){var symbol=option.Symbol;var bFinder=false;for(var i=0;i<this.Data.Data.length;++i){var item=this.Data.Data[i];if(symbol==item){this.SelectedRow=i;bFinder=true;break;}}if(!bFinder)return false;if(option.AutoYScroll===true){this.UpdatePageYOffset({SelectedRow:this.SelectedRow});}return bFinder;}return false;};this.UpdatePageYOffset=function(option){if(!option)return;var selectedRow=option.SelectedRow;if(selectedRow<0)return;var pageStatus=this.GetCurrentPageStatus();if(pageStatus.IsSinglePage)return;if(selectedRow>=pageStatus.Start&&selectedRow<=pageStatus.End)return;this.Data.YOffset=selectedRow;//选中行不在当前屏 设置为第1行
|
|
13557
13561
|
};}//报价列表底部tab和横向滚动条
|
|
@@ -14849,7 +14853,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
14849
14853
|
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);};}/********************************************************************************
|
|
14850
14854
|
* 版本信息输出
|
|
14851
14855
|
*
|
|
14852
|
-
*/var HQCHART_VERSION="1.1.
|
|
14856
|
+
*/var HQCHART_VERSION="1.1.14612";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();//把给外界调用的方法暴露出来
|
|
14853
14857
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
14854
14858
|
// BaseIndex:BaseIndex,
|
|
14855
14859
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
|
@@ -416,14 +416,6 @@ function JSReportChartContainer(uielement)
|
|
|
416
416
|
|
|
417
417
|
this.Canvas=uielement.getContext("2d"); //画布
|
|
418
418
|
|
|
419
|
-
this.Tooltip=document.createElement("div");
|
|
420
|
-
this.Tooltip.className='jsreport-tooltip';
|
|
421
|
-
this.Tooltip.style.background=g_JSChartResource.TooltipBGColor;
|
|
422
|
-
this.Tooltip.style.opacity=g_JSChartResource.TooltipAlpha;
|
|
423
|
-
this.Tooltip.style["pointer-events"]="none";
|
|
424
|
-
this.Tooltip.id=Guid();
|
|
425
|
-
uielement.parentNode.appendChild(this.Tooltip);
|
|
426
|
-
|
|
427
419
|
this.Symbol; //板块代码
|
|
428
420
|
this.Name; //板块名称
|
|
429
421
|
this.NetworkFilter; //数据回调接口
|
|
@@ -2464,7 +2456,7 @@ function JSReportChartContainer(uielement)
|
|
|
2464
2456
|
|
|
2465
2457
|
if (reportChart)
|
|
2466
2458
|
{
|
|
2467
|
-
var moveRow=reportChart.
|
|
2459
|
+
var moveRow=reportChart.OnDragRow(x,y,e);
|
|
2468
2460
|
if (moveRow )
|
|
2469
2461
|
{
|
|
2470
2462
|
if (moveRow.Type==2)
|
|
@@ -2537,6 +2529,8 @@ function JSReportChartContainer(uielement)
|
|
|
2537
2529
|
var yMove=e.clientY-this.DragHeader.Click.Y;
|
|
2538
2530
|
if ( Math.abs(yMove)<=1 && Math.abs(xMove)<=1) return;
|
|
2539
2531
|
|
|
2532
|
+
var reportChart=this.GetReportChart();
|
|
2533
|
+
var clickData=this.DragHeader.ClickData;
|
|
2540
2534
|
this.DragHeader.LastMove.X=e.clientX;
|
|
2541
2535
|
this.DragHeader.LastMove.Y=e.clientY;
|
|
2542
2536
|
if (!this.DragHeader.MovePoint)
|
|
@@ -2549,8 +2543,17 @@ function JSReportChartContainer(uielement)
|
|
|
2549
2543
|
this.DragHeader.MovePoint.Y=y;
|
|
2550
2544
|
}
|
|
2551
2545
|
|
|
2552
|
-
|
|
2553
|
-
|
|
2546
|
+
var moveData=reportChart.OnDragHeader(x,y,e);
|
|
2547
|
+
if (!moveData) return;
|
|
2548
|
+
if (moveData.Type!=1) return;
|
|
2549
|
+
|
|
2550
|
+
if (moveData.Header.Index!=clickData.Header.Index)
|
|
2551
|
+
{
|
|
2552
|
+
this.DragHeader.MoveToData=moveData;
|
|
2553
|
+
}
|
|
2554
|
+
|
|
2555
|
+
reportChart.DragHeader=this.DragHeader;
|
|
2556
|
+
this.Draw();
|
|
2554
2557
|
}
|
|
2555
2558
|
else if (this.DragColumnWidth && this.DragColumnWidth.ClickData) //列宽度拖拽
|
|
2556
2559
|
{
|
|
@@ -2592,57 +2595,6 @@ function JSReportChartContainer(uielement)
|
|
|
2592
2595
|
this.Draw();
|
|
2593
2596
|
}
|
|
2594
2597
|
|
|
2595
|
-
this.OnMoveDragHeader=function(x, y,e)
|
|
2596
|
-
{
|
|
2597
|
-
var chart=this.ChartPaint[0];
|
|
2598
|
-
if (!chart) return;
|
|
2599
|
-
|
|
2600
|
-
var clickData=this.DragHeader.ClickData;
|
|
2601
|
-
this.DragHeader.MoveToData=null;
|
|
2602
|
-
|
|
2603
|
-
if (!clickData.Header.IsFixed) //固定列不能拖
|
|
2604
|
-
{
|
|
2605
|
-
var yHeader=this.DragHeader.ClickPoint.Y;
|
|
2606
|
-
var moveData=chart.OnMouseDown(x,yHeader,e);
|
|
2607
|
-
if (!moveData || !moveData.Header) return;
|
|
2608
|
-
if (moveData.Header.IsFixed) return;
|
|
2609
|
-
if (moveData.Header.Index== clickData.Header.Index) return;
|
|
2610
|
-
|
|
2611
|
-
this.DragHeader.MoveToData=moveData;
|
|
2612
|
-
console.log(`[JSReportChartContainer::OnMoveDragHeader] Click[Index=${clickData.Header.Index}, Title=${clickData.Header.Column.Title}] => Move[Index=${moveData.Header.Index}, Title=${moveData.Header.Column.Title}]`);
|
|
2613
|
-
}
|
|
2614
|
-
}
|
|
2615
|
-
|
|
2616
|
-
this.ShowDragHeaderTooltip=function(x,y,e)
|
|
2617
|
-
{
|
|
2618
|
-
if (!this.DragHeader) return;
|
|
2619
|
-
var drag=this.DragHeader;
|
|
2620
|
-
if (!drag.ClickData || !drag.MovePoint) return;
|
|
2621
|
-
|
|
2622
|
-
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_DRAG_HEADER_TOOLTIP);
|
|
2623
|
-
if (event)
|
|
2624
|
-
{
|
|
2625
|
-
var sendData={ PreventDefault:false, e, X:x, Y:y, DragHeader:this.DragHeader, Tooltip:this.Tooltip };
|
|
2626
|
-
event.Callback(event,sendData,this);
|
|
2627
|
-
if (sendData.PreventDefault) return;
|
|
2628
|
-
}
|
|
2629
|
-
|
|
2630
|
-
var title=drag.ClickData.Header.Column.Title;
|
|
2631
|
-
this.Tooltip.className='jchart-chartdrawsvg-tooltip'; //ChartDrawSVG指标数据
|
|
2632
|
-
this.Tooltip.style.position = "absolute";
|
|
2633
|
-
this.Tooltip.style.left = e.clientX + "px";
|
|
2634
|
-
this.Tooltip.style.top = e.clientY+ "px";
|
|
2635
|
-
this.Tooltip.style.width = 100+"px";
|
|
2636
|
-
this.Tooltip.style.height =null;
|
|
2637
|
-
this.Tooltip.innerHTML=title;
|
|
2638
|
-
this.Tooltip.style.display = "block";
|
|
2639
|
-
}
|
|
2640
|
-
|
|
2641
|
-
this.HideTooltip=function()
|
|
2642
|
-
{
|
|
2643
|
-
if (this.Tooltip.style.display!="none") this.Tooltip.style.display = "none";
|
|
2644
|
-
}
|
|
2645
|
-
|
|
2646
2598
|
this.DocOnMouseUp=function(e)
|
|
2647
2599
|
{
|
|
2648
2600
|
//清空事件
|
|
@@ -2679,6 +2631,12 @@ function JSReportChartContainer(uielement)
|
|
|
2679
2631
|
this.DragMove=null;
|
|
2680
2632
|
this.DragColumnWidth=null;
|
|
2681
2633
|
|
|
2634
|
+
if (reportChart.DragHeader)
|
|
2635
|
+
{
|
|
2636
|
+
bRedraw=true;
|
|
2637
|
+
reportChart.DragHeader=null;
|
|
2638
|
+
}
|
|
2639
|
+
|
|
2682
2640
|
if (bRedraw) this.Draw();
|
|
2683
2641
|
|
|
2684
2642
|
if (dragHeader)
|
|
@@ -4763,6 +4721,7 @@ function ChartReport()
|
|
|
4763
4721
|
|
|
4764
4722
|
this.ShowSymbol=[]; //显示的股票列表 { Index:序号(排序用), Symbol:股票代码 }
|
|
4765
4723
|
this.DragRow; //拖拽行
|
|
4724
|
+
this.DragHeader; //拖拽表头
|
|
4766
4725
|
|
|
4767
4726
|
this.Tab;
|
|
4768
4727
|
this.VScrollbar;
|
|
@@ -4970,6 +4929,11 @@ function ChartReport()
|
|
|
4970
4929
|
Bottom:g_JSChartResource.Report.LimitBorder.Mergin.Bottom
|
|
4971
4930
|
}
|
|
4972
4931
|
|
|
4932
|
+
this.DragRowColor=g_JSChartResource.Report.DragRow.Color;
|
|
4933
|
+
this.DragRowTextColor=g_JSChartResource.Report.DragRow.TextColor;
|
|
4934
|
+
this.DragMoveRowColor=g_JSChartResource.Report.DragRow.MoveRowColor;
|
|
4935
|
+
this.DragSrcRowColor=g_JSChartResource.Report.DragRow.SrcRowColor;
|
|
4936
|
+
|
|
4973
4937
|
//排序图标
|
|
4974
4938
|
this.SortConfig=
|
|
4975
4939
|
{
|
|
@@ -5389,6 +5353,7 @@ function ChartReport()
|
|
|
5389
5353
|
|
|
5390
5354
|
this.ClipClient();
|
|
5391
5355
|
|
|
5356
|
+
this.DrawDragHeaderBG();
|
|
5392
5357
|
this.DrawHeader();
|
|
5393
5358
|
this.DrawBody();
|
|
5394
5359
|
this.Canvas.restore();
|
|
@@ -5406,6 +5371,8 @@ function ChartReport()
|
|
|
5406
5371
|
|
|
5407
5372
|
this.DrawDragRow();
|
|
5408
5373
|
|
|
5374
|
+
this.DrawDragHeader();
|
|
5375
|
+
|
|
5409
5376
|
if (this.VScrollbar)
|
|
5410
5377
|
{
|
|
5411
5378
|
var bottom=this.ChartBorder.GetBottom();
|
|
@@ -5416,6 +5383,60 @@ function ChartReport()
|
|
|
5416
5383
|
this.SizeChange=false;
|
|
5417
5384
|
}
|
|
5418
5385
|
|
|
5386
|
+
this.DrawDragHeaderBG=function()
|
|
5387
|
+
{
|
|
5388
|
+
if (!this.DragHeader) return;
|
|
5389
|
+
|
|
5390
|
+
var left=this.RectClient.Left;
|
|
5391
|
+
var right=this.RectClient.Right;
|
|
5392
|
+
var top=this.RectClient.Top;
|
|
5393
|
+
var bottom=top+this.HeaderHeight+this.RowHeight*this.RowCount+this.FixedRowHeight*this.FixedRowCount;
|
|
5394
|
+
|
|
5395
|
+
//竖线
|
|
5396
|
+
var columnLeft=left;
|
|
5397
|
+
for(var i=0;i<this.FixedColumn && i<this.Column.length; ++i)
|
|
5398
|
+
{
|
|
5399
|
+
var item=this.Column[i];
|
|
5400
|
+
columnLeft+=item.Width;
|
|
5401
|
+
}
|
|
5402
|
+
|
|
5403
|
+
for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i)
|
|
5404
|
+
{
|
|
5405
|
+
var item=this.Column[i];
|
|
5406
|
+
|
|
5407
|
+
if (this.DragHeader)
|
|
5408
|
+
{
|
|
5409
|
+
if (this.DragHeader.ClickData)
|
|
5410
|
+
{
|
|
5411
|
+
var clickData=this.DragHeader.ClickData;
|
|
5412
|
+
if (clickData.Header.Index==i)
|
|
5413
|
+
{
|
|
5414
|
+
var rtBG={ Left:columnLeft,Top:top, Bottom:bottom, Right:columnLeft+item.Width };
|
|
5415
|
+
rtBG.Width=rtBG.Right-rtBG.Left;
|
|
5416
|
+
rtBG.Height=rtBG.Bottom-rtBG.Top;
|
|
5417
|
+
this.Canvas.fillStyle=this.DragSrcRowColor;
|
|
5418
|
+
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
5419
|
+
}
|
|
5420
|
+
}
|
|
5421
|
+
|
|
5422
|
+
if (this.DragHeader.MoveToData)
|
|
5423
|
+
{
|
|
5424
|
+
var moveToData=this.DragHeader.MoveToData;
|
|
5425
|
+
if (moveToData.Header.Index==i)
|
|
5426
|
+
{
|
|
5427
|
+
var rtBG={ Left:columnLeft,Top:top, Bottom:bottom, Right:columnLeft+item.Width };
|
|
5428
|
+
rtBG.Width=rtBG.Right-rtBG.Left;
|
|
5429
|
+
rtBG.Height=rtBG.Bottom-rtBG.Top;
|
|
5430
|
+
this.Canvas.fillStyle=this.DragMoveRowColor;
|
|
5431
|
+
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
5432
|
+
}
|
|
5433
|
+
}
|
|
5434
|
+
}
|
|
5435
|
+
|
|
5436
|
+
columnLeft+=item.Width;
|
|
5437
|
+
}
|
|
5438
|
+
}
|
|
5439
|
+
|
|
5419
5440
|
//更新缓存变量
|
|
5420
5441
|
this.UpdateCacheData=function()
|
|
5421
5442
|
{
|
|
@@ -5577,7 +5598,8 @@ function ChartReport()
|
|
|
5577
5598
|
if (!item.Title || item.Title.length<=0) continue;
|
|
5578
5599
|
var text=item.Title;
|
|
5579
5600
|
itemWidth=this.Canvas.measureText(text).width;
|
|
5580
|
-
if (item.Sort>0) itemWidth
|
|
5601
|
+
if (item.Sort>0) itemWidth+=this.SortConfig.Size*pixelRatio;
|
|
5602
|
+
|
|
5581
5603
|
itemWidth+=(4+this.HeaderMergin.Left+this.HeaderMergin.Right);
|
|
5582
5604
|
if (item.Width<itemWidth) item.Width=itemWidth;
|
|
5583
5605
|
}
|
|
@@ -5609,7 +5631,7 @@ function ChartReport()
|
|
|
5609
5631
|
this.IsShowAllColumn=(subWidth<reportWidth);
|
|
5610
5632
|
}
|
|
5611
5633
|
|
|
5612
|
-
this.DrawHeaderItem=function(column, rtCell, index)
|
|
5634
|
+
this.DrawHeaderItem=function(column, rtCell, index, option)
|
|
5613
5635
|
{
|
|
5614
5636
|
if (column.HeaderBGColor) //背景色
|
|
5615
5637
|
{
|
|
@@ -5653,12 +5675,18 @@ function ChartReport()
|
|
|
5653
5675
|
//图标
|
|
5654
5676
|
if (column.Icon) lastItem.Icon=column.Icon;
|
|
5655
5677
|
|
|
5678
|
+
if (option)
|
|
5679
|
+
{
|
|
5680
|
+
if (option.HeaderColor) drawInfo.HeaderColor=option.HeaderColor;
|
|
5681
|
+
}
|
|
5682
|
+
|
|
5656
5683
|
this.DrawHeaderText(column, drawInfo);
|
|
5657
5684
|
}
|
|
5658
5685
|
|
|
5659
5686
|
this.DrawHeaderText=function(column, drawInfo)
|
|
5660
5687
|
{
|
|
5661
|
-
if (
|
|
5688
|
+
if (drawInfo.HeaderColor) this.Canvas.fillStyle=drawInfo.HeaderColor;
|
|
5689
|
+
else if (column.HeaderColor) this.Canvas.fillStyle=column.HeaderColor;
|
|
5662
5690
|
else this.Canvas.fillStyle=this.HeaderColor;
|
|
5663
5691
|
|
|
5664
5692
|
var pixelRatio=GetDevicePixelRatio();
|
|
@@ -8365,7 +8393,7 @@ function ChartReport()
|
|
|
8365
8393
|
|
|
8366
8394
|
}
|
|
8367
8395
|
|
|
8368
|
-
this.
|
|
8396
|
+
this.OnDragRow=function(x, y, e) //Type: 5=顶部 6=空白行 2=行 7=底部
|
|
8369
8397
|
{
|
|
8370
8398
|
if (!this.Data) return null;
|
|
8371
8399
|
if (!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return null;
|
|
@@ -8401,6 +8429,26 @@ function ChartReport()
|
|
|
8401
8429
|
return { Type:7 };
|
|
8402
8430
|
}
|
|
8403
8431
|
|
|
8432
|
+
this.OnDragHeader=function(x,y,e) //Type:1=行 2=左边 3=右边 4=空白 5=固定行
|
|
8433
|
+
{
|
|
8434
|
+
if (!this.IsShowHeader) return null;
|
|
8435
|
+
|
|
8436
|
+
var left=this.RectClient.Left;
|
|
8437
|
+
var right=this.RectClient.Right;
|
|
8438
|
+
var top=this.RectClient.Top;
|
|
8439
|
+
var bottom=top+this.HeaderHeight;
|
|
8440
|
+
|
|
8441
|
+
if (x<left) return { Type:2 };
|
|
8442
|
+
else if (x>right) return { Type:3 };
|
|
8443
|
+
|
|
8444
|
+
var cell=this.PtInItem(x,top+2,top,bottom);
|
|
8445
|
+
if (!cell) return { Type:4 };
|
|
8446
|
+
|
|
8447
|
+
if (cell.IsFixed) return { Type:5 }
|
|
8448
|
+
|
|
8449
|
+
return { Type:1, Header:cell };
|
|
8450
|
+
}
|
|
8451
|
+
|
|
8404
8452
|
this.OnClickButton=function(x, y, e, status)
|
|
8405
8453
|
{
|
|
8406
8454
|
if (e.button!=0) return false;
|
|
@@ -8669,6 +8717,48 @@ function ChartReport()
|
|
|
8669
8717
|
|
|
8670
8718
|
}
|
|
8671
8719
|
|
|
8720
|
+
this.DrawDragHeader=function()
|
|
8721
|
+
{
|
|
8722
|
+
if (!this.DragHeader) return;
|
|
8723
|
+
var drag=this.DragHeader;
|
|
8724
|
+
var clickData=drag.ClickData;
|
|
8725
|
+
var rtHeader=clickData.Header.Rect;
|
|
8726
|
+
var headerWidth=rtHeader.Right-rtHeader.Left;
|
|
8727
|
+
|
|
8728
|
+
var rtRow={ Left:drag.MovePoint.X-headerWidth/2, Top:this.RectClient.Top+this.HeaderHeight, Width:headerWidth };
|
|
8729
|
+
rtRow.Bottom=rtRow.Top+this.HeaderHeight+this.RowHeight*this.RowCount+this.FixedRowHeight*this.FixedRowCount;
|
|
8730
|
+
rtRow.Right=rtRow.Left+rtRow.Width;
|
|
8731
|
+
rtRow.Height=rtRow.Bottom-rtRow.Top;
|
|
8732
|
+
|
|
8733
|
+
//背景
|
|
8734
|
+
this.Canvas.fillStyle=this.DragRowColor;
|
|
8735
|
+
this.Canvas.fillRect(rtRow.Left, rtRow.Top, rtRow.Width, rtRow.Height);
|
|
8736
|
+
|
|
8737
|
+
//文字
|
|
8738
|
+
var cellHeader={ Left:rtRow.Left, Top:rtRow.Top, Right:rtRow.Right, Width:rtRow.Width, Height:this.HeaderHeight };
|
|
8739
|
+
cellHeader.Bottom=cellHeader.Top+cellHeader.Height;
|
|
8740
|
+
this.DrawHeaderItem(clickData.Header.Column, cellHeader, clickData.Header.Index, { HeaderColor:this.DragRowTextColor });
|
|
8741
|
+
|
|
8742
|
+
var textTop=cellHeader.Bottom+this.FixedRowHeight*this.FixedRowCount;
|
|
8743
|
+
this.Canvas.font=this.ItemFont;
|
|
8744
|
+
var dataCount=this.GetAllRowCount();
|
|
8745
|
+
for(var i=this.Data.YOffset, j=0; i<dataCount && j<this.RowCount ;++i, ++j)
|
|
8746
|
+
{
|
|
8747
|
+
var symbol=this.Data.Data[i];
|
|
8748
|
+
|
|
8749
|
+
var data= { Symbol:symbol , Stock:null, Block:null };
|
|
8750
|
+
if (this.GetStockDataCallback) data.Stock=this.GetStockDataCallback(symbol);
|
|
8751
|
+
if (this.GetBlockDataCallback) data.Block=this.GetBlockDataCallback(symbol);
|
|
8752
|
+
if (this.GetFlashBGDataCallback) data.FlashBG=this.GetFlashBGDataCallback(symbol, Date.now());
|
|
8753
|
+
data.Decimal=GetfloatPrecision(symbol); //小数位数
|
|
8754
|
+
|
|
8755
|
+
var item=this.Column[clickData.Header.Index];
|
|
8756
|
+
this.DrawItem(i, data, item, cellHeader.Left, textTop, 3);
|
|
8757
|
+
|
|
8758
|
+
textTop+=this.RowHeight;
|
|
8759
|
+
}
|
|
8760
|
+
}
|
|
8761
|
+
|
|
8672
8762
|
this.GetTooltipData=function(x,y)
|
|
8673
8763
|
{
|
|
8674
8764
|
if (!IFrameSplitOperator.IsNonEmptyArray(this.TooltipRect)) return null;
|
|
@@ -133430,14 +133430,6 @@ function JSReportChartContainer(uielement)
|
|
|
133430
133430
|
|
|
133431
133431
|
this.Canvas=uielement.getContext("2d"); //画布
|
|
133432
133432
|
|
|
133433
|
-
this.Tooltip=document.createElement("div");
|
|
133434
|
-
this.Tooltip.className='jsreport-tooltip';
|
|
133435
|
-
this.Tooltip.style.background=g_JSChartResource.TooltipBGColor;
|
|
133436
|
-
this.Tooltip.style.opacity=g_JSChartResource.TooltipAlpha;
|
|
133437
|
-
this.Tooltip.style["pointer-events"]="none";
|
|
133438
|
-
this.Tooltip.id=Guid();
|
|
133439
|
-
uielement.parentNode.appendChild(this.Tooltip);
|
|
133440
|
-
|
|
133441
133433
|
this.Symbol; //板块代码
|
|
133442
133434
|
this.Name; //板块名称
|
|
133443
133435
|
this.NetworkFilter; //数据回调接口
|
|
@@ -135478,7 +135470,7 @@ function JSReportChartContainer(uielement)
|
|
|
135478
135470
|
|
|
135479
135471
|
if (reportChart)
|
|
135480
135472
|
{
|
|
135481
|
-
var moveRow=reportChart.
|
|
135473
|
+
var moveRow=reportChart.OnDragRow(x,y,e);
|
|
135482
135474
|
if (moveRow )
|
|
135483
135475
|
{
|
|
135484
135476
|
if (moveRow.Type==2)
|
|
@@ -135551,6 +135543,8 @@ function JSReportChartContainer(uielement)
|
|
|
135551
135543
|
var yMove=e.clientY-this.DragHeader.Click.Y;
|
|
135552
135544
|
if ( Math.abs(yMove)<=1 && Math.abs(xMove)<=1) return;
|
|
135553
135545
|
|
|
135546
|
+
var reportChart=this.GetReportChart();
|
|
135547
|
+
var clickData=this.DragHeader.ClickData;
|
|
135554
135548
|
this.DragHeader.LastMove.X=e.clientX;
|
|
135555
135549
|
this.DragHeader.LastMove.Y=e.clientY;
|
|
135556
135550
|
if (!this.DragHeader.MovePoint)
|
|
@@ -135563,8 +135557,17 @@ function JSReportChartContainer(uielement)
|
|
|
135563
135557
|
this.DragHeader.MovePoint.Y=y;
|
|
135564
135558
|
}
|
|
135565
135559
|
|
|
135566
|
-
|
|
135567
|
-
|
|
135560
|
+
var moveData=reportChart.OnDragHeader(x,y,e);
|
|
135561
|
+
if (!moveData) return;
|
|
135562
|
+
if (moveData.Type!=1) return;
|
|
135563
|
+
|
|
135564
|
+
if (moveData.Header.Index!=clickData.Header.Index)
|
|
135565
|
+
{
|
|
135566
|
+
this.DragHeader.MoveToData=moveData;
|
|
135567
|
+
}
|
|
135568
|
+
|
|
135569
|
+
reportChart.DragHeader=this.DragHeader;
|
|
135570
|
+
this.Draw();
|
|
135568
135571
|
}
|
|
135569
135572
|
else if (this.DragColumnWidth && this.DragColumnWidth.ClickData) //列宽度拖拽
|
|
135570
135573
|
{
|
|
@@ -135606,57 +135609,6 @@ function JSReportChartContainer(uielement)
|
|
|
135606
135609
|
this.Draw();
|
|
135607
135610
|
}
|
|
135608
135611
|
|
|
135609
|
-
this.OnMoveDragHeader=function(x, y,e)
|
|
135610
|
-
{
|
|
135611
|
-
var chart=this.ChartPaint[0];
|
|
135612
|
-
if (!chart) return;
|
|
135613
|
-
|
|
135614
|
-
var clickData=this.DragHeader.ClickData;
|
|
135615
|
-
this.DragHeader.MoveToData=null;
|
|
135616
|
-
|
|
135617
|
-
if (!clickData.Header.IsFixed) //固定列不能拖
|
|
135618
|
-
{
|
|
135619
|
-
var yHeader=this.DragHeader.ClickPoint.Y;
|
|
135620
|
-
var moveData=chart.OnMouseDown(x,yHeader,e);
|
|
135621
|
-
if (!moveData || !moveData.Header) return;
|
|
135622
|
-
if (moveData.Header.IsFixed) return;
|
|
135623
|
-
if (moveData.Header.Index== clickData.Header.Index) return;
|
|
135624
|
-
|
|
135625
|
-
this.DragHeader.MoveToData=moveData;
|
|
135626
|
-
console.log(`[JSReportChartContainer::OnMoveDragHeader] Click[Index=${clickData.Header.Index}, Title=${clickData.Header.Column.Title}] => Move[Index=${moveData.Header.Index}, Title=${moveData.Header.Column.Title}]`);
|
|
135627
|
-
}
|
|
135628
|
-
}
|
|
135629
|
-
|
|
135630
|
-
this.ShowDragHeaderTooltip=function(x,y,e)
|
|
135631
|
-
{
|
|
135632
|
-
if (!this.DragHeader) return;
|
|
135633
|
-
var drag=this.DragHeader;
|
|
135634
|
-
if (!drag.ClickData || !drag.MovePoint) return;
|
|
135635
|
-
|
|
135636
|
-
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_DRAG_HEADER_TOOLTIP);
|
|
135637
|
-
if (event)
|
|
135638
|
-
{
|
|
135639
|
-
var sendData={ PreventDefault:false, e, X:x, Y:y, DragHeader:this.DragHeader, Tooltip:this.Tooltip };
|
|
135640
|
-
event.Callback(event,sendData,this);
|
|
135641
|
-
if (sendData.PreventDefault) return;
|
|
135642
|
-
}
|
|
135643
|
-
|
|
135644
|
-
var title=drag.ClickData.Header.Column.Title;
|
|
135645
|
-
this.Tooltip.className='jchart-chartdrawsvg-tooltip'; //ChartDrawSVG指标数据
|
|
135646
|
-
this.Tooltip.style.position = "absolute";
|
|
135647
|
-
this.Tooltip.style.left = e.clientX + "px";
|
|
135648
|
-
this.Tooltip.style.top = e.clientY+ "px";
|
|
135649
|
-
this.Tooltip.style.width = 100+"px";
|
|
135650
|
-
this.Tooltip.style.height =null;
|
|
135651
|
-
this.Tooltip.innerHTML=title;
|
|
135652
|
-
this.Tooltip.style.display = "block";
|
|
135653
|
-
}
|
|
135654
|
-
|
|
135655
|
-
this.HideTooltip=function()
|
|
135656
|
-
{
|
|
135657
|
-
if (this.Tooltip.style.display!="none") this.Tooltip.style.display = "none";
|
|
135658
|
-
}
|
|
135659
|
-
|
|
135660
135612
|
this.DocOnMouseUp=function(e)
|
|
135661
135613
|
{
|
|
135662
135614
|
//清空事件
|
|
@@ -135693,6 +135645,12 @@ function JSReportChartContainer(uielement)
|
|
|
135693
135645
|
this.DragMove=null;
|
|
135694
135646
|
this.DragColumnWidth=null;
|
|
135695
135647
|
|
|
135648
|
+
if (reportChart.DragHeader)
|
|
135649
|
+
{
|
|
135650
|
+
bRedraw=true;
|
|
135651
|
+
reportChart.DragHeader=null;
|
|
135652
|
+
}
|
|
135653
|
+
|
|
135696
135654
|
if (bRedraw) this.Draw();
|
|
135697
135655
|
|
|
135698
135656
|
if (dragHeader)
|
|
@@ -137777,6 +137735,7 @@ function ChartReport()
|
|
|
137777
137735
|
|
|
137778
137736
|
this.ShowSymbol=[]; //显示的股票列表 { Index:序号(排序用), Symbol:股票代码 }
|
|
137779
137737
|
this.DragRow; //拖拽行
|
|
137738
|
+
this.DragHeader; //拖拽表头
|
|
137780
137739
|
|
|
137781
137740
|
this.Tab;
|
|
137782
137741
|
this.VScrollbar;
|
|
@@ -137984,6 +137943,11 @@ function ChartReport()
|
|
|
137984
137943
|
Bottom:g_JSChartResource.Report.LimitBorder.Mergin.Bottom
|
|
137985
137944
|
}
|
|
137986
137945
|
|
|
137946
|
+
this.DragRowColor=g_JSChartResource.Report.DragRow.Color;
|
|
137947
|
+
this.DragRowTextColor=g_JSChartResource.Report.DragRow.TextColor;
|
|
137948
|
+
this.DragMoveRowColor=g_JSChartResource.Report.DragRow.MoveRowColor;
|
|
137949
|
+
this.DragSrcRowColor=g_JSChartResource.Report.DragRow.SrcRowColor;
|
|
137950
|
+
|
|
137987
137951
|
//排序图标
|
|
137988
137952
|
this.SortConfig=
|
|
137989
137953
|
{
|
|
@@ -138403,6 +138367,7 @@ function ChartReport()
|
|
|
138403
138367
|
|
|
138404
138368
|
this.ClipClient();
|
|
138405
138369
|
|
|
138370
|
+
this.DrawDragHeaderBG();
|
|
138406
138371
|
this.DrawHeader();
|
|
138407
138372
|
this.DrawBody();
|
|
138408
138373
|
this.Canvas.restore();
|
|
@@ -138420,6 +138385,8 @@ function ChartReport()
|
|
|
138420
138385
|
|
|
138421
138386
|
this.DrawDragRow();
|
|
138422
138387
|
|
|
138388
|
+
this.DrawDragHeader();
|
|
138389
|
+
|
|
138423
138390
|
if (this.VScrollbar)
|
|
138424
138391
|
{
|
|
138425
138392
|
var bottom=this.ChartBorder.GetBottom();
|
|
@@ -138430,6 +138397,60 @@ function ChartReport()
|
|
|
138430
138397
|
this.SizeChange=false;
|
|
138431
138398
|
}
|
|
138432
138399
|
|
|
138400
|
+
this.DrawDragHeaderBG=function()
|
|
138401
|
+
{
|
|
138402
|
+
if (!this.DragHeader) return;
|
|
138403
|
+
|
|
138404
|
+
var left=this.RectClient.Left;
|
|
138405
|
+
var right=this.RectClient.Right;
|
|
138406
|
+
var top=this.RectClient.Top;
|
|
138407
|
+
var bottom=top+this.HeaderHeight+this.RowHeight*this.RowCount+this.FixedRowHeight*this.FixedRowCount;
|
|
138408
|
+
|
|
138409
|
+
//竖线
|
|
138410
|
+
var columnLeft=left;
|
|
138411
|
+
for(var i=0;i<this.FixedColumn && i<this.Column.length; ++i)
|
|
138412
|
+
{
|
|
138413
|
+
var item=this.Column[i];
|
|
138414
|
+
columnLeft+=item.Width;
|
|
138415
|
+
}
|
|
138416
|
+
|
|
138417
|
+
for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i)
|
|
138418
|
+
{
|
|
138419
|
+
var item=this.Column[i];
|
|
138420
|
+
|
|
138421
|
+
if (this.DragHeader)
|
|
138422
|
+
{
|
|
138423
|
+
if (this.DragHeader.ClickData)
|
|
138424
|
+
{
|
|
138425
|
+
var clickData=this.DragHeader.ClickData;
|
|
138426
|
+
if (clickData.Header.Index==i)
|
|
138427
|
+
{
|
|
138428
|
+
var rtBG={ Left:columnLeft,Top:top, Bottom:bottom, Right:columnLeft+item.Width };
|
|
138429
|
+
rtBG.Width=rtBG.Right-rtBG.Left;
|
|
138430
|
+
rtBG.Height=rtBG.Bottom-rtBG.Top;
|
|
138431
|
+
this.Canvas.fillStyle=this.DragSrcRowColor;
|
|
138432
|
+
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
138433
|
+
}
|
|
138434
|
+
}
|
|
138435
|
+
|
|
138436
|
+
if (this.DragHeader.MoveToData)
|
|
138437
|
+
{
|
|
138438
|
+
var moveToData=this.DragHeader.MoveToData;
|
|
138439
|
+
if (moveToData.Header.Index==i)
|
|
138440
|
+
{
|
|
138441
|
+
var rtBG={ Left:columnLeft,Top:top, Bottom:bottom, Right:columnLeft+item.Width };
|
|
138442
|
+
rtBG.Width=rtBG.Right-rtBG.Left;
|
|
138443
|
+
rtBG.Height=rtBG.Bottom-rtBG.Top;
|
|
138444
|
+
this.Canvas.fillStyle=this.DragMoveRowColor;
|
|
138445
|
+
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
138446
|
+
}
|
|
138447
|
+
}
|
|
138448
|
+
}
|
|
138449
|
+
|
|
138450
|
+
columnLeft+=item.Width;
|
|
138451
|
+
}
|
|
138452
|
+
}
|
|
138453
|
+
|
|
138433
138454
|
//更新缓存变量
|
|
138434
138455
|
this.UpdateCacheData=function()
|
|
138435
138456
|
{
|
|
@@ -138591,7 +138612,8 @@ function ChartReport()
|
|
|
138591
138612
|
if (!item.Title || item.Title.length<=0) continue;
|
|
138592
138613
|
var text=item.Title;
|
|
138593
138614
|
itemWidth=this.Canvas.measureText(text).width;
|
|
138594
|
-
if (item.Sort>0) itemWidth
|
|
138615
|
+
if (item.Sort>0) itemWidth+=this.SortConfig.Size*pixelRatio;
|
|
138616
|
+
|
|
138595
138617
|
itemWidth+=(4+this.HeaderMergin.Left+this.HeaderMergin.Right);
|
|
138596
138618
|
if (item.Width<itemWidth) item.Width=itemWidth;
|
|
138597
138619
|
}
|
|
@@ -138623,7 +138645,7 @@ function ChartReport()
|
|
|
138623
138645
|
this.IsShowAllColumn=(subWidth<reportWidth);
|
|
138624
138646
|
}
|
|
138625
138647
|
|
|
138626
|
-
this.DrawHeaderItem=function(column, rtCell, index)
|
|
138648
|
+
this.DrawHeaderItem=function(column, rtCell, index, option)
|
|
138627
138649
|
{
|
|
138628
138650
|
if (column.HeaderBGColor) //背景色
|
|
138629
138651
|
{
|
|
@@ -138667,12 +138689,18 @@ function ChartReport()
|
|
|
138667
138689
|
//图标
|
|
138668
138690
|
if (column.Icon) lastItem.Icon=column.Icon;
|
|
138669
138691
|
|
|
138692
|
+
if (option)
|
|
138693
|
+
{
|
|
138694
|
+
if (option.HeaderColor) drawInfo.HeaderColor=option.HeaderColor;
|
|
138695
|
+
}
|
|
138696
|
+
|
|
138670
138697
|
this.DrawHeaderText(column, drawInfo);
|
|
138671
138698
|
}
|
|
138672
138699
|
|
|
138673
138700
|
this.DrawHeaderText=function(column, drawInfo)
|
|
138674
138701
|
{
|
|
138675
|
-
if (
|
|
138702
|
+
if (drawInfo.HeaderColor) this.Canvas.fillStyle=drawInfo.HeaderColor;
|
|
138703
|
+
else if (column.HeaderColor) this.Canvas.fillStyle=column.HeaderColor;
|
|
138676
138704
|
else this.Canvas.fillStyle=this.HeaderColor;
|
|
138677
138705
|
|
|
138678
138706
|
var pixelRatio=GetDevicePixelRatio();
|
|
@@ -141379,7 +141407,7 @@ function ChartReport()
|
|
|
141379
141407
|
|
|
141380
141408
|
}
|
|
141381
141409
|
|
|
141382
|
-
this.
|
|
141410
|
+
this.OnDragRow=function(x, y, e) //Type: 5=顶部 6=空白行 2=行 7=底部
|
|
141383
141411
|
{
|
|
141384
141412
|
if (!this.Data) return null;
|
|
141385
141413
|
if (!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return null;
|
|
@@ -141415,6 +141443,26 @@ function ChartReport()
|
|
|
141415
141443
|
return { Type:7 };
|
|
141416
141444
|
}
|
|
141417
141445
|
|
|
141446
|
+
this.OnDragHeader=function(x,y,e) //Type:1=行 2=左边 3=右边 4=空白 5=固定行
|
|
141447
|
+
{
|
|
141448
|
+
if (!this.IsShowHeader) return null;
|
|
141449
|
+
|
|
141450
|
+
var left=this.RectClient.Left;
|
|
141451
|
+
var right=this.RectClient.Right;
|
|
141452
|
+
var top=this.RectClient.Top;
|
|
141453
|
+
var bottom=top+this.HeaderHeight;
|
|
141454
|
+
|
|
141455
|
+
if (x<left) return { Type:2 };
|
|
141456
|
+
else if (x>right) return { Type:3 };
|
|
141457
|
+
|
|
141458
|
+
var cell=this.PtInItem(x,top+2,top,bottom);
|
|
141459
|
+
if (!cell) return { Type:4 };
|
|
141460
|
+
|
|
141461
|
+
if (cell.IsFixed) return { Type:5 }
|
|
141462
|
+
|
|
141463
|
+
return { Type:1, Header:cell };
|
|
141464
|
+
}
|
|
141465
|
+
|
|
141418
141466
|
this.OnClickButton=function(x, y, e, status)
|
|
141419
141467
|
{
|
|
141420
141468
|
if (e.button!=0) return false;
|
|
@@ -141683,6 +141731,48 @@ function ChartReport()
|
|
|
141683
141731
|
|
|
141684
141732
|
}
|
|
141685
141733
|
|
|
141734
|
+
this.DrawDragHeader=function()
|
|
141735
|
+
{
|
|
141736
|
+
if (!this.DragHeader) return;
|
|
141737
|
+
var drag=this.DragHeader;
|
|
141738
|
+
var clickData=drag.ClickData;
|
|
141739
|
+
var rtHeader=clickData.Header.Rect;
|
|
141740
|
+
var headerWidth=rtHeader.Right-rtHeader.Left;
|
|
141741
|
+
|
|
141742
|
+
var rtRow={ Left:drag.MovePoint.X-headerWidth/2, Top:this.RectClient.Top+this.HeaderHeight, Width:headerWidth };
|
|
141743
|
+
rtRow.Bottom=rtRow.Top+this.HeaderHeight+this.RowHeight*this.RowCount+this.FixedRowHeight*this.FixedRowCount;
|
|
141744
|
+
rtRow.Right=rtRow.Left+rtRow.Width;
|
|
141745
|
+
rtRow.Height=rtRow.Bottom-rtRow.Top;
|
|
141746
|
+
|
|
141747
|
+
//背景
|
|
141748
|
+
this.Canvas.fillStyle=this.DragRowColor;
|
|
141749
|
+
this.Canvas.fillRect(rtRow.Left, rtRow.Top, rtRow.Width, rtRow.Height);
|
|
141750
|
+
|
|
141751
|
+
//文字
|
|
141752
|
+
var cellHeader={ Left:rtRow.Left, Top:rtRow.Top, Right:rtRow.Right, Width:rtRow.Width, Height:this.HeaderHeight };
|
|
141753
|
+
cellHeader.Bottom=cellHeader.Top+cellHeader.Height;
|
|
141754
|
+
this.DrawHeaderItem(clickData.Header.Column, cellHeader, clickData.Header.Index, { HeaderColor:this.DragRowTextColor });
|
|
141755
|
+
|
|
141756
|
+
var textTop=cellHeader.Bottom+this.FixedRowHeight*this.FixedRowCount;
|
|
141757
|
+
this.Canvas.font=this.ItemFont;
|
|
141758
|
+
var dataCount=this.GetAllRowCount();
|
|
141759
|
+
for(var i=this.Data.YOffset, j=0; i<dataCount && j<this.RowCount ;++i, ++j)
|
|
141760
|
+
{
|
|
141761
|
+
var symbol=this.Data.Data[i];
|
|
141762
|
+
|
|
141763
|
+
var data= { Symbol:symbol , Stock:null, Block:null };
|
|
141764
|
+
if (this.GetStockDataCallback) data.Stock=this.GetStockDataCallback(symbol);
|
|
141765
|
+
if (this.GetBlockDataCallback) data.Block=this.GetBlockDataCallback(symbol);
|
|
141766
|
+
if (this.GetFlashBGDataCallback) data.FlashBG=this.GetFlashBGDataCallback(symbol, Date.now());
|
|
141767
|
+
data.Decimal=GetfloatPrecision(symbol); //小数位数
|
|
141768
|
+
|
|
141769
|
+
var item=this.Column[clickData.Header.Index];
|
|
141770
|
+
this.DrawItem(i, data, item, cellHeader.Left, textTop, 3);
|
|
141771
|
+
|
|
141772
|
+
textTop+=this.RowHeight;
|
|
141773
|
+
}
|
|
141774
|
+
}
|
|
141775
|
+
|
|
141686
141776
|
this.GetTooltipData=function(x,y)
|
|
141687
141777
|
{
|
|
141688
141778
|
if (!IFrameSplitOperator.IsNonEmptyArray(this.TooltipRect)) return null;
|
|
@@ -145943,7 +146033,7 @@ function ScrollBarBGChart()
|
|
|
145943
146033
|
|
|
145944
146034
|
|
|
145945
146035
|
|
|
145946
|
-
var HQCHART_VERSION="1.1.
|
|
146036
|
+
var HQCHART_VERSION="1.1.14612";
|
|
145947
146037
|
|
|
145948
146038
|
function PrintHQChartVersion()
|
|
145949
146039
|
{
|
|
@@ -133474,14 +133474,6 @@ function JSReportChartContainer(uielement)
|
|
|
133474
133474
|
|
|
133475
133475
|
this.Canvas=uielement.getContext("2d"); //画布
|
|
133476
133476
|
|
|
133477
|
-
this.Tooltip=document.createElement("div");
|
|
133478
|
-
this.Tooltip.className='jsreport-tooltip';
|
|
133479
|
-
this.Tooltip.style.background=g_JSChartResource.TooltipBGColor;
|
|
133480
|
-
this.Tooltip.style.opacity=g_JSChartResource.TooltipAlpha;
|
|
133481
|
-
this.Tooltip.style["pointer-events"]="none";
|
|
133482
|
-
this.Tooltip.id=Guid();
|
|
133483
|
-
uielement.parentNode.appendChild(this.Tooltip);
|
|
133484
|
-
|
|
133485
133477
|
this.Symbol; //板块代码
|
|
133486
133478
|
this.Name; //板块名称
|
|
133487
133479
|
this.NetworkFilter; //数据回调接口
|
|
@@ -135522,7 +135514,7 @@ function JSReportChartContainer(uielement)
|
|
|
135522
135514
|
|
|
135523
135515
|
if (reportChart)
|
|
135524
135516
|
{
|
|
135525
|
-
var moveRow=reportChart.
|
|
135517
|
+
var moveRow=reportChart.OnDragRow(x,y,e);
|
|
135526
135518
|
if (moveRow )
|
|
135527
135519
|
{
|
|
135528
135520
|
if (moveRow.Type==2)
|
|
@@ -135595,6 +135587,8 @@ function JSReportChartContainer(uielement)
|
|
|
135595
135587
|
var yMove=e.clientY-this.DragHeader.Click.Y;
|
|
135596
135588
|
if ( Math.abs(yMove)<=1 && Math.abs(xMove)<=1) return;
|
|
135597
135589
|
|
|
135590
|
+
var reportChart=this.GetReportChart();
|
|
135591
|
+
var clickData=this.DragHeader.ClickData;
|
|
135598
135592
|
this.DragHeader.LastMove.X=e.clientX;
|
|
135599
135593
|
this.DragHeader.LastMove.Y=e.clientY;
|
|
135600
135594
|
if (!this.DragHeader.MovePoint)
|
|
@@ -135607,8 +135601,17 @@ function JSReportChartContainer(uielement)
|
|
|
135607
135601
|
this.DragHeader.MovePoint.Y=y;
|
|
135608
135602
|
}
|
|
135609
135603
|
|
|
135610
|
-
|
|
135611
|
-
|
|
135604
|
+
var moveData=reportChart.OnDragHeader(x,y,e);
|
|
135605
|
+
if (!moveData) return;
|
|
135606
|
+
if (moveData.Type!=1) return;
|
|
135607
|
+
|
|
135608
|
+
if (moveData.Header.Index!=clickData.Header.Index)
|
|
135609
|
+
{
|
|
135610
|
+
this.DragHeader.MoveToData=moveData;
|
|
135611
|
+
}
|
|
135612
|
+
|
|
135613
|
+
reportChart.DragHeader=this.DragHeader;
|
|
135614
|
+
this.Draw();
|
|
135612
135615
|
}
|
|
135613
135616
|
else if (this.DragColumnWidth && this.DragColumnWidth.ClickData) //列宽度拖拽
|
|
135614
135617
|
{
|
|
@@ -135650,57 +135653,6 @@ function JSReportChartContainer(uielement)
|
|
|
135650
135653
|
this.Draw();
|
|
135651
135654
|
}
|
|
135652
135655
|
|
|
135653
|
-
this.OnMoveDragHeader=function(x, y,e)
|
|
135654
|
-
{
|
|
135655
|
-
var chart=this.ChartPaint[0];
|
|
135656
|
-
if (!chart) return;
|
|
135657
|
-
|
|
135658
|
-
var clickData=this.DragHeader.ClickData;
|
|
135659
|
-
this.DragHeader.MoveToData=null;
|
|
135660
|
-
|
|
135661
|
-
if (!clickData.Header.IsFixed) //固定列不能拖
|
|
135662
|
-
{
|
|
135663
|
-
var yHeader=this.DragHeader.ClickPoint.Y;
|
|
135664
|
-
var moveData=chart.OnMouseDown(x,yHeader,e);
|
|
135665
|
-
if (!moveData || !moveData.Header) return;
|
|
135666
|
-
if (moveData.Header.IsFixed) return;
|
|
135667
|
-
if (moveData.Header.Index== clickData.Header.Index) return;
|
|
135668
|
-
|
|
135669
|
-
this.DragHeader.MoveToData=moveData;
|
|
135670
|
-
console.log(`[JSReportChartContainer::OnMoveDragHeader] Click[Index=${clickData.Header.Index}, Title=${clickData.Header.Column.Title}] => Move[Index=${moveData.Header.Index}, Title=${moveData.Header.Column.Title}]`);
|
|
135671
|
-
}
|
|
135672
|
-
}
|
|
135673
|
-
|
|
135674
|
-
this.ShowDragHeaderTooltip=function(x,y,e)
|
|
135675
|
-
{
|
|
135676
|
-
if (!this.DragHeader) return;
|
|
135677
|
-
var drag=this.DragHeader;
|
|
135678
|
-
if (!drag.ClickData || !drag.MovePoint) return;
|
|
135679
|
-
|
|
135680
|
-
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_DRAG_HEADER_TOOLTIP);
|
|
135681
|
-
if (event)
|
|
135682
|
-
{
|
|
135683
|
-
var sendData={ PreventDefault:false, e, X:x, Y:y, DragHeader:this.DragHeader, Tooltip:this.Tooltip };
|
|
135684
|
-
event.Callback(event,sendData,this);
|
|
135685
|
-
if (sendData.PreventDefault) return;
|
|
135686
|
-
}
|
|
135687
|
-
|
|
135688
|
-
var title=drag.ClickData.Header.Column.Title;
|
|
135689
|
-
this.Tooltip.className='jchart-chartdrawsvg-tooltip'; //ChartDrawSVG指标数据
|
|
135690
|
-
this.Tooltip.style.position = "absolute";
|
|
135691
|
-
this.Tooltip.style.left = e.clientX + "px";
|
|
135692
|
-
this.Tooltip.style.top = e.clientY+ "px";
|
|
135693
|
-
this.Tooltip.style.width = 100+"px";
|
|
135694
|
-
this.Tooltip.style.height =null;
|
|
135695
|
-
this.Tooltip.innerHTML=title;
|
|
135696
|
-
this.Tooltip.style.display = "block";
|
|
135697
|
-
}
|
|
135698
|
-
|
|
135699
|
-
this.HideTooltip=function()
|
|
135700
|
-
{
|
|
135701
|
-
if (this.Tooltip.style.display!="none") this.Tooltip.style.display = "none";
|
|
135702
|
-
}
|
|
135703
|
-
|
|
135704
135656
|
this.DocOnMouseUp=function(e)
|
|
135705
135657
|
{
|
|
135706
135658
|
//清空事件
|
|
@@ -135737,6 +135689,12 @@ function JSReportChartContainer(uielement)
|
|
|
135737
135689
|
this.DragMove=null;
|
|
135738
135690
|
this.DragColumnWidth=null;
|
|
135739
135691
|
|
|
135692
|
+
if (reportChart.DragHeader)
|
|
135693
|
+
{
|
|
135694
|
+
bRedraw=true;
|
|
135695
|
+
reportChart.DragHeader=null;
|
|
135696
|
+
}
|
|
135697
|
+
|
|
135740
135698
|
if (bRedraw) this.Draw();
|
|
135741
135699
|
|
|
135742
135700
|
if (dragHeader)
|
|
@@ -137821,6 +137779,7 @@ function ChartReport()
|
|
|
137821
137779
|
|
|
137822
137780
|
this.ShowSymbol=[]; //显示的股票列表 { Index:序号(排序用), Symbol:股票代码 }
|
|
137823
137781
|
this.DragRow; //拖拽行
|
|
137782
|
+
this.DragHeader; //拖拽表头
|
|
137824
137783
|
|
|
137825
137784
|
this.Tab;
|
|
137826
137785
|
this.VScrollbar;
|
|
@@ -138028,6 +137987,11 @@ function ChartReport()
|
|
|
138028
137987
|
Bottom:g_JSChartResource.Report.LimitBorder.Mergin.Bottom
|
|
138029
137988
|
}
|
|
138030
137989
|
|
|
137990
|
+
this.DragRowColor=g_JSChartResource.Report.DragRow.Color;
|
|
137991
|
+
this.DragRowTextColor=g_JSChartResource.Report.DragRow.TextColor;
|
|
137992
|
+
this.DragMoveRowColor=g_JSChartResource.Report.DragRow.MoveRowColor;
|
|
137993
|
+
this.DragSrcRowColor=g_JSChartResource.Report.DragRow.SrcRowColor;
|
|
137994
|
+
|
|
138031
137995
|
//排序图标
|
|
138032
137996
|
this.SortConfig=
|
|
138033
137997
|
{
|
|
@@ -138447,6 +138411,7 @@ function ChartReport()
|
|
|
138447
138411
|
|
|
138448
138412
|
this.ClipClient();
|
|
138449
138413
|
|
|
138414
|
+
this.DrawDragHeaderBG();
|
|
138450
138415
|
this.DrawHeader();
|
|
138451
138416
|
this.DrawBody();
|
|
138452
138417
|
this.Canvas.restore();
|
|
@@ -138464,6 +138429,8 @@ function ChartReport()
|
|
|
138464
138429
|
|
|
138465
138430
|
this.DrawDragRow();
|
|
138466
138431
|
|
|
138432
|
+
this.DrawDragHeader();
|
|
138433
|
+
|
|
138467
138434
|
if (this.VScrollbar)
|
|
138468
138435
|
{
|
|
138469
138436
|
var bottom=this.ChartBorder.GetBottom();
|
|
@@ -138474,6 +138441,60 @@ function ChartReport()
|
|
|
138474
138441
|
this.SizeChange=false;
|
|
138475
138442
|
}
|
|
138476
138443
|
|
|
138444
|
+
this.DrawDragHeaderBG=function()
|
|
138445
|
+
{
|
|
138446
|
+
if (!this.DragHeader) return;
|
|
138447
|
+
|
|
138448
|
+
var left=this.RectClient.Left;
|
|
138449
|
+
var right=this.RectClient.Right;
|
|
138450
|
+
var top=this.RectClient.Top;
|
|
138451
|
+
var bottom=top+this.HeaderHeight+this.RowHeight*this.RowCount+this.FixedRowHeight*this.FixedRowCount;
|
|
138452
|
+
|
|
138453
|
+
//竖线
|
|
138454
|
+
var columnLeft=left;
|
|
138455
|
+
for(var i=0;i<this.FixedColumn && i<this.Column.length; ++i)
|
|
138456
|
+
{
|
|
138457
|
+
var item=this.Column[i];
|
|
138458
|
+
columnLeft+=item.Width;
|
|
138459
|
+
}
|
|
138460
|
+
|
|
138461
|
+
for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i)
|
|
138462
|
+
{
|
|
138463
|
+
var item=this.Column[i];
|
|
138464
|
+
|
|
138465
|
+
if (this.DragHeader)
|
|
138466
|
+
{
|
|
138467
|
+
if (this.DragHeader.ClickData)
|
|
138468
|
+
{
|
|
138469
|
+
var clickData=this.DragHeader.ClickData;
|
|
138470
|
+
if (clickData.Header.Index==i)
|
|
138471
|
+
{
|
|
138472
|
+
var rtBG={ Left:columnLeft,Top:top, Bottom:bottom, Right:columnLeft+item.Width };
|
|
138473
|
+
rtBG.Width=rtBG.Right-rtBG.Left;
|
|
138474
|
+
rtBG.Height=rtBG.Bottom-rtBG.Top;
|
|
138475
|
+
this.Canvas.fillStyle=this.DragSrcRowColor;
|
|
138476
|
+
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
138477
|
+
}
|
|
138478
|
+
}
|
|
138479
|
+
|
|
138480
|
+
if (this.DragHeader.MoveToData)
|
|
138481
|
+
{
|
|
138482
|
+
var moveToData=this.DragHeader.MoveToData;
|
|
138483
|
+
if (moveToData.Header.Index==i)
|
|
138484
|
+
{
|
|
138485
|
+
var rtBG={ Left:columnLeft,Top:top, Bottom:bottom, Right:columnLeft+item.Width };
|
|
138486
|
+
rtBG.Width=rtBG.Right-rtBG.Left;
|
|
138487
|
+
rtBG.Height=rtBG.Bottom-rtBG.Top;
|
|
138488
|
+
this.Canvas.fillStyle=this.DragMoveRowColor;
|
|
138489
|
+
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
138490
|
+
}
|
|
138491
|
+
}
|
|
138492
|
+
}
|
|
138493
|
+
|
|
138494
|
+
columnLeft+=item.Width;
|
|
138495
|
+
}
|
|
138496
|
+
}
|
|
138497
|
+
|
|
138477
138498
|
//更新缓存变量
|
|
138478
138499
|
this.UpdateCacheData=function()
|
|
138479
138500
|
{
|
|
@@ -138635,7 +138656,8 @@ function ChartReport()
|
|
|
138635
138656
|
if (!item.Title || item.Title.length<=0) continue;
|
|
138636
138657
|
var text=item.Title;
|
|
138637
138658
|
itemWidth=this.Canvas.measureText(text).width;
|
|
138638
|
-
if (item.Sort>0) itemWidth
|
|
138659
|
+
if (item.Sort>0) itemWidth+=this.SortConfig.Size*pixelRatio;
|
|
138660
|
+
|
|
138639
138661
|
itemWidth+=(4+this.HeaderMergin.Left+this.HeaderMergin.Right);
|
|
138640
138662
|
if (item.Width<itemWidth) item.Width=itemWidth;
|
|
138641
138663
|
}
|
|
@@ -138667,7 +138689,7 @@ function ChartReport()
|
|
|
138667
138689
|
this.IsShowAllColumn=(subWidth<reportWidth);
|
|
138668
138690
|
}
|
|
138669
138691
|
|
|
138670
|
-
this.DrawHeaderItem=function(column, rtCell, index)
|
|
138692
|
+
this.DrawHeaderItem=function(column, rtCell, index, option)
|
|
138671
138693
|
{
|
|
138672
138694
|
if (column.HeaderBGColor) //背景色
|
|
138673
138695
|
{
|
|
@@ -138711,12 +138733,18 @@ function ChartReport()
|
|
|
138711
138733
|
//图标
|
|
138712
138734
|
if (column.Icon) lastItem.Icon=column.Icon;
|
|
138713
138735
|
|
|
138736
|
+
if (option)
|
|
138737
|
+
{
|
|
138738
|
+
if (option.HeaderColor) drawInfo.HeaderColor=option.HeaderColor;
|
|
138739
|
+
}
|
|
138740
|
+
|
|
138714
138741
|
this.DrawHeaderText(column, drawInfo);
|
|
138715
138742
|
}
|
|
138716
138743
|
|
|
138717
138744
|
this.DrawHeaderText=function(column, drawInfo)
|
|
138718
138745
|
{
|
|
138719
|
-
if (
|
|
138746
|
+
if (drawInfo.HeaderColor) this.Canvas.fillStyle=drawInfo.HeaderColor;
|
|
138747
|
+
else if (column.HeaderColor) this.Canvas.fillStyle=column.HeaderColor;
|
|
138720
138748
|
else this.Canvas.fillStyle=this.HeaderColor;
|
|
138721
138749
|
|
|
138722
138750
|
var pixelRatio=GetDevicePixelRatio();
|
|
@@ -141423,7 +141451,7 @@ function ChartReport()
|
|
|
141423
141451
|
|
|
141424
141452
|
}
|
|
141425
141453
|
|
|
141426
|
-
this.
|
|
141454
|
+
this.OnDragRow=function(x, y, e) //Type: 5=顶部 6=空白行 2=行 7=底部
|
|
141427
141455
|
{
|
|
141428
141456
|
if (!this.Data) return null;
|
|
141429
141457
|
if (!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return null;
|
|
@@ -141459,6 +141487,26 @@ function ChartReport()
|
|
|
141459
141487
|
return { Type:7 };
|
|
141460
141488
|
}
|
|
141461
141489
|
|
|
141490
|
+
this.OnDragHeader=function(x,y,e) //Type:1=行 2=左边 3=右边 4=空白 5=固定行
|
|
141491
|
+
{
|
|
141492
|
+
if (!this.IsShowHeader) return null;
|
|
141493
|
+
|
|
141494
|
+
var left=this.RectClient.Left;
|
|
141495
|
+
var right=this.RectClient.Right;
|
|
141496
|
+
var top=this.RectClient.Top;
|
|
141497
|
+
var bottom=top+this.HeaderHeight;
|
|
141498
|
+
|
|
141499
|
+
if (x<left) return { Type:2 };
|
|
141500
|
+
else if (x>right) return { Type:3 };
|
|
141501
|
+
|
|
141502
|
+
var cell=this.PtInItem(x,top+2,top,bottom);
|
|
141503
|
+
if (!cell) return { Type:4 };
|
|
141504
|
+
|
|
141505
|
+
if (cell.IsFixed) return { Type:5 }
|
|
141506
|
+
|
|
141507
|
+
return { Type:1, Header:cell };
|
|
141508
|
+
}
|
|
141509
|
+
|
|
141462
141510
|
this.OnClickButton=function(x, y, e, status)
|
|
141463
141511
|
{
|
|
141464
141512
|
if (e.button!=0) return false;
|
|
@@ -141727,6 +141775,48 @@ function ChartReport()
|
|
|
141727
141775
|
|
|
141728
141776
|
}
|
|
141729
141777
|
|
|
141778
|
+
this.DrawDragHeader=function()
|
|
141779
|
+
{
|
|
141780
|
+
if (!this.DragHeader) return;
|
|
141781
|
+
var drag=this.DragHeader;
|
|
141782
|
+
var clickData=drag.ClickData;
|
|
141783
|
+
var rtHeader=clickData.Header.Rect;
|
|
141784
|
+
var headerWidth=rtHeader.Right-rtHeader.Left;
|
|
141785
|
+
|
|
141786
|
+
var rtRow={ Left:drag.MovePoint.X-headerWidth/2, Top:this.RectClient.Top+this.HeaderHeight, Width:headerWidth };
|
|
141787
|
+
rtRow.Bottom=rtRow.Top+this.HeaderHeight+this.RowHeight*this.RowCount+this.FixedRowHeight*this.FixedRowCount;
|
|
141788
|
+
rtRow.Right=rtRow.Left+rtRow.Width;
|
|
141789
|
+
rtRow.Height=rtRow.Bottom-rtRow.Top;
|
|
141790
|
+
|
|
141791
|
+
//背景
|
|
141792
|
+
this.Canvas.fillStyle=this.DragRowColor;
|
|
141793
|
+
this.Canvas.fillRect(rtRow.Left, rtRow.Top, rtRow.Width, rtRow.Height);
|
|
141794
|
+
|
|
141795
|
+
//文字
|
|
141796
|
+
var cellHeader={ Left:rtRow.Left, Top:rtRow.Top, Right:rtRow.Right, Width:rtRow.Width, Height:this.HeaderHeight };
|
|
141797
|
+
cellHeader.Bottom=cellHeader.Top+cellHeader.Height;
|
|
141798
|
+
this.DrawHeaderItem(clickData.Header.Column, cellHeader, clickData.Header.Index, { HeaderColor:this.DragRowTextColor });
|
|
141799
|
+
|
|
141800
|
+
var textTop=cellHeader.Bottom+this.FixedRowHeight*this.FixedRowCount;
|
|
141801
|
+
this.Canvas.font=this.ItemFont;
|
|
141802
|
+
var dataCount=this.GetAllRowCount();
|
|
141803
|
+
for(var i=this.Data.YOffset, j=0; i<dataCount && j<this.RowCount ;++i, ++j)
|
|
141804
|
+
{
|
|
141805
|
+
var symbol=this.Data.Data[i];
|
|
141806
|
+
|
|
141807
|
+
var data= { Symbol:symbol , Stock:null, Block:null };
|
|
141808
|
+
if (this.GetStockDataCallback) data.Stock=this.GetStockDataCallback(symbol);
|
|
141809
|
+
if (this.GetBlockDataCallback) data.Block=this.GetBlockDataCallback(symbol);
|
|
141810
|
+
if (this.GetFlashBGDataCallback) data.FlashBG=this.GetFlashBGDataCallback(symbol, Date.now());
|
|
141811
|
+
data.Decimal=GetfloatPrecision(symbol); //小数位数
|
|
141812
|
+
|
|
141813
|
+
var item=this.Column[clickData.Header.Index];
|
|
141814
|
+
this.DrawItem(i, data, item, cellHeader.Left, textTop, 3);
|
|
141815
|
+
|
|
141816
|
+
textTop+=this.RowHeight;
|
|
141817
|
+
}
|
|
141818
|
+
}
|
|
141819
|
+
|
|
141730
141820
|
this.GetTooltipData=function(x,y)
|
|
141731
141821
|
{
|
|
141732
141822
|
if (!IFrameSplitOperator.IsNonEmptyArray(this.TooltipRect)) return null;
|
|
@@ -156655,7 +156745,7 @@ function HQChartScriptWorker()
|
|
|
156655
156745
|
|
|
156656
156746
|
|
|
156657
156747
|
|
|
156658
|
-
var HQCHART_VERSION="1.1.
|
|
156748
|
+
var HQCHART_VERSION="1.1.14612";
|
|
156659
156749
|
|
|
156660
156750
|
function PrintHQChartVersion()
|
|
156661
156751
|
{
|