hqchart 1.1.15358 → 1.1.15364
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
|
@@ -2233,7 +2233,8 @@ event.Callback(event,data,this);if(data.PreventDefault)return;}if(button.ID==JSC
|
|
|
2233
2233
|
}else if(button.ID==JSCHART_BUTTON_ID.DRAW_PICTURE_SETTING){}};this.PtInTitleButtons=function(x,y){for(var i=0;i<this.TitlePaint.length;++i){var item=this.TitlePaint[i];if(!item.PtInButtons)continue;var button=item.PtInButtons(x,y);if(button){button.Chart=item;return button;}}return null;};this.OnMouseMove=function(x,y,e,isPhone){var _this15=this;this.StopDrawDynamicInfo();this.LastPoint.X=x;this.LastPoint.Y=y;var mouseStatus=null;//鼠标状态
|
|
2234
2234
|
var button=null;//当前鼠标所在按钮
|
|
2235
2235
|
var frameID=this.Frame.PtInFrame(x,y);this.LastPoint.FrameID=frameID;if(IFrameSplitOperator.IsNumber(frameID)&&frameID>=0)//在K线内部移动,调整K线索引
|
|
2236
|
-
this.CursorIndex=this.Frame.GetXData(x);if(this.
|
|
2236
|
+
this.CursorIndex=this.Frame.GetXData(x);if(this.TryMouseMoveChartTooltipData){//DrawDynamic:{ Enable, Option: }
|
|
2237
|
+
var data={e:e,X:x,Y:y,Draw:false,DrawDynamic:null,PreventDefault:false,MouseStatus:null};this.TryMouseMoveChartTooltipData(data,this);if(data.MouseStatus)mouseStatus=data.MouseStatus;if(data.PreventDefault){if(data.Draw)this.Draw();if(data.DrawDynamic&&data.DrawDynamic.Enable)this.DrawDynamicInfo(data.DrawDynamic.Option);this.SetCursor(mouseStatus);return;}}if(this.EnableBorderDrag&&this.Frame&&!this.CurrentChartDrawPicture){var dragBorder=this.Frame.PtInFrameBorder(x,y);if(dragBorder&&dragBorder.Index>=0){mouseStatus={Cursor:"n-resize",Name:"DragBorder"};JSConsole.Chart.Log("[JSChartContainer::OnMouseMove] drag border ",dragBorder);}}if(this.EnableYDrag&&this.Frame&&!this.CurrentChartDrawPicture){var dragY=this.TryYDrag(x,y);if(dragY){mouseStatus={Cursor:dragY.Position==0?"n-resize":"row-resize",Name:"DragY"};JSConsole.Chart.Log("[JSChartContainer::OnMouseMove] drag y ",dragY);}}if(!this.CurrentChartDrawPicture){button=this.PtInButton(x,y);if(button){mouseStatus={Cursor:"pointer",Name:button.Name};JSConsole.Chart.Log("[JSChartContainer::OnMouseMove] frame button ",button);}}if(this.ChartCorssCursor){var crossButton=this.ChartCorssCursor.PtInButton(x,y);if(crossButton){mouseStatus={Cursor:"pointer",Name:"CorssCursorButton"};JSConsole.Chart.Log("[JSChartContainer::OnMouseMove] cross cursor button ",crossButton);}}//X轴拖动缩放
|
|
2237
2238
|
if(this.ClassName=="KLineChartContainer"&&this.EnableXDrag.Bottom&&this.Frame.PtInFrameBottom(x,y)){//var dragType=this.GetDragXCoordinateType(e,"OnMouseMove");
|
|
2238
2239
|
//mouseStatus={ Cursor:"pointer", Name:"FrameButtom"};
|
|
2239
2240
|
JSConsole.Chart.Log("[JSChartContainer::OnMouseMove] frame bottom ");}if(this.Frame.PtInHorizontalLabel&&this.Frame.PtInHorizontalLabel(x,y)){mouseStatus={Cursor:"pointer",Name:"HorizontalLabel"};JSConsole.Chart.Log("[JSChartContainer::OnMouseMove] frame Horizontal Label ");}if(this.SelectedChart.EnableMoveOn&&this.PtInChart&&!this.CurrentChartDrawPicture){var chartInfo=this.PtInChart(x,y);if(chartInfo&&chartInfo.Identify){mouseStatus={Cursor:"pointer",Name:"PtInChart"};this.SelectedChart.MoveOn.Identify=chartInfo.Identify;this.SelectedChart.MoveOn.Identify=null;JSConsole.Chart.Log("[JSChartContainer::OnMouseMove] Point in chart ",chartInfo);}else{this.SelectedChart.MoveOn.Identify=null;}}else{this.SelectedChart.MoveOn.Identify=null;}//区间选择
|
|
@@ -4354,6 +4355,7 @@ this.newMethod();delete this.newMethod;this.ClassName='ChartKLineTable';//类名
|
|
|
4354
4355
|
this.Data;this.RowName;this.RowNamePosition=1;//0=不显示 1=左边内部 2=左边外部 3=右边外部
|
|
4355
4356
|
this.BGColor;//背景色
|
|
4356
4357
|
this.BorderColor;//分割线颜色
|
|
4358
|
+
this.AryBorderColor;//分割线颜色
|
|
4357
4359
|
this.RowCount=5;//行数
|
|
4358
4360
|
this.RowHeight=10;//行高
|
|
4359
4361
|
this.RowHeightType=1;//0=均分 1=固定高度
|
|
@@ -4361,15 +4363,17 @@ this.TextFontConfig=CloneData(g_JSChartResource.ChartKLineTable.TextFont);this.I
|
|
|
4361
4363
|
this.AryTableData=[];this.MapCache=null;//key=date/date-time value={ Date:, Time:, Data:[ ] }
|
|
4362
4364
|
this.GetKValue=ChartData.GetKValue;this.AryCellRect=[];//保存单元格信息
|
|
4363
4365
|
this.AryNameRect=[];//右侧行的名字
|
|
4364
|
-
this.SetOption=function(option){if(!option)return;if(option.BGColor)this.BGColor=option.BGColor;if(option.TextColor)this.TextColor=option.TextColor;if(option.BorderColor)this.BorderColor=option.BorderColor;if(IFrameSplitOperator.IsNumber(option.RowNamePosition))this.RowNamePosition=option.RowNamePosition;if(IFrameSplitOperator.IsNumber(option.RowHeightType))this.RowHeightType=option.RowHeightType;if(IFrameSplitOperator.IsNumber(option.Style))this.Style=option.Style;if(option.ItemMargin){var subItem=option.ItemMargin;if(IFrameSplitOperator.IsNumber(subItem.Left))this.ItemMargin.Left=subItem.Left;if(IFrameSplitOperator.IsNumber(subItem.Top))this.ItemMargin.Top=subItem.Top;if(IFrameSplitOperator.IsNumber(subItem.Bottom))this.ItemMargin.Bottom=subItem.Bottom;if(IFrameSplitOperator.IsNumber(subItem.Right))this.ItemMargin.Right=subItem.Right;if(IFrameSplitOperator.IsNumber(subItem.YOffset))this.ItemMargin.YOffset=subItem.YOffset;}if(option.TextFont){var subItem=option.TextFont;if(IFrameSplitOperator.IsNumber(subItem.FontMaxSize))this.TextFontConfig.FontMaxSize=subItem.FontMaxSize;if(subItem.Family)this.TextFontConfig.Family=subItem.Family;}if(IFrameSplitOperator.IsPlusNumber(option.CellWidth))this.CellWidth=option.CellWidth;};this.BuildCacheData=function(){var mapData=new _map2.default();this.MapCache=mapData;if(!IFrameSplitOperator.IsNonEmptyArray(this.AryTableData))return;for(var i=0;i<this.AryTableData.length;++i){var item=this.AryTableData[i];var key=this.BuildKey(item);mapData.set(key,item);}};//绘制背景色
|
|
4365
|
-
this.DrawBG=function(rtBG){if(!this.BGColor)return;this.Canvas.fillStyle=this.BGColor;if((this.Style===1||this.Style===2)&&this.RowHeightType==1){var height=this.RowCount*this.RowHeight;height=Math.min(rtBG.Height,height);this.Canvas.fillRect(rtBG.Left+1,rtBG.Top,rtBG.Width-2,height);}else{this.Canvas.fillRect(rtBG.Left+1,rtBG.Top,rtBG.Width-1,rtBG.Height);}};this.DrawBorder=function(rtBG){if(!this.BorderColor)return;var lineCount=30;if(this.Style===1||this.Style===2)lineCount=this.RowCount+1;
|
|
4366
|
+
this.SetOption=function(option){if(!option)return;if(option.BGColor)this.BGColor=option.BGColor;if(option.TextColor)this.TextColor=option.TextColor;if(option.BorderColor)this.BorderColor=option.BorderColor;if(IFrameSplitOperator.IsNumber(option.RowNamePosition))this.RowNamePosition=option.RowNamePosition;if(IFrameSplitOperator.IsNumber(option.RowHeightType))this.RowHeightType=option.RowHeightType;if(IFrameSplitOperator.IsNumber(option.Style))this.Style=option.Style;if(option.ItemMargin){var subItem=option.ItemMargin;if(IFrameSplitOperator.IsNumber(subItem.Left))this.ItemMargin.Left=subItem.Left;if(IFrameSplitOperator.IsNumber(subItem.Top))this.ItemMargin.Top=subItem.Top;if(IFrameSplitOperator.IsNumber(subItem.Bottom))this.ItemMargin.Bottom=subItem.Bottom;if(IFrameSplitOperator.IsNumber(subItem.Right))this.ItemMargin.Right=subItem.Right;if(IFrameSplitOperator.IsNumber(subItem.YOffset))this.ItemMargin.YOffset=subItem.YOffset;}if(option.TextFont){var subItem=option.TextFont;if(IFrameSplitOperator.IsNumber(subItem.FontMaxSize))this.TextFontConfig.FontMaxSize=subItem.FontMaxSize;if(subItem.Family)this.TextFontConfig.Family=subItem.Family;}if(IFrameSplitOperator.IsPlusNumber(option.CellWidth))this.CellWidth=option.CellWidth;if(IFrameSplitOperator.IsNonEmptyArray(option.AryBorderColor))this.AryBorderColor=option.AryBorderColor.slice();};this.BuildCacheData=function(){var mapData=new _map2.default();this.MapCache=mapData;if(!IFrameSplitOperator.IsNonEmptyArray(this.AryTableData))return;for(var i=0;i<this.AryTableData.length;++i){var item=this.AryTableData[i];var key=this.BuildKey(item);mapData.set(key,item);}};//绘制背景色
|
|
4367
|
+
this.DrawBG=function(rtBG){if(!this.BGColor)return;this.Canvas.fillStyle=this.BGColor;if((this.Style===1||this.Style===2)&&this.RowHeightType==1){var height=this.RowCount*this.RowHeight;height=Math.min(rtBG.Height,height);this.Canvas.fillRect(rtBG.Left+1,rtBG.Top,rtBG.Width-2,height);}else{this.Canvas.fillRect(rtBG.Left+1,rtBG.Top,rtBG.Width-1,rtBG.Height);}};this.DrawBorder=function(rtBG){if(!this.BorderColor)return;var lineCount=30;if(this.Style===1||this.Style===2)lineCount=this.RowCount+1;var yLine=rtBG.Top;for(var i=0;i<lineCount;++i){var borderColor=this.BorderColor;if(this.AryBorderColor&&this.AryBorderColor[i])borderColor=this.AryBorderColor[i];this.Canvas.strokeStyle=borderColor;this.Canvas.beginPath();this.Canvas.moveTo(rtBG.Left,ToFixedPoint(yLine));this.Canvas.lineTo(rtBG.Right,ToFixedPoint(yLine));this.Canvas.stroke();yLine+=this.RowHeight;if(yLine>rtBG.Bottom)break;}};//计算行高
|
|
4366
4368
|
this.CalculateRowHeight=function(rtBG){if(this.RowHeightType==1){this.RowHeight=this.TextFontConfig.FontMaxSize+this.ItemMargin.Top+this.ItemMargin.Bottom;}else{this.RowHeight=rtBG.Height/this.RowCount;}};this.Draw=function(){this.AryCellRect=[];this.AryNameRect=[];if(!this.IsShow||this.ChartFrame.IsMinSize||!this.IsVisible)return;if(this.IsShowIndexTitleOnly())return;if(this.IsHideScriptIndex())return;if(!this.Data||!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return;//if (!IFrameSplitOperator.IsNonEmptyArray(this.AryTableData)) return;
|
|
4367
4369
|
//if (!this.MapCache || this.MapCache.size<=0) return;
|
|
4368
4370
|
var isHScreen=this.ChartFrame.IsHScreen===true;if(isHScreen)return;if(this.RowCount<=0)return;var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var xPointCount=this.ChartFrame.XPointCount;var border=this.ChartFrame.GetBorder();var height=border.Bottom-border.TopTitle;var xOffset=border.LeftEx+g_JSChartResource.FrameLeftMargin;var chartright=border.RightEx;var top=border.TopTitle;var bottom=border.Bottom;//绘制背景
|
|
4369
4371
|
if(this.Style===1){var rtBG={Left:border.LeftEx,Top:border.TopTitle,Right:border.RightEx,Bottom:border.TopEx};rtBG.Width=rtBG.Right-rtBG.Left;rtBG.Height=rtBG.Bottom-rtBG.Top;}else if(this.Style===2){var rtBG={Left:border.LeftEx,Top:border.BottomEx,Right:border.RightEx,Bottom:border.Bottom};rtBG.Width=rtBG.Right-rtBG.Left;rtBG.Height=rtBG.Bottom-rtBG.Top;top=rtBG.Top;}else{var rtBG={Left:border.LeftEx,Top:top,Right:border.RightEx,Bottom:bottom};rtBG.Width=rtBG.Right-rtBG.Left;rtBG.Height=rtBG.Bottom-rtBG.Top;}this.CalculateRowHeight(rtBG);this.DrawBG(rtBG);var itemHeight=this.RowHeight;var itemWidth=dataWidth+distanceWidth;if(itemHeight-this.ItemMargin.Top-this.ItemMargin.Bottom>0)itemHeight=itemHeight-this.ItemMargin.Top-this.ItemMargin.Bottom;if(itemWidth-this.ItemMargin.Left-this.ItemMargin.Right>0)itemWidth=itemWidth-this.ItemMargin.Left-this.ItemMargin.Right;var font=this.GetDynamicTextFont(itemHeight,itemWidth);this.TextFont=font;this.Canvas.font=this.TextFont;var bMinute=this.IsMinuteFrame();var cellWidth=1;if(bMinute){cellWidth=(border.Right-border.Left)/this.ChartFrame.XPointCount;if(cellWidth<1)cellWidth=1;}for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth){var kItem=this.Data.Data[i];if(!kItem)continue;if(bMinute){var x=this.ChartFrame.GetXFromIndex(j);var left=x-cellWidth/2;var right=x+cellWidth/2;}else{var left=xOffset;var right=xOffset+dataWidth+distanceWidth;if(right>chartright)break;var x=left+(right-left)/2;if(x>chartright)break;}var bDrawName=false;if(j==0&&this.RowNamePosition===1)bDrawName=true;if(bDrawName)this.DrawRowName(top,bottom,left,right);var key=this.BuildKey(kItem);if(!this.MapCache.has(key))continue;var mapItem=this.MapCache.get(key);if(!bDrawName)this.DrawRow(mapItem,top,bottom,left,right);//绘制一列
|
|
4370
4372
|
}if(this.RowNamePosition==3)this.DrawRightRowName(rtBG);this.DrawBorder(rtBG);};this.DrawRowName=function(top,bottom,left,right){if(!IFrameSplitOperator.IsNonEmptyArray(this.RowName))return;var x=left,y=top,width=right-left;var yOffset=3;if(this.ItemMargin.YOffset)yOffset=this.ItemMargin.YOffset;for(var i=0;i<this.RowName.length;++i){var item=this.RowName[i];var rtBG={Left:x,Top:y,Right:right,Height:this.RowHeight,Width:width};rtBG.Bottom=rtBG.Top+this.RowHeight;var yText=rtBG.Bottom-yOffset;if(item.Name&&rtBG.Width>10){this.Canvas.fillStyle=item.Color?item.Color:this.TextColor;this.Canvas.textBaseline='bottom';if(item.TextAlign=='right'){this.Canvas.textAlign='right';this.Canvas.fillText(item.Name,rtBG.Right-2,yText,width-4);}else if(item.TextAlign=='center'){this.Canvas.textAlign='center';this.Canvas.fillText(item.Name,rtBG.Left+rtBG.Width/2,yText,width-4);}else{this.Canvas.textAlign='left';this.Canvas.fillText(item.Name,rtBG.Left+2,yText,width-4);}}y+=this.RowHeight;}};//绘制右侧行名
|
|
4371
4373
|
this.DrawRightRowName=function(rtBG){var border=this.ChartFrame.GetBorder();var maxTextWidth=0;if(this.BGColor){if(this.Style===1){var height=this.RowCount*this.RowHeight;height=Math.min(rtBG.Height,height);var width=border.ChartWidth-rtBG.Right-2;for(var i=0;i<this.RowName.length;++i){var item=this.RowName[i];if(!item||!item.Name)continue;var textWidth=this.Canvas.measureText(item.Name).width;if(textWidth>maxTextWidth)maxTextWidth=textWidth;}if(maxTextWidth>0){maxTextWidth+=4;width=Math.min(width,maxTextWidth);}var rtRightBG={Left:rtBG.Right+1,Top:rtBG.Top+1,Width:width,Height:height};rtRightBG.Right=rtRightBG.Left+rtRightBG.Width;rtRightBG.Bottom=rtRightBG.Top+rtRightBG.Height;this.Canvas.fillStyle=this.BGColor;this.Canvas.fillRect(rtRightBG.Left,rtRightBG.Top,rtRightBG.Width,rtRightBG.Height);}else{var rtRightBG={Left:border.RightEx,Top:border.Top,Right:border.ChartWidth,Bottom:border.Bottom};rtRightBG.Width=rtRightBG.Right-rtRightBG.Left;rtRightBG.Height=rtRightBG.Bottom-rtRightBG.Top;this.Canvas.fillStyle=this.BGColor;this.Canvas.fillRect(rtRightBG.Left+1,rtRightBG.Top,rtRightBG.Width-2,rtRightBG.Height);}}var x=rtBG.Right,y=rtBG.Top;var yOffset=3;if(this.ItemMargin.YOffset)yOffset=this.ItemMargin.YOffset;for(var i=0;i<this.RowName.length;++i){var item=this.RowName[i];var rtBG={Left:x,Top:y,Right:border.ChartWidth,Height:this.RowHeight};rtBG.Bottom=rtBG.Top+this.RowHeight;rtBG.Width=rtBG.Right-rtBG.Left;var yText=rtBG.Bottom-yOffset;if(rtBG.Bottom>border.Bottom)break;if(item.Name&&rtBG.Width>10){if(item.BGColor){this.Canvas.fillStyle=item.BGColor;if(maxTextWidth>0)this.Canvas.fillRect(rtBG.Left,rtBG.Top,maxTextWidth,rtBG.Height);else this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}this.Canvas.fillStyle=item.Color?item.Color:this.TextColor;this.Canvas.textBaseline='bottom';this.Canvas.textAlign='left';this.Canvas.fillText(item.Name,rtBG.Left+2,yText);this.AryNameRect.push({Rect:rtBG,Item:item,Index:i});}y+=this.RowHeight;}};this.DrawRow=function(data,top,bottom,left,right){if(!IFrameSplitOperator.IsNonEmptyArray(data.Data))return;var x=left,y=top,width=right-left;var yOffset=3;if(this.ItemMargin.YOffset)yOffset=this.ItemMargin.YOffset;for(var i=0;i<data.Data.length;++i,y+=this.RowHeight){var item=data.Data[i];if(!item)continue;var rtBG={Left:x,Top:y,Right:right,Height:this.RowHeight,Width:width};rtBG.Bottom=rtBG.Top+this.RowHeight;if(rtBG.Bottom>bottom)break;if(IFrameSplitOperator.IsNonEmptyArray(item.AryText))//左右显示
|
|
4372
|
-
{var subCellWidth=rtBG.Width/item.AryText.length;var xCell=rtBG.Left;for(var j=0;j<item.AryText.length;++j){var subItem=item.AryText[j];var rtSubBG={Left:xCell,Top:rtBG.Top,Bottom:rtBG.Bottom,Width:subCellWidth,Height:rtBG.Height};rtSubBG.Right=rtSubBG.Left+rtSubBG.Width;if(subItem&&subItem.BGColor){this.Canvas.fillStyle=subItem.BGColor;this.Canvas.fillRect(rtSubBG.Left,rtSubBG.Top,rtSubBG.Width,rtSubBG.Height);}if(subItem&&subItem.Color&&subCellWidth>10){this.Canvas.fillStyle=subItem.Color;this.Canvas.textBaseline='bottom';var yText=rtSubBG.Bottom-yOffset;if(subItem.TextAlign=='right'){this.Canvas.textAlign='right';this.Canvas.fillText(subItem.Text,rtSubBG.Right-2,yText,width-4);}else if(subItem.TextAlign=='center'){this.Canvas.textAlign='center';this.Canvas.fillText(subItem.Text,rtSubBG.Left+rtSubBG.Width/2,yText,width-4);}else{this.Canvas.textAlign='left';this.Canvas.fillText(subItem.Text,rtSubBG.Left+2,yText,width-4);}}if
|
|
4374
|
+
{var subCellWidth=rtBG.Width/item.AryText.length;var xCell=rtBG.Left;for(var j=0;j<item.AryText.length;++j){var subItem=item.AryText[j];var rtSubBG={Left:xCell,Top:rtBG.Top,Bottom:rtBG.Bottom,Width:subCellWidth,Height:rtBG.Height};rtSubBG.Right=rtSubBG.Left+rtSubBG.Width;if(subItem&&subItem.BGColor){this.Canvas.fillStyle=subItem.BGColor;this.Canvas.fillRect(rtSubBG.Left,rtSubBG.Top,rtSubBG.Width,rtSubBG.Height);}if(subItem&&subItem.Color&&subCellWidth>10){this.Canvas.fillStyle=subItem.Color;this.Canvas.textBaseline='bottom';var yText=rtSubBG.Bottom-yOffset;if(subItem.TextAlign=='right'){this.Canvas.textAlign='right';this.Canvas.fillText(subItem.Text,rtSubBG.Right-2,yText,width-4);}else if(subItem.TextAlign=='center'){this.Canvas.textAlign='center';this.Canvas.fillText(subItem.Text,rtSubBG.Left+rtSubBG.Width/2,yText,width-4);}else{this.Canvas.textAlign='left';this.Canvas.fillText(subItem.Text,rtSubBG.Left+2,yText,width-4);}}//if (rtBG.Width>5)
|
|
4375
|
+
{this.AryCellRect.push({Item:{Cell:item,Colunm:data,RowIndex:i,SubCell:subItem,SubIndex:j,Tooltip:subItem.Tooltip,Type:2},Rect:rtSubBG});}xCell+=subCellWidth;}}else{if(item.BGColor){this.Canvas.fillStyle=item.BGColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}if(item.Text&&rtBG.Width>10){if(item.Color)this.Canvas.fillStyle=item.Color;else this.Canvas.fillStyle=this.TextColor;this.Canvas.textBaseline='bottom';var yText=rtBG.Bottom-yOffset;if(item.TextAlign=='right'){this.Canvas.textAlign='right';this.Canvas.fillText(item.Text,rtBG.Right-2,yText,width-4);}else if(item.TextAlign=='center'){this.Canvas.textAlign='center';this.Canvas.fillText(item.Text,rtBG.Left+rtBG.Width/2,yText,width-4);}else{this.Canvas.textAlign='left';this.Canvas.fillText(item.Text,rtBG.Left+2,yText,width-4);}}//if (rtBG.Width>5)
|
|
4376
|
+
{this.AryCellRect.push({Item:{Cell:item,Colunm:data,RowIndex:i,Tooltip:item.Tooltip,Type:1},Rect:rtBG});}}}};this.GetDynamicTextFont=function(cellHeight,width,fontOption){var fontSize=parseInt(cellHeight)-2;if(cellHeight<5)fontSize=parseInt(cellHeight);//高度太小了就不要上下间距了
|
|
4373
4377
|
if(fontSize>this.TextFontConfig.FontMaxSize)fontSize=this.TextFontConfig.FontMaxSize;else if(fontSize<=0)fontSize=1;var font=this.FormatFontString(fontSize,this.TextFontConfig.Family,fontOption);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.GetMaxMin=function(){return{Min:0,Max:this.RowCount};};this.GetTooltipData=function(x,y,tooltip){if(!this.IsShow)return false;for(var i=0;i<this.AryCellRect.length;++i){var item=this.AryCellRect[i];if(!item.Rect)continue;var rect=item.Rect;if(x>=rect.Left&&x<=rect.Right&&y>=rect.Top&&y<=rect.Bottom){var data=item.Item;JSConsole.Chart.Log('[ChartKLineTable::GetTooltipData] cell',item);tooltip.Data={Rect:item.Rect,Item:data};tooltip.ChartPaint=this;tooltip.Type=9;//ChartKLineTable
|
|
4374
4378
|
return true;}}return false;};}//表格
|
|
4375
4379
|
function ChartSimpleTable(){this.newMethod=IChartPainting;//派生
|
|
@@ -15768,7 +15772,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
15768
15772
|
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);};}/********************************************************************************
|
|
15769
15773
|
* 版本信息输出
|
|
15770
15774
|
*
|
|
15771
|
-
*/var HQCHART_VERSION="1.1.
|
|
15775
|
+
*/var HQCHART_VERSION="1.1.15363";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();//把给外界调用的方法暴露出来
|
|
15772
15776
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
15773
15777
|
// BaseIndex:BaseIndex,
|
|
15774
15778
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
package/src/jscommon/umychart.js
CHANGED
|
@@ -7671,6 +7671,23 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7671
7671
|
this.LastPoint.FrameID=frameID;
|
|
7672
7672
|
if (IFrameSplitOperator.IsNumber(frameID) && frameID>=0) //在K线内部移动,调整K线索引
|
|
7673
7673
|
this.CursorIndex=this.Frame.GetXData(x);
|
|
7674
|
+
|
|
7675
|
+
if (this.TryMouseMoveChartTooltipData)
|
|
7676
|
+
{
|
|
7677
|
+
//DrawDynamic:{ Enable, Option: }
|
|
7678
|
+
var data={ e:e, X:x, Y:y, Draw:false, DrawDynamic:null, PreventDefault:false, MouseStatus:null };
|
|
7679
|
+
this.TryMouseMoveChartTooltipData(data, this);
|
|
7680
|
+
|
|
7681
|
+
if (data.MouseStatus) mouseStatus=data.MouseStatus;
|
|
7682
|
+
|
|
7683
|
+
if (data.PreventDefault)
|
|
7684
|
+
{
|
|
7685
|
+
if (data.Draw) this.Draw();
|
|
7686
|
+
if (data.DrawDynamic && data.DrawDynamic.Enable) this.DrawDynamicInfo(data.DrawDynamic.Option);
|
|
7687
|
+
this.SetCursor(mouseStatus);
|
|
7688
|
+
return;
|
|
7689
|
+
}
|
|
7690
|
+
}
|
|
7674
7691
|
|
|
7675
7692
|
|
|
7676
7693
|
if (this.EnableBorderDrag && this.Frame && !this.CurrentChartDrawPicture)
|
|
@@ -34475,6 +34492,7 @@ function ChartKLineTable()
|
|
|
34475
34492
|
this.RowNamePosition=1; //0=不显示 1=左边内部 2=左边外部 3=右边外部
|
|
34476
34493
|
this.BGColor; //背景色
|
|
34477
34494
|
this.BorderColor; //分割线颜色
|
|
34495
|
+
this.AryBorderColor;//分割线颜色
|
|
34478
34496
|
|
|
34479
34497
|
this.RowCount=5; //行数
|
|
34480
34498
|
this.RowHeight=10; //行高
|
|
@@ -34523,6 +34541,8 @@ function ChartKLineTable()
|
|
|
34523
34541
|
}
|
|
34524
34542
|
|
|
34525
34543
|
if (IFrameSplitOperator.IsPlusNumber(option.CellWidth)) this.CellWidth=option.CellWidth;
|
|
34544
|
+
|
|
34545
|
+
if (IFrameSplitOperator.IsNonEmptyArray(option.AryBorderColor)) this.AryBorderColor=option.AryBorderColor.slice();
|
|
34526
34546
|
}
|
|
34527
34547
|
|
|
34528
34548
|
this.BuildCacheData=function()
|
|
@@ -34564,10 +34584,14 @@ function ChartKLineTable()
|
|
|
34564
34584
|
var lineCount=30;
|
|
34565
34585
|
if (this.Style===1 || this.Style===2) lineCount=this.RowCount+1;
|
|
34566
34586
|
|
|
34567
|
-
this.Canvas.strokeStyle=this.BorderColor;
|
|
34568
34587
|
var yLine=rtBG.Top;
|
|
34569
34588
|
for(var i=0;i<lineCount;++i)
|
|
34570
34589
|
{
|
|
34590
|
+
var borderColor=this.BorderColor;
|
|
34591
|
+
if (this.AryBorderColor && this.AryBorderColor[i])
|
|
34592
|
+
borderColor=this.AryBorderColor[i];
|
|
34593
|
+
|
|
34594
|
+
this.Canvas.strokeStyle=borderColor
|
|
34571
34595
|
this.Canvas.beginPath();
|
|
34572
34596
|
this.Canvas.moveTo(rtBG.Left,ToFixedPoint(yLine));
|
|
34573
34597
|
this.Canvas.lineTo(rtBG.Right,ToFixedPoint(yLine));
|
|
@@ -34872,7 +34896,7 @@ function ChartKLineTable()
|
|
|
34872
34896
|
}
|
|
34873
34897
|
}
|
|
34874
34898
|
|
|
34875
|
-
if (rtBG.Width>5)
|
|
34899
|
+
//if (rtBG.Width>5)
|
|
34876
34900
|
{
|
|
34877
34901
|
this.AryCellRect.push({ Item:{ Cell:item, Colunm:data, RowIndex:i, SubCell:subItem, SubIndex:j, Tooltip:subItem.Tooltip, Type:2 }, Rect:rtSubBG });
|
|
34878
34902
|
}
|
|
@@ -34913,7 +34937,7 @@ function ChartKLineTable()
|
|
|
34913
34937
|
}
|
|
34914
34938
|
}
|
|
34915
34939
|
|
|
34916
|
-
if (rtBG.Width>5)
|
|
34940
|
+
//if (rtBG.Width>5)
|
|
34917
34941
|
{
|
|
34918
34942
|
this.AryCellRect.push({ Item:{ Cell:item, Colunm:data, RowIndex:i, Tooltip:item.Tooltip, Type:1 }, Rect:rtBG });
|
|
34919
34943
|
}
|
|
@@ -11767,6 +11767,23 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
11767
11767
|
this.LastPoint.FrameID=frameID;
|
|
11768
11768
|
if (IFrameSplitOperator.IsNumber(frameID) && frameID>=0) //在K线内部移动,调整K线索引
|
|
11769
11769
|
this.CursorIndex=this.Frame.GetXData(x);
|
|
11770
|
+
|
|
11771
|
+
if (this.TryMouseMoveChartTooltipData)
|
|
11772
|
+
{
|
|
11773
|
+
//DrawDynamic:{ Enable, Option: }
|
|
11774
|
+
var data={ e:e, X:x, Y:y, Draw:false, DrawDynamic:null, PreventDefault:false, MouseStatus:null };
|
|
11775
|
+
this.TryMouseMoveChartTooltipData(data, this);
|
|
11776
|
+
|
|
11777
|
+
if (data.MouseStatus) mouseStatus=data.MouseStatus;
|
|
11778
|
+
|
|
11779
|
+
if (data.PreventDefault)
|
|
11780
|
+
{
|
|
11781
|
+
if (data.Draw) this.Draw();
|
|
11782
|
+
if (data.DrawDynamic && data.DrawDynamic.Enable) this.DrawDynamicInfo(data.DrawDynamic.Option);
|
|
11783
|
+
this.SetCursor(mouseStatus);
|
|
11784
|
+
return;
|
|
11785
|
+
}
|
|
11786
|
+
}
|
|
11770
11787
|
|
|
11771
11788
|
|
|
11772
11789
|
if (this.EnableBorderDrag && this.Frame && !this.CurrentChartDrawPicture)
|
|
@@ -38571,6 +38588,7 @@ function ChartKLineTable()
|
|
|
38571
38588
|
this.RowNamePosition=1; //0=不显示 1=左边内部 2=左边外部 3=右边外部
|
|
38572
38589
|
this.BGColor; //背景色
|
|
38573
38590
|
this.BorderColor; //分割线颜色
|
|
38591
|
+
this.AryBorderColor;//分割线颜色
|
|
38574
38592
|
|
|
38575
38593
|
this.RowCount=5; //行数
|
|
38576
38594
|
this.RowHeight=10; //行高
|
|
@@ -38619,6 +38637,8 @@ function ChartKLineTable()
|
|
|
38619
38637
|
}
|
|
38620
38638
|
|
|
38621
38639
|
if (IFrameSplitOperator.IsPlusNumber(option.CellWidth)) this.CellWidth=option.CellWidth;
|
|
38640
|
+
|
|
38641
|
+
if (IFrameSplitOperator.IsNonEmptyArray(option.AryBorderColor)) this.AryBorderColor=option.AryBorderColor.slice();
|
|
38622
38642
|
}
|
|
38623
38643
|
|
|
38624
38644
|
this.BuildCacheData=function()
|
|
@@ -38660,10 +38680,14 @@ function ChartKLineTable()
|
|
|
38660
38680
|
var lineCount=30;
|
|
38661
38681
|
if (this.Style===1 || this.Style===2) lineCount=this.RowCount+1;
|
|
38662
38682
|
|
|
38663
|
-
this.Canvas.strokeStyle=this.BorderColor;
|
|
38664
38683
|
var yLine=rtBG.Top;
|
|
38665
38684
|
for(var i=0;i<lineCount;++i)
|
|
38666
38685
|
{
|
|
38686
|
+
var borderColor=this.BorderColor;
|
|
38687
|
+
if (this.AryBorderColor && this.AryBorderColor[i])
|
|
38688
|
+
borderColor=this.AryBorderColor[i];
|
|
38689
|
+
|
|
38690
|
+
this.Canvas.strokeStyle=borderColor
|
|
38667
38691
|
this.Canvas.beginPath();
|
|
38668
38692
|
this.Canvas.moveTo(rtBG.Left,ToFixedPoint(yLine));
|
|
38669
38693
|
this.Canvas.lineTo(rtBG.Right,ToFixedPoint(yLine));
|
|
@@ -38968,7 +38992,7 @@ function ChartKLineTable()
|
|
|
38968
38992
|
}
|
|
38969
38993
|
}
|
|
38970
38994
|
|
|
38971
|
-
if (rtBG.Width>5)
|
|
38995
|
+
//if (rtBG.Width>5)
|
|
38972
38996
|
{
|
|
38973
38997
|
this.AryCellRect.push({ Item:{ Cell:item, Colunm:data, RowIndex:i, SubCell:subItem, SubIndex:j, Tooltip:subItem.Tooltip, Type:2 }, Rect:rtSubBG });
|
|
38974
38998
|
}
|
|
@@ -39009,7 +39033,7 @@ function ChartKLineTable()
|
|
|
39009
39033
|
}
|
|
39010
39034
|
}
|
|
39011
39035
|
|
|
39012
|
-
if (rtBG.Width>5)
|
|
39036
|
+
//if (rtBG.Width>5)
|
|
39013
39037
|
{
|
|
39014
39038
|
this.AryCellRect.push({ Item:{ Cell:item, Colunm:data, RowIndex:i, Tooltip:item.Tooltip, Type:1 }, Rect:rtBG });
|
|
39015
39039
|
}
|
|
@@ -155435,7 +155459,7 @@ function ScrollBarBGChart()
|
|
|
155435
155459
|
|
|
155436
155460
|
|
|
155437
155461
|
|
|
155438
|
-
var HQCHART_VERSION="1.1.
|
|
155462
|
+
var HQCHART_VERSION="1.1.15363";
|
|
155439
155463
|
|
|
155440
155464
|
function PrintHQChartVersion()
|
|
155441
155465
|
{
|
|
@@ -11811,6 +11811,23 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
11811
11811
|
this.LastPoint.FrameID=frameID;
|
|
11812
11812
|
if (IFrameSplitOperator.IsNumber(frameID) && frameID>=0) //在K线内部移动,调整K线索引
|
|
11813
11813
|
this.CursorIndex=this.Frame.GetXData(x);
|
|
11814
|
+
|
|
11815
|
+
if (this.TryMouseMoveChartTooltipData)
|
|
11816
|
+
{
|
|
11817
|
+
//DrawDynamic:{ Enable, Option: }
|
|
11818
|
+
var data={ e:e, X:x, Y:y, Draw:false, DrawDynamic:null, PreventDefault:false, MouseStatus:null };
|
|
11819
|
+
this.TryMouseMoveChartTooltipData(data, this);
|
|
11820
|
+
|
|
11821
|
+
if (data.MouseStatus) mouseStatus=data.MouseStatus;
|
|
11822
|
+
|
|
11823
|
+
if (data.PreventDefault)
|
|
11824
|
+
{
|
|
11825
|
+
if (data.Draw) this.Draw();
|
|
11826
|
+
if (data.DrawDynamic && data.DrawDynamic.Enable) this.DrawDynamicInfo(data.DrawDynamic.Option);
|
|
11827
|
+
this.SetCursor(mouseStatus);
|
|
11828
|
+
return;
|
|
11829
|
+
}
|
|
11830
|
+
}
|
|
11814
11831
|
|
|
11815
11832
|
|
|
11816
11833
|
if (this.EnableBorderDrag && this.Frame && !this.CurrentChartDrawPicture)
|
|
@@ -38615,6 +38632,7 @@ function ChartKLineTable()
|
|
|
38615
38632
|
this.RowNamePosition=1; //0=不显示 1=左边内部 2=左边外部 3=右边外部
|
|
38616
38633
|
this.BGColor; //背景色
|
|
38617
38634
|
this.BorderColor; //分割线颜色
|
|
38635
|
+
this.AryBorderColor;//分割线颜色
|
|
38618
38636
|
|
|
38619
38637
|
this.RowCount=5; //行数
|
|
38620
38638
|
this.RowHeight=10; //行高
|
|
@@ -38663,6 +38681,8 @@ function ChartKLineTable()
|
|
|
38663
38681
|
}
|
|
38664
38682
|
|
|
38665
38683
|
if (IFrameSplitOperator.IsPlusNumber(option.CellWidth)) this.CellWidth=option.CellWidth;
|
|
38684
|
+
|
|
38685
|
+
if (IFrameSplitOperator.IsNonEmptyArray(option.AryBorderColor)) this.AryBorderColor=option.AryBorderColor.slice();
|
|
38666
38686
|
}
|
|
38667
38687
|
|
|
38668
38688
|
this.BuildCacheData=function()
|
|
@@ -38704,10 +38724,14 @@ function ChartKLineTable()
|
|
|
38704
38724
|
var lineCount=30;
|
|
38705
38725
|
if (this.Style===1 || this.Style===2) lineCount=this.RowCount+1;
|
|
38706
38726
|
|
|
38707
|
-
this.Canvas.strokeStyle=this.BorderColor;
|
|
38708
38727
|
var yLine=rtBG.Top;
|
|
38709
38728
|
for(var i=0;i<lineCount;++i)
|
|
38710
38729
|
{
|
|
38730
|
+
var borderColor=this.BorderColor;
|
|
38731
|
+
if (this.AryBorderColor && this.AryBorderColor[i])
|
|
38732
|
+
borderColor=this.AryBorderColor[i];
|
|
38733
|
+
|
|
38734
|
+
this.Canvas.strokeStyle=borderColor
|
|
38711
38735
|
this.Canvas.beginPath();
|
|
38712
38736
|
this.Canvas.moveTo(rtBG.Left,ToFixedPoint(yLine));
|
|
38713
38737
|
this.Canvas.lineTo(rtBG.Right,ToFixedPoint(yLine));
|
|
@@ -39012,7 +39036,7 @@ function ChartKLineTable()
|
|
|
39012
39036
|
}
|
|
39013
39037
|
}
|
|
39014
39038
|
|
|
39015
|
-
if (rtBG.Width>5)
|
|
39039
|
+
//if (rtBG.Width>5)
|
|
39016
39040
|
{
|
|
39017
39041
|
this.AryCellRect.push({ Item:{ Cell:item, Colunm:data, RowIndex:i, SubCell:subItem, SubIndex:j, Tooltip:subItem.Tooltip, Type:2 }, Rect:rtSubBG });
|
|
39018
39042
|
}
|
|
@@ -39053,7 +39077,7 @@ function ChartKLineTable()
|
|
|
39053
39077
|
}
|
|
39054
39078
|
}
|
|
39055
39079
|
|
|
39056
|
-
if (rtBG.Width>5)
|
|
39080
|
+
//if (rtBG.Width>5)
|
|
39057
39081
|
{
|
|
39058
39082
|
this.AryCellRect.push({ Item:{ Cell:item, Colunm:data, RowIndex:i, Tooltip:item.Tooltip, Type:1 }, Rect:rtBG });
|
|
39059
39083
|
}
|
|
@@ -167494,7 +167518,7 @@ function HQChartScriptWorker()
|
|
|
167494
167518
|
|
|
167495
167519
|
|
|
167496
167520
|
|
|
167497
|
-
var HQCHART_VERSION="1.1.
|
|
167521
|
+
var HQCHART_VERSION="1.1.15363";
|
|
167498
167522
|
|
|
167499
167523
|
function PrintHQChartVersion()
|
|
167500
167524
|
{
|