hqchart 1.1.12560 → 1.1.12565
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
|
@@ -2436,8 +2436,9 @@ this.GetXData=function(x,isLimit){var distanceWidth=this.DistanceWidth;var dataW
|
|
|
2436
2436
|
return index;}};//计算数据宽度
|
|
2437
2437
|
this.CalculateDataWidth=function(){if(this.XPointCount<2)return;//JSConsole.Chart.Log(`[KLineFrame::CalculateDataWidth] ZoomIndex=${this.ZoomIndex}, XPointCount=${this.XPointCount}, DataWidth=${this.DataWidth}, DistanceWidth=${this.DistanceWidth}`);
|
|
2438
2438
|
var width=this.GetFrameWidth()-g_JSChartResource.FrameMargin;if(this.ZoomIndex>=0&&this.LastCalculateStatus.Width==width&&this.LastCalculateStatus.XPointCount==this.XPointCount)//宽度没变 尝试使用原来的柱子宽度
|
|
2439
|
-
{var caclWidth=this.DistanceWidth/2+g_JSChartResource.FrameLeftMargin+(this.DataWidth+this.DistanceWidth)*(this.XPointCount-1);var caclWidth2=(this.DataWidth+this.DistanceWidth)*this.XPointCount;if(
|
|
2440
|
-
return;}
|
|
2439
|
+
{var caclWidth=this.DistanceWidth/2+g_JSChartResource.FrameLeftMargin+(this.DataWidth+this.DistanceWidth)*(this.XPointCount-1);var caclWidth2=(this.DataWidth+this.DistanceWidth)*this.XPointCount;if(this.DataWidth<2){if(caclWidth2<=width)//当前的柱子宽度够用 就不调整了
|
|
2440
|
+
return;}else{if(caclWidth<=width)//当前的柱子宽度够用 就不调整了
|
|
2441
|
+
return;}}this.LastCalculateStatus.Width=width;this.LastCalculateStatus.XPointCount=this.XPointCount;for(var i=0;i<ZOOM_SEED.length;++i){if((ZOOM_SEED[i][0]+ZOOM_SEED[i][1])*this.XPointCount<width){this.ZoomIndex=i;this.DataWidth=ZOOM_SEED[i][0];this.DistanceWidth=ZOOM_SEED[i][1];this.TrimKLineDataWidth(width);JSConsole.Chart.Log('[KLineFrame::CalculateDataWidth] ZOOM_SEED, DataWidth, DistanceWidth, XPointCount',ZOOM_SEED[this.ZoomIndex],this.DataWidth,this.DistanceWidth,this.XPointCount);return;}}//太多了 就平均分了
|
|
2441
2442
|
this.ZoomIndex=ZOOM_SEED.length-1;this.DataWidth=width/this.XPointCount;this.DistanceWidth=0;};this.OnSize=function(obj){var width=this.GetFrameWidth()-g_JSChartResource.FrameMargin;var xPointCount=0;var y=this.DistanceWidth/2+g_JSChartResource.FrameLeftMargin+(this.DataWidth+this.DistanceWidth);for(;y<width;y+=this.DataWidth+this.DistanceWidth,++xPointCount){}obj.CurCount=this.XPointCount;obj.CalcCount=xPointCount;obj.DataWidth=this.DataWidth;obj.DistanceWidth=this.DistanceWidth;obj.Changed=false;this.LastCalculateStatus.Width=width;if(obj.CurCount==obj.CalcCount)return obj;this.XPointCount=xPointCount;this.LastCalculateStatus.XPointCount=this.XPointCount;if(this.Data){this.Data.DataOffset+=obj.CurCount-obj.CalcCount;if(this.Data.DataOffset<0)this.Data.DataOffset=0;obj.Changed=true;}return obj;};this.SetDataWidth=function(dataWidth){var zoomIndex=ZOOM_SEED.length-1;for(var i in ZOOM_SEED){var item=ZOOM_SEED[i];if(item[0]<=dataWidth){zoomIndex=parseInt(i)-1;break;}}this.ZoomIndex=zoomIndex;this.DataWidth=ZOOM_SEED[this.ZoomIndex][0];this.DistanceWidth=ZOOM_SEED[this.ZoomIndex][1];var width=this.GetFrameWidth()-g_JSChartResource.FrameMargin;var xPointCount=0;var y=this.DistanceWidth/2+g_JSChartResource.FrameLeftMargin+(this.DataWidth+this.DistanceWidth);for(;y<=width;y+=this.DataWidth+this.DistanceWidth,++xPointCount){}this.XPointCount=xPointCount;this.LastCalculateStatus.XPointCount=this.XPointCount;this.LastCalculateStatus.Width=width;var obj={XPointCount:this.XPointCount,DataWidth:this.DataWidth,DistanceWidth:this.DistanceWidth};return obj;};this.TrimKLineDataWidth=function(width){var dataWidth=ZOOM_SEED[this.ZoomIndex][0];var distanceWidth=ZOOM_SEED[this.ZoomIndex][1];if(dataWidth==1&&distanceWidth==0){this.DataWidth=width/this.XPointCount;return;}while(true){if((this.DistanceWidth+this.DataWidth)*this.XPointCount+this.DistanceWidth>width){this.DistanceWidth-=0.01;break;}this.DistanceWidth+=0.01;}};//当前坐标信息 是否覆盖最大 最小值输出
|
|
2442
2443
|
this.IsOverlayMaxMin=function(obj){if(!this.ChartKLine)return false;if(!this.ChartKLine.Max||!this.ChartKLine.Min)return false;var textWidth=this.Canvas.measureText(obj.Text.Value).width+4;//刻度文字宽度
|
|
2443
2444
|
if(obj.Text.TextAlign==='right')obj.X-=textWidth;var max=this.ChartKLine.Max,min=this.ChartKLine.Min;var isOverlayMax=false,isOverlayMin=false;var textHeight=20;//字体高度
|
|
@@ -12656,7 +12657,7 @@ function HQChartScriptWorker(){this.Create=function(){var _this60=this;addEventL
|
|
|
12656
12657
|
hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,Stock:{Symbol:message.Symbol},Request:{MaxDataCount:500,MaxMinuteDayCount:5},Period:message.Period,Right:message.Right,Data:hisData};if(IFrameSplitOperator.IsNumber(message.HQDataType))stockObj.HQDataType=message.HQDataType;indexConsole.ExecuteScript(stockObj);};this.OnRecvMessage=function(message){var data=message.data;if(!data)return;if(data.ID==JSCHART_WORKER_MESSAGE_ID.EXECUTE_SCRIPT){if(!IFrameSplitOperator.IsNonEmptyArray(data.AryIndex))return;for(var i=0;i<data.AryIndex.length;++i){var item=data.AryIndex[i];this.ExecuteScript(item,data);}}};this.OnExecuteFinish=function(data,indexInfo,jsExectute){var message={Data:data,IndexInfo:indexInfo,ID:JSCHART_WORKER_MESSAGE_ID.FINISH_EXECUTE_SCRIPT};postMessage(message);};this.OnExecuteError=function(error,indexInfo){var message={IndexInfo:indexInfo,ID:JSCHART_WORKER_MESSAGE_ID.ERROR_EXECUTE_SCRIPT,Error:error};postMessage(message);};}/********************************************************************************
|
|
12657
12658
|
* 版本信息输出
|
|
12658
12659
|
*
|
|
12659
|
-
*/var HQCHART_VERSION="1.1.
|
|
12660
|
+
*/var HQCHART_VERSION="1.1.12564";function PrintHQChartVersion(){var log='*************************************************************************************************************\n*\n* HQChart Ver: '+HQCHART_VERSION+' \n* \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n*************************************************************************************************************\n';console.log(log);}PrintHQChartVersion();//把给外界调用的方法暴露出来
|
|
12660
12661
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
12661
12662
|
// BaseIndex:BaseIndex,
|
|
12662
12663
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
package/src/jscommon/umychart.js
CHANGED
|
@@ -13626,8 +13626,16 @@ function KLineFrame()
|
|
|
13626
13626
|
{
|
|
13627
13627
|
var caclWidth=(this.DistanceWidth/2+g_JSChartResource.FrameLeftMargin)+(this.DataWidth + this.DistanceWidth)*(this.XPointCount-1);
|
|
13628
13628
|
var caclWidth2=(this.DataWidth + this.DistanceWidth) * this.XPointCount;
|
|
13629
|
-
if (
|
|
13630
|
-
|
|
13629
|
+
if (this.DataWidth<2)
|
|
13630
|
+
{
|
|
13631
|
+
if (caclWidth2<= width) //当前的柱子宽度够用 就不调整了
|
|
13632
|
+
return;
|
|
13633
|
+
}
|
|
13634
|
+
else
|
|
13635
|
+
{
|
|
13636
|
+
if (caclWidth<= width) //当前的柱子宽度够用 就不调整了
|
|
13637
|
+
return;
|
|
13638
|
+
}
|
|
13631
13639
|
}
|
|
13632
13640
|
|
|
13633
13641
|
this.LastCalculateStatus.Width=width;
|
|
@@ -17706,8 +17706,16 @@ function KLineFrame()
|
|
|
17706
17706
|
{
|
|
17707
17707
|
var caclWidth=(this.DistanceWidth/2+g_JSChartResource.FrameLeftMargin)+(this.DataWidth + this.DistanceWidth)*(this.XPointCount-1);
|
|
17708
17708
|
var caclWidth2=(this.DataWidth + this.DistanceWidth) * this.XPointCount;
|
|
17709
|
-
if (
|
|
17710
|
-
|
|
17709
|
+
if (this.DataWidth<2)
|
|
17710
|
+
{
|
|
17711
|
+
if (caclWidth2<= width) //当前的柱子宽度够用 就不调整了
|
|
17712
|
+
return;
|
|
17713
|
+
}
|
|
17714
|
+
else
|
|
17715
|
+
{
|
|
17716
|
+
if (caclWidth<= width) //当前的柱子宽度够用 就不调整了
|
|
17717
|
+
return;
|
|
17718
|
+
}
|
|
17711
17719
|
}
|
|
17712
17720
|
|
|
17713
17721
|
this.LastCalculateStatus.Width=width;
|
|
@@ -129441,7 +129449,7 @@ function ScrollBarBGChart()
|
|
|
129441
129449
|
|
|
129442
129450
|
|
|
129443
129451
|
|
|
129444
|
-
var HQCHART_VERSION="1.1.
|
|
129452
|
+
var HQCHART_VERSION="1.1.12564";
|
|
129445
129453
|
|
|
129446
129454
|
function PrintHQChartVersion()
|
|
129447
129455
|
{
|
|
@@ -17750,8 +17750,16 @@ function KLineFrame()
|
|
|
17750
17750
|
{
|
|
17751
17751
|
var caclWidth=(this.DistanceWidth/2+g_JSChartResource.FrameLeftMargin)+(this.DataWidth + this.DistanceWidth)*(this.XPointCount-1);
|
|
17752
17752
|
var caclWidth2=(this.DataWidth + this.DistanceWidth) * this.XPointCount;
|
|
17753
|
-
if (
|
|
17754
|
-
|
|
17753
|
+
if (this.DataWidth<2)
|
|
17754
|
+
{
|
|
17755
|
+
if (caclWidth2<= width) //当前的柱子宽度够用 就不调整了
|
|
17756
|
+
return;
|
|
17757
|
+
}
|
|
17758
|
+
else
|
|
17759
|
+
{
|
|
17760
|
+
if (caclWidth<= width) //当前的柱子宽度够用 就不调整了
|
|
17761
|
+
return;
|
|
17762
|
+
}
|
|
17755
17763
|
}
|
|
17756
17764
|
|
|
17757
17765
|
this.LastCalculateStatus.Width=width;
|
|
@@ -129594,7 +129602,7 @@ function HQChartScriptWorker()
|
|
|
129594
129602
|
|
|
129595
129603
|
|
|
129596
129604
|
|
|
129597
|
-
var HQCHART_VERSION="1.1.
|
|
129605
|
+
var HQCHART_VERSION="1.1.12564";
|
|
129598
129606
|
|
|
129599
129607
|
function PrintHQChartVersion()
|
|
129600
129608
|
{
|