hqchart 1.1.14630 → 1.1.14632
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
|
@@ -4073,7 +4073,7 @@ this.DrawBG=function(rtBG){if(!this.BGColor)return;if(this.BGColor){this.Canvas.
|
|
|
4073
4073
|
this.CalculateRowHeight=function(rtBG){if(this.RowHeightType==1){this.RowHeight=this.TextFontConfig.FontMaxSize+this.ItemMergin.Top+this.ItemMergin.Bottom;}else{this.RowHeight=rtBG.Height/this.RowCount;}};this.Draw=function(){if(!this.IsShow||this.ChartFrame.IsMinSize||!this.IsVisible)return;if(this.IsShowIndexTitleOnly())return;if(this.IsHideScriptIndex())return;if(!IFrameSplitOperator.IsNonEmptyArray(this.AryTableData))return;if(!this.MapCache||this.MapCache.size<=0)return;if(!this.Data||!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return;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;//绘制背景
|
|
4074
4074
|
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.DrawBG(rtBG);this.CalculateRowHeight(rtBG);var itemHeight=this.RowHeight;var itemWidth=dataWidth+distanceWidth;if(itemHeight-this.ItemMergin.Top-this.ItemMergin.Bottom>0)itemHeight=itemHeight-this.ItemMergin.Top-this.ItemMergin.Bottom;if(itemWidth-this.ItemMergin.Left-this.ItemMergin.Right>0)itemWidth=itemWidth-this.ItemMergin.Left-this.ItemMergin.Right;var font=this.GetDynamicTextFont(itemHeight,itemWidth);this.TextFont=font;this.Canvas.font=this.TextFont;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;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);//绘制一列
|
|
4075
4075
|
}if(this.RowNamePosition==3)this.DrawRightRowName();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.ItemMergin.YOffset)yOffset=this.ItemMergin.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;}};//绘制右侧行名
|
|
4076
|
-
this.DrawRightRowName=function(){var border=this.ChartFrame.GetBorder();if(this.BGColor){var rtRightBG={Left:border.RightEx,Top:border.TopTitle,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-1,rtRightBG.Height);}var x=border.RightEx,y=border.TopTitle;var yOffset=3;if(this.ItemMergin.YOffset)yOffset=this.ItemMergin.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(item.Name&&rtBG.Width>10){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);}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.ItemMergin.YOffset)yOffset=this.ItemMergin.YOffset;for(var i=0;i<data.Data.length;++i){var item=data.Data[i];var rtBG={Left:x,Top:y,Right:right,Height:this.RowHeight,Width:width};rtBG.Bottom=rtBG.Top+this.RowHeight;if(IFrameSplitOperator.IsNonEmptyArray(item.AryText))//左右显示
|
|
4076
|
+
this.DrawRightRowName=function(){var border=this.ChartFrame.GetBorder();if(this.BGColor){var rtRightBG={Left:border.RightEx,Top:border.TopTitle,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-1,rtRightBG.Height);}var x=border.RightEx,y=border.TopTitle;var yOffset=3;if(this.ItemMergin.YOffset)yOffset=this.ItemMergin.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){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);}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.ItemMergin.YOffset)yOffset=this.ItemMergin.YOffset;for(var i=0;i<data.Data.length;++i){var item=data.Data[i];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))//左右显示
|
|
4077
4077
|
{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);}}xCell+=subCellWidth;}}else{if(item&&item.BGColor){this.Canvas.fillStyle=item.BGColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}if(item&&item.Color&&rtBG.Width>10){this.Canvas.fillStyle=item.Color;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);}}}y+=this.RowHeight;}};this.GetDynamicTextFont=function(cellHeight,width,fontOption){var fontSize=parseInt(cellHeight)-2;if(cellHeight<5)fontSize=parseInt(cellHeight);//高度太小了就不要上下间距了
|
|
4078
4078
|
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};};}//表格
|
|
4079
4079
|
function ChartSimpleTable(){this.newMethod=IChartPainting;//派生
|
|
@@ -14885,7 +14885,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
14885
14885
|
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);};}/********************************************************************************
|
|
14886
14886
|
* 版本信息输出
|
|
14887
14887
|
*
|
|
14888
|
-
*/var HQCHART_VERSION="1.1.
|
|
14888
|
+
*/var HQCHART_VERSION="1.1.14631";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();//把给外界调用的方法暴露出来
|
|
14889
14889
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
14890
14890
|
// BaseIndex:BaseIndex,
|
|
14891
14891
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
package/src/jscommon/umychart.js
CHANGED
|
@@ -32804,6 +32804,8 @@ function ChartKLineTable()
|
|
|
32804
32804
|
rtBG.Width=rtBG.Right-rtBG.Left;
|
|
32805
32805
|
var yText=rtBG.Bottom-yOffset;
|
|
32806
32806
|
|
|
32807
|
+
if (rtBG.Bottom>border.Bottom) break;
|
|
32808
|
+
|
|
32807
32809
|
if (item.Name && rtBG.Width>10)
|
|
32808
32810
|
{
|
|
32809
32811
|
this.Canvas.fillStyle=item.Color?item.Color:this.TextColor;
|
|
@@ -32830,6 +32832,8 @@ function ChartKLineTable()
|
|
|
32830
32832
|
var rtBG={Left:x, Top:y, Right:right, Height:this.RowHeight, Width:width };
|
|
32831
32833
|
rtBG.Bottom=rtBG.Top+this.RowHeight;
|
|
32832
32834
|
|
|
32835
|
+
if (rtBG.Bottom>bottom) break;
|
|
32836
|
+
|
|
32833
32837
|
if (IFrameSplitOperator.IsNonEmptyArray(item.AryText)) //左右显示
|
|
32834
32838
|
{
|
|
32835
32839
|
var subCellWidth=rtBG.Width/item.AryText.length;
|
|
@@ -36900,6 +36900,8 @@ function ChartKLineTable()
|
|
|
36900
36900
|
rtBG.Width=rtBG.Right-rtBG.Left;
|
|
36901
36901
|
var yText=rtBG.Bottom-yOffset;
|
|
36902
36902
|
|
|
36903
|
+
if (rtBG.Bottom>border.Bottom) break;
|
|
36904
|
+
|
|
36903
36905
|
if (item.Name && rtBG.Width>10)
|
|
36904
36906
|
{
|
|
36905
36907
|
this.Canvas.fillStyle=item.Color?item.Color:this.TextColor;
|
|
@@ -36926,6 +36928,8 @@ function ChartKLineTable()
|
|
|
36926
36928
|
var rtBG={Left:x, Top:y, Right:right, Height:this.RowHeight, Width:width };
|
|
36927
36929
|
rtBG.Bottom=rtBG.Top+this.RowHeight;
|
|
36928
36930
|
|
|
36931
|
+
if (rtBG.Bottom>bottom) break;
|
|
36932
|
+
|
|
36929
36933
|
if (IFrameSplitOperator.IsNonEmptyArray(item.AryText)) //左右显示
|
|
36930
36934
|
{
|
|
36931
36935
|
var subCellWidth=rtBG.Width/item.AryText.length;
|
|
@@ -146627,7 +146631,7 @@ function ScrollBarBGChart()
|
|
|
146627
146631
|
|
|
146628
146632
|
|
|
146629
146633
|
|
|
146630
|
-
var HQCHART_VERSION="1.1.
|
|
146634
|
+
var HQCHART_VERSION="1.1.14631";
|
|
146631
146635
|
|
|
146632
146636
|
function PrintHQChartVersion()
|
|
146633
146637
|
{
|
|
@@ -36944,6 +36944,8 @@ function ChartKLineTable()
|
|
|
36944
36944
|
rtBG.Width=rtBG.Right-rtBG.Left;
|
|
36945
36945
|
var yText=rtBG.Bottom-yOffset;
|
|
36946
36946
|
|
|
36947
|
+
if (rtBG.Bottom>border.Bottom) break;
|
|
36948
|
+
|
|
36947
36949
|
if (item.Name && rtBG.Width>10)
|
|
36948
36950
|
{
|
|
36949
36951
|
this.Canvas.fillStyle=item.Color?item.Color:this.TextColor;
|
|
@@ -36970,6 +36972,8 @@ function ChartKLineTable()
|
|
|
36970
36972
|
var rtBG={Left:x, Top:y, Right:right, Height:this.RowHeight, Width:width };
|
|
36971
36973
|
rtBG.Bottom=rtBG.Top+this.RowHeight;
|
|
36972
36974
|
|
|
36975
|
+
if (rtBG.Bottom>bottom) break;
|
|
36976
|
+
|
|
36973
36977
|
if (IFrameSplitOperator.IsNonEmptyArray(item.AryText)) //左右显示
|
|
36974
36978
|
{
|
|
36975
36979
|
var subCellWidth=rtBG.Width/item.AryText.length;
|
|
@@ -157339,7 +157343,7 @@ function HQChartScriptWorker()
|
|
|
157339
157343
|
|
|
157340
157344
|
|
|
157341
157345
|
|
|
157342
|
-
var HQCHART_VERSION="1.1.
|
|
157346
|
+
var HQCHART_VERSION="1.1.14631";
|
|
157343
157347
|
|
|
157344
157348
|
function PrintHQChartVersion()
|
|
157345
157349
|
{
|