hqchart 1.1.13497 → 1.1.13502
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 +61 -20
- package/package.json +1 -1
- package/src/jscommon/umychart.js +193 -78
- package/src/jscommon/umychart.report.js +24 -6
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +218 -85
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +218 -85
package/lib/umychart.vue.js
CHANGED
|
@@ -2048,7 +2048,8 @@ return fixValue;}function ToFixedRect(value){// With a bitwise or.
|
|
|
2048
2048
|
// Finally, a left bitwise shift.
|
|
2049
2049
|
//value*=GetDevicePixelRatio();
|
|
2050
2050
|
var rounded;return rounded=0.5+value<<0;}//深拷贝
|
|
2051
|
-
function CloneData(data){if(!data)return null;var strData=(0,_stringify2.default)(data);var item=JSON.parse(strData);return item;}function IsRecvOverlap(rect1,rect2){return Math.max(rect1.Left,rect2.Left)<Math.min(rect1.Right,rect2.Right)&&Math.max(rect1.Top,rect2.Top)<Math.min(rect1.Bottom,rect2.Bottom);}function
|
|
2051
|
+
function CloneData(data){if(!data)return null;var strData=(0,_stringify2.default)(data);var item=JSON.parse(strData);return item;}function IsRecvOverlap(rect1,rect2){return Math.max(rect1.Left,rect2.Left)<Math.min(rect1.Right,rect2.Right)&&Math.max(rect1.Top,rect2.Top)<Math.min(rect1.Bottom,rect2.Bottom);}function CopyMarginConfig(dest,src){if(!src||!dest)return;if(IFrameSplitOperator.IsNumber(src.Left))dest.Left=src.Left;if(IFrameSplitOperator.IsNumber(src.Top))dest.Top=src.Top;if(IFrameSplitOperator.IsNumber(src.Right))dest.Right=src.Right;if(IFrameSplitOperator.IsNumber(src.Bottom))dest.Bottom=src.Bottom;}//兼容老版本
|
|
2052
|
+
function CopyMerginConfig(dest,src){CopyMarginConfig(dest,src);}function Point(){this.X;this.Y;}function SelectRectData(){this.Data;//主数据
|
|
2052
2053
|
this.JSChartContainer;//行情控件
|
|
2053
2054
|
this.Start;//数据起始位子
|
|
2054
2055
|
this.End;//数据结束位置
|
|
@@ -5164,7 +5165,7 @@ this.PointX;this.PointY;this.StringFormatX;this.StringFormatY;this.ShowTextMode=
|
|
|
5164
5165
|
this.TextFormat={Right:0};//0=默认 1=价格显示(分时图才有用)
|
|
5165
5166
|
this.IsShowCorss=true;//是否显示十字光标
|
|
5166
5167
|
this.IsShow=true;this.IsShowClose=false;//Y轴始终显示收盘价
|
|
5167
|
-
this.ClientPos=-1;this.CallAcutionXOperator;this.RightButton={Enable:false,Rect:null,BGColor:g_JSChartResource.CorssCursor.RightButton.BGColor,PenColor:g_JSChartResource.CorssCursor.RightButton.PenColor,Icon:g_JSChartResource.CorssCursor.RightButton.Icon};//内部使用
|
|
5168
|
+
this.ClientPos=-1;this.CallAcutionXOperator;this.RightButton={Enable:false,Rect:null,BGColor:g_JSChartResource.CorssCursor.RightButton.BGColor,PenColor:g_JSChartResource.CorssCursor.RightButton.PenColor,Icon:g_JSChartResource.CorssCursor.RightButton.Icon};this.RightMargin={Left:2,Right:2,Top:4,Bottom:3};CopyMarginConfig(this.RightMargin,g_JSChartResource.CorssCursor.RightMargin);//内部使用
|
|
5168
5169
|
this.Close=null;//收盘价格
|
|
5169
5170
|
this.Status=0;//当前状态 0=隐藏 1=显示
|
|
5170
5171
|
this.ReloadResource=function(resource){this.Font=g_JSChartResource.CorssCursorTextFont;//字体
|
|
@@ -5185,17 +5186,47 @@ if(barWidth>2*pixel)this.Canvas.lineWidth=barWidth;}this.Canvas.beginPath();if(t
|
|
|
5185
5186
|
this.StringFormatX.Value=this.CursorIndex;this.StringFormatX.Point={X:x,Y:y};this.StringFormatX.ClientPos=clientPos;this.StringFormatY.Value=yValue;this.StringFormatY.RValue=yValueExtend.RightYValue;//右侧子坐标
|
|
5186
5187
|
this.StringFormatY.FrameID=yValueExtend.FrameID;this.StringFormatY.Point={X:x,Y:y};this.StringFormatY.ClientPos=clientPos;this.Canvas.font=this.Font;var textHeight=this.GetFontHeight();if(textHeight>this.TextHeight)this.TextHeight=textHeight;//Y轴
|
|
5187
5188
|
if((this.ShowTextMode.Left==1&&this.Frame.ChartBorder.Left>=30||this.ShowTextMode.Left==2||this.ShowTextMode.Right==1&&this.Frame.ChartBorder.Right>=30||this.ShowTextMode.Right==2)&&this.StringFormatY.Operator()){var text=this.StringFormatY.Text;this.Canvas.font=this.Font;var textWidth=this.Canvas.measureText(text).width+4;//前后各空2个像素
|
|
5188
|
-
var buttonData={Y:y,YValue:yValue,FrameID:yValueExtend.FrameID};if(this.Frame.ChartBorder.Left>=30&&this.ShowTextMode.Left==1){if(left<textWidth)//左边空白的地方太少了画布下
|
|
5189
|
+
var textSize={Width:textWidth,Height:this.TextHeight,Text:[]};var buttonData={Y:y,YValue:yValue,FrameID:yValueExtend.FrameID};if(this.Frame.ChartBorder.Left>=30&&this.ShowTextMode.Left==1){if(left<textWidth)//左边空白的地方太少了画布下
|
|
5189
5190
|
{this.DrawTextBGRect(ToFixedPoint(2),ToFixedPoint(y-this.TextHeight/2),ToFixedRect(textWidth),ToFixedRect(this.TextHeight));this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.fillStyle=this.TextColor;this.Canvas.fillText(text,2+2,y,textWidth);}else{this.DrawTextBGRect(left-2,y-this.TextHeight/2,-textWidth,this.TextHeight);this.Canvas.textAlign="right";this.Canvas.textBaseline="middle";this.Canvas.fillStyle=this.TextColor;this.Canvas.fillText(text,left-4,y,textWidth);}}else if(this.ShowTextMode.Left==2)//在框架内显示
|
|
5190
|
-
{this.DrawTextBGRect(left,y-this.TextHeight/2,textWidth,this.TextHeight);this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.fillStyle=this.TextColor;this.Canvas.fillText(text,left+2,y,textWidth);}
|
|
5191
|
-
}}if(this.StringFormatY.RText){text=this.StringFormatY.RText;
|
|
5192
|
-
}var complexText=null;if(this.StringFormatY.RComplexText&&IFrameSplitOperator.IsNonEmptyArray(this.StringFormatY.RComplexText.Text)){var textWidth=0;complexText=this.StringFormatY.RComplexText;for(var i=0;i<complexText.Text.length;++i){var item=complexText.Text[i];var itemWidth=this.Canvas.measureText(item.Text).width+4;//前后各空2个像素
|
|
5193
|
-
if(i>0&&IFrameSplitOperator.IsNumber(complexText.Space))textWidth+=complexText.Space;textWidth+=itemWidth;}}if(this.Frame.ChartBorder.Right>=30&&this.ShowTextMode.Right==1){var isOverlayIndex=false;//是否有叠加子坐标
|
|
5191
|
+
{this.DrawTextBGRect(left,y-this.TextHeight/2,textWidth,this.TextHeight);this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.fillStyle=this.TextColor;this.Canvas.fillText(text,left+2,y,textWidth);}var complexText={ShowType:0,//0=单行(默认) 1=多行
|
|
5192
|
+
Font:this.Font,Color:this.TextColor,Text:[{Text:text,Margin:this.RightMargin}]};var yTop=y-this.TextHeight/2;if(this.StringFormatY.PercentageText){if(this.TextFormat.Right==0){text=this.StringFormatY.PercentageText+'%';complexText.Text[0].Text=text;}}if(this.StringFormatY.RText){text=this.StringFormatY.RText;complexText.Text[0].Text=text;}if(this.StringFormatY.RComplexText&&IFrameSplitOperator.IsNonEmptyArray(this.StringFormatY.RComplexText.Text)){complexText=this.StringFormatY.RComplexText;}this.CalculateComplexTextSize(complexText,textSize);if(this.Frame.ChartBorder.Right>=30&&this.ShowTextMode.Right==1){var isOverlayIndex=false;//是否有叠加子坐标
|
|
5194
5193
|
var overlayIndexInterval=null;//子坐标间距
|
|
5195
|
-
if(yValueExtend.FrameID>=0){var frame=this.Frame.SubFrame[yValueExtend.FrameID];isOverlayIndex=frame.OverlayIndex.length>0;overlayIndexInterval=frame.
|
|
5196
|
-
|
|
5197
|
-
{var
|
|
5198
|
-
|
|
5194
|
+
if(yValueExtend.FrameID>=0){var frame=this.Frame.SubFrame[yValueExtend.FrameID];isOverlayIndex=frame.OverlayIndex.length>0;overlayIndexInterval=null;if(isOverlayIndex){for(var i=0;i<=frame.OverlayIndex.length;++i){var item=frame.OverlayIndex[i];if(item.Frame.IsShow===false)continue;if(!item.Frame.GetXHorizontal)continue;var overlayLeft=item.Frame.GetXHorizontal();overlayIndexInterval=overlayLeft-right;break;}}}//叠加坐标
|
|
5195
|
+
if(isOverlayIndex&&textSize.Width>overlayIndexInterval&&overlayIndexInterval>0)//大于子坐标宽度
|
|
5196
|
+
{var drawRight=right+overlayIndexInterval;if(drawRight>chartRight)drawRight=chartRight;var itemLeft=drawRight-2-textSize.Width;this.DrawTextBGRect(itemLeft,yTop,textSize.Width,textSize.Height);this.DrawComplexTextV2(itemLeft,yTop,complexText,textSize);if(this.RightButton.Enable)this.DrawRightButton(yTop,itemLeft,this.TextHeight,this.TextHeight,buttonData);}else if(rightWidth<textSize.Width)//右边空白显示不下,
|
|
5197
|
+
{var itemLeft=chartRight-2-textSize.Width;this.DrawTextBGRect(itemLeft,yTop,textSize.Width,textSize.Height);this.DrawComplexTextV2(itemLeft,yTop,complexText,textSize);if(this.RightButton.Enable)this.DrawRightButton(yTop,chartRight-2-textSize.Width,this.TextHeight,this.TextHeight,buttonData);}else{var itemLeft=right+2;this.DrawTextBGRect(itemLeft,yTop,textSize.Width,textSize.Height);this.DrawComplexTextV2(itemLeft,yTop,complexText,textSize);if(this.RightButton.Enable)this.DrawRightButton(yTop,right+2,this.TextHeight,this.TextHeight,buttonData);}/*
|
|
5198
|
+
if (this.StringFormatY.RExtendText && this.StringFormatY.RExtendText.length>0)
|
|
5199
|
+
{
|
|
5200
|
+
var yOffset=0;
|
|
5201
|
+
for(var i in this.StringFormatY.RExtendText)
|
|
5202
|
+
{
|
|
5203
|
+
var item=this.StringFormatY.RExtendText[i];
|
|
5204
|
+
var rText='--.--'
|
|
5205
|
+
if (item.YText) rText=item.YText;
|
|
5206
|
+
else if (IFrameSplitOperator.IsNumber(item.Y)) rText=item.Y.toFixed(0);
|
|
5207
|
+
var rTextWidth=this.Canvas.measureText(rText).width+4; //前后各空2个像素
|
|
5208
|
+
|
|
5209
|
+
if (rightWidth<rTextWidth)
|
|
5210
|
+
{
|
|
5211
|
+
this.DrawTextBGRect(chartRight-2-rTextWidth,y+yOffset+this.TextHeight/2,rTextWidth,this.TextHeight);
|
|
5212
|
+
this.Canvas.textAlign="right";
|
|
5213
|
+
this.Canvas.textBaseline="middle";
|
|
5214
|
+
this.Canvas.fillStyle=item.TextColor;
|
|
5215
|
+
this.Canvas.fillText(rText,chartRight-4,y+yOffset+this.TextHeight,rTextWidth);
|
|
5216
|
+
}
|
|
5217
|
+
else
|
|
5218
|
+
{
|
|
5219
|
+
this.DrawTextBGRect(right+2,y+yOffset+this.TextHeight/2,rTextWidth,this.TextHeight);
|
|
5220
|
+
this.Canvas.textAlign="left";
|
|
5221
|
+
this.Canvas.textBaseline="middle";
|
|
5222
|
+
this.Canvas.fillStyle=item.TextColor;
|
|
5223
|
+
this.Canvas.fillText(rText,right+4,y+yOffset+this.TextHeight,rTextWidth);
|
|
5224
|
+
}
|
|
5225
|
+
|
|
5226
|
+
yOffset+=this.TextHeight;
|
|
5227
|
+
}
|
|
5228
|
+
}
|
|
5229
|
+
*/}else if(this.ShowTextMode.Right==2){this.Canvas.fillStyle=this.TextBGColor;var showLeft=right-textSize.Width;this.DrawTextBGRect(showLeft,yTop,textSize.Width,textSize.Height);this.DrawComplexTextV2(showLeft,yTop,complexText,textSize);if(this.RightButton.Enable)this.DrawRightButton(yTop,showLeft,this.TextHeight,this.TextHeight,buttonData);}}//X轴 Bottom=10 使用第1个指标框位置
|
|
5199
5230
|
if((this.ShowTextMode.Bottom==1||this.ShowTextMode.Bottom==2||this.ShowTextMode.Bottom==10)&&this.StringFormatX.Operator()){var text=this.StringFormatX.Text;this.Canvas.font=this.Font;this.Canvas.fillStyle=this.TextBGColor;var textWidth=this.Canvas.measureText(text).width+4;//前后各空2个像素
|
|
5200
5231
|
var yCenter=bottom+2+this.TextHeight/2;var yTop=bottom+2;if(this.ShowTextMode.Bottom==2){yCenter=bottom-this.TextHeight/2-2;yTop=bottom-this.TextHeight-2;}else if(this.ShowTextMode.Bottom==10){var frame=this.Frame.SubFrame[0].Frame;if(frame.GetCorssCursorTop){var value=frame.GetCorssCursorTop();if(IFrameSplitOperator.IsNumber(value)){yCenter=value+this.TextHeight/2;yTop=value;}}}//JSConsole.Chart.Log('[ChartCorssCursor::Draw] ',yCenter);
|
|
5201
5232
|
if(x-textWidth/2<3)//左边位置不够了, 顶着左边画
|
|
@@ -5210,7 +5241,16 @@ var yValue=item.Frame.GetYData(y);var text=IFrameSplitOperator.FormatValueString
|
|
|
5210
5241
|
if (textWidth<frame.Interval) break;
|
|
5211
5242
|
}
|
|
5212
5243
|
*/this.Canvas.fillStyle=this.TextBGColor;this.Canvas.fillRect(overlayLeft+1,y-this.TextHeight/2,textWidth,this.TextHeight);this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.fillStyle=this.TextColor;this.Canvas.fillText(text,overlayLeft+4,y,textWidth);}}this.Status=1;};this.DrawComplexText=function(left,y,complexText){this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";var xText=left+2;for(var i=0;i<complexText.Text.length;++i){var item=complexText.Text[i];var itemWidth=this.Canvas.measureText(item.Text).width+4;//前后各空2个像素
|
|
5213
|
-
if(item.Color)this.Canvas.fillStyle=item.Color;else is.Canvas.fillStyle=this.TextColor;this.Canvas.fillText(item.Text,xText,y,itemWidth);if(i>0&&IFrameSplitOperator.IsNumber(complexText.Space))xText+=complexText.Space;xText+=itemWidth;}};this.
|
|
5244
|
+
if(item.Color)this.Canvas.fillStyle=item.Color;else is.Canvas.fillStyle=this.TextColor;this.Canvas.fillText(item.Text,xText,y,itemWidth);if(i>0&&IFrameSplitOperator.IsNumber(complexText.Space))xText+=complexText.Space;xText+=itemWidth;}};this.DrawComplexTextV2=function(left,yTop,complexText,size){this.Canvas.textAlign="left";this.Canvas.textBaseline="bottom";var showType=0;if(complexText.ShowType==1)showType=complexText.ShowType;if(showType==1)//多行
|
|
5245
|
+
{var xLeft=left;var yText=yTop;//顶
|
|
5246
|
+
for(var i=0;i<complexText.Text.length;++i){var item=complexText.Text[i];var itemSize=size.Text[i];if(item.Font)this.Canvas.font=item.Font;else this.Canvas.font=complexText.Font;if(item.Color)this.Canvas.fillStyle=item.Color;else this.Canvas.fillStyle=complexText.Color;var y=yText+itemSize.Height;var x=xLeft;if(item.Margin){var margin=item.Margin;if(IFrameSplitOperator.IsNumber(margin.Bottom))y-=margin.Bottom;if(IFrameSplitOperator.IsNumber(margin.Left))x+=margin.Left;}this.Canvas.fillText(item.Text,x,y,itemSize.Width);yText+=itemSize.Height;}}else//水平 单行
|
|
5247
|
+
{var xText=left;var yBottom=yTop+size.Height;for(var i=0;i<complexText.Text.length;++i){var item=complexText.Text[i];var itemSize=size.Text[i];if(item.Font)this.Canvas.font=item.Font;else this.Canvas.font=complexText.Font;if(item.Color)this.Canvas.fillStyle=item.Color;else this.Canvas.fillStyle=complexText.Color;var y=yBottom;var x=xText;if(item.Margin){var margin=item.Margin;if(IFrameSplitOperator.IsNumber(margin.Bottom))y-=margin.Bottom;if(IFrameSplitOperator.IsNumber(margin.Left))x+=margin.Left;}this.Canvas.fillText(item.Text,x,y,itemSize.Width);xText+=itemSize.Width;}}};this.CalculateComplexTextSize=function(complexText,size){if(!complexText||!IFrameSplitOperator.IsNonEmptyArray(complexText.Text))return;var showType=0;if(complexText.ShowType==1)showType=complexText.ShowType;if(showType==1)//多行
|
|
5248
|
+
{var textWidth=0,textHeight=0;for(var i=0;i<complexText.Text.length;++i){var item=complexText.Text[i];if(item.Font)this.Canvas.font=item.Font;else this.Canvas.font=complexText.Font;var itemWidth=this.Canvas.measureText(item.Text).width;//前后各空2个像素
|
|
5249
|
+
var itemHeight=this.Canvas.measureText("擎").width;if(item.Margin){var margin=item.Margin;if(IFrameSplitOperator.IsNumber(margin.Left))itemWidth+=margin.Left;if(IFrameSplitOperator.IsNumber(margin.Right))itemWidth+=margin.Right;if(IFrameSplitOperator.IsNumber(margin.Top))itemHeight+=margin.Top;if(IFrameSplitOperator.IsNumber(margin.Bottom))itemHeight+=margin.Bottom;}size.Text[i]={Width:itemWidth,Height:itemHeight};//保存所有文字的大小信息
|
|
5250
|
+
if(textWidth<itemWidth)textWidth=itemWidth;textHeight+=itemHeight;}size.Width=textWidth;size.Height=textHeight;}else//水平 单行
|
|
5251
|
+
{var textWidth=0,textHeight=0;for(var i=0;i<complexText.Text.length;++i){var item=complexText.Text[i];if(item.Font)this.Canvas.font=item.Font;else this.Canvas.font=complexText.Font;var itemWidth=this.Canvas.measureText(item.Text).width;//前后各空2个像素
|
|
5252
|
+
var itemHeight=this.Canvas.measureText("擎").width;if(item.Margin){var margin=item.Margin;if(IFrameSplitOperator.IsNumber(margin.Left))itemWidth+=margin.Left;if(IFrameSplitOperator.IsNumber(margin.Right))itemWidth+=margin.Right;if(IFrameSplitOperator.IsNumber(margin.Top))itemHeight+=margin.Top;if(IFrameSplitOperator.IsNumber(margin.Bottom))itemHeight+=margin.Bottom;}size.Text[i]={Width:itemWidth,Height:itemHeight};//保存所有文字的大小信息
|
|
5253
|
+
textWidth+=itemWidth;if(textHeight<itemHeight)textHeight=itemHeight;}size.Width=textWidth;size.Height=textHeight;}};this.DrawRightButton=function(drawTop,drawRight,drawWidth,drawHeight,data){this.Canvas.fillStyle=this.RightButton.BGColor;var rtButton={Left:drawRight-drawWidth,Top:drawTop,Width:drawWidth,Height:drawHeight};rtButton.Right=rtButton.Left+rtButton.Width;rtButton.Bottom=rtButton.Top+rtButton.Height;this.RightButton.Rect=rtButton;this.RightButton.Data=data;this.Canvas.fillRect(ToFixedPoint(rtButton.Left+1),ToFixedPoint(rtButton.Top),ToFixedRect(rtButton.Width),ToFixedRect(rtButton.Height));var pixelRatio=GetDevicePixelRatio();var spaceWidth=3;var yCenter=rtButton.Top+spaceWidth+(rtButton.Height-spaceWidth*2)/2;var xCenter=rtButton.Left+spaceWidth+(rtButton.Width-spaceWidth*2)/2;if(this.RightButton.Icon){var icon=this.RightButton.Icon;this.Canvas.font=icon.Size*pixelRatio+'px '+icon.Family;this.Canvas.textAlign="center";this.Canvas.textBaseline="middle";this.Canvas.fillStyle=icon.Color;this.Canvas.fillText('\uE6A3',xCenter,yCenter);}else{//画加号
|
|
5214
5254
|
this.Canvas.strokeStyle=this.RightButton.PenColor;var x=rtButtom.Left+spaceWidth;var y=rtButtom.Top+spaceWidth;this.Canvas.save();this.Canvas.linewidth=1*pixelRatio;this.Canvas.beginPath();this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(yCenter));this.Canvas.lineTo(ToFixedPoint(x+rtButton.Width-spaceWidth*2),ToFixedPoint(yCenter));this.Canvas.moveTo(ToFixedPoint(xCenter),ToFixedPoint(y));this.Canvas.lineTo(ToFixedPoint(xCenter),ToFixedPoint(y+rtButton.Height-spaceWidth*2));this.Canvas.stroke();this.Canvas.restore();}};this.PtInButton=function(x,y){if(!this.RightButton.Enable)return null;if(!this.RightButton.Rect)return null;var rect=this.RightButton.Rect;this.Canvas.beginPath();this.Canvas.rect(rect.Left,rect.Top,rect.Width,rect.Height);if(this.Canvas.isPointInPath(x,y)){return{Data:this.RightButton.Data,Rect:rect};}};this.DrawTextBGRect=function(x,y,height,width){this.Canvas.fillStyle=this.TextBGColor;this.Canvas.fillRect(ToFixedPoint(x),ToFixedPoint(y),ToFixedRect(height),ToFixedRect(width));if(this.BorderColor){this.Canvas.strokeStyle=this.BorderColor;this.Canvas.strokeRect(ToFixedPoint(x),ToFixedPoint(y),ToFixedRect(height),ToFixedRect(width));}};this.HScreenDraw=function(){var x=this.LastPoint.X;var y=this.LastPoint.Y;if(this.IsOnlyDrawKLine)//手机端 十字只能画在K线上
|
|
5215
5255
|
{y=this.Frame.GetXFromIndex(this.CursorIndex);if(this.IsShowClose){var yPoint=this.GetCloseYPoint(this.CursorIndex);if(yPoint!=null)x=yPoint;}}else if(this.IsOnlyDrawMinute){var yPoint=this.GetMinuteCloseYPoint(this.CursorIndex);if(yPoint!=null)x=yPoint;}var border=this.Frame.ChartBorder.GetHScreenBorder();var left=border.Left;var right=border.Right;var top=border.Top;var bottom=border.Bottom;var bottomWidth=this.Frame.ChartBorder.Bottom;if(this.CallAcutionXOperator){this.CallAcutionXOperator.Value=y;this.CallAcutionXOperator.Point={X:x,Y:y};this.CallAcutionXOperator.ClientPos=this.ClientPos;if(this.CallAcutionXOperator.Operator()){y=this.CallAcutionXOperator.X;}}this.PointY=[[left,y],[right,y]];this.PointX=[[x,top],[x,bottom]];//十字线
|
|
5216
5256
|
if(this.IsShowCorss){var pixel=GetDevicePixelRatio();this.Canvas.save();this.Canvas.strokeStyle=this.HPenColor;if(this.HPenType==0)this.Canvas.setLineDash([3*pixel,2*pixel]);//虚线
|
|
@@ -6165,7 +6205,7 @@ function ChartDrawMonitorLine(){this.newMethod=IChartDrawPicture;//派生
|
|
|
6165
6205
|
this.newMethod();delete this.newMethod;this.ClassName='ChartDrawMonitorLine';this.PointCount=1;this.IsPointIn=this.IsPointIn_XYValue_Line;this.IsHScreen=false;this.GetXYCoordinate=this.GetXYCoordinate_default;this.FormatLabelTextCallback=null;this.LineColor='rgb(255,215,0)';this.LabelConfig={Font:12*GetDevicePixelRatio()+'px \u5FAE\u8F6F\u96C5\u9ED1',BGColor:"rgb(30,144,255)",LineColor:"rgba(255,215,0,0.8)",LineDash:[3,5],Mergin:{Left:5,Right:5,Top:5,Bottom:4},LineSpace:5,//行间距
|
|
6166
6206
|
TextAlign:1//对齐方式 0=left 1=right
|
|
6167
6207
|
};this.PointToValue_Backup=this.PointToValue;this.PointToValue=function(){if(!this.PointToValue_Backup())return false;if(this.Frame.IsKLineFrame(false)){if(this.Frame.Identify===0){var dataIndex=this.Value[0].XValue;var data=this.Frame.Data;var kItem=data.Data[dataIndex];this.Value[0].YValue=kItem.Close;//使用收盘价
|
|
6168
|
-
}}return true;};this.SetOption=function(option){if(option.LineColor)this.LineColor=option.LineColor;if(option.Label){var item=option.Label;var dest=this.LabelConfig;if(item.Font)dest.Font=item.Font;if(item.BGColor)dest.BGColor=item.BGColor;if(item.LineColor)dest.LineColor=item.LineColor;if(item.LineDash)dest.LineDash=item.LineDash;if(IFrameSplitOperator.IsNumber(item.LineSpace))dest.LineSpace=item.LineSpace;if(IFrameSplitOperator.IsNumber(item.TextAlign))dest.TextAlign=item.TextAlign;if(item.Mergin)
|
|
6208
|
+
}}return true;};this.SetOption=function(option){if(option.LineColor)this.LineColor=option.LineColor;if(option.Label){var item=option.Label;var dest=this.LabelConfig;if(item.Font)dest.Font=item.Font;if(item.BGColor)dest.BGColor=item.BGColor;if(item.LineColor)dest.LineColor=item.LineColor;if(item.LineDash)dest.LineDash=item.LineDash;if(IFrameSplitOperator.IsNumber(item.LineSpace))dest.LineSpace=item.LineSpace;if(IFrameSplitOperator.IsNumber(item.TextAlign))dest.TextAlign=item.TextAlign;if(item.Mergin)CopyMarginConfig(dest.Mergin,item.Mergin);}if(option.FormatLabelTextCallback)this.FormatLabelTextCallback=option.FormatLabelTextCallback;};this.Draw=function(){this.LinePoint=[];if(this.IsFrameMinSize())return;if(!this.IsShow)return;if(!this.Frame||!this.Frame.Data)return;var data=this.Frame.Data;if(!IFrameSplitOperator.IsNonEmptyArray(data.Data))return;if(this.Point.length!=1)return;if(this.Value.length!=1)return;this.IsHScreen=this.Frame.IsHScreen;if(this.IsHScreen)return;if(this.Status==20)this.DrawMoveLine();else if(this.Status==10)this.DrawMonitorLine(data);};this.DrawMoveLine=function(){var border=this.Frame.ChartBorder.GetBorder();var pt=this.Point[0];var x=ToFixedPoint(pt.X);this.ClipFrame();this.Canvas.strokeStyle=this.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(x,border.TopEx);this.Canvas.lineTo(x,border.BottomEx);this.Canvas.stroke();this.Canvas.restore();};this.DrawMonitorLine=function(data){var isMinute=this.Frame.IsMinuteFrame();var dataWidth=this.Frame.DataWidth;var distanceWidth=this.Frame.DistanceWidth;var xPointCount=this.Frame.XPointCount;if(this.IsHScreen){//var border=this.Frame.ChartBorder.GetHScreenBorder();
|
|
6169
6209
|
//var chartright=border.BottomEx;
|
|
6170
6210
|
//var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
|
|
6171
6211
|
}else{var border=this.Frame.ChartBorder.GetBorder();var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.RightEx;}var ptData=this.Value[0];this.ClipFrame();var labelInfo=null;for(var i=data.DataOffset,j=0;i<data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth){var item=data.Data[i];if(isMinute){var x=this.Frame.GetXFromIndex(j);}else{var left=xOffset;var right=xOffset+dataWidth;if(right>chartright)break;var x=left+(right-left)/2;}if(i==ptData.XValue)//起始
|
|
@@ -6353,7 +6393,7 @@ var startIndex=this.Frame.GetXData(ptStart.X,false);var endIndex=this.Frame.GetX
|
|
|
6353
6393
|
function ChartInfoLine(){this.newMethod=IChartDrawPicture;//派生
|
|
6354
6394
|
this.newMethod();delete this.newMethod;this.ClassName='ChartInfoLine';this.PointCount=2;this.Font=12*GetDevicePixelRatio()+"px 微软雅黑";this.IsPointIn=this.IsPointIn_XYValue_Line;this.GetXYCoordinate=this.GetXYCoordinate_default;this.IsShowYCoordinate=false;this.CopyData=this.CopyData_default;this.OnlyMoveXIndex=true;this.IsSupportMagnet=true;this.LabelConfig={Font:12*GetDevicePixelRatio()+'px \u5FAE\u8F6F\u96C5\u9ED1',BGColor:"rgba(135, 206 ,250,0.95)",Mergin:{Left:10,Right:10,Top:10,Bottom:8},LineSpace:5,//行间距
|
|
6355
6395
|
TextAlign:1//对齐方式 0=left 1=right
|
|
6356
|
-
};this.FormatLabelTextCallback=null;this.SetOption=function(option){if(option.LineColor)this.LineColor=option.LineColor;if(option.PointColor)this.PointColor=option.PointColor;if(option.Label){var item=option.Label;var dest=this.LabelConfig;if(item.Font)dest.Font=item.Font;if(item.BGColor)dest.BGColor=item.BGColor;if(IFrameSplitOperator.IsNumber(item.LineSpace))dest.LineSpace=item.LineSpace;if(IFrameSplitOperator.IsNumber(item.TextAlign))dest.TextAlign=item.TextAlign;if(item.Mergin)
|
|
6396
|
+
};this.FormatLabelTextCallback=null;this.SetOption=function(option){if(option.LineColor)this.LineColor=option.LineColor;if(option.PointColor)this.PointColor=option.PointColor;if(option.Label){var item=option.Label;var dest=this.LabelConfig;if(item.Font)dest.Font=item.Font;if(item.BGColor)dest.BGColor=item.BGColor;if(IFrameSplitOperator.IsNumber(item.LineSpace))dest.LineSpace=item.LineSpace;if(IFrameSplitOperator.IsNumber(item.TextAlign))dest.TextAlign=item.TextAlign;if(item.Mergin)CopyMarginConfig(dest.Mergin,item.Mergin);}if(option.FormatLabelTextCallback)this.FormatLabelTextCallback=option.FormatLabelTextCallback;};this.Draw=function(){this.LinePoint=[];if(this.IsFrameMinSize())return;if(!this.IsShow)return;var drawPoint=this.CalculateDrawPoint({IsCheckX:true,IsCheckY:false});if(!drawPoint)return;if(drawPoint.length!=2)return;this.ClipFrame();var ptStart=drawPoint[0];var ptEnd=drawPoint[1];this.SetLineWidth();this.Canvas.strokeStyle=this.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(ptStart.X,ptStart.Y);this.Canvas.lineTo(ptEnd.X,ptEnd.Y);this.Canvas.stroke();this.RestoreLineWidth();var line={Start:ptStart,End:ptEnd};this.LinePoint.push(line);this.DrawPoint(drawPoint);//画点
|
|
6357
6397
|
var labelInfo={};labelInfo.Config=this.LabelConfig;labelInfo.PtStart=ptStart;labelInfo.PtEnd=ptEnd;this.Canvas.restore();this.DrawLabel(labelInfo);};this.DrawLabel=function(labelInfo){if(!this.FormatLabelTextCallback)return;labelInfo.AryPoint=this.Point;if(this.Status!=10){labelInfo.AryValue=this.PointToKLine(this.Point);}else{labelInfo.AryValue=this.Value;}labelInfo.Data=this.Frame.Data;//数据
|
|
6358
6398
|
this.FormatLabelTextCallback(labelInfo);if(!IFrameSplitOperator.IsNonEmptyArray(labelInfo.AryText))return;this.CalculateLabelSize(labelInfo);var ptStart=labelInfo.PtStart;var ptEnd=labelInfo.PtEnd;if(ptStart.X>ptEnd.X){ptStart=labelInfo.PtEnd;ptEnd=labelInfo.PtStart;}var config=labelInfo.Config;var xCenter=labelInfo.PtStart.X+(labelInfo.PtEnd.X-labelInfo.PtStart.X)/2;var yCenter=labelInfo.PtStart.Y+(labelInfo.PtEnd.Y-labelInfo.PtStart.Y)/2;if(ptStart.Y<ptEnd.Y){var rtBG={Left:xCenter,Bottom:yCenter,Width:labelInfo.Width,Height:labelInfo.Height};rtBG.Right=rtBG.Left+rtBG.Width;rtBG.Top=rtBG.Bottom-rtBG.Height;}else{var rtBG={Left:xCenter,Top:yCenter,Width:labelInfo.Width,Height:labelInfo.Height};rtBG.Right=rtBG.Left+rtBG.Width;rtBG.Bottom=rtBG.Top+rtBG.Height;}this.DrawDefaultLabel(labelInfo,rtBG);};}function ChartDrawStorage(){this.DrawData=new _map2.default();//画图工具数据 key=symbol-Period, value=Map() Key:Guid, Value:{Guid, Symbol, Period, ClassName, Value}
|
|
6359
6399
|
this.StorageKey;this.GetEventCallback;//事件回调
|
|
@@ -6487,7 +6527,7 @@ this.CorssCursorTextColor="rgb(255,255,255)";//十字光文字颜色
|
|
|
6487
6527
|
this.CorssCursorTextFont=14*GetDevicePixelRatio()+"px 微软雅黑";this.CorssCursorHPenColor="rgb(130,130,130)";//十字光标线段颜色(水平)
|
|
6488
6528
|
this.CorssCursorVPenColor="rgb(130,130,130)";//十字光标线段颜色(垂直)
|
|
6489
6529
|
this.CorssCursorXRangeBGColor="rgba(100,149,237,0.3)";//十字光标X轴访问背景色
|
|
6490
|
-
this.CorssCursor={RightButton:{BGColor:'rgb(43,54,69)',PenColor:'rgb(255,255,255)',Icon:{Text:'\uE6A3',Color:'rgb(255,255,255)',Family:"iconfont",Size:18}}};this.LockBGColor="rgb(220, 220, 220)";//指标锁区域颜色
|
|
6530
|
+
this.CorssCursor={RightButton:{BGColor:'rgb(43,54,69)',PenColor:'rgb(255,255,255)',Icon:{Text:'\uE6A3',Color:'rgb(255,255,255)',Family:"iconfont",Size:18}},RightMargin:{Left:2,Right:2,Top:5,Bottom:3}};this.LockBGColor="rgb(220, 220, 220)";//指标锁区域颜色
|
|
6491
6531
|
this.LockTextColor="rgb(210, 34, 34)";//指标锁提示信息文字颜色
|
|
6492
6532
|
this.Domain="http://127.0.0.1:8080";//API域名
|
|
6493
6533
|
this.CacheDomain="http://127.0.0.1:8087";//缓存域名
|
|
@@ -12221,7 +12261,7 @@ this.DragPageCycle=true;//手机翻页循环
|
|
|
12221
12261
|
this.DragXScroll=null;//{Start:{x,y}, End:{x, y}}
|
|
12222
12262
|
this.DragYScroll=null;this.IsShowVScrollbar=false;this.IsDestroy=false;//是否已经销毁了
|
|
12223
12263
|
this.JSPopMenu;//内置菜单
|
|
12224
|
-
this.ChartDestory=function()//销毁
|
|
12264
|
+
this.IsShowRightMenu=true;this.ChartDestory=function()//销毁
|
|
12225
12265
|
{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.InitalPopMenu=function()//初始化弹出窗口
|
|
12226
12266
|
{if(this.JSPopMenu)return;this.JSPopMenu=new JSPopMenu();//内置菜单
|
|
12227
12267
|
this.JSPopMenu.Inital();};this.AutoScrollPage=function(step){var _this50=this;this.AutoDragScrollTimer=setTimeout(function(){_this50.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;};//清空固定行数据
|
|
@@ -12341,7 +12381,8 @@ if((clickData.Type==2||clickData.Type==4)&&(e.button==0||e.button==2))//点击
|
|
|
12341
12381
|
{if(this.MoveYOffset(1)){this.Draw();this.DelayUpdateStockData();}}else if(scroll.Type==3)//滚动条
|
|
12342
12382
|
{this.DragYScroll={Click:{X:x,Y:y},LastMove:{X:x,Y:y}};}else if(scroll.Type==4)//滚动条内部
|
|
12343
12383
|
{if(this.SetYOffset(scroll.Pos)){this.Draw();this.DelayUpdateStockData();}}}}}document.onmousemove=function(e){_this55.DocOnMouseMove(e);};document.onmouseup=function(e){_this55.DocOnMouseUp(e);};};this.UIOnMounseUp=function(e){console.log('"UIOnMounseUp');};//去掉右键菜单
|
|
12344
|
-
this.UIOnContextMenu=function(e){
|
|
12384
|
+
this.UIOnContextMenu=function(e){if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;if(!this.IsShowRightMenu)return;var x=e.clientX-this.UIElement.getBoundingClientRect().left;var y=e.clientY-this.UIElement.getBoundingClientRect().top;if(typeof this.OnRightMenu=='function')this.OnRightMenu(x,y,e);//右键菜单事件
|
|
12385
|
+
};this.OnRightMenu=function(x,y,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;if(this.DrawHeader)return;if(this.DragColumnWidth)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();}}}var mouseStatus={Cursor:"default",Name:"Default"};;//鼠标状态
|
|
12345
12386
|
var report=this.GetReportChart();var cell=null;var bDraw=false;if(report){var dragHeaderWidth=report.PtInHeaderDragBorder(x,y);if(dragHeaderWidth){mouseStatus={Cursor:"col-resize",Name:"DragHeaderWidth"};JSConsole.Chart.Log("[JSReportChartContainer::UIOnMouseMove] drag column width ",dragHeaderWidth);}else{cell=report.PtInCell(x,y);//是否在单元格(EnableTooltip)
|
|
12346
12387
|
}var scrollbar=report.VScrollbar;if(scrollbar.Enable){var bShowScrollbar=report.PtInClient(x,y);this.IsShowVScrollbar=bShowScrollbar;if(!this.DragYScroll){if(bShowScrollbar&&!scrollbar.LastStatus.Draw)bDraw=true;else if(!bShowScrollbar&&scrollbar.LastStatus.Draw)bDraw=true;}}}var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_MOUSE_MOVE);if(event){var sendData={X:x,Y:y,Cell:cell};event.Callback(event,sendData,this);}if(mouseStatus)this.UIElement.style.cursor=mouseStatus.Cursor;if(bDraw)this.Draw();};this.UIOnMounseOut=function(e){var bDraw=false;var tabChart=this.GetTabChart();if(tabChart&&tabChart.MoveOnTabIndex>=0){tabChart.MoveOnTabIndex=-1;bDraw=true;this.Draw();}var scrollbar=this.GetVScrollbarChart();if(scrollbar.Enable){this.IsShowVScrollbar=false;if(!this.DragYScroll){if(scrollbar.LastStatus.Draw)bDraw=true;}}if(bDraw)this.Draw();};this.UIOnMouseleave=function(e){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}`);
|
|
12347
12388
|
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();}else if(this.DragYScroll){var chart=this.ChartPaint[0];if(!chart||!chart.VScrollbar)return;this.DragYScroll.LastMove.X=x;this.DragYScroll.LastMove.Y=y;var pos=chart.VScrollbar.GetScrollPostionByPoint(x,y);if(this.SetYOffset(pos)){this.Draw();this.DelayUpdateStockData();}}else if(this.DragHeader&&this.DragHeader.ClickData)//表头拖拽
|
|
@@ -12500,8 +12541,8 @@ if(IFrameSplitOperator.IsNumber(item.FormatType))colItem.FormatType=item.FormatT
|
|
|
12500
12541
|
if(IFrameSplitOperator.IsNumber(item.ValueType))colItem.FormatType=item.ValueType;//输出样式
|
|
12501
12542
|
}else if(item.Type==REPORT_COLUMN_ID.CUSTOM_ICON_ID){}else if(item.Type==REPORT_COLUMN_ID.CLOSE_LINE_ID){if(IFrameSplitOperator.IsBool(item.IsDrawArea))colItem.IsDrawArea=item.IsDrawArea;}else if(item.Type==REPORT_COLUMN_ID.TIME_ID){if(IFrameSplitOperator.IsNumber(item.ValueType))colItem.ValueType=item.ValueType;}else if(item.Type==REPORT_COLUMN_ID.DATE_ID){if(IFrameSplitOperator.IsNumber(item.FormatType))colItem.FormatType=item.FormatType;}this.Column.push(colItem);}};this.SwapColumn=function(leftIndex,rightIndex){if(!IFrameSplitOperator.IsNumber(leftIndex)||!IFrameSplitOperator.IsNumber(rightIndex))return false;var count=this.Column.length;if(leftIndex<0||leftIndex>=count)return false;if(rightIndex<0||rightIndex>=count)return false;if(leftIndex==rightIndex)return;var tempItem=this.Column[leftIndex];this.Column[leftIndex]=this.Column[rightIndex];this.Column[rightIndex]=tempItem;return true;};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.GetYScrollRange=function(){if(!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return 0;var maxOffset=this.Data.Data.length-this.RowCount;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.NAME_EX_ID,Title:"名称",TextAlign:"left",Width:null,TextColor:g_JSChartResource.Report.FieldColor.Name,MaxText:"擎擎擎擎擎擎"},{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.CLOSE_LINE_ID,Title:"走势",TextAlign:"center",TextColor:g_JSChartResource.Report.CloseLineColor,Width:null,MaxText:"88888.88888"},{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" },
|
|
12502
12543
|
//{ Type:REPORT_COLUMN_ID.CENTER_BAR_ID, Title:"柱子2", TextAlign:"center", Width:null, TextColor:g_JSChartResource.DealList.FieldColor.BarTitle, MaxText:"888888" },
|
|
12503
|
-
{Type:REPORT_COLUMN_ID.CUSTOM_STRING_TEXT_ID,Title:"自定义",TextAlign:"center",Width:null,TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"擎擎擎擎擎"},{Type:REPORT_COLUMN_ID.CUSTOM_NUMBER_TEXT_ID,Title:"自定义",TextAlign:"center",Width:null,TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"擎擎擎擎擎"},{Type:REPORT_COLUMN_ID.CUSTOM_DATETIME_TEXT_ID,Title:"自定义",TextAlign:"center",Width:null,TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"9999-99-99"},{Type:REPORT_COLUMN_ID.CUSTOM_ICON_ID,Title:" ",TextAlign:"left",FixedWidth:20,TextColor:g_JSChartResource.Report.FieldColor.Text},{Type:REPORT_COLUMN_ID.KLINE_ID,Title:"K线",TextAlign:"left",FixedWidth:50,TextColor:g_JSChartResource.Report.FieldColor.Text},{Type:REPORT_COLUMN_ID.TIME_ID,Title:"时间",TextAlign:"left",ValueType:0,TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"99:99:99.999"},{Type:REPORT_COLUMN_ID.DATE_ID,Title:"日期",TextAlign:"left",FormatType:0,TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"9999-99-99"}];for(var i=0;i<DEFAULT_COLUMN.length;++i){var item=DEFAULT_COLUMN[i];if(item.Type==id)return item;}return null;};this.
|
|
12504
|
-
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();if(this.VScrollbar){var bottom=this.ChartBorder.GetBottom();this.VScrollbar.DrawScrollbar(this.RectClient.Left,this.RectClient.Top+this.HeaderHeight,this.RectClient.Right,bottom-this.BottomToolbarHeight-4);}this.SizeChange=false;};//更新缓存变量
|
|
12544
|
+
{Type:REPORT_COLUMN_ID.CUSTOM_STRING_TEXT_ID,Title:"自定义",TextAlign:"center",Width:null,TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"擎擎擎擎擎"},{Type:REPORT_COLUMN_ID.CUSTOM_NUMBER_TEXT_ID,Title:"自定义",TextAlign:"center",Width:null,TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"擎擎擎擎擎"},{Type:REPORT_COLUMN_ID.CUSTOM_DATETIME_TEXT_ID,Title:"自定义",TextAlign:"center",Width:null,TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"9999-99-99"},{Type:REPORT_COLUMN_ID.CUSTOM_ICON_ID,Title:" ",TextAlign:"left",FixedWidth:20,TextColor:g_JSChartResource.Report.FieldColor.Text},{Type:REPORT_COLUMN_ID.KLINE_ID,Title:"K线",TextAlign:"left",FixedWidth:50,TextColor:g_JSChartResource.Report.FieldColor.Text},{Type:REPORT_COLUMN_ID.TIME_ID,Title:"时间",TextAlign:"left",ValueType:0,TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"99:99:99.999"},{Type:REPORT_COLUMN_ID.DATE_ID,Title:"日期",TextAlign:"left",FormatType:0,TextColor:g_JSChartResource.Report.FieldColor.Text,MaxText:"9999-99-99"}];for(var i=0;i<DEFAULT_COLUMN.length;++i){var item=DEFAULT_COLUMN[i];if(item.Type==id)return item;}return null;};this.ClipClient=function(){this.Canvas.save();this.Canvas.beginPath();this.Canvas.rect(this.RectClient.Left,this.RectClient.Top,this.RectClient.Right-this.RectClient.Left,this.RectClient.Bottom-this.RectClient.Top);//this.Canvas.stroke(); //调试用
|
|
12545
|
+
this.Canvas.clip();};this.Draw=function(){this.ShowSymbol=[];this.TooltipRect=[];if(this.GlobalOption)this.GlobalOption.FlashBGCount=0;if(this.SizeChange)this.CalculateSize();else this.UpdateCacheData();this.ClipClient();this.DrawHeader();this.DrawBody();this.Canvas.restore();if(this.Tab&&this.BottomToolbarHeight>0){var bottom=this.ChartBorder.GetBottom();this.Tab.DrawTab(this.RectClient.Left,bottom-this.BottomToolbarHeight,this.RectClient.Right,bottom);this.Tab.DrawScrollbar(this.RectClient.Left,bottom-this.BottomToolbarHeight,this.RectClient.Right,bottom);}this.ClipClient();this.DrawBorder();this.Canvas.restore();this.DrawDragRow();if(this.VScrollbar){var bottom=this.ChartBorder.GetBottom();this.VScrollbar.DrawScrollbar(this.RectClient.Left,this.RectClient.Top+this.HeaderHeight,this.RectClient.Right,bottom-this.BottomToolbarHeight-4);}this.SizeChange=false;};//更新缓存变量
|
|
12505
12546
|
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 是否重新计算
|
|
12506
12547
|
{if(recalculate)this.CalculateSize();var size=this.RowCount;return size;};this.GetCurrentPageStatus=function()//{ Start:起始索引, End:结束索引(数据), PageSize:页面可以显示几条记录, IsEnd:是否是最后一页, IsSinglePage:是否只有一页数据}
|
|
12507
12548
|
{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.Start=0;result.End=0;result.IsEnd=true;result.IsSinglePage=true;}return result;};this.CalculateSize=function()//计算大小
|
|
@@ -13224,7 +13265,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
13224
13265
|
this.ExecuteScript(item,data);}this.Status=0;}};this.OnExecuteFinish=function(data,indexInfo,jsExectute,jobInfo){var message={Data:data,IndexInfo:indexInfo,ID:JSCHART_WORKER_MESSAGE_ID.FINISH_EXECUTE_SCRIPT,JobInfo:jobInfo};postMessage(message);};this.OnExecuteError=function(error,indexInfo,jobData){var message={IndexInfo:indexInfo,ID:JSCHART_WORKER_MESSAGE_ID.ERROR_EXECUTE_SCRIPT,Error:error};postMessage(message);};}/********************************************************************************
|
|
13225
13266
|
* 版本信息输出
|
|
13226
13267
|
*
|
|
13227
|
-
*/var HQCHART_VERSION="1.1.
|
|
13268
|
+
*/var HQCHART_VERSION="1.1.13501";function PrintHQChartVersion(){var logo='\n\n*************************************************************************************************************************************************************************** \n* \n* :%@@- \n* :@@@@- \n* =@@@@ :#@@@ .:+#@@@#=: :=*@@@@@@#+-. *@@@@. \n* :@@@@@ .@@@@@ .#@@@@@@@@@@@- +@@@@@@@@@@@@@+ @@@@@ -%@@* \n* +@@@@% #@@@@# *@@@@@@@@@@@@@@%. =@@@@@@@@@@@@@@@- @@@@@ -@@@@+ \n* %@@@@* @@@@@+ .%@@@@@@@@@@@@@@@@%: #@@@@@@@@@@@@@@@% @@@@# *@@@@= \n* @@@@@= @@@@@- .%@@@@@@@*++*%@@@@@@% .%@@@@@@@%*+==+**= -@@@@+ #@@@@- \n* @@@@@. @@@@@. #@@@@@%= =@@@@@@* %@@@@@@#: *@@@@- :::. .-+*###+: ::: .+##+: -%%@@@@@%%%% \n* .@@@@@ .@@@@@. +@@@@@% .@@@@@@ *@@@@@@: %@@@@: +@@@@@%. :%@@@@@@@@@@: *@@@ :@@@@@* @@@@@@@@@@@@ \n* :@@@@@ :@@@@@ @@@@@% :@@@@@+ @@@@@@: %@@@@-@@@@@@@@@. @@@@@@@@@@@@@. :@@@%-@@@@@@.:@@@@@@@@@@@# \n* -@@@@% -@@@@@ =@@@@@. %@@@@% %@@@@@- %@@@@@@@@@@@@@@* %@@@@@@@@@@@@+ -@@@@@@@@@@# -@@@@@@@@@@@. \n* +@@@@%=========#@@@@% @@@@@# :@@@@@ .@@@@@% @@@@@@@@%@@@@@@@ -%+:. .#@@@@* +@@@@@@@%%@. .::+@@@@#:: \n* #@@@@@@@@@@@@@@@@@@@# .@@@@@ .@@@@@ :@@@@@. @@@@@@#. #@@@@@. -@@@@* #@@@@@@: *@@@@+ \n* %@@@@@@@@@@@@@@@@@@@+ :@@@@@ .@@@@@ -@@@@@ @@@@@+ @@@@@. :@@@@* @@@@@% #@@@@- \n* @@@@@@@@@@@@@@@@@@@@: :@@@@% :@@@@@ +@@@@% -@@@@+ @@@@@ -@@@@+ @@@@@. @@@@@. \n* .@@@@@@@@@@@@@@@@@@@@ :@@@@% -@@@@% *@@@@% #@@@@. @@@@@ .=*#%%%@@@@@= :@@@@# @@@@@. \n* -@@@@@:::::::::=@@@@@ :@@@@@ @@@@@* +@@@@% @@@@@ @@@@% -#@@@@@@@@@@@@: -@@@@* @@@@@ \n* =@@@@% =@@@@% .@@@@@ :@@@@@. -@@@@% @@@@@ .@@@@* +@@@@@@@@@@@@@@. =@@@@+ .@@@@@ \n* +@@@@# +@@@@# @@@@@# %@@@@% :@@@@@ .@@@@% =@@@@= -@@@@@*-:..%@@@@ +@@@@= :@@@@# \n* *@@@@* *@@@@* +@@@@@: #@@@@@+ .@@@@@@ :@@@@% *@@@@- @@@@@. @@@@% #@@@@: =@@@@+ \n* %@@@@= %@@@@+ @@@@@@- .%@@@@@# #@@@@@# :@@@@% #@@@@: @@@@% @@@@* %@@@@. #@@@@- \n* @@@@@- @@@@@= =@@@@@@#=...-*@@@@@@@: @@@@@@%=. :+**. :@@@@* %@@@@. .@@@@* *@@@@= @@@@@ %@@@@+ \n* .@@@@@: .@@@@@: *@@@@@@@@@@@@@@@@@@@# =@@@@@@@@%%%@@@@@@ +@@@@- @@@@@ .@@@@@: :%@@@@@- .@@@@% %@@@@@*+- \n* :@@@@@ :@@@@@ +@@@@@@@@@@@@@@@@@@@# =@@@@@@@@@@@@@@@@% %@@@@ @@@@@ @@@@@@@@@@@@@@@: -@@@@* *@@@@@@@@- \n* =@@@@@ -@@@@@ :@@@@@@@@@@@@@@@@@@@# :@@@@@@@@@@@@@@@% @@@@@ %@@@% #@@@@@@@@@#@@@@. +@@@@- .@@@@@@@@# \n* *@@@@# =@@@@% :#@@@@@@@#: :@@@@@= =@@@@@@@@@@@+. @@@@@ :@@@+ *@@@@@@@- %@@@ *@@@= =@@@@@@@* \n* =++++- -++++= .:::. .=*+: :-=+++=:. ****= .=+. .-++=: :+++ -+=: .-=+=:. \n* \n* \n* HQChart \n* Ver: '+HQCHART_VERSION+' \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n************************************************************************************************************************************************************************** \n ';console.log(logo);}PrintHQChartVersion();//把给外界调用的方法暴露出来
|
|
13228
13269
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
13229
13270
|
// BaseIndex:BaseIndex,
|
|
13230
13271
|
// ChartLine:ChartLine,
|