hqchart 1.1.11049 → 1.1.11059
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
|
@@ -1537,7 +1537,7 @@ OP_RIGHT_ZOOM_IN:10//右边放大
|
|
|
1537
1537
|
};var JSCHART_DRAG_ID={DISABLE_DRAG_ID:0,CLICK_TOUCH_MODE_ID:3//长按十字光标显示保留/点击十字光标消失 (使用TouchStatus)
|
|
1538
1538
|
};var JSCHART_BUTTON_ID={CLOSE_BEFOREOPEN_ID:1,//关闭集合竞价
|
|
1539
1539
|
CLOSE_OVERLAY_INDEX:2//关闭叠加指标
|
|
1540
|
-
};function PhoneDBClick(){this.Start=[];this.Clear=function(){this.Start=[];};this.AddTouchStart=function(x,y,time){if(this.Start.length>0){var item=this.Start[this.Start.length-1];var spanTime=time-item.Time;if(spanTime>0&&spanTime<300){this.Start.push({X:x,Y:y,Time:time});}else{this.Start=[];}}else{this.Start.push({X:x,Y:y,Time:time});}};this.IsVaildDBClick=function(){if(this.Start.length==2)return true;return false;};this.AddTouchEnd=function(time){if(this.Start.length<=0)return;var item=this.Start[this.Start.length-1];var spanTime=time-item.Time;if(spanTime>=0&&spanTime<150){}else{this.Start=[];}};}/*
|
|
1540
|
+
};var JSCHART_DATA_FIELD_ID={KLINE_ORDERFLOW:99};function PhoneDBClick(){this.Start=[];this.Clear=function(){this.Start=[];};this.AddTouchStart=function(x,y,time){if(this.Start.length>0){var item=this.Start[this.Start.length-1];var spanTime=time-item.Time;if(spanTime>0&&spanTime<300){this.Start.push({X:x,Y:y,Time:time});}else{this.Start=[];}}else{this.Start.push({X:x,Y:y,Time:time});}};this.IsVaildDBClick=function(){if(this.Start.length==2)return true;return false;};this.AddTouchEnd=function(time){if(this.Start.length<=0)return;var item=this.Start[this.Start.length-1];var spanTime=time-item.Time;if(spanTime>=0&&spanTime<150){}else{this.Start=[];}};}/*
|
|
1541
1541
|
图形控件
|
|
1542
1542
|
*/function JSChartContainer(uielement,OffscreenElement){var _this3=this;this.ClassName='JSChartContainer';var _self=this;this.Frame;//框架画法
|
|
1543
1543
|
this.ChartPaint=new Array();//图形画法
|
|
@@ -2793,7 +2793,7 @@ var ZOOM_SEED=
|
|
|
2793
2793
|
function ChartKLine(){this.newMethod=IChartPainting;//派生
|
|
2794
2794
|
this.newMethod();delete this.newMethod;this.ClassName='ChartKLine';//类名
|
|
2795
2795
|
this.Symbol;//股票代码
|
|
2796
|
-
this.DrawType=0;// 0=实心K线柱子 1=收盘价线 2=美国线 3=空心K线柱子 4=收盘价面积图 5=订单流 6=空心K线柱子2(全部空心)
|
|
2796
|
+
this.DrawType=0;// 0=实心K线柱子 1=收盘价线 2=美国线 3=空心K线柱子 4=收盘价面积图 5=订单流 6=空心K线柱子2(全部空心) 7=订单流样式2 8=订单流样式3
|
|
2797
2797
|
this.CloseLineColor=g_JSChartResource.CloseLineColor;this.CloseLineAreaColor=g_JSChartResource.CloseLineAreaColor;this.CloseLineWidth=g_JSChartResource.CloseLineWidth;this.UpColor=g_JSChartResource.UpBarColor;this.DownColor=g_JSChartResource.DownBarColor;this.UnchagneColor=g_JSChartResource.UnchagneBarColor;//平盘
|
|
2798
2798
|
this.ColorData;//五彩K线颜色 >0:g_JSChartResource.UpBarColor 其他:g_JSChartResource.DownBarColor
|
|
2799
2799
|
this.TradeData;//交易系统 包含买卖数据{Buy:, Sell:, Name:指标名称 }
|
|
@@ -2820,7 +2820,10 @@ this.DrawKRange={Start:null,End:null};//当前屏K线的索引{ Start: , End:}
|
|
|
2820
2820
|
]);
|
|
2821
2821
|
*///订单流配置
|
|
2822
2822
|
this.OrderFlow={UpColor:{BG:g_JSChartResource.OrderFlow.UpColor.BG,Border:g_JSChartResource.OrderFlow.UpColor.Border},DownColor:{BG:g_JSChartResource.OrderFlow.DownColor.BG,Border:g_JSChartResource.OrderFlow.DownColor.Border},UnchagneColor:{BG:g_JSChartResource.OrderFlow.UnchagneColor.BG,Border:g_JSChartResource.OrderFlow.UnchagneColor.Border},Text:{Color:g_JSChartResource.OrderFlow.Text.Color,Family:g_JSChartResource.OrderFlow.Text.Family,FontMaxSize:g_JSChartResource.OrderFlow.Text.FontMaxSize,MaxValue:g_JSChartResource.OrderFlow.Text.MaxValue},Line:{UpDownColor:g_JSChartResource.OrderFlow.Line.UpDownColor,MiddleColor:g_JSChartResource.OrderFlow.Line.MiddleColor},ShowType:0,//显示类型 0, 1
|
|
2823
|
-
AlwaysShowOrderText:g_JSChartResource.OrderFlow.AlwaysShowOrderText};this.
|
|
2823
|
+
AlwaysShowOrderText:g_JSChartResource.OrderFlow.AlwaysShowOrderText};this.OrderFlow_Style2={BarWidth:g_JSChartResource.OrderFlow_Style2.BarWidth,//柱子颜色
|
|
2824
|
+
UpColor:g_JSChartResource.OrderFlow_Style2.UpColor,DownColor:g_JSChartResource.OrderFlow_Style2.DownColor,UnchagneColor:g_JSChartResource.OrderFlow_Style2.UnchagneColor};this.OrderFlow_Style3={BarWidth:g_JSChartResource.OrderFlow_Style3.BarWidth,//柱子颜色
|
|
2825
|
+
UpColor:g_JSChartResource.OrderFlow_Style3.UpColor,DownColor:g_JSChartResource.OrderFlow_Style3.DownColor,UnchagneColor:g_JSChartResource.OrderFlow_Style3.UnchagneColor};this.IsShowOrderText=false;this.AryOrderFlowBorder=[];//订单流边框 临时变量
|
|
2826
|
+
this.ReloadResource=function(resource){this.TextFont=g_JSChartResource.KLine.MaxMin.Font;this.TextColor=g_JSChartResource.KLine.MaxMin.Color;this.CloseLineColor=g_JSChartResource.CloseLineColor;this.CloseLineAreaColor=g_JSChartResource.CloseLineAreaColor;this.CloseLineWidth=g_JSChartResource.CloseLineWidth;this.UpColor=g_JSChartResource.UpBarColor;this.DownColor=g_JSChartResource.DownBarColor;this.UnchagneColor=g_JSChartResource.UnchagneBarColor;//平盘
|
|
2824
2827
|
this.OrderFlow.UpColor={BG:g_JSChartResource.OrderFlow.UpColor.BG,Border:g_JSChartResource.OrderFlow.UpColor.Border};this.OrderFlow.DownColor={BG:g_JSChartResource.OrderFlow.DownColor.BG,Border:g_JSChartResource.OrderFlow.DownColor.Border};this.OrderFlow.UnchagneColor={BG:g_JSChartResource.OrderFlow.UnchagneColor.BG,Border:g_JSChartResource.OrderFlow.UnchagneColor.Border};this.OrderFlow.Text={Color:g_JSChartResource.OrderFlow.Text.Color,Family:g_JSChartResource.OrderFlow.Text.Family,FontMaxSize:g_JSChartResource.OrderFlow.Text.FontMaxSize,MaxValue:g_JSChartResource.OrderFlow.Text.MaxValue};this.OrderFlow.Line={UpDownColor:g_JSChartResource.OrderFlow.Line.UpDownColor,MiddleColor:g_JSChartResource.OrderFlow.Line.MiddleColor};};this.ClearCustomKLine=function(){this.CustomKLine=null;};this.GetCustomKLine=function(kItem){if(!this.CustomKLine)return null;if(!kItem)return null;var key=kItem.Date*1000000;if(IFrameSplitOperator.IsNumber(kItem.Time))key+=kItem.Time;if(!this.CustomKLine.has(key))return null;var value=this.CustomKLine.get(key);return value;};this.DrawAKLine=function()//美国线
|
|
2825
2828
|
{var isHScreen=this.ChartFrame.IsHScreen===true;var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var xPointCount=this.ChartFrame.XPointCount;if(isHScreen){var border=this.ChartBorder.GetHScreenBorder();var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.BottomEx;}else{var border=this.ChartBorder.GetBorder();var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.RightEx;}var upColor=this.UpColor;var downColor=this.DownColor;var unchagneColor=this.UnchagneColor;var ptMax={X:null,Y:null,Value:null,Align:'left'};var ptMin={X:null,Y:null,Value:null,Align:'left'};for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth){var data=this.Data.Data[i];if(data.Open==null||data.High==null||data.Low==null||data.Close==null)continue;var left=xOffset;var right=xOffset+dataWidth;if(right>chartright)break;var x=left+(right-left)/2;var yLow=this.GetYFromData(data.Low,false);var yHigh=this.GetYFromData(data.High,false);var yOpen=this.GetYFromData(data.Open,false);var yClose=this.GetYFromData(data.Close,false);if(ptMax.Value==null||ptMax.Value<data.High)//求最大值
|
|
2826
2829
|
{ptMax.X=x;ptMax.Y=yHigh;ptMax.Value=data.High;ptMax.Align=j<xPointCount/2?'left':'right';}if(ptMin.Value==null||ptMin.Value>data.Low)//求最小值
|
|
@@ -2881,7 +2884,7 @@ this.TooltipRect.push([i,rect]);//[0]数据索引 [1]数据区域
|
|
|
2881
2884
|
this.PtMin={X:null,Y:null,Value:null,Align:'left'};//清空最小
|
|
2882
2885
|
this.DrawKRange={Start:null,End:null};this.ChartFrame.ChartKLine={Max:null,Min:null};//保存K线上 显示最大最小值坐标
|
|
2883
2886
|
if(!this.IsShow)return;if(ChartData.IsTickPeriod(this.Period))//分笔图
|
|
2884
|
-
{this.Canvas.save();if(this.DrawType==1){this.ClipClient(this.ChartFrame.IsHScreen);this.DrawCloseLine();}else{this.ClipTickClient(this.ChartFrame.IsHScreen);this.DrawTick();}this.Canvas.restore();return;}this.Canvas.save();this.ClipClient(this.ChartFrame.IsHScreen);if(this.DrawType==1){this.DrawCloseLine();this.Canvas.restore();return;}else if(this.DrawType==2){this.DrawAKLine();}else if(this.DrawType==4){this.DrawCloseArea();}else if(this.DrawType==5){this.DrawOrderFlow();}else{this.DrawKBar();}if(this.TradeIcon)this.DrawTradeIcon();else this.DrawTrade();this.Canvas.restore();if(this.IsShowMaxMinPrice)//标注最大值最小值
|
|
2887
|
+
{this.Canvas.save();if(this.DrawType==1){this.ClipClient(this.ChartFrame.IsHScreen);this.DrawCloseLine();}else{this.ClipTickClient(this.ChartFrame.IsHScreen);this.DrawTick();}this.Canvas.restore();return;}this.Canvas.save();this.ClipClient(this.ChartFrame.IsHScreen);if(this.DrawType==1){this.DrawCloseLine();this.Canvas.restore();return;}else if(this.DrawType==2){this.DrawAKLine();}else if(this.DrawType==4){this.DrawCloseArea();}else if(this.DrawType==5){this.DrawOrderFlow();}else if(this.DrawType==7){this.DrawOrderFlow_Style2();}else if(this.DrawType==8){this.DrawOrderFlow_Style3();}else{this.DrawKBar();}if(this.TradeIcon)this.DrawTradeIcon();else this.DrawTrade();this.Canvas.restore();if(this.IsShowMaxMinPrice)//标注最大值最小值
|
|
2885
2888
|
{if(this.ChartFrame.IsHScreen===true)this.HScreenDrawMaxMinPrice(this.PtMax,this.PtMin);else this.DrawMaxMinPrice(this.PtMax,this.PtMin);}};this.DrawMaxMinPrice=function(ptMax,ptMin){if(ptMax.X==null||ptMax.Y==null||ptMax.Value==null)return;if(ptMin.X==null||ptMin.Y==null||ptMin.Value==null)return;var leftArrow=g_JSChartResource.KLine.MaxMin.LeftArrow;var rightArrow=g_JSChartResource.KLine.MaxMin.RightArrow;var highYOffset=g_JSChartResource.KLine.MaxMin.HighYOffset;var lowYOffset=g_JSChartResource.KLine.MaxMin.LowYOffset;var defaultfloatPrecision=GetfloatPrecision(this.Symbol);this.Canvas.font=this.TextFont;this.Canvas.fillStyle=this.TextColor;var top=this.ChartBorder.GetTopEx();var bottom=this.ChartBorder.GetBottomEx();var ptTop=ptMax;if(this.ChartFrame.CoordinateType==1)//反转坐标
|
|
2886
2889
|
{if(ptMax.Y<ptMin.Y)ptTop=ptMin;this.Canvas.textBaseline='top';}else{if(ptMax.Y>ptMin.Y)ptTop=ptMin;this.Canvas.textBaseline='bottom';}this.Canvas.textAlign=ptTop.Align;var left=ptTop.Align=='left'?ptTop.X:ptTop.X;if(IFrameSplitOperator.IsNumber(highYOffset))ptTop.Y+=highYOffset;var text=ptTop.Value.toFixed(defaultfloatPrecision);if(ptTop.Align=='left')text=leftArrow+text;else text=text+rightArrow;if(ptTop.Y>top-2){this.Canvas.fillText(text,left,ptTop.Y);this.ChartFrame.ChartKLine.Max={X:left,Y:ptTop.Y,Text:{BaseLine:'bottom'}};}var ptBottom=ptMin;if(this.ChartFrame.CoordinateType==1){if(ptMin.Y>ptMax.Y)ptBottom=ptMax;this.Canvas.textBaseline='bottom';}else{if(ptMax.Y>ptMin.Y)ptTop=ptMin;this.Canvas.textBaseline='top';}this.Canvas.textAlign=ptBottom.Align;var left=ptBottom.Align=='left'?ptBottom.X:ptBottom.X;if(IFrameSplitOperator.IsNumber(lowYOffset))ptBottom.Y+=lowYOffset;var text=ptMin.Value.toFixed(defaultfloatPrecision);if(ptBottom.Align=='left')text=leftArrow+text;else text=text+rightArrow;if(ptBottom.Y<bottom+1){this.Canvas.fillText(text,left,ptBottom.Y);this.ChartFrame.ChartKLine.Min={X:left,Y:ptBottom.Y,Text:{BaseLine:'top'}};}};this.HScreenDrawMaxMinPrice=function(ptMax,ptMin)//横屏模式下显示最大最小值
|
|
2887
2890
|
{if(ptMax.X==null||ptMax.Y==null||ptMax.Value==null)return;if(ptMin.X==null||ptMin.Y==null||ptMin.Value==null)return;var leftArrow=g_JSChartResource.KLine.MaxMin.LeftArrow;var rightArrow=g_JSChartResource.KLine.MaxMin.RightArrow;var highYOffset=g_JSChartResource.KLine.MaxMin.HighYOffset;var lowYOffset=g_JSChartResource.KLine.MaxMin.LowYOffset;var defaultfloatPrecision=GetfloatPrecision(this.Symbol);var xText=ptMax.Y;var yText=ptMax.X;if(IFrameSplitOperator.IsNumber(highYOffset))xText+=highYOffset;this.Canvas.save();this.Canvas.translate(xText,yText);this.Canvas.rotate(90*Math.PI/180);this.Canvas.font=this.TextFont;this.Canvas.fillStyle=this.TextColor;this.Canvas.textAlign=ptMax.Align;this.Canvas.textBaseline='bottom';var text=ptMax.Value.toFixed(defaultfloatPrecision);if(ptMax.Align=='left')text=leftArrow+text;else text=text+rightArrow;this.Canvas.fillText(text,0,0);this.Canvas.restore();var xText=ptMin.Y;var yText=ptMin.X;if(IFrameSplitOperator.IsNumber(lowYOffset))xText+=lowYOffset;this.Canvas.save();this.Canvas.translate(xText,yText);this.Canvas.rotate(90*Math.PI/180);this.Canvas.font=this.TextFont;this.Canvas.fillStyle=this.TextColor;this.Canvas.textAlign=ptMin.Align;this.Canvas.textBaseline='top';var text=ptMin.Value.toFixed(defaultfloatPrecision);if(ptMin.Align=='left')text=leftArrow+text;else text=text+rightArrow;this.Canvas.fillText(text,0,0);this.Canvas.restore();};//画某一天的信息地雷
|
|
@@ -2912,7 +2915,55 @@ if(!isSmallKLine){this.Canvas.beginPath();this.Canvas.strokeStyle=kColor.Border;
|
|
|
2912
2915
|
var textFont=this.GetDynamicOrderFlowFont(cellHeight,xKLine.DataWidth);//上下文字
|
|
2913
2916
|
if(orderFlow&&IFrameSplitOperator.IsNonEmptyArray(orderFlow.High)&&this.IsShowOrderText){for(var i=0;i<orderFlow.High.length;++i){var item=orderFlow.High[i];var text;if(IFrameSplitOperator.IsString(item.Text))text=item.Text;else if(IFrameSplitOperator.IsNumber(item.Value))text=item.Value.toString();if(!text)continue;if(item.Color)this.Canvas.fillStyle=item.Color;else this.Canvas.fillStyle=this.OrderFlow.Text.Color;var yPrice=this.GetYFromData(item.Price,false);if(item.Font){var itemFont=this.GetDynamicOrderFlowFont(cellHeight,xKLine.DataWidth,item.Font);this.Canvas.font=itemFont;this.Canvas.fillText(text,xKLine.Center,yPrice);this.Canvas.font=textFont;}else{this.Canvas.fillText(text,xKLine.Center,yPrice);}}}if(orderFlow&&IFrameSplitOperator.IsNonEmptyArray(orderFlow.Low)&&this.IsShowOrderText){for(var i=0;i<orderFlow.Low.length;++i){var item=orderFlow.Low[i];var text;if(IFrameSplitOperator.IsString(item.Text))text=item.Text;else if(IFrameSplitOperator.IsNumber(item.Value))text=item.Value.toString();if(!text)continue;if(item.Color)this.Canvas.fillStyle=item.Color;else this.Canvas.fillStyle=this.OrderFlow.Text.Color;var yPrice=this.GetYFromData(item.Price,false);if(item.Font){var itemFont=this.GetDynamicOrderFlowFont(cellHeight,xKLine.DataWidth,item.Font);this.Canvas.font=itemFont;this.Canvas.fillText(text,xKLine.Center,yPrice);this.Canvas.font=textFont;}else{this.Canvas.fillText(text,xKLine.Center,yPrice);}}}};this.GetPriceYOffset=function(value){var frame=this.ChartFrame;var y=frame.ChartBorder.GetHeightEx()*value/(frame.HorizontalMax-frame.HorizontalMin);return y;};this.GetDynamicOrderFlowFont=function(cellHeight,width,fontOption){var fontSize=parseInt(cellHeight)-2;if(cellHeight<5)fontSize=parseInt(cellHeight);//高度太小了就不要上下间距了
|
|
2914
2917
|
if(fontSize>this.OrderFlow.Text.FontMaxSize)fontSize=this.OrderFlow.Text.FontMaxSize;else if(fontSize<=0)fontSize=1;var font=this.FormatFontString(fontSize,this.OrderFlow.Text.Family,fontOption);for(var i=fontSize;i>0;i-=2){var font=this.FormatFontString(i,this.OrderFlow.Text.Family,fontOption);this.Canvas.font=font;var textWidth=this.Canvas.measureText(this.OrderFlow.Text.MaxValue).width+2;if(textWidth<width)break;}return font;};this.FormatFontString=function(fontSize,family,option){var font;if(!option){font=fontSize+'px '+family;}else{if(option.Weight)font=option.Weight+' '+fontSize+'px '+family;}return font;};this.DrawOrderFlowHBar=function(index,orderFlow,orderItem,dataWidth,distanceWidth){var offset=this.ShowRange.Start;var endOffset=this.ShowRange.Start+this.ShowRange.ShowCount;var yPrice=this.GetYFromData(orderItem.Price,false);var value=parseInt(index+orderItem.HBar.Width);var start=index-offset;var end=value-offset;if(start<0)start=0;if(end<0)end=0;if(start<=end){var chartright=this.ChartBorder.GetRight();var xPointCount=this.ChartFrame.XPointCount;var dataOffset=offset;var cellHeight=this.GetPriceYOffset(orderFlow.PriceOffset);var xStart=this.ChartFrame.GetXFromIndex(start)-dataWidth/2;if(orderItem.HBar.Type==1){for(var i=0,j=index+1;i<orderItem.HBar.Width&&j<this.Data.Data.length;++i,++j){var data=this.Data.Data[j];if(data.Close<orderItem.Price){end=j-1-dataOffset;break;}}}else if(orderItem.HBar.Type==2){for(var i=0,j=index+1;i<orderItem.HBar.Width&&j<this.Data.Data.length;++i,++j){var data=this.Data.Data[j];if(data.Close>orderItem.Price){end=j-1-dataOffset;break;}}}if(end<0)return;var xEnd=this.ChartFrame.GetXFromIndex(end)+dataWidth/2;var yTop=yPrice-cellHeight/2;var yHeight=cellHeight+0.5;if(IFrameSplitOperator.IsNumber(orderItem.HBar.Height))yHeight=orderItem.HBar.Height*cellHeight+0.1;var fValue=orderItem.HBar.Width-parseInt(orderItem.HBar.Width);if(fValue>0.000001)xEnd+=(dataWidth+distanceWidth)*fValue;this.Canvas.fillStyle=orderItem.HBar.Color;this.Canvas.fillRect(ToFixedRect(xStart),ToFixedRect(yTop),ToFixedRect(xEnd-xStart),ToFixedRect(yHeight));//高度适当加上,否则行间有空隙
|
|
2915
|
-
}};this.PtInChart=function(x,y){if(this.DrawType==1||this.DrawType==4){return this.PtInLine(x,y,{KLineClose:true});}return this.PtInKBar(x,y);};this.DrawSelectedStatus=function(){this.DrawLinePoint({KLineClose:true});}
|
|
2918
|
+
}};this.PtInChart=function(x,y){if(this.DrawType==1||this.DrawType==4){return this.PtInLine(x,y,{KLineClose:true});}return this.PtInKBar(x,y);};this.DrawSelectedStatus=function(){this.DrawLinePoint({KLineClose:true});};//////////////////////////////////////////////////////////////
|
|
2919
|
+
//订单流样式2
|
|
2920
|
+
this.DrawOrderFlow_Style2=function(){var isHScreen=this.ChartFrame.IsHScreen===true;var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var border=this.ChartBorder.GetBorder();var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.RightEx;var xPointCount=this.ChartFrame.XPointCount;this.AryOrderFlowBorder=[];if(isHScreen){var border=this.ChartBorder.GetHScreenBorder();xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;chartright=border.BottomEx;}var upColor=this.OrderFlow_Style2.UpColor;var downColor=this.OrderFlow_Style2.DownColor;var unchagneColor=this.OrderFlow_Style2.UnchagneColor;var barWidth=ToFixedRect(this.OrderFlow_Style2.BarWidth);var textWidth=dataWidth-barWidth;if(textWidth/7<barWidth)barWidth=textWidth/7;if(barWidth<=1)barWidth=2;for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth,++this.ShowRange.DataCount){var data=this.Data.Data[i];if(data.Open==null||data.High==null||data.Low==null||data.Close==null)continue;var left=xOffset;var right=xOffset+dataWidth;if(right>chartright)break;var x=left+(right-left)/2;var yLow=this.GetYFromData(data.Low,false);var yHigh=this.GetYFromData(data.High,false);var yOpen=this.GetYFromData(data.Open,false);var yClose=this.GetYFromData(data.Close,false);var y=yHigh;var barTop=Math.min(yOpen,yClose);var barBottom=Math.max(yOpen,yClose);var barLeft=ToFixedRect(left);var barRight=barLeft+barWidth;if(data.Open<data.Close)this.Canvas.fillStyle=upColor;else if(data.Open>data.Close)this.Canvas.fillStyle=downColor;else this.Canvas.fillStyle=unchagneColor;var cellHeight=0;if(data.OrderFlow&&IFrameSplitOperator.IsNumber(data.OrderFlow.PriceOffset))cellHeight=this.GetPriceYOffset(data.OrderFlow.PriceOffset);this.Canvas.fillRect(barLeft,ToFixedRect(barTop-cellHeight/2),barWidth,ToFixedRect(barBottom-barTop+cellHeight));var yKline={Low:yLow,High:yHigh,Open:yOpen,Close:yClose};var xKLine={Left:barRight,Center:x,Right:right,DataWidth:right-barRight};xKLine.Center=xKLine.Left+xKLine.DataWidth/2;this.DrawOrderFlowBar_Style2(data.OrderFlow,data,xKLine,yKline,isHScreen);}//最后绘制边框
|
|
2921
|
+
if(dataWidth-barWidth>5){for(var i=0;i<this.AryOrderFlowBorder.length;++i){var item=this.AryOrderFlowBorder[i];if(!item||!item.Rect||!item.Color)continue;var rect=item.Rect;this.Canvas.strokeStyle=item.Color;this.Canvas.beginPath();this.Canvas.rect(ToFixedPoint(rect.Left),ToFixedPoint(rect.Top),ToFixedRect(rect.Width),ToFixedRect(rect.Height));this.Canvas.stroke();}}this.AryOrderFlowBorder=[];};/////////////////////////////////////////////////////////////
|
|
2922
|
+
//订单流样式3
|
|
2923
|
+
this.DrawOrderFlow_Style3=function(){var isHScreen=this.ChartFrame.IsHScreen===true;var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var border=this.ChartBorder.GetBorder();var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.RightEx;var xPointCount=this.ChartFrame.XPointCount;this.AryOrderFlowBorder=[];if(isHScreen){var border=this.ChartBorder.GetHScreenBorder();xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;chartright=border.BottomEx;}var upColor=this.OrderFlow_Style3.UpColor;var downColor=this.OrderFlow_Style3.DownColor;var unchagneColor=this.OrderFlow_Style3.UnchagneColor;var barWidth=ToFixedRect(this.OrderFlow_Style3.BarWidth);if(dataWidth/4<barWidth)barWidth=dataWidth/4;if(barWidth<=1)barWidth=2;for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth,++this.ShowRange.DataCount){var data=this.Data.Data[i];if(data.Open==null||data.High==null||data.Low==null||data.Close==null)continue;var left=xOffset;var right=xOffset+dataWidth;if(right>chartright)break;var x=left+(right-left)/2;var yLow=this.GetYFromData(data.Low,false);var yHigh=this.GetYFromData(data.High,false);var yOpen=this.GetYFromData(data.Open,false);var yClose=this.GetYFromData(data.Close,false);var y=yHigh;var barTop=Math.min(yOpen,yClose);var barBottom=Math.max(yOpen,yClose);var barLeft=ToFixedRect(left);var barRight=barLeft+barWidth;if(data.Open<data.Close)this.Canvas.fillStyle=upColor;else if(data.Open>data.Close)this.Canvas.fillStyle=downColor;else this.Canvas.fillStyle=unchagneColor;var cellHeight=0;if(data.OrderFlow&&IFrameSplitOperator.IsNumber(data.OrderFlow.PriceOffset))cellHeight=this.GetPriceYOffset(data.OrderFlow.PriceOffset);this.Canvas.fillRect(barLeft,ToFixedRect(barTop-cellHeight/2),barWidth,ToFixedRect(barBottom-barTop+cellHeight));var yKline={Low:yLow,High:yHigh,Open:yOpen,Close:yClose};var xKLine={Left:barRight,Right:right,DataWidth:right-barRight};this.DrawOrderFlowBar_Style3(data.OrderFlow,data,xKLine,yKline,isHScreen);}//最后绘制边框
|
|
2924
|
+
if(dataWidth-barWidth>5){for(var i=0;i<this.AryOrderFlowBorder.length;++i){var item=this.AryOrderFlowBorder[i];if(!item||!item.Rect||!item.Color)continue;var rect=item.Rect;this.Canvas.strokeStyle=item.Color;this.Canvas.beginPath();this.Canvas.rect(ToFixedPoint(rect.Left),ToFixedPoint(rect.Top),ToFixedRect(rect.Width),ToFixedRect(rect.Height));this.Canvas.stroke();}}this.AryOrderFlowBorder=[];};this.DrawOrderFlowBar_Style2=function(orderFlow,kItem,xKLine,yKline,isHScreen){var top=Math.min(yKline.Open,yKline.Close);var bottom=Math.max(yKline.Open,yKline.Close);var barHeight=Math.abs(yKline.Open-yKline.Close);var cellHeight=0;if(orderFlow&&IFrameSplitOperator.IsNumber(orderFlow.PriceOffset))cellHeight=this.GetPriceYOffset(orderFlow.PriceOffset);var textFont=this.GetDynamicOrderFlowFont(cellHeight,xKLine.DataWidth/2);this.IsShowOrderText=cellHeight>5&&xKLine.DataWidth>10;if(this.OrderFlow.AlwaysShowOrderText)this.IsShowOrderText=true;/* 背景暂时不用
|
|
2925
|
+
var kColor;
|
|
2926
|
+
if (kItem.Open<kItem.Close) kColor=this.OrderFlow.UpColor;
|
|
2927
|
+
else if (kItem.Open>kItem.Close) kColor=this.OrderFlow.DownColor;
|
|
2928
|
+
else kColor=this.OrderFlow.UnchagneColor;
|
|
2929
|
+
|
|
2930
|
+
var isSmallKLine=(xKLine.DataWidth<4);
|
|
2931
|
+
|
|
2932
|
+
if (isSmallKLine)
|
|
2933
|
+
{
|
|
2934
|
+
this.Canvas.strokeStyle=kColor.Border;
|
|
2935
|
+
this.Canvas.beginPath();
|
|
2936
|
+
this.Canvas.moveTo(ToFixedPoint(xKLine.Center),top-cellHeight/2);
|
|
2937
|
+
this.Canvas.lineTo(ToFixedPoint(xKLine.Center),bottom+cellHeight/2);
|
|
2938
|
+
this.Canvas.stroke();
|
|
2939
|
+
}
|
|
2940
|
+
else
|
|
2941
|
+
{
|
|
2942
|
+
this.Canvas.fillStyle=kColor.BG;
|
|
2943
|
+
this.Canvas.fillRect(ToFixedRect(xKLine.Left),ToFixedRect(top-cellHeight/2),ToFixedRect(xKLine.DataWidth),ToFixedRect(barHeight+cellHeight));
|
|
2944
|
+
}
|
|
2945
|
+
*/this.Canvas.textBaseline='middle';this.Canvas.textAlign='left';this.Canvas.font=textFont;var textWidth=xKLine.DataWidth/2;var textXOffset=2;if(orderFlow&&IFrameSplitOperator.IsNonEmptyArray(orderFlow.Order)){for(var i=0;i<orderFlow.Order.length;++i){var item=orderFlow.Order[i];var yPrice=this.GetYFromData(item.Price,false);var rect={Left:xKLine.Left,Right:xKLine.Center,Bottom:yPrice+cellHeight/2,Top:yPrice-cellHeight/2};rect.Width=rect.Right-rect.Left;rect.Height=rect.Bottom-rect.Top;if(item.Ask.BG){this.Canvas.fillStyle=item.Ask.BG;this.Canvas.fillRect(ToFixedRect(rect.Left),ToFixedRect(rect.Top),ToFixedRect(rect.Width),ToFixedRect(rect.Height));}if(item.Ask.BorderColor){var borderItem={Rect:rect,Color:item.Ask.BorderColor};this.AryOrderFlowBorder.push(borderItem);}var text=null;if(IFrameSplitOperator.IsString(item.Ask.Text))text=item.Ask.Text;else if(IFrameSplitOperator.IsNumber(item.Ask.Value))text=item.Ask.Value.toString();if(text&&this.IsShowOrderText){if(item.Ask.Color)this.Canvas.fillStyle=item.Ask.Color;else this.Canvas.fillStyle=this.OrderFlow.Text.Color;if(item.Ask.Font){var itemFont=this.GetDynamicOrderFlowFont(cellHeight,xKLine.DataWidth/2,item.Ask.Font);this.Canvas.font=itemFont;this.Canvas.fillText(text,xKLine.Left+textXOffset,yPrice);this.Canvas.font=textFont;}else{this.Canvas.fillText(text,xKLine.Left+textXOffset,yPrice);}}var rect={Left:xKLine.Center,Right:xKLine.Right,Bottom:yPrice+cellHeight/2,Top:yPrice-cellHeight/2};rect.Width=rect.Right-rect.Left;rect.Height=rect.Bottom-rect.Top;if(item.Bid.BG){this.Canvas.fillStyle=item.Bid.BG;this.Canvas.fillRect(ToFixedRect(rect.Left),ToFixedRect(rect.Top),ToFixedRect(rect.Width),ToFixedRect(rect.Height));}if(item.Bid.BorderColor){var borderItem={Rect:rect,Color:item.Bid.BorderColor};this.AryOrderFlowBorder.push(borderItem);}var text=null;if(IFrameSplitOperator.IsString(item.Bid.Text))text=item.Bid.Text;else if(IFrameSplitOperator.IsNumber(item.Bid.Value))text=item.Bid.Value.toString();if(text&&this.IsShowOrderText){if(item.Bid.Color)this.Canvas.fillStyle=item.Bid.Color;else this.Canvas.fillStyle=this.OrderFlow.Text.Color;if(item.Bid.Font){var itemFont=this.GetDynamicOrderFlowFont(cellHeight,xKLine.DataWidth/2,item.Bid.Font);this.Canvas.font=itemFont;this.Canvas.fillText(text,xKLine.Center+textXOffset,yPrice);this.Canvas.font=textFont;}else{this.Canvas.fillText(text,xKLine.Center+textXOffset,yPrice);}}}}};this.DrawOrderFlowBar_Style3=function(orderFlow,kItem,xKLine,yKline,isHScreen){var top=Math.min(yKline.Open,yKline.Close);var bottom=Math.max(yKline.Open,yKline.Close);var barHeight=Math.abs(yKline.Open-yKline.Close);var cellHeight=0;if(orderFlow&&IFrameSplitOperator.IsNumber(orderFlow.PriceOffset))cellHeight=this.GetPriceYOffset(orderFlow.PriceOffset);var textFont=this.GetDynamicOrderFlowFont(cellHeight,xKLine.DataWidth/2);this.IsShowOrderText=cellHeight>5&&xKLine.DataWidth>10;if(this.OrderFlow.AlwaysShowOrderText)this.IsShowOrderText=true;/* 背景暂时不用
|
|
2946
|
+
var kColor;
|
|
2947
|
+
if (kItem.Open<kItem.Close) kColor=this.OrderFlow.UpColor;
|
|
2948
|
+
else if (kItem.Open>kItem.Close) kColor=this.OrderFlow.DownColor;
|
|
2949
|
+
else kColor=this.OrderFlow.UnchagneColor;
|
|
2950
|
+
|
|
2951
|
+
var isSmallKLine=(xKLine.DataWidth<4);
|
|
2952
|
+
|
|
2953
|
+
if (isSmallKLine)
|
|
2954
|
+
{
|
|
2955
|
+
this.Canvas.strokeStyle=kColor.Border;
|
|
2956
|
+
this.Canvas.beginPath();
|
|
2957
|
+
this.Canvas.moveTo(ToFixedPoint(xKLine.Center),top-cellHeight/2);
|
|
2958
|
+
this.Canvas.lineTo(ToFixedPoint(xKLine.Center),bottom+cellHeight/2);
|
|
2959
|
+
this.Canvas.stroke();
|
|
2960
|
+
}
|
|
2961
|
+
else
|
|
2962
|
+
{
|
|
2963
|
+
this.Canvas.fillStyle=kColor.BG;
|
|
2964
|
+
this.Canvas.fillRect(ToFixedRect(xKLine.Left),ToFixedRect(top-cellHeight/2),ToFixedRect(xKLine.DataWidth),ToFixedRect(barHeight+cellHeight));
|
|
2965
|
+
}
|
|
2966
|
+
*/this.Canvas.textBaseline='middle';this.Canvas.textAlign='left';this.Canvas.font=textFont;var textXOffset=2;var itemWidth=xKLine.DataWidth-4;if(orderFlow&&IFrameSplitOperator.IsNonEmptyArray(orderFlow.Order)){for(var i=0;i<orderFlow.Order.length;++i){var item=orderFlow.Order[i];var yPrice=this.GetYFromData(item.Price,false);var rect={Left:xKLine.Left,Right:xKLine.Right,Bottom:yPrice+cellHeight/2,Top:yPrice-cellHeight/2};rect.Width=rect.Right-rect.Left;rect.Height=rect.Bottom-rect.Top;if(item.Item.BG){this.Canvas.fillStyle=item.Item.BG;this.Canvas.fillRect(ToFixedRect(rect.Left),ToFixedRect(rect.Top),ToFixedRect(rect.Width),ToFixedRect(rect.Height));}if(item.Item.BorderColor){var borderItem={Rect:rect,Color:item.Item.BorderColor};this.AryOrderFlowBorder.push(borderItem);}var text=null;if(IFrameSplitOperator.IsString(item.Item.Text))text=item.Item.Text;else if(IFrameSplitOperator.IsNumber(item.Item.Value))text=item.Item.Value.toString();if(text&&this.IsShowOrderText){if(item.Item.Color)this.Canvas.fillStyle=item.Item.Color;else this.Canvas.fillStyle=this.OrderFlow.Text.Color;if(item.Item.Font){var itemFont=this.GetDynamicOrderFlowFont(cellHeight,itemWidth,item.Item.Font);this.Canvas.font=itemFont;this.Canvas.fillText(text,xKLine.Left+textXOffset,yPrice);this.Canvas.font=textFont;}else{this.Canvas.fillText(text,xKLine.Left+textXOffset,yPrice);}}}}};}function ChartColorKline(){this.newMethod=IChartPainting;//派生
|
|
2916
2967
|
this.newMethod();delete this.newMethod;this.ClassName='ChartColorKline';//类名
|
|
2917
2968
|
this.Symbol;//股票代码
|
|
2918
2969
|
this.Color='rgb(0,255,44)';this.IsEmptyBar=false;this.DrawType=0;//0=实心K线柱子 3=空心K线柱子
|
|
@@ -3713,7 +3764,7 @@ bFilter=false;}else{switch(this.CoordinateType){case 1:if(!this.SplitPercentage(
|
|
|
3713
3764
|
if(!this.SplitIncrease(splitData,defaultfloatPrecision))this.SplitDefault(splitData,defaultfloatPrecision);else bFilter=false;break;case 4://等分坐标
|
|
3714
3765
|
this.SplitAverage(splitData,defaultfloatPrecision);bFilter=false;break;case 5://黄金分割
|
|
3715
3766
|
this.SplitGoldenSection(splitData,defaultfloatPrecision);bFilter=false;break;case 2://对数坐标
|
|
3716
|
-
if(this.SplitLogarithmic(splitData,defaultfloatPrecision)){bFilter=false;}else{this.SplitDefault(splitData,defaultfloatPrecision);}break;default:if(this.SplitType==1){this.SplitFixed(splitData,defaultfloatPrecision);bFilter=false;}else{this.SplitDefault(splitData,defaultfloatPrecision,isFixedMaxMin);}break;}}this.CustomCoordinate(defaultfloatPrecision);if(bFilter)this.Frame.HorizontalInfo=this.Filter(this.Frame.HorizontalInfo,false);this.Frame.HorizontalMax=splitData.Max;this.Frame.HorizontalMin=splitData.Min;if(this.EnableZoomUpDown==true&&!this.FixedYMaxMin)this.FixedYMaxMin={Max:splitData.Max,Min:splitData.Min};/*
|
|
3767
|
+
if(this.SplitLogarithmic(splitData,defaultfloatPrecision)){bFilter=false;}else{this.SplitDefault(splitData,defaultfloatPrecision);}break;default:if(this.SplitType==1){this.SplitFixed(splitData,defaultfloatPrecision);bFilter=false;}else if(this.SplitType==2){this.SplitFixedV2(splitData,defaultfloatPrecision);bFilter=false;}else{this.SplitDefault(splitData,defaultfloatPrecision,isFixedMaxMin);}break;}}this.CustomCoordinate(defaultfloatPrecision);if(bFilter)this.Frame.HorizontalInfo=this.Filter(this.Frame.HorizontalInfo,false);this.Frame.HorizontalMax=splitData.Max;this.Frame.HorizontalMin=splitData.Min;if(this.EnableZoomUpDown==true&&!this.FixedYMaxMin)this.FixedYMaxMin={Max:splitData.Max,Min:splitData.Min};/*
|
|
3717
3768
|
for(var i=0;i<this.Frame.HorizontalInfo.length;++i)
|
|
3718
3769
|
{
|
|
3719
3770
|
JSConsole.Chart.Log(`[FrameSplitKLinePriceY::Operator] ${i}=${this.Frame.HorizontalInfo[i].Message[0]}`);
|
|
@@ -3741,7 +3792,8 @@ if(this.IsShowRightText)item.Message[1]=strText;//右边价格坐标
|
|
|
3741
3792
|
this.Frame.HorizontalInfo.splice(0,0,item);}this.Frame.Logarithmic={Up:aryUp,Down:aryDown,OpenPrice:firstOpenPrice};return true;};this.SplitDefault=function(splitData,floatPrecision,isFixedMaxMin)//默认坐标
|
|
3742
3793
|
{//固定最大最小值 不自动调整范围
|
|
3743
3794
|
if(!isFixedMaxMin)this.IntegerCoordinateSplit(splitData);this.Frame.HorizontalInfo=[];for(var i=0,value=splitData.Min;i<splitData.Count;++i,value+=splitData.Interval){this.Frame.HorizontalInfo[i]=new CoordinateInfo();this.Frame.HorizontalInfo[i].Value=value;if(this.IsShowLeftText)this.Frame.HorizontalInfo[i].Message[0]=value.toFixed(floatPrecision);if(this.IsShowRightText)this.Frame.HorizontalInfo[i].Message[1]=value.toFixed(floatPrecision);}};this.SplitFixed=function(splitData,floatPrecision)//固定分割坐标
|
|
3744
|
-
{this.Frame.HorizontalInfo=[];for(var i=0,value=splitData.Min;i<splitData.Count;++i,value+=splitData.Interval){this.Frame.HorizontalInfo[i]=new CoordinateInfo();this.Frame.HorizontalInfo[i].Value=value;if(this.IsShowLeftText)this.Frame.HorizontalInfo[i].Message[0]=value.toFixed(floatPrecision);if(this.IsShowRightText)this.Frame.HorizontalInfo[i].Message[1]=value.toFixed(floatPrecision);}};this.
|
|
3795
|
+
{this.Frame.HorizontalInfo=[];for(var i=0,value=splitData.Min;i<splitData.Count;++i,value+=splitData.Interval){this.Frame.HorizontalInfo[i]=new CoordinateInfo();this.Frame.HorizontalInfo[i].Value=value;if(this.IsShowLeftText)this.Frame.HorizontalInfo[i].Message[0]=value.toFixed(floatPrecision);if(this.IsShowRightText)this.Frame.HorizontalInfo[i].Message[1]=value.toFixed(floatPrecision);}};this.SplitFixedV2=function(splitData,floatPrecision)//固定分割坐标
|
|
3796
|
+
{this.Frame.HorizontalInfo=[];for(var i=0,value=splitData.Min;i<splitData.Count;++i,value+=splitData.Interval){this.Frame.HorizontalInfo[i]=new CoordinateInfo();this.Frame.HorizontalInfo[i].Value=value;if(this.IsShowLeftText)this.Frame.HorizontalInfo[i].Message[0]=value.toFixed(floatPrecision);if(this.IsShowRightText)this.Frame.HorizontalInfo[i].Message[1]=value.toFixed(floatPrecision);}if(floatPrecision==0){splitData.Max+=1;splitData.Min-=1;}else if(floatPrecision==1){splitData.Max+=0.1;splitData.Min-=0.1;}else if(floatPrecision==2){splitData.Max+=0.01;splitData.Min-=0.01;}};this.CustomCoordinate=function(floatPrecision){this.Frame.CustomHorizontalInfo=[];for(var i in this.Custom){var item=this.Custom[i];if(item.Type==0){var dec=floatPrecision;//外部设置小数位数
|
|
3745
3797
|
if(IFrameSplitOperator.IsNumber(item.FloatPrecision)&&item.FloatPrecision>=0)dec=item.FloatPrecision;var latestItem=this.GetLatestPrice(dec,item);if(latestItem)this.Frame.CustomHorizontalInfo.push(latestItem);}else if(item.Type==1){this.CustomFixedCoordinate(item);}}};this.GetLatestPrice=function(floatPrecision,option){if(!this.Data||!this.Data.Data)return null;if(this.Data.Data.length<=0)return null;var latestItem=this.Data.Data[this.Data.Data.length-1];var info=new CoordinateInfo();info.Type=0;info.Value=latestItem.Close;info.TextColor=g_JSChartResource.FrameLatestPrice.TextColor;info.LineType=2;//虚线
|
|
3746
3798
|
var strPrice=latestItem.Close.toFixed(floatPrecision);if(option.DateTime=='HH:MM'&&ChartData.IsMinutePeriod(this.Period,true)){var strTime=IFrameSplitOperator.FormatTimeString(latestItem.Time,option.DateTime);var aryText=[{Text:strPrice},{Text:strTime}];if(option.Position=='left')info.Message[0]=aryText;else info.Message[1]=aryText;}else if(IFrameSplitOperator.IsBool(option.CountDown))//倒计时
|
|
3747
3799
|
{var aryText=[{Text:strPrice},{Type:1}];if(option.Position=='left')info.Message[0]=aryText;else info.Message[1]=aryText;}else{if(option.Position=='left')info.Message[0]=strPrice;else info.Message[1]=strPrice;}if(latestItem.Close>latestItem.Open)info.LineColor=g_JSChartResource.FrameLatestPrice.UpBarColor;else if(latestItem.Close<latestItem.Open)info.LineColor=g_JSChartResource.FrameLatestPrice.DownBarColor;else info.LineColor=g_JSChartResource.FrameLatestPrice.UnchagneBarColor;if(IFrameSplitOperator.IsNumber(option.LineType))info.LineType=option.LineType;if(option.IsShowLine==false)info.LineType=-1;return info;};this.GetFirstOpenPrice=function()//获取显示第1个数据的开盘价
|
|
@@ -4634,7 +4686,7 @@ UnchagneColor:{BG:"rgb(216,221,177)",Border:"rgb(209,172,129)"},//平盘
|
|
|
4634
4686
|
Text:{Color:"rgb(92,96,89)",Family:'Arial',FontMaxSize:16,MaxValue:"8888"},//文字
|
|
4635
4687
|
Line:{UpDownColor:"rgb(0,0,0)",MiddleColor:"rgb(211,211,211)"},//最大, 最低,中间 竖线
|
|
4636
4688
|
AlwaysShowOrderText:true//总是显示订单流文字
|
|
4637
|
-
};this.Index={};//指标线段颜色
|
|
4689
|
+
};this.OrderFlow_Style2={BarWidth:10,UpColor:'rgb(241,55,63)',DownColor:"rgb(75,105,150)",UnchagneColor:"rgb(79,79,79)"};this.OrderFlow_Style3={BarWidth:20,UpColor:'rgb(241,55,63)',DownColor:"rgb(75,105,150)",UnchagneColor:"rgb(79,79,79)"};this.Index={};//指标线段颜色
|
|
4638
4690
|
this.Index.LineColor=["rgb(255,174,0)","rgb(25,199,255)","rgb(175,95,162)","rgb(236,105,65)","rgb(68,114,196)","rgb(229,0,79)","rgb(0,128,255)","rgb(252,96,154)","rgb(42,230,215)","rgb(24,71,178)"];this.OverlaySymbol={Random:0};//Random 颜色的随机数
|
|
4639
4691
|
this.OverlaySymbol.Color=//叠加股票颜色
|
|
4640
4692
|
["rgb(38,198,218)","rgb(103,58,183)","rgb(0,191,165)","rgb(130,177,255)"];//历史数据api
|
|
@@ -4737,8 +4789,8 @@ Text:"rgb(60,60,60)"//默认文本
|
|
|
4737
4789
|
},UpTextColor:"rgb(238,21,21)",//上涨文字颜色
|
|
4738
4790
|
DownTextColor:"rgb(25,158,0)",//下跌文字颜色
|
|
4739
4791
|
UnchagneTextColor:"rgb(90,90,90)",//平盘文字颜色
|
|
4740
|
-
Tab:{Font:{Size:12,Name:"微软雅黑"},ScrollBarWidth:100,ButtonColor:"rgb(252,252,252)",BarColor:"rgb(180,180,180)",BorderColor:'rgb(180,180,180)',Mergin:{Left:5,Right:5,Top:4,Bottom:2},TabTitleColor:'rgb(60,60,60)',TabSelectedTitleColor:'rgb(0,0,0)',TabSelectedBGColor:"rgb(252,252,252)",TabMoveOnTitleColor:"rgb(0,0,0)",TabBGColor:"rgb(220,220,220)"},PageInfo:{Font:{Size:15,Name:"微软雅黑"},TextColor:"rgb(0,0,0)",BGColor:"rgba(180,180,180,0.5)",Mergin:{Left:5,Right:5,Top:4,Bottom:2}}},//自定义风格
|
|
4741
|
-
this.SetStyle=function(style){if(style.TooltipBGColor)this.TooltipBGColor=style.TooltipBGColor;if(style.TooltipAlpha)this.TooltipAlpha=style.TooltipAlpha;if(style.SelectRectBGColor)this.SelectRectBGColor=style.SelectRectBGColor;if(style.UpBarColor)this.UpBarColor=style.UpBarColor;if(style.DownBarColor)this.DownBarColor=style.DownBarColor;if(style.UnchagneBarColor)this.UnchagneBarColor=style.UnchagneBarColor;if(style.EmptyBarBGColor)this.EmptyBarBGColor=style.EmptyBarBGColor;if(style.Minute){if(style.Minute.VolBarColor)this.Minute.VolBarColor=style.Minute.VolBarColor;if(style.Minute.VolTitleColor)this.Minute.VolTitleColor=style.Minute.VolTitleColor;if(style.Minute.PriceColor)this.Minute.PriceColor=style.Minute.PriceColor;if(style.Minute.AvPriceColor)this.Minute.AvPriceColor=style.Minute.AvPriceColor;if(style.Minute.AreaPriceColor)this.Minute.AreaPriceColor=style.Minute.AreaPriceColor;if(style.Minute.PositionColor)this.Minute.PositionColor=style.Minute.PositionColor;if(style.Minute.FrameSplitTextColor)this.Minute.FrameSplitTextColor=style.Minute.FrameSplitTextColor;if(style.Minute.Before){var item=style.Minute.Before;if(item.BGColor)this.Minute.Before.BGColor=item.BGColor;if(item.LineColor)this.Minute.Before.LineColor=item.LineColor;if(item.VolColor)this.Minute.Before.VolColor=item.VolColor;if(item.AvPriceColor)this.Minute.Before.AvPriceColor=item.AvPriceColor;if(item.CloseIcon)this.Minute.Before.CloseIcon=item.CloseIcon;if(item.Point){if(item.Point.Color)this.Minute.Before.Point.Color=item.Point.Color;if(item.Point.Radius)this.Minute.Before.Point.Radius=item.Point.Radius;}}}if(style.DefaultTextColor)this.DefaultTextColor=style.DefaultTextColor;if(style.DefaultTextFont)this.DefaultTextFont=style.DefaultTextFont;if(style.TitleFont)this.TitleFont=style.TitleFont;if(style.IndexTitleBGColor)this.IndexTitleBGColor=style.IndexTitleBGColor;if(style.IndexTitleColor)this.IndexTitleColor=style.IndexTitleColor;if(style.IndexTitleSelectedColor)this.IndexTitleSelectedColor=style.IndexTitleSelectedColor;if(style.OverlayIndexTitleBGColor)this.OverlayIndexTitleBGColor=style.OverlayIndexTitleBGColor;if(style.UpTextColor)this.UpTextColor=style.UpTextColor;if(style.DownTextColor)this.DownTextColor=style.DownTextColor;if(style.UnchagneTextColor)this.UnchagneTextColor=style.UnchagneTextColor;if(style.CloseLineColor)this.CloseLineColor=style.CloseLineColor;if(style.CloseLineAreaColor)this.CloseLineAreaColor=style.CloseLineAreaColor;if(style.CloseLineWidth)this.CloseLineWidth=style.CloseLineWidth;if(style.FrameBorderPen)this.FrameBorderPen=style.FrameBorderPen;if(style.FrameSplitPen)this.FrameSplitPen=style.FrameSplitPen;if(style.FrameDotSplitPen)this.FrameDotSplitPen=style.FrameDotSplitPen;if(style.FrameSplitTextColor)this.FrameSplitTextColor=style.FrameSplitTextColor;if(style.FrameSplitTextFont)this.FrameSplitTextFont=style.FrameSplitTextFont;if(style.FrameTitleBGColor)this.FrameTitleBGColor=style.FrameTitleBGColor;if(style.Frame){if(style.Frame.XBottomOffset)this.Frame.XBottomOffset=style.Frame.XBottomOffset;if(style.Frame.YTopOffset)this.Frame.YTopOffset=style.Frame.YTopOffset;if(style.Frame.PercentageText){var item=style.Frame.PercentageText;if(item.PriceColor)this.Frame.PercentageText.PriceColor=item.PriceColor;if(item.PercentageColor)this.Frame.PercentageText.PercentageColor=item.PercentageColor;if(item.SplitColor)this.Frame.PercentageText.SplitColor=item.SplitColor;if(item.Font)this.Frame.PercentageText.Font=item.Font;}}if(style.FrameLatestPrice){if(style.FrameLatestPrice.TextColor)this.FrameLatestPrice.TextColor=style.FrameLatestPrice.TextColor;if(style.FrameLatestPrice.UpBarColor)this.FrameLatestPrice.UpBarColor=style.FrameLatestPrice.UpBarColor;if(style.FrameLatestPrice.DownBarColor)this.FrameLatestPrice.DownBarColor=style.FrameLatestPrice.DownBarColor;if(style.FrameLatestPrice.UnchagneBarColor)this.FrameLatestPrice.UnchagneBarColor=style.FrameLatestPrice.UnchagneBarColor;if(style.FrameLatestPrice.BGAlpha)this.FrameLatestPrice.BGAlpha=style.FrameLatestPrice.BGAlpha;}if(style.CorssCursorBGColor)this.CorssCursorBGColor=style.CorssCursorBGColor;if(style.CorssCursorTextColor)this.CorssCursorTextColor=style.CorssCursorTextColor;if(style.CorssCursorTextFont)this.CorssCursorTextFont=style.CorssCursorTextFont;if(style.CorssCursorVPenColor)this.CorssCursorVPenColor=style.CorssCursorVPenColor;if(style.CorssCursorHPenColor)this.CorssCursorHPenColor=style.CorssCursorHPenColor;if(style.CorssCursorBorderColor)this.CorssCursorBorderColor=style.CorssCursorBorderColor;if(style.CorssCursorXRangeBGColor)this.CorssCursorXRangeBGColor=style.CorssCursorXRangeBGColor;if(style.CorssCursor&&style.CorssCursor.RightButton){var item=style.CorssCursor.RightButton;if(item.BGColor)this.CorssCursor.RightButton.BGColor=item.BGColor;if(item.PenColor)this.CorssCursor.RightButton.PenColor=item.PenColor;if(item.Icon)this.CorssCursor.RightButton.Icon=item.Icon;}if(style.KLine)this.KLine=style.KLine;if(style.Index){if(style.Index.LineColor)this.Index.LineColor=style.Index.LineColor;if(style.Index.NotSupport)this.Index.NotSupport=style.Index.NotSupport;}if(style.ColorArray)this.ColorArray=style.ColorArray;if(style.DrawPicture){var item=style.DrawPicture;if(item.LineColor)this.DrawPicture.LineColor=item.LineColor;if(item.PointColor)this.DrawPicture.PointColor=item.PointColor;if(item.XYCoordinate)this.DrawPicture.XYCoordinate=item.XYCoordinate;if(IFrameSplitOperator.IsNumber(item.PointType))this.DrawPicture.PointType=item.PointType;if(IFrameSplitOperator.IsBool(item.IsShowPoint))this.DrawPicture.IsShowPoint=item.IsShowPoint;}if(style.TooltipPaint){if(style.TooltipPaint.BGColor)this.TooltipPaint.BGColor=style.TooltipPaint.BGColor;if(style.TooltipPaint.BorderColor)this.TooltipPaint.BorderColor=style.TooltipPaint.BorderColor;if(style.TooltipPaint.TitleColor)this.TooltipPaint.TitleColor=style.TooltipPaint.TitleColor;if(style.TooltipPaint.TitleFont)this.TooltipPaint.TitleFont=style.TooltipPaint.TitleFont;if(style.TooltipPaint.DateTimeColor)this.TooltipPaint.DateTimeColor=style.TooltipPaint.DateTimeColor;if(style.TooltipPaint.VolColor)this.TooltipPaint.VolColor=style.TooltipPaint.VolColor;if(style.TooltipPaint.AmountColor)this.TooltipPaint.AmountColor=style.TooltipPaint.AmountColor;}if(style.MinuteInfo){if(style.MinuteInfo.TextColor)this.MinuteInfo.TextColor=style.MinuteInfo.TextColor;if(style.MinuteInfo.Font)this.MinuteInfo.Font=style.MinuteInfo.Font;if(style.MinuteInfo.PointColor)this.MinuteInfo.PointColor=style.MinuteInfo.PointColor;if(style.MinuteInfo.LineColor)this.MinuteInfo.LineColor=style.MinuteInfo.LineColor;if(style.MinuteInfo.TextBGColor)this.MinuteInfo.TextBGColor=style.MinuteInfo.TextBGColor;}if(style.Title){if(style.Title.TradeIndexColor)this.Title.TradeIndexColor=style.Title.TradeIndexColor;if(style.Title.ColorIndexColor)this.Title.ColorIndexColor=style.Title.ColorIndexColor;if(style.Title.VolColor)this.Title.VolColor=style.Title.VolColor;if(style.Title.AmountColor)this.Title.AmountColor=style.Title.AmountColor;if(style.Title.DateTimeColor)this.Title.DateTimeColor=style.Title.DateTimeColor;if(style.Title.NameColor)this.Title.NameColor=style.Title.NameColor;if(style.Title.SettingColor)this.Title.SettingColor=style.Title.SettingColor;if(style.Title.TurnoverRateColor)this.Title.TurnoverRateColor=style.Title.TurnoverRateColor;if(style.Title.PositionColor)this.Title.PositionColor=style.Title.PositionColor;}if(style.DRAWICON){if(style.DRAWICON.Icon){var item=style.DRAWICON.Icon;if(IFrameSplitOperator.IsPlusNumber(item.MaxSize))this.DRAWICON.Icon.MaxSize=item.MaxSize;if(IFrameSplitOperator.IsPlusNumber(item.MinSize))this.DRAWICON.Icon.MinSize=item.MinSize;if(item.Zoom)this.DRAWICON.Icon.Zoom=item.Zoom;if(IFrameSplitOperator.IsNumber(item.YOffset))this.DRAWICON.Icon.YOffset=item.YOffset;}if(style.DRAWICON.Text){var item=style.DRAWICON.Text;if(IFrameSplitOperator.IsPlusNumber(item.MaxSize))this.DRAWICON.Text.MaxSize=item.MaxSize;if(IFrameSplitOperator.IsPlusNumber(item.MinSize))this.DRAWICON.Text.MinSize=item.MinSize;if(item.Zoom)this.DRAWICON.Text.Zoom=item.Zoom;if(item.FontName)this.DRAWICON.Text.FontName=item.FontName;if(IFrameSplitOperator.IsNumber(item.YOffset))this.DRAWICON.Text.YOffset=item.YOffset;}}if(style.DRAWTEXT){var item=style.DRAWTEXT;if(IFrameSplitOperator.IsPlusNumber(item.MaxSize))this.DRAWICON.MaxSize=item.MaxSize;if(IFrameSplitOperator.IsPlusNumber(item.MinSize))this.DRAWICON.MinSize=item.MinSize;if(item.Zoom)this.DRAWTEXT.Zoom=item.Zoom;if(item.FontName)this.DRAWTEXT.FontName=item.FontName;if(IFrameSplitOperator.IsNumber(item.YOffset))this.DRAWTEXT.YOffset=item.YOffset;}if(style.DRAWTEXT_FIX){var item=style.DRAWTEXT_FIX;if(item.Font)this.DRAWTEXT_FIX.Font=item.Font;}if(style.DRAWNUMBER_FIX){var item=style.DRAWNUMBER_FIX;if(item.Font)this.DRAWNUMBER_FIX.Font=item.Font;}if(style.DRAWNUMBER){var item=style.DRAWNUMBER;if(IFrameSplitOperator.IsPlusNumber(item.MaxSize))this.DRAWNUMBER.MaxSize=item.MaxSize;if(IFrameSplitOperator.IsPlusNumber(item.MinSize))this.DRAWNUMBER.MinSize=item.MinSize;if(item.Zoom)this.DRAWNUMBER.Zoom=item.Zoom;if(item.FontName)this.DRAWNUMBER.FontName=item.FontName;if(IFrameSplitOperator.IsNumber(item.YOffset))this.DRAWNUMBER.YOffset=item.YOffset;}if(style.DRAWABOVE){var item=style.DRAWABOVE;if(IFrameSplitOperator.IsNumber(item.YOffset))this.DRAWABOVE.YOffset=item.YOffset;}if(style.DOTLINE)this.DOTLINE=style.DOTLINE;if(style.DRAWSL)this.DOTLINE=style.DRAWSL;if(style.DragSubFrameBorder)this.DragSubFrameBorder=style.DragSubFrameBorder;if(style.StockChip){var item=style.StockChip;if(item.InfoColor)this.StockChip.InfoColor=item.InfoColor;if(item.DayInfoColor)this.StockChip.DayInfoColor=item.DayInfoColor;}if(style.DepthChart){var item=style.DepthChart;if(item.BidColor){if(item.BidColor.Line)this.DepthChart.BidColor.Line=item.BidColor.Line;if(item.BidColor.Area)this.DepthChart.BidColor.Area=item.BidColor.Area;}if(item.AskColor){if(item.AskColor.Line)this.DepthChart.AskColor.Line=item.AskColor.Line;if(item.AskColor.Area)this.DepthChart.AskColor.Area=item.AskColor.Area;}if(item.LineWidth)this.DepthChart.LineWidth=item.LineWidth;}if(style.DepthCorss){var item=style.DepthCorss;if(item.BidColor){if(item.BidColor.Line)this.DepthCorss.BidColor.Line=item.BidColor.Line;}if(item.AskColor){if(item.AskColor.Line)this.DepthCorss.AskColor.Line=item.AskColor.Line;}if(item.LineWidth)this.DepthCorss.LineWidth=item.LineWidth;if(item.LineDash)this.DepthCorss.LineDash=item.LineDash;if(item.Tooltip){var tooltip=item.Tooltip;if(tooltip.BGColor)this.DepthCorss.Tooltip.BGColor=tooltip.BGColor;if(tooltip.TextColor)this.DepthCorss.Tooltip.TextColor=tooltip.TextColor;if(tooltip.Font)this.DepthCorss.Tooltip.Font=tooltip.Font;if(tooltip.LineHeight)this.DepthCorss.Tooltip.LineHeight=tooltip.LineHeight;var border=tooltip.Border;if(IFrameSplitOperator.IsNumber(border.Top))this.DepthCorss.Tooltip.Border.Top=border.Top;if(IFrameSplitOperator.IsNumber(border.Left))this.DepthCorss.Tooltip.Border.Left=border.Left;if(IFrameSplitOperator.IsNumber(border.Bottom))this.DepthCorss.Tooltip.Border.Bottom=border.Bottom;if(IFrameSplitOperator.IsNumber(border.Center))this.DepthCorss.Tooltip.Border.Center=border.Center;}}if(style.CIRCLEDOT){var item=style.CIRCLEDOT;if(IFrameSplitOperator.IsNumber(item.Radius))this.CIRCLEDOT.Radius=item.Radius;}if(style.POINTDOT){var item=style.POINTDOT;if(IFrameSplitOperator.IsNumber(item.Radius))this.POINTDOT.Radius=item.Radius;}if(style.RectSelect){var item=style.RectSelect;if(item.LineColor)this.RectSelect.LineColor=item.LineColor;if(item.LineWidth>0)this.RectSelect.LineWidth=item.LineWidth;if(item.LineDotted)this.RectSelect.LineDotted=item.LineDotted;if(item.AreaColor)this.RectSelect.AreaColor=item.AreaColor;}if(style.OrderFlow){item=style.OrderFlow;if(item.UpColor)this.OrderFlow.UpColor=item.UpColor;if(item.DownColor)this.OrderFlow.DownColor=item.DownColor;if(item.UnchagneColor)this.OrderFlow.UnchagneColor=item.UnchagneColor;if(item.Text)this.OrderFlow.Text=item.Text;if(item.Line)this.OrderFlow.Line=item.Line;}if(style.ChartOX){var item=style.ChartOX;if(item.Family)this.ChartOX.Family=item.Family;if(item.Up)this.ChartOX.Up=item.Up;if(item.Down)this.ChartOX.Down=item.Down;if(item.SquareLineColor)this.ChartOX.SquareLineColor=item.SquareLineColor;}if(style.DealList){var item=style.DealList;if(item.BorderColor)this.DealList.BorderColor=item.BorderColor;if(item.UpTextColor)this.DealList.UpTextColor=item.UpTextColor;if(item.DownTextColor)this.DealList.DownTextColor=item.DownTextColor;if(item.UnchagneTextColor)this.DealList.UnchagneTextColor=item.UnchagneTextColor;if(item.Header){var header=item.Header;if(header.Color)this.DealList.Header.Color=header.Color;if(header.Mergin){var mergin=header.Mergin;if(IFrameSplitOperator.IsNumber(mergin.Left))this.DealList.Header.Mergin.Left=mergin.Left;if(IFrameSplitOperator.IsNumber(mergin.Right))this.DealList.Header.Mergin.Left=mergin.Right;if(IFrameSplitOperator.IsNumber(mergin.Top))this.DealList.Header.Mergin.Top=mergin.Top;if(IFrameSplitOperator.IsNumber(mergin.Bottom))this.DealList.Header.Mergin.Bottom=mergin.Bottom;}if(header.Font){var font=header.Font;if(font.Name)this.DealList.Header.Font.Name=font.Name;if(IFrameSplitOperator.IsNumber(font.Size))this.DealList.Header.Font.Size=font.Size;}}if(item.Row){var row=item.Row;if(row.Mergin){var mergin=row.Mergin;if(IFrameSplitOperator.IsNumber(mergin.Top))this.DealList.Row.Mergin.Top=mergin.Top;if(IFrameSplitOperator.IsNumber(mergin.Bottom))this.DealList.Row.Mergin.Bottom=mergin.Bottom;}if(row.Font){var font=row.Font;if(font.Name)this.DealList.Row.Font.Name=font.Name;if(IFrameSplitOperator.IsNumber(font.Size))this.DealList.Row.Font.Size=font.Size;}if(row.BarMergin){var mergin=row.BarMergin;if(IFrameSplitOperator.IsNumber(mergin.Left))this.DealList.Row.BarMergin.Left=mergin.Left;if(IFrameSplitOperator.IsNumber(mergin.Top))this.DealList.Row.BarMergin.Top=mergin.Top;if(IFrameSplitOperator.IsNumber(mergin.Right))this.DealList.Row.BarMergin.Right=mergin.Right;if(IFrameSplitOperator.IsNumber(mergin.Bottom))this.DealList.Row.BarMergin.Bottom=mergin.Bottom;}}if(item.FieldColor){var filed=item.FieldColor;if(filed.Vol)this.DealList.FieldColor.Vol=filed.Vol;if(filed.Time)this.DealList.FieldColor.Time=filed.Time;if(filed.Deal)this.DealList.FieldColor.Deal=filed.Deal;if(filed.Index)this.DealList.FieldColor.Index=filed.Index;if(filed.BarTitle)this.DealList.FieldColor.BarTitle=filed.BarTitle;if(filed.Text)this.DealList.FieldColor.Text=filed.Text;if(IFrameSplitOperator.IsNonEmptyArray(filed.Bar)){for(var i=0;i<filed.Bar.length;++i){this.DealList.FieldColor.Bar[i]=filed.Bar[i];}}}}if(style.Report){var item=style.Report;if(item.BorderColor)this.Report.BorderColor=item.BorderColor;if(item.UpTextColor)this.Report.UpTextColor=item.UpTextColor;if(item.DownTextColor)this.Report.DownTextColor=item.DownTextColor;if(item.UnchagneTextColor)this.Report.UnchagneTextColor=item.UnchagneTextColor;if(item.BorderColor)this.Report.SelectedColor=item.SelectedColor;if(item.Header){var header=item.Header;if(header.Color)this.Report.Header.Color=header.Color;if(header.SortColor)this.Report.Header.SortColor=header.SortColor;if(header.Mergin){var mergin=header.Mergin;if(IFrameSplitOperator.IsNumber(mergin.Left))this.Report.Header.Mergin.Left=mergin.Left;if(IFrameSplitOperator.IsNumber(mergin.Right))this.Report.Header.Mergin.Left=mergin.Right;if(IFrameSplitOperator.IsNumber(mergin.Top))this.Report.Header.Mergin.Top=mergin.Top;if(IFrameSplitOperator.IsNumber(mergin.Bottom))this.Report.Header.Mergin.Bottom=mergin.Bottom;}if(header.Font){var font=header.Font;if(font.Name)this.Report.Header.Font.Name=font.Name;if(IFrameSplitOperator.IsNumber(font.Size))this.Report.Header.Font.Size=font.Size;}}if(item.Item){var row=item.Item;if(row.Mergin){var mergin=row.Mergin;if(IFrameSplitOperator.IsNumber(mergin.Left))this.Report.Item.Mergin.Left=mergin.Left;if(IFrameSplitOperator.IsNumber(mergin.Right))this.Report.Item.Mergin.Right=mergin.Right;if(IFrameSplitOperator.IsNumber(mergin.Top))this.Report.Item.Mergin.Top=mergin.Top;if(IFrameSplitOperator.IsNumber(mergin.Bottom))this.Report.Item.Mergin.Bottom=mergin.Bottom;}if(row.Font){var font=row.Font;if(font.Name)this.Report.Item.Font.Name=font.Name;if(IFrameSplitOperator.IsNumber(font.Size))this.Report.Item.Font.Size=font.Size;}if(row.BarMergin){var mergin=row.BarMergin;if(IFrameSplitOperator.IsNumber(mergin.Left))this.Report.Item.BarMergin.Left=mergin.Left;if(IFrameSplitOperator.IsNumber(mergin.Top))this.Report.Item.BarMergin.Top=mergin.Top;if(IFrameSplitOperator.IsNumber(mergin.Right))this.Report.Item.BarMergin.Right=mergin.Right;if(IFrameSplitOperator.IsNumber(mergin.Bottom))this.Report.Item.BarMergin.Bottom=mergin.Bottom;}if(row.NameFont){var font=row.NameFont;if(font.Name)this.Report.Item.NameFont.Name=font.Name;if(IFrameSplitOperator.IsNumber(font.Size))this.Report.Item.NameFont.Size=font.Size;}if(row.SymbolFont){var font=row.SymbolFont;if(font.Name)this.Report.Item.SymbolFont.Name=font.Name;if(IFrameSplitOperator.IsNumber(font.Size))this.Report.Item.SymbolFont.Size=font.Size;}}if(item.FixedItem){var row=item.FixedItem;if(row.Font){var font=row.Font;if(font.Name)this.Report.FixedItem.Font.Name=font.Name;if(IFrameSplitOperator.IsNumber(font.Size))this.Report.FixedItem.Font.Size=font.Size;}}if(item.LimitBorder){var limit=item.LimitBorder;if(limit.Color)this.Report.LimitBorder.Color=limit.Color;if(limit.Mergin){var mergin=limit.Mergin;if(IFrameSplitOperator.IsNumber(mergin.Left))this.Report.LimitBorder.Mergin.Left=mergin.Left;if(IFrameSplitOperator.IsNumber(mergin.Top))this.Report.LimitBorder.Mergin.Top=mergin.Top;if(IFrameSplitOperator.IsNumber(mergin.Right))this.Report.LimitBorder.Mergin.Right=mergin.Right;if(IFrameSplitOperator.IsNumber(mergin.Bottom))this.Report.LimitBorder.Mergin.Bottom=mergin.Bottom;}}if(item.FieldColor){var filed=item.FieldColor;if(filed.Name)this.Report.FieldColor.Name=filed.Name;if(filed.Symbol)this.Report.FieldColor.Symbol=filed.Symbol;if(filed.Vol)this.Report.FieldColor.Vol=filed.Vol;if(filed.Amount)this.Report.FieldColor.Amount=filed.Amount;if(filed.Index)this.Report.FieldColor.Index=filed.Index;if(filed.BarTitle)this.Report.FieldColor.BarTitle=filed.BarTitle;if(filed.Text)this.Report.FieldColor.Text=filed.Text;if(IFrameSplitOperator.IsNonEmptyArray(filed.Bar)){for(var i=0;i<filed.Bar.length;++i){this.Report.FieldColor.Bar[i]=filed.Bar[i];}}}if(item.Tab){var tab=item.Tab;if(tab.Font){var font=tab.Font;if(font.Name)this.Report.Tab.Font.Name=font.Name;if(IFrameSplitOperator.IsNumber(font.Size))this.Report.Tab.Font.Size=font.Size;}if(IFrameSplitOperator.IsNumber(tab.ScrollBarWidth))this.Report.Tab.ScrollBarWidth=tab.ScrollBarWidth;if(tab.ButtonColor)this.Report.Tab.ButtonColor=tab.ButtonColor;if(tab.BarColor)this.Report.Tab.BarColor=tab.BarColor;if(tab.BorderColor)this.Report.Tab.BorderColor=tab.BorderColor;if(tab.TabTitleColor)this.Report.Tab.TabTitleColor=tab.TabTitleColor;if(tab.TabSelectedTitleColor)this.Report.Tab.TabSelectedTitleColor=tab.TabSelectedTitleColor;if(tab.TabSelectedBGColor)this.Report.Tab.TabSelectedBGColor=tab.TabSelectedBGColor;if(tab.TabMoveOnTitleColor)this.Report.Tab.TabMoveOnTitleColor=tab.TabMoveOnTitleColor;if(tab.TabBGColor)this.Report.Tab.TabBGColor=tab.TabBGColor;}if(item.PageInfo){var pageinfo=item.PageInfo;if(pageinfo.Font){var font=pageinfo.Font;if(font.Name)this.Report.PageInfo.Font.Name=font.Name;if(IFrameSplitOperator.IsNumber(font.Size))this.Report.PageInfo.Font.Size=font.Size;}if(pageinfo.TextColor)this.Report.PageInfo.TextColor=pageinfo.TextColor;if(pageinfo.BGColor)this.Report.PageInfo.BGColor=pageinfo.BGColor;if(pageinfo.Mergin){var mergin=pageinfo.Mergin;if(IFrameSplitOperator.IsNumber(mergin.Left))this.Report.PageInfo.Mergin.Left=mergin.Left;if(IFrameSplitOperator.IsNumber(mergin.Top))this.Report.PageInfo.Mergin.Top=mergin.Top;if(IFrameSplitOperator.IsNumber(mergin.Right))this.Report.PageInfo.Mergin.Right=mergin.Right;if(IFrameSplitOperator.IsNumber(mergin.Bottom))this.Report.PageInfo.Mergin.Bottom=mergin.Bottom;}}}if(style.SelectedChart){var item=style.SelectedChart;if(IFrameSplitOperator.IsNumber(item.LineWidth))this.SelectedChart.LineWidth=item.LineWidth;if(IFrameSplitOperator.IsNumber(item.Radius))this.SelectedChart.Radius=item.Radius;if(IFrameSplitOperator.IsNumber(item.MinSpace))this.SelectedChart.MinSpace=item.MinSpace;if(item.LineColor)this.SelectedChart.LineColor=item.LineColor;if(item.LineColor)this.SelectedChart.BGColor=item.BGColor;}if(style.DragMovePaint){var item=style.DragMovePaint;if(item.TextColor)this.DragMovePaint.TextColor=item.TextColor;if(item.Font)this.DragMovePaint.Font=item.Font;}if(style.Buttons){var buttons=style.Buttons;if(buttons.CloseOverlayIndex){var item=buttons.CloseOverlayIndex;if(item.Color)this.Buttons.CloseOverlayIndex.Color=item.Color;if(item.Family)this.Buttons.CloseOverlayIndex.Family=item.Family;if(item.Text)this.Buttons.CloseOverlayIndex.Text=item.Text;if(IFrameSplitOperator.IsNumber(item.Size))this.Buttons.CloseOverlayIndex.Size=item.Size;if(IFrameSplitOperator.IsNumber(item.MerginLeft))this.Buttons.CloseOverlayIndex.MerginLeft=item.MerginLeft;}}};}var g_JSChartResource=new JSChartResource();/////////////////////////////////////////////////////////////////////////////////
|
|
4792
|
+
Tab:{Font:{Size:12,Name:"微软雅黑"},ScrollBarWidth:100,ButtonColor:"rgb(252,252,252)",BarColor:"rgb(180,180,180)",BorderColor:'rgb(180,180,180)',Mergin:{Left:5,Right:5,Top:4,Bottom:2},TabTitleColor:'rgb(60,60,60)',TabSelectedTitleColor:'rgb(0,0,0)',TabSelectedBGColor:"rgb(252,252,252)",TabMoveOnTitleColor:"rgb(0,0,0)",TabBGColor:"rgb(220,220,220)"},PageInfo:{Font:{Size:15,Name:"微软雅黑"},TextColor:"rgb(0,0,0)",BGColor:"rgba(180,180,180,0.5)",Mergin:{Left:5,Right:5,Top:4,Bottom:2}},DragRow:{Color:"rgba(190,190,190,0.8)",TextColor:'rgba(0,0, 0, 0.8)',MoveRowColor:'rgb(240,128,128)',SrcRowColor:'rgb(180,240,240)'}},//自定义风格
|
|
4793
|
+
this.SetStyle=function(style){if(style.TooltipBGColor)this.TooltipBGColor=style.TooltipBGColor;if(style.TooltipAlpha)this.TooltipAlpha=style.TooltipAlpha;if(style.SelectRectBGColor)this.SelectRectBGColor=style.SelectRectBGColor;if(style.UpBarColor)this.UpBarColor=style.UpBarColor;if(style.DownBarColor)this.DownBarColor=style.DownBarColor;if(style.UnchagneBarColor)this.UnchagneBarColor=style.UnchagneBarColor;if(style.EmptyBarBGColor)this.EmptyBarBGColor=style.EmptyBarBGColor;if(style.Minute){if(style.Minute.VolBarColor)this.Minute.VolBarColor=style.Minute.VolBarColor;if(style.Minute.VolTitleColor)this.Minute.VolTitleColor=style.Minute.VolTitleColor;if(style.Minute.PriceColor)this.Minute.PriceColor=style.Minute.PriceColor;if(style.Minute.AvPriceColor)this.Minute.AvPriceColor=style.Minute.AvPriceColor;if(style.Minute.AreaPriceColor)this.Minute.AreaPriceColor=style.Minute.AreaPriceColor;if(style.Minute.PositionColor)this.Minute.PositionColor=style.Minute.PositionColor;if(style.Minute.FrameSplitTextColor)this.Minute.FrameSplitTextColor=style.Minute.FrameSplitTextColor;if(style.Minute.Before){var item=style.Minute.Before;if(item.BGColor)this.Minute.Before.BGColor=item.BGColor;if(item.LineColor)this.Minute.Before.LineColor=item.LineColor;if(item.VolColor)this.Minute.Before.VolColor=item.VolColor;if(item.AvPriceColor)this.Minute.Before.AvPriceColor=item.AvPriceColor;if(item.CloseIcon)this.Minute.Before.CloseIcon=item.CloseIcon;if(item.Point){if(item.Point.Color)this.Minute.Before.Point.Color=item.Point.Color;if(item.Point.Radius)this.Minute.Before.Point.Radius=item.Point.Radius;}}}if(style.DefaultTextColor)this.DefaultTextColor=style.DefaultTextColor;if(style.DefaultTextFont)this.DefaultTextFont=style.DefaultTextFont;if(style.TitleFont)this.TitleFont=style.TitleFont;if(style.IndexTitleBGColor)this.IndexTitleBGColor=style.IndexTitleBGColor;if(style.IndexTitleColor)this.IndexTitleColor=style.IndexTitleColor;if(style.IndexTitleSelectedColor)this.IndexTitleSelectedColor=style.IndexTitleSelectedColor;if(style.OverlayIndexTitleBGColor)this.OverlayIndexTitleBGColor=style.OverlayIndexTitleBGColor;if(style.UpTextColor)this.UpTextColor=style.UpTextColor;if(style.DownTextColor)this.DownTextColor=style.DownTextColor;if(style.UnchagneTextColor)this.UnchagneTextColor=style.UnchagneTextColor;if(style.CloseLineColor)this.CloseLineColor=style.CloseLineColor;if(style.CloseLineAreaColor)this.CloseLineAreaColor=style.CloseLineAreaColor;if(style.CloseLineWidth)this.CloseLineWidth=style.CloseLineWidth;if(style.FrameBorderPen)this.FrameBorderPen=style.FrameBorderPen;if(style.FrameSplitPen)this.FrameSplitPen=style.FrameSplitPen;if(style.FrameDotSplitPen)this.FrameDotSplitPen=style.FrameDotSplitPen;if(style.FrameSplitTextColor)this.FrameSplitTextColor=style.FrameSplitTextColor;if(style.FrameSplitTextFont)this.FrameSplitTextFont=style.FrameSplitTextFont;if(style.FrameTitleBGColor)this.FrameTitleBGColor=style.FrameTitleBGColor;if(style.Frame){if(style.Frame.XBottomOffset)this.Frame.XBottomOffset=style.Frame.XBottomOffset;if(style.Frame.YTopOffset)this.Frame.YTopOffset=style.Frame.YTopOffset;if(style.Frame.PercentageText){var item=style.Frame.PercentageText;if(item.PriceColor)this.Frame.PercentageText.PriceColor=item.PriceColor;if(item.PercentageColor)this.Frame.PercentageText.PercentageColor=item.PercentageColor;if(item.SplitColor)this.Frame.PercentageText.SplitColor=item.SplitColor;if(item.Font)this.Frame.PercentageText.Font=item.Font;}}if(style.FrameLatestPrice){if(style.FrameLatestPrice.TextColor)this.FrameLatestPrice.TextColor=style.FrameLatestPrice.TextColor;if(style.FrameLatestPrice.UpBarColor)this.FrameLatestPrice.UpBarColor=style.FrameLatestPrice.UpBarColor;if(style.FrameLatestPrice.DownBarColor)this.FrameLatestPrice.DownBarColor=style.FrameLatestPrice.DownBarColor;if(style.FrameLatestPrice.UnchagneBarColor)this.FrameLatestPrice.UnchagneBarColor=style.FrameLatestPrice.UnchagneBarColor;if(style.FrameLatestPrice.BGAlpha)this.FrameLatestPrice.BGAlpha=style.FrameLatestPrice.BGAlpha;}if(style.CorssCursorBGColor)this.CorssCursorBGColor=style.CorssCursorBGColor;if(style.CorssCursorTextColor)this.CorssCursorTextColor=style.CorssCursorTextColor;if(style.CorssCursorTextFont)this.CorssCursorTextFont=style.CorssCursorTextFont;if(style.CorssCursorVPenColor)this.CorssCursorVPenColor=style.CorssCursorVPenColor;if(style.CorssCursorHPenColor)this.CorssCursorHPenColor=style.CorssCursorHPenColor;if(style.CorssCursorBorderColor)this.CorssCursorBorderColor=style.CorssCursorBorderColor;if(style.CorssCursorXRangeBGColor)this.CorssCursorXRangeBGColor=style.CorssCursorXRangeBGColor;if(style.CorssCursor&&style.CorssCursor.RightButton){var item=style.CorssCursor.RightButton;if(item.BGColor)this.CorssCursor.RightButton.BGColor=item.BGColor;if(item.PenColor)this.CorssCursor.RightButton.PenColor=item.PenColor;if(item.Icon)this.CorssCursor.RightButton.Icon=item.Icon;}if(style.KLine)this.KLine=style.KLine;if(style.Index){if(style.Index.LineColor)this.Index.LineColor=style.Index.LineColor;if(style.Index.NotSupport)this.Index.NotSupport=style.Index.NotSupport;}if(style.ColorArray)this.ColorArray=style.ColorArray;if(style.DrawPicture){var item=style.DrawPicture;if(item.LineColor)this.DrawPicture.LineColor=item.LineColor;if(item.PointColor)this.DrawPicture.PointColor=item.PointColor;if(item.XYCoordinate)this.DrawPicture.XYCoordinate=item.XYCoordinate;if(IFrameSplitOperator.IsNumber(item.PointType))this.DrawPicture.PointType=item.PointType;if(IFrameSplitOperator.IsBool(item.IsShowPoint))this.DrawPicture.IsShowPoint=item.IsShowPoint;}if(style.TooltipPaint){if(style.TooltipPaint.BGColor)this.TooltipPaint.BGColor=style.TooltipPaint.BGColor;if(style.TooltipPaint.BorderColor)this.TooltipPaint.BorderColor=style.TooltipPaint.BorderColor;if(style.TooltipPaint.TitleColor)this.TooltipPaint.TitleColor=style.TooltipPaint.TitleColor;if(style.TooltipPaint.TitleFont)this.TooltipPaint.TitleFont=style.TooltipPaint.TitleFont;if(style.TooltipPaint.DateTimeColor)this.TooltipPaint.DateTimeColor=style.TooltipPaint.DateTimeColor;if(style.TooltipPaint.VolColor)this.TooltipPaint.VolColor=style.TooltipPaint.VolColor;if(style.TooltipPaint.AmountColor)this.TooltipPaint.AmountColor=style.TooltipPaint.AmountColor;}if(style.MinuteInfo){if(style.MinuteInfo.TextColor)this.MinuteInfo.TextColor=style.MinuteInfo.TextColor;if(style.MinuteInfo.Font)this.MinuteInfo.Font=style.MinuteInfo.Font;if(style.MinuteInfo.PointColor)this.MinuteInfo.PointColor=style.MinuteInfo.PointColor;if(style.MinuteInfo.LineColor)this.MinuteInfo.LineColor=style.MinuteInfo.LineColor;if(style.MinuteInfo.TextBGColor)this.MinuteInfo.TextBGColor=style.MinuteInfo.TextBGColor;}if(style.Title){if(style.Title.TradeIndexColor)this.Title.TradeIndexColor=style.Title.TradeIndexColor;if(style.Title.ColorIndexColor)this.Title.ColorIndexColor=style.Title.ColorIndexColor;if(style.Title.VolColor)this.Title.VolColor=style.Title.VolColor;if(style.Title.AmountColor)this.Title.AmountColor=style.Title.AmountColor;if(style.Title.DateTimeColor)this.Title.DateTimeColor=style.Title.DateTimeColor;if(style.Title.NameColor)this.Title.NameColor=style.Title.NameColor;if(style.Title.SettingColor)this.Title.SettingColor=style.Title.SettingColor;if(style.Title.TurnoverRateColor)this.Title.TurnoverRateColor=style.Title.TurnoverRateColor;if(style.Title.PositionColor)this.Title.PositionColor=style.Title.PositionColor;}if(style.DRAWICON){if(style.DRAWICON.Icon){var item=style.DRAWICON.Icon;if(IFrameSplitOperator.IsPlusNumber(item.MaxSize))this.DRAWICON.Icon.MaxSize=item.MaxSize;if(IFrameSplitOperator.IsPlusNumber(item.MinSize))this.DRAWICON.Icon.MinSize=item.MinSize;if(item.Zoom)this.DRAWICON.Icon.Zoom=item.Zoom;if(IFrameSplitOperator.IsNumber(item.YOffset))this.DRAWICON.Icon.YOffset=item.YOffset;}if(style.DRAWICON.Text){var item=style.DRAWICON.Text;if(IFrameSplitOperator.IsPlusNumber(item.MaxSize))this.DRAWICON.Text.MaxSize=item.MaxSize;if(IFrameSplitOperator.IsPlusNumber(item.MinSize))this.DRAWICON.Text.MinSize=item.MinSize;if(item.Zoom)this.DRAWICON.Text.Zoom=item.Zoom;if(item.FontName)this.DRAWICON.Text.FontName=item.FontName;if(IFrameSplitOperator.IsNumber(item.YOffset))this.DRAWICON.Text.YOffset=item.YOffset;}}if(style.DRAWTEXT){var item=style.DRAWTEXT;if(IFrameSplitOperator.IsPlusNumber(item.MaxSize))this.DRAWICON.MaxSize=item.MaxSize;if(IFrameSplitOperator.IsPlusNumber(item.MinSize))this.DRAWICON.MinSize=item.MinSize;if(item.Zoom)this.DRAWTEXT.Zoom=item.Zoom;if(item.FontName)this.DRAWTEXT.FontName=item.FontName;if(IFrameSplitOperator.IsNumber(item.YOffset))this.DRAWTEXT.YOffset=item.YOffset;}if(style.DRAWTEXT_FIX){var item=style.DRAWTEXT_FIX;if(item.Font)this.DRAWTEXT_FIX.Font=item.Font;}if(style.DRAWNUMBER_FIX){var item=style.DRAWNUMBER_FIX;if(item.Font)this.DRAWNUMBER_FIX.Font=item.Font;}if(style.DRAWNUMBER){var item=style.DRAWNUMBER;if(IFrameSplitOperator.IsPlusNumber(item.MaxSize))this.DRAWNUMBER.MaxSize=item.MaxSize;if(IFrameSplitOperator.IsPlusNumber(item.MinSize))this.DRAWNUMBER.MinSize=item.MinSize;if(item.Zoom)this.DRAWNUMBER.Zoom=item.Zoom;if(item.FontName)this.DRAWNUMBER.FontName=item.FontName;if(IFrameSplitOperator.IsNumber(item.YOffset))this.DRAWNUMBER.YOffset=item.YOffset;}if(style.DRAWABOVE){var item=style.DRAWABOVE;if(IFrameSplitOperator.IsNumber(item.YOffset))this.DRAWABOVE.YOffset=item.YOffset;}if(style.DOTLINE)this.DOTLINE=style.DOTLINE;if(style.DRAWSL)this.DOTLINE=style.DRAWSL;if(style.DragSubFrameBorder)this.DragSubFrameBorder=style.DragSubFrameBorder;if(style.StockChip){var item=style.StockChip;if(item.InfoColor)this.StockChip.InfoColor=item.InfoColor;if(item.DayInfoColor)this.StockChip.DayInfoColor=item.DayInfoColor;}if(style.DepthChart){var item=style.DepthChart;if(item.BidColor){if(item.BidColor.Line)this.DepthChart.BidColor.Line=item.BidColor.Line;if(item.BidColor.Area)this.DepthChart.BidColor.Area=item.BidColor.Area;}if(item.AskColor){if(item.AskColor.Line)this.DepthChart.AskColor.Line=item.AskColor.Line;if(item.AskColor.Area)this.DepthChart.AskColor.Area=item.AskColor.Area;}if(item.LineWidth)this.DepthChart.LineWidth=item.LineWidth;}if(style.DepthCorss){var item=style.DepthCorss;if(item.BidColor){if(item.BidColor.Line)this.DepthCorss.BidColor.Line=item.BidColor.Line;}if(item.AskColor){if(item.AskColor.Line)this.DepthCorss.AskColor.Line=item.AskColor.Line;}if(item.LineWidth)this.DepthCorss.LineWidth=item.LineWidth;if(item.LineDash)this.DepthCorss.LineDash=item.LineDash;if(item.Tooltip){var tooltip=item.Tooltip;if(tooltip.BGColor)this.DepthCorss.Tooltip.BGColor=tooltip.BGColor;if(tooltip.TextColor)this.DepthCorss.Tooltip.TextColor=tooltip.TextColor;if(tooltip.Font)this.DepthCorss.Tooltip.Font=tooltip.Font;if(tooltip.LineHeight)this.DepthCorss.Tooltip.LineHeight=tooltip.LineHeight;var border=tooltip.Border;if(IFrameSplitOperator.IsNumber(border.Top))this.DepthCorss.Tooltip.Border.Top=border.Top;if(IFrameSplitOperator.IsNumber(border.Left))this.DepthCorss.Tooltip.Border.Left=border.Left;if(IFrameSplitOperator.IsNumber(border.Bottom))this.DepthCorss.Tooltip.Border.Bottom=border.Bottom;if(IFrameSplitOperator.IsNumber(border.Center))this.DepthCorss.Tooltip.Border.Center=border.Center;}}if(style.CIRCLEDOT){var item=style.CIRCLEDOT;if(IFrameSplitOperator.IsNumber(item.Radius))this.CIRCLEDOT.Radius=item.Radius;}if(style.POINTDOT){var item=style.POINTDOT;if(IFrameSplitOperator.IsNumber(item.Radius))this.POINTDOT.Radius=item.Radius;}if(style.RectSelect){var item=style.RectSelect;if(item.LineColor)this.RectSelect.LineColor=item.LineColor;if(item.LineWidth>0)this.RectSelect.LineWidth=item.LineWidth;if(item.LineDotted)this.RectSelect.LineDotted=item.LineDotted;if(item.AreaColor)this.RectSelect.AreaColor=item.AreaColor;}if(style.OrderFlow){item=style.OrderFlow;if(item.UpColor)this.OrderFlow.UpColor=item.UpColor;if(item.DownColor)this.OrderFlow.DownColor=item.DownColor;if(item.UnchagneColor)this.OrderFlow.UnchagneColor=item.UnchagneColor;if(item.Text)this.OrderFlow.Text=item.Text;if(item.Line)this.OrderFlow.Line=item.Line;}if(style.OrderFlow_Style2){item=style.OrderFlow_Style2;if(item.UpColor)this.OrderFlow_Style2.UpColor=item.UpColor;if(item.DownColor)this.OrderFlow_Style2.DownColor=item.DownColor;if(item.UnchagneColor)this.OrderFlow_Style2.UnchagneColor=item.UnchagneColor;if(IFrameSplitOperator.IsNumber(item.BarWidth))this.OrderFlow_Style2.BarWidth=item.BarWidth;}if(style.ChartOX){var item=style.ChartOX;if(item.Family)this.ChartOX.Family=item.Family;if(item.Up)this.ChartOX.Up=item.Up;if(item.Down)this.ChartOX.Down=item.Down;if(item.SquareLineColor)this.ChartOX.SquareLineColor=item.SquareLineColor;}if(style.DealList){var item=style.DealList;if(item.BorderColor)this.DealList.BorderColor=item.BorderColor;if(item.UpTextColor)this.DealList.UpTextColor=item.UpTextColor;if(item.DownTextColor)this.DealList.DownTextColor=item.DownTextColor;if(item.UnchagneTextColor)this.DealList.UnchagneTextColor=item.UnchagneTextColor;if(item.Header){var header=item.Header;if(header.Color)this.DealList.Header.Color=header.Color;if(header.Mergin){var mergin=header.Mergin;if(IFrameSplitOperator.IsNumber(mergin.Left))this.DealList.Header.Mergin.Left=mergin.Left;if(IFrameSplitOperator.IsNumber(mergin.Right))this.DealList.Header.Mergin.Left=mergin.Right;if(IFrameSplitOperator.IsNumber(mergin.Top))this.DealList.Header.Mergin.Top=mergin.Top;if(IFrameSplitOperator.IsNumber(mergin.Bottom))this.DealList.Header.Mergin.Bottom=mergin.Bottom;}if(header.Font){var font=header.Font;if(font.Name)this.DealList.Header.Font.Name=font.Name;if(IFrameSplitOperator.IsNumber(font.Size))this.DealList.Header.Font.Size=font.Size;}}if(item.Row){var row=item.Row;if(row.Mergin){var mergin=row.Mergin;if(IFrameSplitOperator.IsNumber(mergin.Top))this.DealList.Row.Mergin.Top=mergin.Top;if(IFrameSplitOperator.IsNumber(mergin.Bottom))this.DealList.Row.Mergin.Bottom=mergin.Bottom;}if(row.Font){var font=row.Font;if(font.Name)this.DealList.Row.Font.Name=font.Name;if(IFrameSplitOperator.IsNumber(font.Size))this.DealList.Row.Font.Size=font.Size;}if(row.BarMergin){var mergin=row.BarMergin;if(IFrameSplitOperator.IsNumber(mergin.Left))this.DealList.Row.BarMergin.Left=mergin.Left;if(IFrameSplitOperator.IsNumber(mergin.Top))this.DealList.Row.BarMergin.Top=mergin.Top;if(IFrameSplitOperator.IsNumber(mergin.Right))this.DealList.Row.BarMergin.Right=mergin.Right;if(IFrameSplitOperator.IsNumber(mergin.Bottom))this.DealList.Row.BarMergin.Bottom=mergin.Bottom;}}if(item.FieldColor){var filed=item.FieldColor;if(filed.Vol)this.DealList.FieldColor.Vol=filed.Vol;if(filed.Time)this.DealList.FieldColor.Time=filed.Time;if(filed.Deal)this.DealList.FieldColor.Deal=filed.Deal;if(filed.Index)this.DealList.FieldColor.Index=filed.Index;if(filed.BarTitle)this.DealList.FieldColor.BarTitle=filed.BarTitle;if(filed.Text)this.DealList.FieldColor.Text=filed.Text;if(IFrameSplitOperator.IsNonEmptyArray(filed.Bar)){for(var i=0;i<filed.Bar.length;++i){this.DealList.FieldColor.Bar[i]=filed.Bar[i];}}}}if(style.Report){var item=style.Report;if(item.BorderColor)this.Report.BorderColor=item.BorderColor;if(item.UpTextColor)this.Report.UpTextColor=item.UpTextColor;if(item.DownTextColor)this.Report.DownTextColor=item.DownTextColor;if(item.UnchagneTextColor)this.Report.UnchagneTextColor=item.UnchagneTextColor;if(item.BorderColor)this.Report.SelectedColor=item.SelectedColor;if(item.Header){var header=item.Header;if(header.Color)this.Report.Header.Color=header.Color;if(header.SortColor)this.Report.Header.SortColor=header.SortColor;if(header.Mergin){var mergin=header.Mergin;if(IFrameSplitOperator.IsNumber(mergin.Left))this.Report.Header.Mergin.Left=mergin.Left;if(IFrameSplitOperator.IsNumber(mergin.Right))this.Report.Header.Mergin.Left=mergin.Right;if(IFrameSplitOperator.IsNumber(mergin.Top))this.Report.Header.Mergin.Top=mergin.Top;if(IFrameSplitOperator.IsNumber(mergin.Bottom))this.Report.Header.Mergin.Bottom=mergin.Bottom;}if(header.Font){var font=header.Font;if(font.Name)this.Report.Header.Font.Name=font.Name;if(IFrameSplitOperator.IsNumber(font.Size))this.Report.Header.Font.Size=font.Size;}}if(item.Item){var row=item.Item;if(row.Mergin){var mergin=row.Mergin;if(IFrameSplitOperator.IsNumber(mergin.Left))this.Report.Item.Mergin.Left=mergin.Left;if(IFrameSplitOperator.IsNumber(mergin.Right))this.Report.Item.Mergin.Right=mergin.Right;if(IFrameSplitOperator.IsNumber(mergin.Top))this.Report.Item.Mergin.Top=mergin.Top;if(IFrameSplitOperator.IsNumber(mergin.Bottom))this.Report.Item.Mergin.Bottom=mergin.Bottom;}if(row.Font){var font=row.Font;if(font.Name)this.Report.Item.Font.Name=font.Name;if(IFrameSplitOperator.IsNumber(font.Size))this.Report.Item.Font.Size=font.Size;}if(row.BarMergin){var mergin=row.BarMergin;if(IFrameSplitOperator.IsNumber(mergin.Left))this.Report.Item.BarMergin.Left=mergin.Left;if(IFrameSplitOperator.IsNumber(mergin.Top))this.Report.Item.BarMergin.Top=mergin.Top;if(IFrameSplitOperator.IsNumber(mergin.Right))this.Report.Item.BarMergin.Right=mergin.Right;if(IFrameSplitOperator.IsNumber(mergin.Bottom))this.Report.Item.BarMergin.Bottom=mergin.Bottom;}if(row.NameFont){var font=row.NameFont;if(font.Name)this.Report.Item.NameFont.Name=font.Name;if(IFrameSplitOperator.IsNumber(font.Size))this.Report.Item.NameFont.Size=font.Size;}if(row.SymbolFont){var font=row.SymbolFont;if(font.Name)this.Report.Item.SymbolFont.Name=font.Name;if(IFrameSplitOperator.IsNumber(font.Size))this.Report.Item.SymbolFont.Size=font.Size;}}if(item.FixedItem){var row=item.FixedItem;if(row.Font){var font=row.Font;if(font.Name)this.Report.FixedItem.Font.Name=font.Name;if(IFrameSplitOperator.IsNumber(font.Size))this.Report.FixedItem.Font.Size=font.Size;}}if(item.LimitBorder){var limit=item.LimitBorder;if(limit.Color)this.Report.LimitBorder.Color=limit.Color;if(limit.Mergin){var mergin=limit.Mergin;if(IFrameSplitOperator.IsNumber(mergin.Left))this.Report.LimitBorder.Mergin.Left=mergin.Left;if(IFrameSplitOperator.IsNumber(mergin.Top))this.Report.LimitBorder.Mergin.Top=mergin.Top;if(IFrameSplitOperator.IsNumber(mergin.Right))this.Report.LimitBorder.Mergin.Right=mergin.Right;if(IFrameSplitOperator.IsNumber(mergin.Bottom))this.Report.LimitBorder.Mergin.Bottom=mergin.Bottom;}}if(item.FieldColor){var filed=item.FieldColor;if(filed.Name)this.Report.FieldColor.Name=filed.Name;if(filed.Symbol)this.Report.FieldColor.Symbol=filed.Symbol;if(filed.Vol)this.Report.FieldColor.Vol=filed.Vol;if(filed.Amount)this.Report.FieldColor.Amount=filed.Amount;if(filed.Index)this.Report.FieldColor.Index=filed.Index;if(filed.BarTitle)this.Report.FieldColor.BarTitle=filed.BarTitle;if(filed.Text)this.Report.FieldColor.Text=filed.Text;if(IFrameSplitOperator.IsNonEmptyArray(filed.Bar)){for(var i=0;i<filed.Bar.length;++i){this.Report.FieldColor.Bar[i]=filed.Bar[i];}}}if(item.Tab){var tab=item.Tab;if(tab.Font){var font=tab.Font;if(font.Name)this.Report.Tab.Font.Name=font.Name;if(IFrameSplitOperator.IsNumber(font.Size))this.Report.Tab.Font.Size=font.Size;}if(IFrameSplitOperator.IsNumber(tab.ScrollBarWidth))this.Report.Tab.ScrollBarWidth=tab.ScrollBarWidth;if(tab.ButtonColor)this.Report.Tab.ButtonColor=tab.ButtonColor;if(tab.BarColor)this.Report.Tab.BarColor=tab.BarColor;if(tab.BorderColor)this.Report.Tab.BorderColor=tab.BorderColor;if(tab.TabTitleColor)this.Report.Tab.TabTitleColor=tab.TabTitleColor;if(tab.TabSelectedTitleColor)this.Report.Tab.TabSelectedTitleColor=tab.TabSelectedTitleColor;if(tab.TabSelectedBGColor)this.Report.Tab.TabSelectedBGColor=tab.TabSelectedBGColor;if(tab.TabMoveOnTitleColor)this.Report.Tab.TabMoveOnTitleColor=tab.TabMoveOnTitleColor;if(tab.TabBGColor)this.Report.Tab.TabBGColor=tab.TabBGColor;}if(item.PageInfo){var pageinfo=item.PageInfo;if(pageinfo.Font){var font=pageinfo.Font;if(font.Name)this.Report.PageInfo.Font.Name=font.Name;if(IFrameSplitOperator.IsNumber(font.Size))this.Report.PageInfo.Font.Size=font.Size;}if(pageinfo.TextColor)this.Report.PageInfo.TextColor=pageinfo.TextColor;if(pageinfo.BGColor)this.Report.PageInfo.BGColor=pageinfo.BGColor;if(pageinfo.Mergin){var mergin=pageinfo.Mergin;if(IFrameSplitOperator.IsNumber(mergin.Left))this.Report.PageInfo.Mergin.Left=mergin.Left;if(IFrameSplitOperator.IsNumber(mergin.Top))this.Report.PageInfo.Mergin.Top=mergin.Top;if(IFrameSplitOperator.IsNumber(mergin.Right))this.Report.PageInfo.Mergin.Right=mergin.Right;if(IFrameSplitOperator.IsNumber(mergin.Bottom))this.Report.PageInfo.Mergin.Bottom=mergin.Bottom;}}if(item.DragRow){var dragRow=item.DragRow;if(dragRow.Color)this.Report.DragRow.Color=dragRow.Color;if(dragRow.TextColor)this.Report.DragRow.TextColor=dragRow.TextColor;if(dragRow.MoveRowColor)this.Report.DragRow.MoveRowColor=dragRow.MoveRowColor;if(dragRow.SrcRowColor)this.Report.DragRow.SrcRowColor=dragRow.SrcRowColor;}}if(style.SelectedChart){var item=style.SelectedChart;if(IFrameSplitOperator.IsNumber(item.LineWidth))this.SelectedChart.LineWidth=item.LineWidth;if(IFrameSplitOperator.IsNumber(item.Radius))this.SelectedChart.Radius=item.Radius;if(IFrameSplitOperator.IsNumber(item.MinSpace))this.SelectedChart.MinSpace=item.MinSpace;if(item.LineColor)this.SelectedChart.LineColor=item.LineColor;if(item.LineColor)this.SelectedChart.BGColor=item.BGColor;}if(style.DragMovePaint){var item=style.DragMovePaint;if(item.TextColor)this.DragMovePaint.TextColor=item.TextColor;if(item.Font)this.DragMovePaint.Font=item.Font;}if(style.Buttons){var buttons=style.Buttons;if(buttons.CloseOverlayIndex){var item=buttons.CloseOverlayIndex;if(item.Color)this.Buttons.CloseOverlayIndex.Color=item.Color;if(item.Family)this.Buttons.CloseOverlayIndex.Family=item.Family;if(item.Text)this.Buttons.CloseOverlayIndex.Text=item.Text;if(IFrameSplitOperator.IsNumber(item.Size))this.Buttons.CloseOverlayIndex.Size=item.Size;if(IFrameSplitOperator.IsNumber(item.MerginLeft))this.Buttons.CloseOverlayIndex.MerginLeft=item.MerginLeft;}}};}var g_JSChartResource=new JSChartResource();/////////////////////////////////////////////////////////////////////////////////
|
|
4742
4794
|
//
|
|
4743
4795
|
//
|
|
4744
4796
|
//
|
|
@@ -5527,7 +5579,7 @@ var obj=this.Frame.OnSize();this.Frame.SetSizeChage(true);if(obj.Changed){this.U
|
|
|
5527
5579
|
KLineChartContainer.JsonDataToHistoryData=function(data){var aryDayData=[];if(!data.data)return aryDayData;var upperSymbol=null;if(data.symbol)upperSymbol=data.symbol.toUpperCase();var isFutures=false;//是否是期货
|
|
5528
5580
|
if(upperSymbol)isFutures=MARKET_SUFFIX_NAME.IsFutures(upperSymbol);var list=data.data;var date=0,yclose=1,open=2,high=3,low=4,close=5,vol=6,amount=7,position=8;var fclose=9,yfclose=10;//结算价, 前结算价
|
|
5529
5581
|
var bfactor=11,afactor=12;//前, 后复权因子
|
|
5530
|
-
var orderFlow=
|
|
5582
|
+
var orderFlow=JSCHART_DATA_FIELD_ID.KLINE_ORDERFLOW;for(var i=0;i<list.length;++i){var item=new HistoryData();var jsData=list[i];item.Date=jsData[date];item.Open=jsData[open];item.YClose=jsData[yclose];item.Close=jsData[close];item.High=jsData[high];item.Low=jsData[low];item.Vol=jsData[vol];//原始单位股
|
|
5531
5583
|
item.Amount=jsData[amount];if(IFrameSplitOperator.IsNumber(jsData[position]))item.Position=jsData[position];//期货持仓
|
|
5532
5584
|
if(IFrameSplitOperator.IsNumber(jsData[fclose]))item.FClose=jsData[fclose];//期货结算价
|
|
5533
5585
|
if(IFrameSplitOperator.IsNumber(jsData[yfclose]))item.YFClose=jsData[yfclose];//期货前结算价
|
|
@@ -5549,11 +5601,11 @@ if(!IFrameSplitOperator.IsNumber(item.Open))item.Open=null;if(!IFrameSplitOperat
|
|
|
5549
5601
|
if(IFrameSplitOperator.IsNumber(jsData.price))preClose=jsData.price;aryMinuteData[i]=item;}return aryMinuteData;};//分钟K线叠加数据增量更新v2版本
|
|
5550
5602
|
KLineChartContainer.JsonDataToMinuteRealtimeDataV2=function(data,symbol){if(!data||!data.overlay||!symbol)return null;var overlayData=null;for(var i=0;i<data.overlay.length;++i)//overlay={ symbol:, name:, data:[] }
|
|
5551
5603
|
{var item=data.overlay[i];if(item.symbol==symbol){overlayData=item;break;}}if(!overlayData)return null;var upperSymbol=symbol.toUpperCase();var isSHSZ=MARKET_SUFFIX_NAME.IsSHSZ(upperSymbol);var isFutures=MARKET_SUFFIX_NAME.IsFutures(upperSymbol);//是否是期货
|
|
5552
|
-
var date=0,yclose=1,open=2,high=3,low=4,close=5,vol=6,amount=7,time=8,position=9,orderFlow=
|
|
5604
|
+
var date=0,yclose=1,open=2,high=3,low=4,close=5,vol=6,amount=7,time=8,position=9,orderFlow=JSCHART_DATA_FIELD_ID.KLINE_ORDERFLOW;;var yClose=null;for(var i=0;i<overlayData.data.length;++i){var item=new HistoryData();var jsData=overlayData.data[i];item.Date=jsData[date];item.Open=jsData[open];item.YClose=jsData[yclose];item.Close=jsData[close];item.High=jsData[high];item.Low=jsData[low];item.Vol=jsData[vol];//股
|
|
5553
5605
|
item.Amount=jsData[amount];item.Time=jsData[time];if(IFrameSplitOperator.IsNumber(jsData[position]))item.Position=jsData[position];//期货持仓
|
|
5554
5606
|
if(!IFrameSplitOperator.IsNumber(item.YClose)){if(IFrameSplitOperator.IsNumber(yClose))item.YClose=yClose;}if(IFrameSplitOperator.IsNumber(item.Close))yClose=item.Close;if(jsData[orderFlow])item.OrderFlow=jsData[orderFlow];aryMinuteData.push(item);}return aryMinuteData;};//API 返回数据 转化为array[]
|
|
5555
5607
|
KLineChartContainer.JsonDataToMinuteHistoryData=function(data){var upperSymbol=null;if(data.symbol)upperSymbol=data.symbol.toUpperCase();var isSHSZ=false;if(upperSymbol)isSHSZ=MARKET_SUFFIX_NAME.IsSHSZ(upperSymbol);var isFutures=false;//是否是期货
|
|
5556
|
-
if(upperSymbol)isFutures=MARKET_SUFFIX_NAME.IsFutures(upperSymbol);var list=data.data;var aryDayData=new Array();var date=0,yclose=1,open=2,high=3,low=4,close=5,vol=6,amount=7,time=8,position=9,orderFlow=
|
|
5608
|
+
if(upperSymbol)isFutures=MARKET_SUFFIX_NAME.IsFutures(upperSymbol);var list=data.data;var aryDayData=new Array();var date=0,yclose=1,open=2,high=3,low=4,close=5,vol=6,amount=7,time=8,position=9,orderFlow=JSCHART_DATA_FIELD_ID.KLINE_ORDERFLOW;;var yClose=null;for(var i=0;i<list.length;++i){var item=new HistoryData();var jsData=list[i];item.Date=jsData[date];item.Open=jsData[open];item.YClose=jsData[yclose];item.Close=jsData[close];item.High=jsData[high];item.Low=jsData[low];item.Vol=jsData[vol];//股
|
|
5557
5609
|
item.Amount=jsData[amount];item.Time=jsData[time];if(IFrameSplitOperator.IsNumber(jsData[position]))item.Position=jsData[position];//期货持仓
|
|
5558
5610
|
if(!IFrameSplitOperator.IsNumber(item.YClose)){if(IFrameSplitOperator.IsNumber(yClose))item.YClose=yClose;}if(IFrameSplitOperator.IsNumber(item.Close))yClose=item.Close;if(jsData[orderFlow])item.OrderFlow=jsData[orderFlow];aryDayData.push(item);}/* 内部不处理无效数据, 确保外部传过来的数据是对的.
|
|
5559
5611
|
// 无效数据处理
|
|
@@ -9622,7 +9674,7 @@ Text:"rgb(245,245,245)"//默认文本
|
|
|
9622
9674
|
},UpTextColor:"rgb(238,21,21)",//上涨文字颜色
|
|
9623
9675
|
DownTextColor:"rgb(25,158,0)",//下跌文字颜色
|
|
9624
9676
|
UnchagneTextColor:"rgb(228,228,228)",//平盘文字颜色
|
|
9625
|
-
Tab:{Font:{Size:12,Name:"微软雅黑"},ScrollBarWidth:100,ButtonColor:"rgb(13,12,15)",BarColor:"rgb(48,48,48)",BorderColor:'rgb(48,48,48)',TabTitleColor:'rgb(153,153,153)',TabSelectedTitleColor:'rgb(255,255,255)',TabSelectedBGColor:"rgb(13,12,15)",TabMoveOnTitleColor:"rgb(255,255,255)",TabBGColor:"rgb(28,28,31)"},PageInfo:{Font:{Size:15,Name:"微软雅黑"},TextColor:"rgb(255,255,255)",BGColor:"rgba(49,48,56,0.8)",Mergin:{Left:5,Right:5,Top:4,Bottom:2}}}};return BLACK_STYLE;}var STYLE_TYPE_ID={BLACK_ID:1,//黑色风格
|
|
9677
|
+
Tab:{Font:{Size:12,Name:"微软雅黑"},ScrollBarWidth:100,ButtonColor:"rgb(13,12,15)",BarColor:"rgb(48,48,48)",BorderColor:'rgb(48,48,48)',TabTitleColor:'rgb(153,153,153)',TabSelectedTitleColor:'rgb(255,255,255)',TabSelectedBGColor:"rgb(13,12,15)",TabMoveOnTitleColor:"rgb(255,255,255)",TabBGColor:"rgb(28,28,31)"},PageInfo:{Font:{Size:15,Name:"微软雅黑"},TextColor:"rgb(255,255,255)",BGColor:"rgba(49,48,56,0.8)",Mergin:{Left:5,Right:5,Top:4,Bottom:2}},DragRow:{Color:"rgba(255,250, 250,0.8)",TextColor:'rgba(0,0, 0, 0.8)',MoveRowColor:'rgb(135,206,250)',SrcRowColor:'rgb(49,48,56)'}}};return BLACK_STYLE;}var STYLE_TYPE_ID={BLACK_ID:1,//黑色风格
|
|
9626
9678
|
WHITE_ID:0//白色风格
|
|
9627
9679
|
};function HQChartStyle(){}HQChartStyle.GetStyleConfig=function(styleid)//获取一个风格的配置变量
|
|
9628
9680
|
{switch(styleid){case STYLE_TYPE_ID.BLACK_ID:return GetBlackStyle();case STYLE_TYPE_ID.WHITE_ID:return new JSChartResource();default:return null;}};/*
|
|
@@ -9777,7 +9829,7 @@ this.CanvasElement=document.createElement("canvas");this.CanvasElement.className
|
|
|
9777
9829
|
var height=parseInt(this.DivElement.style.height.replace("px",""));this.CanvasElement.height=height;this.CanvasElement.width=parseInt(this.DivElement.style.width.replace("px",""));this.CanvasElement.style.width=this.CanvasElement.width+'px';this.CanvasElement.style.height=this.CanvasElement.height+'px';var pixelTatio=GetDevicePixelRatio();//获取设备的分辨率
|
|
9778
9830
|
this.CanvasElement.height*=pixelTatio;this.CanvasElement.width*=pixelTatio;JSConsole.Chart.Log('[JSReportChart::OnSize] devicePixelRatio='+window.devicePixelRatio+', height='+this.CanvasElement.height+', width='+this.CanvasElement.width);if(this.JSChartContainer&&this.JSChartContainer.OnSize){this.JSChartContainer.OnSize();}};this.SetOption=function(option){var chart=this.CreateJSReportChartContainer(option);if(!chart)return false;if(option.OnCreatedCallback)option.OnCreatedCallback(chart);this.JSChartContainer=chart;this.DivElement.JSChart=this;//div中保存一份
|
|
9779
9831
|
if(option.Symbol)chart.Symbol=option.Symbol;if(option.Name)chart.Name=option.Name;var requestOption={Callback:null};if(chart.Symbol)requestOption.Callback=function(){chart.RequestMemberListData();};chart.RequestStockListData(requestOption);//下载码表
|
|
9780
|
-
};this.CreateJSReportChartContainer=function(option){var chart=new JSReportChartContainer(this.CanvasElement);chart.Create(option);if(option.NetworkFilter)chart.NetworkFilter=option.NetworkFilter;if(IFrameSplitOperator.IsNonEmptyArray(option.Column))chart.SetColumn(option.Column);if(IFrameSplitOperator.IsNonEmptyArray(option.Tab))chart.SetTab(option.Tab);if(IFrameSplitOperator.IsNumber(option.TabSelected))chart.SetSelectedTab(option.TabSelected);if(option.SortInfo){var item=option.SortInfo;if(IFrameSplitOperator.IsNumber(item.Field))chart.SortInfo.Field=item.Field;if(IFrameSplitOperator.IsNumber(item.Sort))chart.SortInfo.Sort=item.Sort;}this.SetChartBorder(chart,option);//是否自动更新
|
|
9832
|
+
};this.CreateJSReportChartContainer=function(option){var chart=new JSReportChartContainer(this.CanvasElement);chart.Create(option);if(option.NetworkFilter)chart.NetworkFilter=option.NetworkFilter;if(IFrameSplitOperator.IsNonEmptyArray(option.Column))chart.SetColumn(option.Column);if(IFrameSplitOperator.IsNonEmptyArray(option.Tab))chart.SetTab(option.Tab);if(IFrameSplitOperator.IsNumber(option.TabSelected))chart.SetSelectedTab(option.TabSelected);if(IFrameSplitOperator.IsBool(option.EnableDragRow))chart.EnableDragRow=option.EnableDragRow;if(option.SortInfo){var item=option.SortInfo;if(IFrameSplitOperator.IsNumber(item.Field))chart.SortInfo.Field=item.Field;if(IFrameSplitOperator.IsNumber(item.Sort))chart.SortInfo.Sort=item.Sort;}this.SetChartBorder(chart,option);//是否自动更新
|
|
9781
9833
|
if(option.IsAutoUpdate!=null)chart.IsAutoUpdate=option.IsAutoUpdate;if(option.AutoUpdateFrequency>0)chart.AutoUpdateFrequency=option.AutoUpdateFrequency;if(IFrameSplitOperator.IsBool(option.EnableFilter))chart.EnableFilter=option.EnableFilter;//注册事件
|
|
9782
9834
|
if(option.EventCallback){for(var i=0;i<option.EventCallback.length;++i){var item=option.EventCallback[i];chart.AddEventCallback(item);}}return chart;};this.SetChartBorder=function(chart,option){if(!option.Border)return;var item=option.Border;if(IFrameSplitOperator.IsNumber(option.Border.Left))chart.Frame.ChartBorder.Left=option.Border.Left;if(IFrameSplitOperator.IsNumber(option.Border.Right))chart.Frame.ChartBorder.Right=option.Border.Right;if(IFrameSplitOperator.IsNumber(option.Border.Top))chart.Frame.ChartBorder.Top=option.Border.Top;if(IFrameSplitOperator.IsNumber(option.Border.Bottom))chart.Frame.ChartBorder.Bottom=option.Border.Bottom;var pixelTatio=GetDevicePixelRatio();//获取设备的分辨率
|
|
9783
9835
|
chart.Frame.ChartBorder.Left*=pixelTatio;chart.Frame.ChartBorder.Right*=pixelTatio;chart.Frame.ChartBorder.Top*=pixelTatio;chart.Frame.ChartBorder.Bottom*=pixelTatio;};/////////////////////////////////////////////////////////////////////////////
|
|
@@ -9821,6 +9873,8 @@ this.MapStockData=new _map2.default();//原始股票数据
|
|
|
9821
9873
|
this.FixedRowData={Data:[],Type:0,Symbol:[]};//顶部固定行Data:[{ Value:, Text:, Color:, TextAgiln: }], Type:0=自定义数据, 1 =(股票数据) Symbol:[],
|
|
9822
9874
|
//this.FixedRowData.Data=[ [null, {Value:11, Text:"11" }], [null, null, null, {Value:12, Text:"ddddd", Color:"rgb(45,200,4)"}]];
|
|
9823
9875
|
this.SortInfo={Field:-1,Sort:0};//排序信息 {Field:排序字段id, Sort:0 不排序 1升序 2降序 }
|
|
9876
|
+
//行拖拽
|
|
9877
|
+
this.DragRow;this.EnableDragRow=false;this.AutoDragScrollTimer=null;this.EnablePageScroll=false;this.DragMove;//={ Click:{ 点击的点}, Move:{最后移动的点}, PreMove:{上一个点的位置} };
|
|
9824
9878
|
//事件回调
|
|
9825
9879
|
this.mapEvent=new _map2.default();//通知外部调用 key:JSCHART_EVENT_ID value:{Callback:回调,}
|
|
9826
9880
|
this.AutoUpdateTimer=null;this.AutoUpdateFrequency=15000;//15秒更新一次数据
|
|
@@ -9834,22 +9888,22 @@ this.DragPageCycle=true;//手机翻页循环
|
|
|
9834
9888
|
this.DragXScroll=null;//{Start:{x,y}, End:{x, y}}
|
|
9835
9889
|
this.IsDestroy=false;//是否已经销毁了
|
|
9836
9890
|
this.ChartDestory=function()//销毁
|
|
9837
|
-
{this.IsDestroy=true;this.StopAutoUpdate();};//清空固定行数据
|
|
9891
|
+
{this.IsDestroy=true;this.StopAutoUpdate();};this.StopAutoDragScrollTimer=function(){JSConsole.Chart.Log("[JSReportChartContainer::StopAutoDragScrollTimer] stop ");this.EnablePageScroll=false;if(this.AutoDragScrollTimer!=null){clearTimeout(this.AutoDragScrollTimer);this.AutoDragScrollTimer=null;}};this.AutoScrollPage=function(step){var _this33=this;this.AutoDragScrollTimer=setTimeout(function(){_this33.ChartOperator_Temp_ScrollPage(step);},300);};this.ChartOperator_Temp_ScrollPage=function(moveSetp){if(!this.EnablePageScroll)return;var reportChart=this.GetReportChart();if(!reportChart)return;if(moveSetp>0){var pageStatus=reportChart.GetCurrentPageStatus();if(pageStatus.IsEnd)return;this.MoveYOffset(moveSetp,false);++moveSetp;}else if(moveSetp<0){if(this.Data.YOffset<=0)return;this.MoveYOffset(moveSetp,false);--moveSetp;}else{return;}this.Draw();if(!this.EnablePageScroll)return;this.AutoScrollPage(moveSetp);return;};//清空固定行数据
|
|
9838
9892
|
this.ClearFixedRowData=function(){this.FixedRowData.Data=[];this.FixedRowData.Symbol=[];};//设置固定行
|
|
9839
9893
|
this.SetFixedRowCount=function(value){var chart=this.GetReportChart();if(!chart)return;chart.FixedRowCount=value;};//创建
|
|
9840
|
-
this.Create=function(option){var
|
|
9894
|
+
this.Create=function(option){var _this34=this;this.UIElement.JSChartContainer=this;//创建等待提示
|
|
9841
9895
|
this.ChartSplashPaint=new ChartSplashPaint();this.ChartSplashPaint.Canvas=this.Canvas;this.ChartSplashPaint.SetTitle(this.LoadDataSplashTitle);this.ChartSplashPaint.IsEnableSplash=true;//创建框架
|
|
9842
9896
|
this.Frame=new JSReportFrame();this.Frame.ChartBorder=new ChartBorder();this.Frame.ChartBorder.UIElement=this.UIElement;this.Frame.ChartBorder.Top=30;this.Frame.ChartBorder.Left=5;this.Frame.ChartBorder.Bottom=20;this.Frame.Canvas=this.Canvas;this.ChartSplashPaint.Frame=this.Frame;//创建表格
|
|
9843
|
-
var chart=new ChartReport();chart.Frame=this.Frame;chart.ChartBorder=this.Frame.ChartBorder;chart.Canvas=this.Canvas;chart.UIElement=this.UIElement;chart.GetEventCallback=function(id){return
|
|
9897
|
+
var chart=new ChartReport();chart.Frame=this.Frame;chart.ChartBorder=this.Frame.ChartBorder;chart.Canvas=this.Canvas;chart.UIElement=this.UIElement;chart.GetEventCallback=function(id){return _this34.GetEventCallback(id);};chart.GetStockDataCallback=function(symbol){return _this34.GetStockData(symbol);};chart.GetBlockDataCallback=function(symbol){return _this34.GetBlockData(symbol);};chart.Data=this.Data;chart.FixedRowData=this.FixedRowData;chart.SortInfo=this.SortInfo;chart.Tab=new ChartReportTab();chart.Tab.Frame=this.Frame;chart.Tab.Canvas=this.Canvas;chart.Tab.ChartBorder=this.Frame.ChartBorder;chart.Tab.Report=chart;this.ChartPaint[0]=chart;//页脚
|
|
9844
9898
|
if(option&&option.PageInfo===true){var pageInfoChart=new ChartReportPageInfo();pageInfoChart.Frame=this.Frame;pageInfoChart.ChartBorder=this.Frame.ChartBorder;pageInfoChart.Canvas=this.Canvas;pageInfoChart.Report=chart;this.ChartPaint[1]=pageInfoChart;}if(option){if(IFrameSplitOperator.IsBool(option.IsShowHeader))chart.IsShowHeader=option.IsShowHeader;//是否显示表头
|
|
9845
9899
|
if(IFrameSplitOperator.IsNumber(option.FixedColumn))chart.FixedColumn=option.FixedColumn;//固定列
|
|
9846
9900
|
if(IFrameSplitOperator.IsNumber(option.BorderLine))this.Frame.BorderLine=option.BorderLine;//边框
|
|
9847
9901
|
if(IFrameSplitOperator.IsBool(option.TabShow))chart.Tab.IsShow=option.TabShow;if(IFrameSplitOperator.IsNumber(option.FixedRowCount))chart.FixedRowCount=option.FixedRowCount;//固定行
|
|
9848
9902
|
if(IFrameSplitOperator.IsBool(option.ItemBorder))chart.IsDrawBorder=option.ItemBorder;//单元格边框
|
|
9849
|
-
if(IFrameSplitOperator.IsNumber(option.SelectedModel))chart.SelectedModel=option.SelectedModel;if(IFrameSplitOperator.IsNonEmptyArray(option.FixedSymbol)){chart.FixedRowCount=0;this.FixedRowData.Type=1;this.FixedRowData.Symbol=[];var aryData=option.FixedSymbol;for(var i=0;i<aryData.length;++i){var item=aryData[i];this.FixedRowData.Symbol.push(item.Symbol);++chart.FixedRowCount;}}}var bRegisterKeydown=true;var bRegisterWheel=true;if(option){if(option.KeyDown===false){bRegisterKeydown=false;JSConsole.Chart.Log('[JSDealChartContainer::Create] not register keydown event.');}if(option.Wheel===false){bRegisterWheel=false;JSConsole.Chart.Log('[JSDealChartContainer::Create] not register wheel event.');}}if(bRegisterKeydown)this.UIElement.addEventListener("keydown",function(e){
|
|
9850
|
-
if(bRegisterWheel)this.UIElement.addEventListener("wheel",function(e){
|
|
9851
|
-
this.UIElement.ondblclick=function(e){
|
|
9852
|
-
this.UIElement.ontouchstart=function(e){
|
|
9903
|
+
if(IFrameSplitOperator.IsNumber(option.SelectedModel))chart.SelectedModel=option.SelectedModel;if(IFrameSplitOperator.IsNonEmptyArray(option.FixedSymbol)){chart.FixedRowCount=0;this.FixedRowData.Type=1;this.FixedRowData.Symbol=[];var aryData=option.FixedSymbol;for(var i=0;i<aryData.length;++i){var item=aryData[i];this.FixedRowData.Symbol.push(item.Symbol);++chart.FixedRowCount;}}}var bRegisterKeydown=true;var bRegisterWheel=true;if(option){if(option.KeyDown===false){bRegisterKeydown=false;JSConsole.Chart.Log('[JSDealChartContainer::Create] not register keydown event.');}if(option.Wheel===false){bRegisterWheel=false;JSConsole.Chart.Log('[JSDealChartContainer::Create] not register wheel event.');}}if(bRegisterKeydown)this.UIElement.addEventListener("keydown",function(e){_this34.OnKeyDown(e);},true);//键盘消息
|
|
9904
|
+
if(bRegisterWheel)this.UIElement.addEventListener("wheel",function(e){_this34.OnWheel(e);},true);//上下滚动消息
|
|
9905
|
+
this.UIElement.ondblclick=function(e){_this34.UIOnDblClick(e);};this.UIElement.onmousedown=function(e){_this34.UIOnMouseDown(e);};this.UIElement.oncontextmenu=function(e){_this34.UIOnContextMenu(e);};this.UIElement.onmousemove=function(e){_this34.UIOnMouseMove(e);};this.UIElement.onmouseout=function(e){_this34.UIOnMounseOut(e);};this.UIElement.onmouseleave=function(e){_this34.UIOnMouseleave(e);};//手机拖拽
|
|
9906
|
+
this.UIElement.ontouchstart=function(e){_this34.OnTouchStart(e);};this.UIElement.ontouchmove=function(e){_this34.OnTouchMove(e);};this.UIElement.ontouchend=function(e){_this34.OnTouchEnd(e);};};this.Draw=function(){if(this.UIElement.width<=0||this.UIElement.height<=0)return;this.Canvas.clearRect(0,0,this.UIElement.width,this.UIElement.height);var pixelTatio=GetDevicePixelRatio();//获取设备的分辨率
|
|
9853
9907
|
this.Canvas.lineWidth=pixelTatio;//手机端需要根据分辨率比调整线段宽度
|
|
9854
9908
|
if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash){this.Frame.Draw({IsEnableSplash:this.ChartSplashPaint.IsEnableSplash});this.ChartSplashPaint.Draw();return;}this.Frame.Draw();this.Frame.DrawLogo();//框架内图形
|
|
9855
9909
|
for(var i=0;i<this.ChartPaint.length;++i){var item=this.ChartPaint[i];if(item.IsDrawFirst)item.Draw();}for(var i=0;i<this.ChartPaint.length;++i){var item=this.ChartPaint[i];if(!item.IsDrawFirst)item.Draw();}};this.ResetReportStatus=function(){this.Data.XOffset=0;this.Data.YOffset=0;};this.ResetReportSelectStatus=function(){var chart=this.GetReportChart();if(chart){chart.SelectedRow=-1;chart.SelectedFixedRow=-1;}};this.ClearData=function(){this.SourceData.Data=[];this.Data.Data=[];this.BlockData=new _map2.default();};this.ResetSortStatus=function(){this.SortInfo.Field=-1;this.SortInfo.Sort=0;};//设置股票列表
|
|
@@ -9868,7 +9922,7 @@ for(var i=0;i<data.data.length;++i){var item=data.data[i];var symbol=item[0];var
|
|
|
9868
9922
|
this.UpdateMapStockData=function(data){if(!data||!IFrameSplitOperator.IsNonEmptyArray(data.data))return;//0=证券代码 1=股票名称
|
|
9869
9923
|
for(var i=0;i<data.data.length;++i){var item=data.data[i];var symbol=item[0];var stock=null;if(this.MapStockData.has(symbol)){stock=this.MapStockData.get(symbol);}else{stock=new HQReportItem();stock.OriginalSymbol=symbol;this.MapStockData.set(symbol,stock);}stock.Symbol=this.GetSymbolNoSuffix(symbol);stock.Name=item[1];this.ReadStockJsonData(stock,item);}};//获取个股数据
|
|
9870
9924
|
this.GetStockData=function(symbol){if(!this.MapStockData)return null;if(!this.MapStockData.has(symbol))return null;return this.MapStockData.get(symbol);};this.GetBlockData=function(symbol){if(!this.BlockData)return null;if(!this.BlockData.has(symbol))return null;return this.BlockData.get(symbol);};//delay=是否延迟
|
|
9871
|
-
this.DelayUpdateStockData=function(){var
|
|
9925
|
+
this.DelayUpdateStockData=function(){var _this35=this;if(this.DelayUpdateTimer!=null){clearTimeout(this.DelayUpdateTimer);this.DelayUpdateTimer=null;}var frequency=this.DelayUpdateFrequency;this.DelayUpdateTimer=setTimeout(function(){_this35.UpdateStockData();},frequency);};this.UpdateStockData=function(){if(!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return;var chart=this.ChartPaint[0];if(!chart)return;if(this.SortInfo&&this.SortInfo.Field>=0&&this.SortInfo.Sort>0){var column=chart.Column[this.SortInfo.Field];if(column.Sort==2){this.RequestStockSortData(column,this.SortInfo.Field,this.SortInfo.Sort);//远程排序
|
|
9872
9926
|
return;}}var arySymbol=chart.ShowSymbol;if(!IFrameSplitOperator.IsNonEmptyArray(arySymbol))return;this.RequestStockData(arySymbol);};//下载股票数据
|
|
9873
9927
|
this.RequestStockData=function(arySymbol){var self=this;if(this.NetworkFilter){var obj={Name:'JSDealChartContainer::RequestStockData',//类名::函数名
|
|
9874
9928
|
Explain:'报价列表股票数据',Request:{Data:{stocks:arySymbol}},Self:this,PreventDefault:false};this.NetworkFilter(obj,function(data){self.RecvStockData(data);self.AutoUpdate();});if(obj.PreventDefault==true)return;}throw{Name:'JSReportChartContainer::RequestStockData',Error:'(报价列表股票数据)不提供内置测试数据'};};this.RecvStockData=function(data){var setUpdateSymbol=new _set2.default();//更新的股票列表
|
|
@@ -9919,18 +9973,21 @@ var result=this.MoveSelectedRow(-1);if(result){if(result.Redraw)this.Draw();if(r
|
|
|
9919
9973
|
var result=this.MoveSelectedRow(1);if(result){if(result.Redraw)this.Draw();if(result.Update)this.DelayUpdateStockData();}break;case 37://left
|
|
9920
9974
|
if(this.MoveXOffset(-1))this.Draw();break;case 39://right
|
|
9921
9975
|
if(this.MoveXOffset(1))this.Draw();break;}//不让滚动条滚动
|
|
9922
|
-
if(e.preventDefault)e.preventDefault();else e.returnValue=false;};this.UIOnDblClick=function(e){var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;var chart=this.ChartPaint[0];if(chart)chart.OnDblClick(x,y,e);};this.UIOnMouseDown=function(e){var
|
|
9976
|
+
if(e.preventDefault)e.preventDefault();else e.returnValue=false;};this.UIOnDblClick=function(e){var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;var chart=this.ChartPaint[0];if(chart)chart.OnDblClick(x,y,e);};this.UIOnMouseDown=function(e){var _this36=this;this.DragXScroll=null;this.DragMove={Click:{X:e.clientX,Y:e.clientY},Move:{X:e.clientX,Y:e.clientY},PreMove:{X:e.clientX,Y:e.clientY}};var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;var chart=this.ChartPaint[0];if(chart){var clickData=chart.OnMouseDown(x,y,e);if(!clickData)return;//if (e.button!=0) return;
|
|
9923
9977
|
if((clickData.Type==2||clickData.Type==4)&&(e.button==0||e.button==2))//点击行|固定行
|
|
9924
|
-
{if(clickData.Redraw==true)this.Draw();}else if(clickData.Type==3&&e.button==0)//表头
|
|
9978
|
+
{if(e.button==0&&clickData.Type==2){if(this.EnableDragRow&&this.SortInfo.Sort<=0){this.DragRow={Click:{X:e.clientX,Y:e.clientY},LastMove:{X:e.clientX,Y:e.clientY},Data:clickData};}}if(clickData.Redraw==true)this.Draw();}else if(clickData.Type==3&&e.button==0)//表头
|
|
9925
9979
|
{this.OnClickHeader(clickData,e);}else if(clickData.Type==1&&e.button==0)//底部工具栏
|
|
9926
9980
|
{var tabData=clickData.Tab;if(tabData.Type==1)//左按钮
|
|
9927
9981
|
{if(this.MoveXOffset(-1))this.Draw();}else if(tabData.Type==2)//右按钮
|
|
9928
9982
|
{if(this.MoveXOffset(1))this.Draw();}else if(tabData.Type==3)//滚动条
|
|
9929
9983
|
{this.DragXScroll={Click:{X:x,Y:y},LastMove:{X:x,Y:y}};}else if(tabData.Type==4)//滚动条内部
|
|
9930
9984
|
{if(this.SetXOffset(tabData.Pos))this.Draw();}else if(tabData.Type==5)//标签
|
|
9931
|
-
{this.OnClickTab(tabData,e);}}}document.onmousemove=function(e){
|
|
9932
|
-
this.UIOnContextMenu=function(e){e.preventDefault();};this.UIOnMouseMove=function(e){var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;var tabChart=this.GetTabChart();if(tabChart){var tabData=tabChart.PtInTab(x,y);if(tabData){var index=tabData.Index;if(tabChart.MoveOnTabIndex!=index){tabChart.MoveOnTabIndex=index;this.Draw();}}}};this.UIOnMounseOut=function(e){var tabChart=this.GetTabChart();if(tabChart&&tabChart.MoveOnTabIndex>=0){tabChart.MoveOnTabIndex=-1;this.Draw();}};this.UIOnMouseleave=function(e){var tabChart=this.GetTabChart();if(tabChart&&tabChart.MoveOnTabIndex>=0){tabChart.MoveOnTabIndex=-1;this.Draw();}};this.DocOnMouseMove=function(e){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
|
|
9933
|
-
|
|
9985
|
+
{this.OnClickTab(tabData,e);}}}document.onmousemove=function(e){_this36.DocOnMouseMove(e);};document.onmouseup=function(e){_this36.DocOnMouseUp(e);};};//去掉右键菜单
|
|
9986
|
+
this.UIOnContextMenu=function(e){e.preventDefault();};this.UIOnMouseMove=function(e){var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;if(this.DragRow)return;var tabChart=this.GetTabChart();if(tabChart){var tabData=tabChart.PtInTab(x,y);if(tabData){var index=tabData.Index;if(tabChart.MoveOnTabIndex!=index){tabChart.MoveOnTabIndex=index;this.Draw();}}}};this.UIOnMounseOut=function(e){var tabChart=this.GetTabChart();if(tabChart&&tabChart.MoveOnTabIndex>=0){tabChart.MoveOnTabIndex=-1;this.Draw();}};this.UIOnMouseleave=function(e){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}`);
|
|
9987
|
+
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.OnDrawgRow(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();}};this.DocOnMouseUp=function(e){//清空事件
|
|
9988
|
+
document.onmousemove=null;document.onmouseup=null;this.StopAutoDragScrollTimer();var bRedraw=false;if(this.DragRow){var reportChart=this.GetReportChart();if(reportChart){this.OnDragRow();reportChart.DragRow=null;}bRedraw=true;}this.DragXScroll=null;this.DragRow=null;this.DragMove=null;if(bRedraw)this.Draw();};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;//原始数据交换顺序
|
|
9989
|
+
var temp=data[srcIndex];data[srcIndex]=data[moveIndex];data[moveIndex]=temp;this.Data.Data=data.slice(0);//更新选中行
|
|
9990
|
+
var reportChart=this.GetReportChart();if(reportChart){if(reportChart.SelectedModel==0)reportChart.SelectedRow=drag.MoveRow.Data.Index;else reportChart.SelectedRow=drag.MoveRow.Data.DataIndex;}};//判断是单个手指
|
|
9934
9991
|
this.IsPhoneDragging=function(e){// JSConsole.Chart.Log(e);
|
|
9935
9992
|
var changed=e.changedTouches.length;var touching=e.touches.length;return changed==1&&touching==1;};this.GetTouchData=function(e){var touches=[];var pixelTatio=GetDevicePixelRatio();//获取设备的分辨率
|
|
9936
9993
|
for(var i=0;i<e.touches.length;++i){var item=e.touches[i];var toucheItem={clientX:item.clientX*pixelTatio,clientY:item.clientY*pixelTatio,pageX:item.pageX*pixelTatio,pageY:item.pageY*pixelTatio,//内部相对坐标
|
|
@@ -9955,8 +10012,8 @@ if(chart.SelectedModel==0)//不可翻页模式, 只能在当前页移动
|
|
|
9955
10012
|
{var pageStatus=chart.GetCurrentPageStatus();var pageSize=pageStatus.PageSize;var selected=pageStatus.SelectedRow;if(step>0){if(selected<0||selected<pageStatus.Start||selected>pageStatus.End){chart.SelectedRow=pageStatus.Start;result.Redraw=true;return result;}var offset=this.Data.YOffset;for(var i=0;i<step;++i){++selected;if(selected>pageStatus.End)++offset;if(selected>=this.Data.Data.length){selected=0;offset=0;}}result.Redraw=true;result.Update=offset!=this.Data.YOffset;chart.SelectedRow=selected;this.Data.YOffset=offset;return result;}else if(step<0){if(selected<0||selected<pageStatus.Start||selected>pageStatus.End){chart.SelectedRow=pageStatus.End;result.Redraw=true;return result;}step=Math.abs(step);var offset=this.Data.YOffset;for(var i=0;i<step;++i){--selected;if(selected<pageStatus.Start)--offset;if(selected<0){selected=this.Data.Data.length-1;offset=this.Data.Data.length-pageSize;if(offset<0)offset=0;}}result.Redraw=true;result.Update=offset!=this.Data.YOffset;chart.SelectedRow=selected;this.Data.YOffset=offset;return result;}}return null;};//左右移动
|
|
9956
10013
|
this.MoveXOffset=function(step){var chart=this.ChartPaint[0];if(!chart)return false;var maxOffset=chart.GetXScrollRange();if(maxOffset<=0)return false;if(step>0){if(this.Data.XOffset>=maxOffset)return false;for(var i=0;i<step;++i){if(this.Data.XOffset>=maxOffset)break;++this.Data.XOffset;}return true;}else if(step<0){if(this.Data.XOffset<=0)return false;step=Math.abs(step);for(var i=0;i<step;++i){if(this.Data.XOffset-1<0)break;--this.Data.XOffset;}return true;}return false;};this.SetXOffset=function(pos){if(!IFrameSplitOperator.IsNumber(pos))return false;var chart=this.ChartPaint[0];if(!chart)return false;var maxOffset=chart.GetXScrollRange();if(pos<0)pos=0;if(pos>maxOffset)pos=maxOffset;this.Data.XOffset=pos;return true;};this.GotoLastPage=function(){var chart=this.ChartPaint[0];if(!chart)return;//显示最后一屏
|
|
9957
10014
|
var pageSize=chart.GetPageSize(true);var offset=this.Data.Data.length-pageSize;if(offset<0)offset=0;this.Data.DataOffset=offset;};this.SetColumn=function(aryColunm,option){var chart=this.ChartPaint[0];if(!chart)return;chart.SetColumn(aryColunm);chart.SizeChange=true;if(option&&option.Redraw)this.Draw();};this.SetTab=function(aryTab,option){var chart=this.ChartPaint[0];;if(!chart)return;var chartTab=chart.Tab;if(!chartTab)return;chartTab.SetTabList(aryTab);if(option&&option.Redraw)this.Draw();};this.SetSelectedTab=function(index,opiton){var chart=this.ChartPaint[0];;if(!chart)return;var chartTab=chart.Tab;if(!chartTab)return;chartTab.SelectedTabIndex=index;};this.ReloadResource=function(option){this.Frame.ReloadResource(option);for(var i=0;i<this.ChartPaint.length;++i){var item=this.ChartPaint[i];if(item.ReloadResource)item.ReloadResource(option);}if(option&&option.Redraw){this.SetSizeChange(true);this.Draw();}};//点表头
|
|
9958
|
-
this.OnClickHeader=function(clickData,e){var
|
|
9959
|
-
{var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_LOCAL_SORT);if(event&&event.Callback){var sendData={Column:header.Column,SortInfo:sortInfo,SymbolList:this.Data.Data,Result:null};event.Callback(event,sendData,this);if(Array.isArray(sendData.Result))this.Data.Data=sendData.Result;}else{this.Data.Data.sort(function(left,right){return
|
|
10015
|
+
this.OnClickHeader=function(clickData,e){var _this37=this;var header=clickData.Header;if(header.Column&&(header.Column.Sort==1||header.Column.Sort==2)){var index=header.Index;var sortInfo={Field:this.SortInfo.Field,Sort:this.SortInfo.Sort};var arySortType=header.Column.SortType;if(sortInfo.Field!=index){sortInfo.Field=index;sortInfo.Sort=arySortType[0];}else{if(arySortType.length==1){sortInfo.Sort=arySortType[0];}else{for(var i=0;i<arySortType.length;++i){if(sortInfo.Sort==arySortType[i]){sortInfo.Sort=arySortType[(i+1)%arySortType.length];break;}}}}if(header.Column.Sort==1||header.Column.Sort==2){if(sortInfo.Sort==0){this.Data.Data=[];for(var i=0;i<this.SourceData.Data.length;++i){this.Data.Data.push(this.SourceData.Data[i]);}}else{if(header.Column.Sort==1)//本地排序
|
|
10016
|
+
{var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_LOCAL_SORT);if(event&&event.Callback){var sendData={Column:header.Column,SortInfo:sortInfo,SymbolList:this.Data.Data,Result:null};event.Callback(event,sendData,this);if(Array.isArray(sendData.Result))this.Data.Data=sendData.Result;}else{this.Data.Data.sort(function(left,right){return _this37.LocalSort(left,right,header.Column,sortInfo.Sort);});}}else if(header.Column.Sort==2)//远程排序
|
|
9960
10017
|
{if(!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return;this.SortInfo.Field=sortInfo.Field;this.SortInfo.Sort=sortInfo.Sort;this.Data.YOffset=0;this.ResetReportSelectStatus();this.RequestStockSortData(header.Column,sortInfo.Field,sortInfo.Sort);//远程排序
|
|
9961
10018
|
return;}}this.Data.YOffset=0;this.ResetReportSelectStatus();this.SortInfo.Field=sortInfo.Field;this.SortInfo.Sort=sortInfo.Sort;this.Draw();this.DelayUpdateStockData();}}};//点击标签
|
|
9962
10019
|
this.OnClickTab=function(tabData,e){if(!tabData.Tab)return;var redraw=false;var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;var uiElement={Left:this.UIElement.getBoundingClientRect().left,Top:this.UIElement.getBoundingClientRect().top};if(tabData.Tab.IsMenu){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_REPORT_TABMENU);if(event&&event.Callback){redraw=true;var rtItem=tabData.Rect;var rtDOM={Left:rtItem.Left/pixelTatio,Right:rtItem.Right/pixelTatio,Top:rtItem.Top/pixelTatio,Bottom:rtItem.Bottom/pixelTatio};var sendData={Data:tabData,IsSide:{X:x,Y:x},UIElement:uiElement,Rect:rtDOM,e:e,Redraw:redraw};event.Callback(event,sendData,this);if(IFrameSplitOperator.IsBool(sendData.Redraw))redraw=sendData.Redraw;}this.SetSelectedTab(tabData.Index);//选中tab
|
|
@@ -10021,6 +10078,7 @@ this.SelectedRow=-1;//选中行ID
|
|
|
10021
10078
|
this.SelectedFixedRow=-1;//选中固定行ID
|
|
10022
10079
|
this.IsDrawBorder=1;//是否绘制单元格边框
|
|
10023
10080
|
this.ShowSymbol=[];//显示的股票列表 { Index:序号(排序用), Symbol:股票代码 }
|
|
10081
|
+
this.DragRow;//拖拽行
|
|
10024
10082
|
this.Tab;//涨跌颜色
|
|
10025
10083
|
this.UpColor=g_JSChartResource.Report.UpTextColor;this.DownColor=g_JSChartResource.Report.DownTextColor;this.UnchagneColor=g_JSChartResource.Report.UnchagneTextColor;this.BorderColor=g_JSChartResource.Report.BorderColor;//边框线
|
|
10026
10084
|
this.SelectedColor=g_JSChartResource.Report.SelectedColor;//选中行
|
|
@@ -10028,8 +10086,8 @@ this.SelectedColor=g_JSChartResource.Report.SelectedColor;//选中行
|
|
|
10028
10086
|
this.HeaderFontConfig={Size:g_JSChartResource.Report.Header.Font.Size,Name:g_JSChartResource.Report.Header.Font.Name};this.HeaderColor=g_JSChartResource.Report.Header.Color;this.SortColor=g_JSChartResource.Report.Header.SortColor;//排序箭头颜色
|
|
10029
10087
|
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};//表格内容配置
|
|
10030
10088
|
this.ItemFontConfig={Size:g_JSChartResource.Report.Item.Font.Size,Name:g_JSChartResource.Report.Item.Font.Name};this.ItemFixedFontConfg={Size:g_JSChartResource.Report.FixedItem.Font.Size,Name:g_JSChartResource.Report.FixedItem.Font.Name};//固定行
|
|
10031
|
-
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
|
|
10032
|
-
|
|
10089
|
+
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;//股票代码+股票名称
|
|
10090
|
+
this.ItemSymbolFontConfig={Size:g_JSChartResource.Report.Item.SymbolFont.Size,Name:g_JSChartResource.Report.Item.SymbolFont.Name};this.ItemNameFontConfg={Size:g_JSChartResource.Report.Item.NameFont.Size,Name:g_JSChartResource.Report.Item.NameFont.Name};//缓存
|
|
10033
10091
|
this.HeaderFont=12*GetDevicePixelRatio()+"px 微软雅黑";this.ItemFont=15*GetDevicePixelRatio()+"px 微软雅黑";this.ItemFixedFont=15*GetDevicePixelRatio()+"px 微软雅黑";this.ItemSymbolFont=12*GetDevicePixelRatio()+"px 微软雅黑";this.ItemNameFont=15*GetDevicePixelRatio()+"px 微软雅黑";this.ItemNameHeight=0;this.RowCount=0;//一屏显示行数
|
|
10034
10092
|
this.HeaderHeight=0;//表头高度
|
|
10035
10093
|
this.FixedRowHeight=0;//固定行高度
|
|
@@ -10062,7 +10120,7 @@ if(IFrameSplitOperator.IsNumber(item.ValueType))colItem.FormatType=item.ValueTyp
|
|
|
10062
10120
|
if(IFrameSplitOperator.IsBool(item.IsDrawCallback))colItem.IsDrawCallback=item.IsDrawCallback;}this.Column.push(colItem);}};this.GetXScrollPos=function(){return this.Data.XOffset;};this.GetXScrollRange=function(){var maxOffset=this.Column.length-this.FixedColumn-3;if(maxOffset<0)return 0;return maxOffset;};this.GetDefaultColunm=function(id){var DEFAULT_COLUMN=[{Type:REPORT_COLUMN_ID.INDEX_ID,Title:"序号",TextAlign:"center",Width:null,TextColor:g_JSChartResource.Report.FieldColor.Index,MaxText:"8888"},{Type:REPORT_COLUMN_ID.SYMBOL_ID,Title:"代码",TextAlign:"left",Width:null,TextColor:g_JSChartResource.Report.FieldColor.Symbol,MaxText:"888888"},{Type:REPORT_COLUMN_ID.NAME_ID,Title:"名称",TextAlign:"left",Width:null,TextColor:g_JSChartResource.Report.FieldColor.Name,MaxText:"擎擎擎擎0"},{Type:REPORT_COLUMN_ID.SYMBOL_NAME_ID,Title:"股票名称",TextAlign:"left",Width:null,TextColor:g_JSChartResource.Report.FieldColor.Name,MaxText:"擎擎擎擎0"},{Type:REPORT_COLUMN_ID.INCREASE_ID,Title:"涨幅%",TextAlign:"right",Width:null,MaxText:"-888.88"},{Type:REPORT_COLUMN_ID.PRICE_ID,Title:"现价",TextAlign:"right",Width:null,MaxText:"88888.88"},{Type:REPORT_COLUMN_ID.UPDOWN_ID,Title:"涨跌",TextAlign:"right",Width:null,MaxText:"-888.88"},{Type:REPORT_COLUMN_ID.AMPLITUDE_ID,Title:"振幅%",TextAlign:"right",Width:null,MaxText:"888.88"},{Type:REPORT_COLUMN_ID.BUY_PRICE_ID,Title:"买价",TextAlign:"right",Width:null,MaxText:"88888.88"},{Type:REPORT_COLUMN_ID.SELL_PRICE_ID,Title:"卖价",TextAlign:"right",Width:null,MaxText:"88888.88"},{Type:REPORT_COLUMN_ID.AVERAGE_PRICE_ID,Title:"均价",TextAlign:"right",Width:null,MaxText:"88888.88"},{Type:REPORT_COLUMN_ID.OPEN_ID,Title:"今开",TextAlign:"right",Width:null,MaxText:"88888.88"},{Type:REPORT_COLUMN_ID.HIGH_ID,Title:"最高",TextAlign:"right",Width:null,MaxText:"88888.88"},{Type:REPORT_COLUMN_ID.LOW_ID,Title:"最低",TextAlign:"right",Width:null,MaxText:"88888.88"},{Type:REPORT_COLUMN_ID.YCLOSE_ID,Title:"昨收",TextAlign:"right",Width:null,MaxText:"88888.88"},{Type:REPORT_COLUMN_ID.VOL_ID,Title:"总量",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Vol,Width:null,MaxText:"8888.8擎"},{Type:REPORT_COLUMN_ID.AMOUNT_ID,Title:"总金额",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Amount,Width:null,MaxText:"8888.8擎"},{Type:REPORT_COLUMN_ID.EXCHANGE_RATE_ID,Title:"换手%",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Text,Width:null,MaxText:"88.88"},{Type:REPORT_COLUMN_ID.OUTSTANDING_SHARES_ID,Title:"流通股本",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Text,Width:null,MaxText:"8888.8擎"},{Type:REPORT_COLUMN_ID.TOTAL_SHARES_ID,Title:"总股本",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Text,Width:null,MaxText:"8888.8擎"},{Type:REPORT_COLUMN_ID.CIRC_MARKET_VALUE_ID,Title:"流通市值",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Text,Width:null,MaxText:"8888.8擎"},{Type:REPORT_COLUMN_ID.MARKET_VALUE_ID,Title:"总市值",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Text,Width:null,MaxText:"8888.8擎"},{Type:REPORT_COLUMN_ID.VOL_IN_ID,Title:"内盘",TextAlign:"right",TextColor:g_JSChartResource.Report.DownTextColor,Width:null,MaxText:"8888.8擎"},{Type:REPORT_COLUMN_ID.VOL_OUT_ID,Title:"外盘",TextAlign:"right",TextColor:g_JSChartResource.Report.UpTextColor,Width:null,MaxText:"8888.8擎"},{Type:REPORT_COLUMN_ID.BUY_VOL_ID,Title:"买量",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Vol,Width:null,MaxText:"8888.8擎"},{Type:REPORT_COLUMN_ID.SELL_VOL_ID,Title:"卖量",TextAlign:"right",TextColor:g_JSChartResource.Report.FieldColor.Vol,Width:null,MaxText:"8888.8擎"},//{ Type:REPORT_COLUMN_ID.MULTI_BAR_ID, Title:"柱子", TextAlign:"center", Width:null, TextColor:g_JSChartResource.DealList.FieldColor.BarTitle, MaxText:"888888" },
|
|
10063
10121
|
//{ Type:REPORT_COLUMN_ID.CENTER_BAR_ID, Title:"柱子2", TextAlign:"center", Width:null, TextColor:g_JSChartResource.DealList.FieldColor.BarTitle, MaxText:"888888" },
|
|
10064
10122
|
{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"}];for(var i=0;i<DEFAULT_COLUMN.length;++i){var item=DEFAULT_COLUMN[i];if(item.Type==id)return item;}return null;};this.Draw=function(){this.ShowSymbol=[];if(this.SizeChange)this.CalculateSize();else this.UpdateCacheData();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(); //调试用
|
|
10065
|
-
this.Canvas.clip();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.DrawBorder();this.SizeChange=false;};//更新缓存变量
|
|
10123
|
+
this.Canvas.clip();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.DrawBorder();this.DrawDragRow();this.SizeChange=false;};//更新缓存变量
|
|
10066
10124
|
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 是否重新计算
|
|
10067
10125
|
{if(recalculate)this.CalculateSize();var size=this.RowCount;return size;};this.GetCurrentPageStatus=function()//{ Start:起始索引, End:结束索引(数据), PageSize:页面可以显示几条记录, IsEnd:是否是最后一页, IsSinglePage:是否只有一页数据}
|
|
10068
10126
|
{var result={Start:this.Data.YOffset,PageSize:this.RowCount,IsEnd:false,SelectedRow:this.SelectedRow,IsSinglePage:false,DataCount:0};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.Star=0;result.End=0;result.IsEnd=true;result.IsSinglePage=true;}return result;};this.CalculateSize=function()//计算大小
|
|
@@ -10072,13 +10130,14 @@ for(var i=0;i<this.RowCount;++i){var drawTop=ToFixedPoint(rowTop);this.Canvas.mo
|
|
|
10072
10130
|
var columnLeft=left;for(var i=0;i<this.FixedColumn&&i<this.Column.length;++i){var item=this.Column[i];var drawLeft=ToFixedPoint(columnLeft+item.Width);this.Canvas.moveTo(drawLeft,top);this.Canvas.lineTo(drawLeft,rotBottom);columnLeft+=item.Width;}for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i){var item=this.Column[i];var drawLeft=ToFixedPoint(columnLeft+item.Width);this.Canvas.moveTo(drawLeft,top);this.Canvas.lineTo(drawLeft,rotBottom);columnLeft+=item.Width;}this.Canvas.stroke();};this.DrawBody=function(){if(!this.Data)return;if(!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return;this.Canvas.font=this.ItemFont;var top=this.RectClient.Top+this.HeaderHeight;var left=this.RectClient.Left;var rowWidth=this.RectClient.Right-this.RectClient.Left;//固定行
|
|
10073
10131
|
var textTop=top;this.Canvas.font=this.ItemFixedFont;for(var i=0;i<this.FixedRowCount;++i){if(this.SelectedFixedRow==i){this.Canvas.fillStyle=this.SelectedColor;;this.Canvas.fillRect(left,textTop,rowWidth,this.FixedRowHeight);}if(this.FixedRowData.Type==1)this.DrawFixedSymbolRow(textTop,i);else this.DrawFixedRow(textTop,i);textTop+=this.FixedRowHeight;}textTop=top+this.FixedRowHeight*this.FixedRowCount;this.Canvas.font=this.ItemFont;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 bFillRow=false;if(this.SelectedModel==0){if(j==this.SelectedRow)bFillRow=true;//选中行
|
|
10074
10132
|
}else{if(i==this.SelectedRow)bFillRow=true;//选中行
|
|
10075
|
-
}if(bFillRow){this.Canvas.fillStyle=this.SelectedColor;this.Canvas.fillRect(left,textTop,rowWidth,this.RowHeight);}this.DrawRow(symbol,textTop,i);this.ShowSymbol.push({Index:i,Symbol:symbol});textTop+=this.RowHeight;}};this.DrawFixedSymbolRow=function(top,dataIndex){var left=this.RectClient.Left;var chartRight=this.RectClient.Right;if(!this.FixedRowData||!IFrameSplitOperator.IsNonEmptyArray(this.FixedRowData.Symbol))return;var symbol=this.FixedRowData.Symbol[dataIndex];if(!symbol)return;this.DrawRow(symbol,top,dataIndex,1);this.ShowSymbol.push({Index:dataIndex,Symbol:symbol,RowType:1});};this.DrawFixedRow=function(top,dataIndex){var left=this.RectClient.Left;var chartRight=this.RectClient.Right;for(var i=0;i<this.FixedColumn&&i<this.Column.length;++i){var item=this.Column[i];this.DrawFixedItem(dataIndex,i,item,left,top);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.DrawFixedItem(dataIndex,i,item,left,top);left+=item.Width;if(left>=chartRight)break;}};this.DrawFixedItem=function(dataIndex,colIndex,column,left,top){var x=left+this.ItemMergin.Left;var textWidth=column.Width-this.ItemMergin.Left-this.ItemMergin.Right;var drawInfo={Text:null,TextColor:column.TextColor,TextAlign:column.TextAlign};if(this.GetFixedRowTextDrawInfo(dataIndex,colIndex,column,drawInfo)){this.DrawItemText(drawInfo.Text,drawInfo.TextColor,drawInfo.TextAlign,x,top,textWidth);return;}if(!this.FixedRowData||!IFrameSplitOperator.IsNonEmptyArray(this.FixedRowData.Data))return;var data=this.FixedRowData.Data;var rowData=data[dataIndex];if(!IFrameSplitOperator.IsNonEmptyArray(rowData))return;var itemData=rowData[colIndex];if(!itemData||!itemData.Text)return;drawInfo.Text=itemData.Text;if(itemData.Color)drawInfo.TextColor=itemData.Color;if(itemData.TextAlign)drawInfo.TextAlign=itemData.TextAlign;this.DrawItemText(drawInfo.Text,drawInfo.TextColor,drawInfo.TextAlign,x,top,textWidth);};this.DrawRow=function(symbol,top,dataIndex,rowType)//rowType 0=表格行 1=顶部固定行
|
|
10133
|
+
}if(this.DragRow){if(this.DragRow.Data){var dataIndex=this.DragRow.Data.Row.DataIndex;if(dataIndex==i){this.Canvas.fillStyle=this.DragSrcRowColor;this.Canvas.fillRect(left,textTop,rowWidth,this.RowHeight);}}if(this.DragRow.MoveRow){var dataIndex=this.DragRow.MoveRow.Data.DataIndex;if(dataIndex==i){this.Canvas.fillStyle=this.DragMoveRowColor;this.Canvas.fillRect(left,textTop,rowWidth,this.RowHeight);}}bFillRow=false;}if(bFillRow){this.Canvas.fillStyle=this.SelectedColor;this.Canvas.fillRect(left,textTop,rowWidth,this.RowHeight);}this.DrawRow(symbol,textTop,i);this.ShowSymbol.push({Index:i,Symbol:symbol});textTop+=this.RowHeight;}};this.DrawFixedSymbolRow=function(top,dataIndex){var left=this.RectClient.Left;var chartRight=this.RectClient.Right;if(!this.FixedRowData||!IFrameSplitOperator.IsNonEmptyArray(this.FixedRowData.Symbol))return;var symbol=this.FixedRowData.Symbol[dataIndex];if(!symbol)return;this.DrawRow(symbol,top,dataIndex,1);this.ShowSymbol.push({Index:dataIndex,Symbol:symbol,RowType:1});};this.DrawFixedRow=function(top,dataIndex){var left=this.RectClient.Left;var chartRight=this.RectClient.Right;for(var i=0;i<this.FixedColumn&&i<this.Column.length;++i){var item=this.Column[i];this.DrawFixedItem(dataIndex,i,item,left,top);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.DrawFixedItem(dataIndex,i,item,left,top);left+=item.Width;if(left>=chartRight)break;}};this.DrawFixedItem=function(dataIndex,colIndex,column,left,top){var x=left+this.ItemMergin.Left;var textWidth=column.Width-this.ItemMergin.Left-this.ItemMergin.Right;var drawInfo={Text:null,TextColor:column.TextColor,TextAlign:column.TextAlign};if(this.GetFixedRowTextDrawInfo(dataIndex,colIndex,column,drawInfo)){this.DrawItemText(drawInfo.Text,drawInfo.TextColor,drawInfo.TextAlign,x,top,textWidth);return;}if(!this.FixedRowData||!IFrameSplitOperator.IsNonEmptyArray(this.FixedRowData.Data))return;var data=this.FixedRowData.Data;var rowData=data[dataIndex];if(!IFrameSplitOperator.IsNonEmptyArray(rowData))return;var itemData=rowData[colIndex];if(!itemData||!itemData.Text)return;drawInfo.Text=itemData.Text;if(itemData.Color)drawInfo.TextColor=itemData.Color;if(itemData.TextAlign)drawInfo.TextAlign=itemData.TextAlign;this.DrawItemText(drawInfo.Text,drawInfo.TextColor,drawInfo.TextAlign,x,top,textWidth);};this.DrawRow=function(symbol,top,dataIndex,rowType)//rowType 0=表格行 1=顶部固定行 2=拖拽行
|
|
10076
10134
|
{var left=this.RectClient.Left;var chartRight=this.RectClient.Right;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);//小数位数
|
|
10077
10135
|
for(var i=0;i<this.FixedColumn&&i<this.Column.length;++i){var item=this.Column[i];this.DrawItem(dataIndex,data,item,left,top,rowType);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,rowType);left+=item.Width;if(left>=chartRight)break;}};this.DrawItem=function(index,data,column,left,top,rowType){var itemWidth=column.Width;var x=left+this.ItemMergin.Left;var textWidth=column.Width-this.ItemMergin.Left-this.ItemMergin.Right;var stock=data.Stock;var drawInfo={Text:null,TextColor:column.TextColor,TextAlign:column.TextAlign};if(column.Type==REPORT_COLUMN_ID.INDEX_ID){if(rowType==1)return;//固定行序号空
|
|
10078
10136
|
drawInfo.Text=(index+1).toString();}else if(column.Type==REPORT_COLUMN_ID.SYMBOL_ID){if(stock&&stock.Symbol)drawInfo.Text=stock.Symbol;else drawInfo.Text=data.Symbol;}else if(column.Type==REPORT_COLUMN_ID.SYMBOL_NAME_ID){this.DrawSymbolName(data,column,left,top,rowType);}else if(column.Type==REPORT_COLUMN_ID.NAME_ID){if(stock&&stock.Name){drawInfo.Text=this.TextEllipsis(stock.Name,textWidth,column.MaxText);drawInfo.TextColor=this.GetNameColor(column,data.Symbol,rowType);}}else if(column.Type==REPORT_COLUMN_ID.PRICE_ID){if(stock)this.GetPriceDrawInfo(stock.Price,stock,data,drawInfo);}else if(column.Type==REPORT_COLUMN_ID.OPEN_ID){//如果行情开盘价为涨停价或跌停价,则对内容加灰框
|
|
10079
10137
|
if(stock){this.DrawLimitPriceBorder(stock.Open,stock,left,top,column.Width);this.GetPriceDrawInfo(stock.Open,stock,data,drawInfo);}}else if(column.Type==REPORT_COLUMN_ID.HIGH_ID){//如果行情最高价为涨停价,则对内容加灰框
|
|
10080
10138
|
if(stock){this.DrawLimitPriceBorder(stock.High,stock,left,top,column.Width);this.GetPriceDrawInfo(stock.High,stock,data,drawInfo);}}else if(column.Type==REPORT_COLUMN_ID.LOW_ID){//如果行情最低价为跌停价,则对内容加灰框
|
|
10081
|
-
if(stock){this.DrawLimitPriceBorder(stock.Low,stock,left,top,column.Width);this.GetPriceDrawInfo(stock.Low,stock,data,drawInfo);}}else if(column.Type==REPORT_COLUMN_ID.YCLOSE_ID){if(stock)this.GetPriceDrawInfo(stock.YClose,stock,data,drawInfo);}else if(column.Type==REPORT_COLUMN_ID.BUY_PRICE_ID){if(stock)this.GetPriceDrawInfo(stock.BuyPrice,stock,data,drawInfo);}else if(column.Type==REPORT_COLUMN_ID.SELL_PRICE_ID){if(stock)this.GetPriceDrawInfo(stock.SellPrice,stock,data,drawInfo);}else if(column.Type==REPORT_COLUMN_ID.AVERAGE_PRICE_ID){if(stock)this.GetPriceDrawInfo(stock.AvPrice,stock,data,drawInfo);}else if(column.Type==REPORT_COLUMN_ID.EXCHANGE_RATE_ID){if(stock&&IFrameSplitOperator.IsNumber(stock.Exchange))drawInfo.Text=stock.Exchange.toFixed(2);}else if(column.Type==REPORT_COLUMN_ID.BUY_VOL_ID){if(stock&&IFrameSplitOperator.IsNumber(stock.BuyVol))drawInfo.Text=this.FormatVolString(stock.BuyVol);}else if(column.Type==REPORT_COLUMN_ID.SELL_VOL_ID){if(stock&&IFrameSplitOperator.IsNumber(stock.SellVol))drawInfo.Text=this.FormatVolString(stock.SellVol);}else if(column.Type==REPORT_COLUMN_ID.VOL_ID){if(stock&&IFrameSplitOperator.IsNumber(stock.Vol))drawInfo.Text=this.FormatVolString(stock.Vol);}else if(column.Type==REPORT_COLUMN_ID.VOL_IN_ID){if(stock&&IFrameSplitOperator.IsNumber(stock.VolIn))drawInfo.Text=this.FormatVolString(stock.VolIn);}else if(column.Type==REPORT_COLUMN_ID.VOL_OUT_ID){if(stock&&IFrameSplitOperator.IsNumber(stock.VolOut))drawInfo.Text=this.FormatVolString(stock.VolOut);}else if(column.Type==REPORT_COLUMN_ID.TOTAL_SHARES_ID){if(stock&&IFrameSplitOperator.IsNumber(stock.TotalShares))drawInfo.Text=this.FormatVolString(stock.TotalShares);}else if(column.Type==REPORT_COLUMN_ID.OUTSTANDING_SHARES_ID){if(stock&&IFrameSplitOperator.IsNumber(stock.OutShares))drawInfo.Text=this.FormatVolString(stock.OutShares);}else if(column.Type==REPORT_COLUMN_ID.CIRC_MARKET_VALUE_ID||column.Type==REPORT_COLUMN_ID.MARKET_VALUE_ID||column.Type==REPORT_COLUMN_ID.AMOUNT_ID){var fieldName=MAP_COLUMN_FIELD.get(column.Type);if(stock&&IFrameSplitOperator.IsNumber(stock[fieldName]))drawInfo.Text=this.FormatVolString(stock[fieldName]);}else if(column.Type==REPORT_COLUMN_ID.INCREASE_ID||column.Type==REPORT_COLUMN_ID.AMPLITUDE_ID||column.Type==REPORT_COLUMN_ID.UPDOWN_ID){var fieldName=MAP_COLUMN_FIELD.get(column.Type);if(stock&&IFrameSplitOperator.IsNumber(stock[fieldName])){var value=stock[fieldName];drawInfo.Text=value.toFixed(2);drawInfo.TextColor=this.GetUpDownColor(value,0);}}else if(column.Type==REPORT_COLUMN_ID.CUSTOM_STRING_TEXT_ID){this.GetCustomStringDrawInfo(data,column,drawInfo);}else if(column.Type==REPORT_COLUMN_ID.CUSTOM_NUMBER_TEXT_ID){this.GetCustomNumberDrawInfo(data,column,drawInfo);}else if(column.Type==REPORT_COLUMN_ID.CUSTOM_DATETIME_TEXT_ID){this.GetCustomDateTimeDrawInfo(data,column,drawInfo);}
|
|
10139
|
+
if(stock){this.DrawLimitPriceBorder(stock.Low,stock,left,top,column.Width);this.GetPriceDrawInfo(stock.Low,stock,data,drawInfo);}}else if(column.Type==REPORT_COLUMN_ID.YCLOSE_ID){if(stock)this.GetPriceDrawInfo(stock.YClose,stock,data,drawInfo);}else if(column.Type==REPORT_COLUMN_ID.BUY_PRICE_ID){if(stock)this.GetPriceDrawInfo(stock.BuyPrice,stock,data,drawInfo);}else if(column.Type==REPORT_COLUMN_ID.SELL_PRICE_ID){if(stock)this.GetPriceDrawInfo(stock.SellPrice,stock,data,drawInfo);}else if(column.Type==REPORT_COLUMN_ID.AVERAGE_PRICE_ID){if(stock)this.GetPriceDrawInfo(stock.AvPrice,stock,data,drawInfo);}else if(column.Type==REPORT_COLUMN_ID.EXCHANGE_RATE_ID){if(stock&&IFrameSplitOperator.IsNumber(stock.Exchange))drawInfo.Text=stock.Exchange.toFixed(2);}else if(column.Type==REPORT_COLUMN_ID.BUY_VOL_ID){if(stock&&IFrameSplitOperator.IsNumber(stock.BuyVol))drawInfo.Text=this.FormatVolString(stock.BuyVol);}else if(column.Type==REPORT_COLUMN_ID.SELL_VOL_ID){if(stock&&IFrameSplitOperator.IsNumber(stock.SellVol))drawInfo.Text=this.FormatVolString(stock.SellVol);}else if(column.Type==REPORT_COLUMN_ID.VOL_ID){if(stock&&IFrameSplitOperator.IsNumber(stock.Vol))drawInfo.Text=this.FormatVolString(stock.Vol);}else if(column.Type==REPORT_COLUMN_ID.VOL_IN_ID){if(stock&&IFrameSplitOperator.IsNumber(stock.VolIn))drawInfo.Text=this.FormatVolString(stock.VolIn);}else if(column.Type==REPORT_COLUMN_ID.VOL_OUT_ID){if(stock&&IFrameSplitOperator.IsNumber(stock.VolOut))drawInfo.Text=this.FormatVolString(stock.VolOut);}else if(column.Type==REPORT_COLUMN_ID.TOTAL_SHARES_ID){if(stock&&IFrameSplitOperator.IsNumber(stock.TotalShares))drawInfo.Text=this.FormatVolString(stock.TotalShares);}else if(column.Type==REPORT_COLUMN_ID.OUTSTANDING_SHARES_ID){if(stock&&IFrameSplitOperator.IsNumber(stock.OutShares))drawInfo.Text=this.FormatVolString(stock.OutShares);}else if(column.Type==REPORT_COLUMN_ID.CIRC_MARKET_VALUE_ID||column.Type==REPORT_COLUMN_ID.MARKET_VALUE_ID||column.Type==REPORT_COLUMN_ID.AMOUNT_ID){var fieldName=MAP_COLUMN_FIELD.get(column.Type);if(stock&&IFrameSplitOperator.IsNumber(stock[fieldName]))drawInfo.Text=this.FormatVolString(stock[fieldName]);}else if(column.Type==REPORT_COLUMN_ID.INCREASE_ID||column.Type==REPORT_COLUMN_ID.AMPLITUDE_ID||column.Type==REPORT_COLUMN_ID.UPDOWN_ID){var fieldName=MAP_COLUMN_FIELD.get(column.Type);if(stock&&IFrameSplitOperator.IsNumber(stock[fieldName])){var value=stock[fieldName];drawInfo.Text=value.toFixed(2);drawInfo.TextColor=this.GetUpDownColor(value,0);}}else if(column.Type==REPORT_COLUMN_ID.CUSTOM_STRING_TEXT_ID){this.GetCustomStringDrawInfo(data,column,drawInfo);}else if(column.Type==REPORT_COLUMN_ID.CUSTOM_NUMBER_TEXT_ID){this.GetCustomNumberDrawInfo(data,column,drawInfo);}else if(column.Type==REPORT_COLUMN_ID.CUSTOM_DATETIME_TEXT_ID){this.GetCustomDateTimeDrawInfo(data,column,drawInfo);}//拖拽行颜色
|
|
10140
|
+
if(rowType==3)drawInfo.TextColor=this.DragRowTextColor;this.DrawItemText(drawInfo.Text,drawInfo.TextColor,drawInfo.TextAlign,x,top,textWidth);};this.DrawSymbolName=function(data,column,left,top,rowType){var stock=data.Stock;var symbol=data.Symbol;var name;if(stock){symbol=stock.Symbol;name=stock.Name;}if(!symbol&&!name)return;var y=top+this.ItemMergin.Top+this.ItemNameHeight;var textLeft=left+this.ItemMergin.Left;var x=textLeft;var width=column.Width-this.ItemMergin.Left-this.ItemMergin.Right;var textAlign=column.TextAlign;if(textAlign=='center'){x=textLeft+width/2;this.Canvas.textAlign="center";}else if(textAlign=='right'){x=textLeft+width-2;this.Canvas.textAlign="right";}else{x+=2;this.Canvas.textAlign="left";}var textColor=this.GetNameColor(column,symbol,rowType);var text=name;if(text){this.Canvas.textBaseline="ideographic";this.Canvas.fillStyle=textColor;this.Canvas.font=this.ItemNameFont;text=this.TextEllipsis(text,width,column.MaxText);if(text)this.Canvas.fillText(text,x,y);}text=symbol;if(text){this.Canvas.textBaseline="top";this.Canvas.font=this.ItemSymbolFont;this.Canvas.fillStyle=textColor;this.Canvas.fillText(text,x,y);}this.Canvas.font=this.ItemFont;//还原字体
|
|
10082
10141
|
};this.DrawLimitPriceBorder=function(value,stock,left,top,itemWidth){if(!IFrameSplitOperator.IsNumber(value)||!stock)return;var bDraw=false;if(IFrameSplitOperator.IsNumber(stock.LimitHigh)){if(value>=stock.LimitHigh)bDraw=true;}if(IFrameSplitOperator.IsNumber(stock.LimitLow)){if(value<=stock.LimitLow)bDraw=true;}if(!bDraw)return;var x=left+this.ItemMergin.Left+this.LimitMergin.Left;var width=itemWidth-this.ItemMergin.Left-this.ItemMergin.Right-this.LimitMergin.Left-this.LimitMergin.Right;var y=top+this.ItemMergin.Top+this.LimitMergin.Top;var height=this.RowHeight-this.ItemMergin.Top-this.ItemMergin.Bottom-this.LimitMergin.Top-this.LimitMergin.Bottom;this.Canvas.strokeStyle=this.LimitBorderColor;this.Canvas.strokeRect(ToFixedPoint(x),ToFixedPoint(y),ToFixedRect(width),ToFixedRect(height));};this.GetExtendData=function(data,column){if(IFrameSplitOperator.IsNumber(column.DataIndex)){if(!data.Stock||!data.Stock.ExtendData)return null;if(column.DataIndex<0)return;return data.Stock.ExtendData[column.DataIndex];}if(IFrameSplitOperator.IsNumber(column.BlockIndex)){if(!data.Block)return;if(column.BlockIndex<0)return;return data.Block[column.BlockIndex];}return null;};this.GetCustomStringDrawInfo=function(data,column,drawInfo){var value=this.GetExtendData(data,column);if(!IFrameSplitOperator.IsString(value))return;if(column.IsDrawCallback)//外部处理输出格式
|
|
10083
10142
|
{this.GetCustomTextDrawInfo(column,data.Symbol,value,drawInfo,data);return;}drawInfo.Text=value;};this.GetCustomNumberDrawInfo=function(data,column,drawInfo){var value=this.GetExtendData(data,column);if(!IFrameSplitOperator.IsNumber(value))return;if(column.IsDrawCallback)//外部处理输出格式
|
|
10084
10143
|
{this.GetCustomTextDrawInfo(column,data.Symbol,value,drawInfo,data);return;}//格式化输出
|
|
@@ -10092,12 +10151,16 @@ if(!barData)return false;if(!IFrameSplitOperator.IsNonEmptyArray(barData.Value))
|
|
|
10092
10151
|
{this.Canvas.fillRect(center,top,-barWidth,height);}else//右边
|
|
10093
10152
|
{this.Canvas.fillRect(center,top,barWidth,height);}}};//外部配置显示格式 颜色 对齐方式
|
|
10094
10153
|
this.GetCustomTextDrawInfo=function(columnInfo,symbol,value,drawInfo,data){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DRAW_CUSTOM_TEXT);if(!event||!event.Callback)return false;var sendData={Symbol:symbol,Column:columnInfo,Value:value,Data:data,Out:{Text:null,TextColor:null,TextAlign:null}};event.Callback(event,sendData,this);if(sendData.Out.Text)drawInfo.Text=sendData.Out.Text;if(sendData.Out.TextColor)drawInfo.TextColor=sendData.Out.TextColor;if(sendData.Out.TextAlign)drawInfo.TextAlign=sendData.Out.TextAlign;return true;};this.GetFixedRowTextDrawInfo=function(rowIndex,colIndex,columnInfo,drawInfo){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DRAW_REPORT_FIXEDROW_TEXT);if(!event||!event.Callback)return false;var sendData={RowIndex:rowIndex,ColIndex:colIndex,Column:columnInfo,Data:this.FixedRowData,Out:{Text:null,TextColor:null,TextAlign:null}};event.Callback(event,sendData,this);if(sendData.Out.Text)drawInfo.Text=sendData.Out.Text;if(sendData.Out.TextColor)drawInfo.TextColor=sendData.Out.TextColor;if(sendData.Out.TextAlign)drawInfo.TextAlign=sendData.Out.TextAlign;return true;};this.GetVolColor=function(colunmInfo,data){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DRAW_DEAL_VOL_COLOR);if(event&&event.Callback){var sendData={Data:data,TextColor:null};event.Callback(event,sendData,this);if(sendData.TextColor)return sendData.TextColor;}return colunmInfo.TextColor;};//获取股票名称颜色
|
|
10095
|
-
this.GetNameColor=function(colunmInfo,symbol,rowType){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DRAW_REPORT_NAME_COLOR);if(event&&event.Callback){var sendData={Symbol:symbol,TextColor:null,RowType:rowType};event.Callback(event,sendData,this);if(sendData.TextColor)return sendData.TextColor;}return colunmInfo.TextColor;};this.GetFontHeight=function(font,word){return GetFontHeight(this.Canvas,font,word);};this.OnMouseDown=function(x,y,e)
|
|
10154
|
+
this.GetNameColor=function(colunmInfo,symbol,rowType){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DRAW_REPORT_NAME_COLOR);if(event&&event.Callback){var sendData={Symbol:symbol,TextColor:null,RowType:rowType};event.Callback(event,sendData,this);if(sendData.TextColor)return sendData.TextColor;}return colunmInfo.TextColor;};this.GetFontHeight=function(font,word){return GetFontHeight(this.Canvas,font,word);};this.OnMouseDown=function(x,y,e)//Type: 1=tab 4=固定行 2=行 3=表头
|
|
10155
|
+
{if(!this.Data)return null;if(this.Tab){var tab=this.Tab.OnMouseDown(x,y,e);if(tab)return{Type:1,Tab:tab};//底部工具栏
|
|
10096
10156
|
}var pixelTatio=GetDevicePixelRatio();var insidePoint={X:x/pixelTatio,Y:y/pixelTatio};if(this.UIElement)var uiElement={Left:this.UIElement.getBoundingClientRect().left,Top:this.UIElement.getBoundingClientRect().top};else var uiElement={Left:null,Top:null};var row=this.PtInFixedBody(x,y);if(row){var bRedraw=true;var eventID=JSCHART_EVENT_ID.ON_CLICK_REPORT_FIXEDROW;if(e.button==2)eventID=JSCHART_EVENT_ID.ON_RCLICK_REPORT_FIXEDROW;this.SendClickEvent(eventID,{Data:row,X:x,Y:y,e:e,Inside:insidePoint,UIElement:uiElement});this.SelectedFixedRow=row.Index;this.SelectedRow=-1;return{Type:4,Redraw:bRedraw,Row:row};//行
|
|
10097
10157
|
}var row=this.PtInBody(x,y);if(row){var bRedraw=true;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,Row:row};//行
|
|
10098
10158
|
}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};//表头
|
|
10099
|
-
}return null;};this.
|
|
10100
|
-
|
|
10159
|
+
}return null;};this.OnDrawgRow=function(x,y,e)//Type: 5=顶部 6=空白行 2=行 7=底部
|
|
10160
|
+
{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.OnDblClick=function(x,y,e){if(!this.Data)return false;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.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;//固定列
|
|
10161
|
+
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};}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};}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;//背景
|
|
10162
|
+
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);//小数位数
|
|
10163
|
+
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;}};}//报价列表底部tab和横向滚动条
|
|
10101
10164
|
function ChartReportTab(){this.Canvas;//画布
|
|
10102
10165
|
this.ChartBorder;//边框信息
|
|
10103
10166
|
this.ChartFrame;//框架画法
|