hqchart 1.1.12655 → 1.1.12674
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 +42 -8
- package/package.json +1 -1
- package/src/jscommon/umychart.complier.js +46 -0
- package/src/jscommon/umychart.index.data.js +64 -0
- package/src/jscommon/umychart.js +113 -39
- package/src/jscommon/umychart.resource/js/codemirror/javascript.js +6 -2
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +224 -40
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +224 -40
- package/src/jscommon/umychart.wechat/umychart.chartpaint.wechat.js +10 -0
- package/src/jscommon/umychart.wechat/umychart.complier.wechat.js +44 -0
- package/src/jscommon/umychart.wechat/umychart.element.wechart.js +1 -1
- package/src/jscommon/umychart.wechat/umychart.framesplit.wechat.js +2 -0
- package/src/jscommon/umychart.wechat/umychart.version.wechat.js +1 -1
- package/src/jscommon/umychart.wechat/umychart.wechat.3.0.js +1 -0
|
@@ -3591,6 +3591,48 @@ function JSAlgorithm(errorHandler, symbolData)
|
|
|
3591
3591
|
return result;
|
|
3592
3592
|
}
|
|
3593
3593
|
|
|
3594
|
+
//STDDEV(X,N) 返回标准偏差
|
|
3595
|
+
//将标准差除以样本大小N的平方根即可得出标准误差。标准误差 = σ/sqrt(n)
|
|
3596
|
+
this.STDDEV=function(data,n)
|
|
3597
|
+
{
|
|
3598
|
+
var result=[];
|
|
3599
|
+
|
|
3600
|
+
if (!Array.isArray(data)) return result;
|
|
3601
|
+
var nStart=this.GetFirstVaildIndex(data);
|
|
3602
|
+
if (!IFrameSplitOperator.IsNumber(n)) return result;
|
|
3603
|
+
if(nStart+n>data.length || n<1) return result;
|
|
3604
|
+
|
|
3605
|
+
var i=nStart, j=0, bFirst=true, dTotal=0, dAvg=0;
|
|
3606
|
+
for(i+=n-1;i<data.length;++i)
|
|
3607
|
+
{
|
|
3608
|
+
dTotal = 0;
|
|
3609
|
+
if(bFirst)
|
|
3610
|
+
{
|
|
3611
|
+
bFirst = false;
|
|
3612
|
+
for(j=i-n+1;j<=i;++j)
|
|
3613
|
+
{
|
|
3614
|
+
dAvg += data[j];
|
|
3615
|
+
}
|
|
3616
|
+
|
|
3617
|
+
dAvg /= n;
|
|
3618
|
+
}
|
|
3619
|
+
else
|
|
3620
|
+
{
|
|
3621
|
+
dAvg += (data[i]-data[i-n])/n;
|
|
3622
|
+
}
|
|
3623
|
+
|
|
3624
|
+
for(j=i-n+1;j<=i;++j)
|
|
3625
|
+
{
|
|
3626
|
+
dTotal += (data[j]-dAvg)*(data[j]-dAvg);
|
|
3627
|
+
}
|
|
3628
|
+
|
|
3629
|
+
|
|
3630
|
+
result[i] = Math.sqrt(dTotal/(n-1))/Math.sqrt(n);
|
|
3631
|
+
}
|
|
3632
|
+
|
|
3633
|
+
return result;
|
|
3634
|
+
}
|
|
3635
|
+
|
|
3594
3636
|
//平均绝对方差
|
|
3595
3637
|
this.AVEDEV=function(data,n)
|
|
3596
3638
|
{
|
|
@@ -7709,6 +7751,8 @@ function JSAlgorithm(errorHandler, symbolData)
|
|
|
7709
7751
|
return this.AVEDEV(args[0], args[1]);
|
|
7710
7752
|
case 'STD':
|
|
7711
7753
|
return this.STD(args[0], args[1]);
|
|
7754
|
+
case "STDDEV":
|
|
7755
|
+
return this.STDDEV(args[0], args[1]);
|
|
7712
7756
|
case 'IF':
|
|
7713
7757
|
case 'IFF':
|
|
7714
7758
|
case "IFELSE":
|
|
@@ -2025,6 +2025,8 @@ function HQPriceStringFormat()
|
|
|
2025
2025
|
this.Text=IFrameSplitOperator.FormatValueThousandsString(this.Value,defaultfloatPrecision);
|
|
2026
2026
|
else
|
|
2027
2027
|
this.Text = this.Value.toFixed(defaultfloatPrecision);
|
|
2028
|
+
|
|
2029
|
+
if (this.YClose>0) this.PercentageText=((this.Value-this.YClose)*100/this.YClose).toFixed(2); //走势图右边坐标显示百分比
|
|
2028
2030
|
}
|
|
2029
2031
|
else
|
|
2030
2032
|
{
|
|
@@ -628,6 +628,7 @@ function JSChart(element)
|
|
|
628
628
|
if (IFrameSplitOperator.IsBool(option.CorssCursorInfo.IsFixXLastTime)) chart.ChartCorssCursor.IsFixXLastTime=option.CorssCursorInfo.IsFixXLastTime;
|
|
629
629
|
if (IFrameSplitOperator.IsNumber(item.PriceFormatType)) chart.ChartCorssCursor.StringFormatY.PriceFormatType=item.PriceFormatType;
|
|
630
630
|
if (IFrameSplitOperator.IsNumber(item.DataFormatType)) chart.ChartCorssCursor.StringFormatY.DataFormatType=item.DataFormatType;
|
|
631
|
+
if (IFrameSplitOperator.IsNumber(item.RightTextFormat)) chart.ChartCorssCursor.TextFormat.Right=item.RightTextFormat;
|
|
631
632
|
}
|
|
632
633
|
|
|
633
634
|
if (option.MinuteInfo) chart.CreateMinuteInfo(option.MinuteInfo);
|