hqchart 1.1.12790 → 1.1.12798
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 +18 -12
- package/package.json +1 -1
- package/src/jscommon/umychart.complier.js +1 -1
- package/src/jscommon/umychart.js +177 -104
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +179 -106
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +179 -106
|
@@ -4495,6 +4495,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4495
4495
|
var item=option.EnableYDrag;
|
|
4496
4496
|
if (IFrameSplitOperator.IsBool(item.Left)) chart.EnableYDrag.Left=item.Left;
|
|
4497
4497
|
if (IFrameSplitOperator.IsBool(item.Right)) chart.EnableYDrag.Right=item.Right;
|
|
4498
|
+
if (IFrameSplitOperator.IsBool(item.Wheel)) chart.EnableYDrag.Wheel=item.Wheel;
|
|
4499
|
+
if (IFrameSplitOperator.IsNumber(item.WheelYMove)) chart.EnableYDrag.WheelYMove=item.WheelYMove;
|
|
4498
4500
|
}
|
|
4499
4501
|
|
|
4500
4502
|
if (option.KLine) //k线图的属性设置
|
|
@@ -6448,6 +6450,11 @@ JSChart.GetKLineZoom=function() //K线缩放配置
|
|
|
6448
6450
|
return ZOOM_SEED;
|
|
6449
6451
|
}
|
|
6450
6452
|
|
|
6453
|
+
JSChart.SetKLineZoom=function(aryZoom) //设置K线缩放比例
|
|
6454
|
+
{
|
|
6455
|
+
ZOOM_SEED=aryZoom;
|
|
6456
|
+
}
|
|
6457
|
+
|
|
6451
6458
|
JSChart.GetDivTooltipDataFormat=function() //div tooltip数据格式化
|
|
6452
6459
|
{
|
|
6453
6460
|
return g_DivTooltipDataForamt;
|
|
@@ -6729,6 +6736,8 @@ var JSCHART_EVENT_ID=
|
|
|
6729
6736
|
ON_KEYDOWN:117,
|
|
6730
6737
|
|
|
6731
6738
|
ON_CREATE_OVERLAY_FRAME:118, //创建叠加框架回调
|
|
6739
|
+
|
|
6740
|
+
ON_CREATE_CUSTOM_Y_COORDINATE:119, //自定义Y轴刻度
|
|
6732
6741
|
}
|
|
6733
6742
|
|
|
6734
6743
|
var JSCHART_OPERATOR_ID=
|
|
@@ -7026,7 +7035,12 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7026
7035
|
this.ClickDownPoint; //鼠标点击坐标 {X, Y}, 鼠标放开以后清空为null
|
|
7027
7036
|
this.IsDestroy=false; //是否已经销毁了
|
|
7028
7037
|
|
|
7029
|
-
this.EnableYDrag=
|
|
7038
|
+
this.EnableYDrag=
|
|
7039
|
+
{
|
|
7040
|
+
Left:false, Right:false, //是否可以拖拽缩放Y轴最大最小值
|
|
7041
|
+
Wheel:false, WheelYMove:5 //是否可以滚轴缩放Y轴最大最小值
|
|
7042
|
+
};
|
|
7043
|
+
|
|
7030
7044
|
this.EnableZoomIndexWindow=false; //是否支持双击缩放附图窗口
|
|
7031
7045
|
this.EnableVerifyRecvData=false; //是否检测接收到的数据
|
|
7032
7046
|
|
|
@@ -47452,130 +47466,144 @@ function IFrameSplitOperator()
|
|
|
47452
47466
|
return result;
|
|
47453
47467
|
}
|
|
47454
47468
|
|
|
47455
|
-
|
|
47456
|
-
|
|
47457
|
-
|
|
47458
|
-
var pageInfo=this.GetKLinePageInfo(); //获取当前屏信息
|
|
47459
|
-
if (!pageInfo) return;
|
|
47460
|
-
if (!this.HQChart) return;
|
|
47461
|
-
|
|
47462
|
-
var event=null;
|
|
47463
|
-
if (this.GetEventCallback)
|
|
47464
|
-
event=this.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_INDEX_Y_LABEL);
|
|
47465
|
-
|
|
47466
|
-
var endIndex=pageInfo.End.Index;
|
|
47467
|
-
var floatPrecision=2;
|
|
47468
|
-
if (IFrameSplitOperator.IsNumber(this.FloatPrecision)) floatPrecision=this.FloatPrecision;
|
|
47469
|
-
for(var i=0, j=0;i<this.HQChart.ChartPaint.length;++i)
|
|
47470
|
-
{
|
|
47471
|
-
var chart=this.HQChart.ChartPaint[i];
|
|
47472
|
-
if (!chart.ChartFrame) continue;
|
|
47473
|
-
if (!chart.GetItemData) continue;
|
|
47474
|
-
if (chart.ChartFrame.Identify==this.Frame.Identify || chart.ChartFrame==this.Frame)
|
|
47475
|
-
{
|
|
47476
|
-
var aryItem=chart.GetItemData( {Index:endIndex} );
|
|
47477
|
-
if (!IFrameSplitOperator.IsNonEmptyArray(aryItem)) continue;
|
|
47478
|
-
|
|
47479
|
-
for(j=0; j<aryItem.length; ++j)
|
|
47480
|
-
{
|
|
47481
|
-
var item=aryItem[j];
|
|
47482
|
-
|
|
47483
|
-
var info=new CoordinateInfo();
|
|
47484
|
-
info.Type=1;
|
|
47485
|
-
info.TextColor=g_JSChartResource.FrameLatestPrice.TextColor;
|
|
47486
|
-
info.LineColor=item.Color;
|
|
47487
|
-
info.LineType=-1; //默认不画线
|
|
47488
|
-
info.IsLast=pageInfo.IsLast;//是否是最后一个数据
|
|
47489
|
-
if (IFrameSplitOperator.IsNumber(option.LineType)) info.LineType=option.LineType;
|
|
47490
|
-
|
|
47491
|
-
info.Value=item.Value;
|
|
47492
|
-
var text=IFrameSplitOperator.FormatValueString(item.Value, floatPrecision,this.LanguageID);
|
|
47493
|
-
|
|
47494
|
-
if (option.Position=='left') info.Message[0]=text;
|
|
47495
|
-
else info.Message[1]=text;
|
|
47496
|
-
|
|
47497
|
-
if (!pageInfo.IsLast)
|
|
47498
|
-
{
|
|
47499
|
-
var config={};
|
|
47500
|
-
if (!pageInfo.IsLast) config.EmptyBGColor=g_JSChartResource.FrameLatestPrice.EmptyBGColor;
|
|
47501
|
-
|
|
47502
|
-
info.ExtendData={ Custom:config };
|
|
47503
|
-
}
|
|
47504
|
-
|
|
47505
|
-
if (event)
|
|
47506
|
-
{
|
|
47507
|
-
var sendData={ PreventDefault:false, Label:info, Data:item, IndexName:chart.IndexName, FrameID:this.Frame.Identify };
|
|
47508
|
-
event.Callback(event,sendData,this);
|
|
47509
|
-
|
|
47510
|
-
if (sendData.PreventDefault) continue;
|
|
47511
|
-
}
|
|
47512
|
-
|
|
47513
|
-
this.Frame.CustomHorizontalInfo.push(info);
|
|
47514
|
-
}
|
|
47515
|
-
}
|
|
47516
|
-
}
|
|
47517
|
-
}
|
|
47518
|
-
|
|
47519
|
-
this.CustomLatestOverlayIndexDataCoordinate=function(option)
|
|
47520
|
-
{
|
|
47469
|
+
//当前屏最新指标数据
|
|
47470
|
+
this.CustomLatestIndexDataCoordinate=function(option)
|
|
47471
|
+
{
|
|
47521
47472
|
var pageInfo=this.GetKLinePageInfo(); //获取当前屏信息
|
|
47522
47473
|
if (!pageInfo) return;
|
|
47523
|
-
if (!this.
|
|
47524
|
-
if (!IFrameSplitOperator.IsNonEmptyArray(this.OverlayIndex.ChartPaint)) return;
|
|
47474
|
+
if (!this.HQChart) return;
|
|
47525
47475
|
|
|
47526
47476
|
var event=null;
|
|
47527
47477
|
if (this.GetEventCallback)
|
|
47528
|
-
event=this.GetEventCallback(JSCHART_EVENT_ID.
|
|
47478
|
+
event=this.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_INDEX_Y_LABEL);
|
|
47529
47479
|
|
|
47530
47480
|
var endIndex=pageInfo.End.Index;
|
|
47531
47481
|
var floatPrecision=2;
|
|
47532
47482
|
if (IFrameSplitOperator.IsNumber(this.FloatPrecision)) floatPrecision=this.FloatPrecision;
|
|
47533
|
-
|
|
47534
|
-
for(var i=0, j=0;i<this.OverlayIndex.ChartPaint.length;++i)
|
|
47483
|
+
for(var i=0, j=0;i<this.HQChart.ChartPaint.length;++i)
|
|
47535
47484
|
{
|
|
47536
|
-
var chart=this.
|
|
47485
|
+
var chart=this.HQChart.ChartPaint[i];
|
|
47537
47486
|
if (!chart.ChartFrame) continue;
|
|
47538
47487
|
if (!chart.GetItemData) continue;
|
|
47539
|
-
|
|
47540
|
-
var aryItem=chart.GetItemData( {Index:endIndex} );
|
|
47541
|
-
if (!IFrameSplitOperator.IsNonEmptyArray(aryItem)) continue;
|
|
47542
|
-
for(j=0; j<aryItem.length; ++j)
|
|
47488
|
+
if (chart.ChartFrame.Identify==this.Frame.Identify || chart.ChartFrame==this.Frame)
|
|
47543
47489
|
{
|
|
47544
|
-
var
|
|
47545
|
-
|
|
47546
|
-
info.Type=1;
|
|
47547
|
-
info.TextColor=g_JSChartResource.FrameLatestPrice.TextColor;
|
|
47548
|
-
info.LineColor=item.Color;
|
|
47549
|
-
info.LineType=-1; //默认不画线
|
|
47550
|
-
info.IsLast=pageInfo.IsLast;//是否是最后一个数据
|
|
47551
|
-
if (IFrameSplitOperator.IsNumber(option.LineType)) info.LineType=option.LineType;
|
|
47490
|
+
var aryItem=chart.GetItemData( {Index:endIndex} );
|
|
47491
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(aryItem)) continue;
|
|
47552
47492
|
|
|
47553
|
-
|
|
47554
|
-
|
|
47493
|
+
for(j=0; j<aryItem.length; ++j)
|
|
47494
|
+
{
|
|
47495
|
+
var item=aryItem[j];
|
|
47555
47496
|
|
|
47556
|
-
|
|
47557
|
-
|
|
47497
|
+
var info=new CoordinateInfo();
|
|
47498
|
+
info.Type=1;
|
|
47499
|
+
info.TextColor=g_JSChartResource.FrameLatestPrice.TextColor;
|
|
47500
|
+
info.LineColor=item.Color;
|
|
47501
|
+
info.LineType=-1; //默认不画线
|
|
47502
|
+
info.IsLast=pageInfo.IsLast;//是否是最后一个数据
|
|
47503
|
+
if (IFrameSplitOperator.IsNumber(option.LineType)) info.LineType=option.LineType;
|
|
47504
|
+
|
|
47505
|
+
info.Value=item.Value;
|
|
47506
|
+
var text=IFrameSplitOperator.FormatValueString(item.Value, floatPrecision,this.LanguageID);
|
|
47558
47507
|
|
|
47559
|
-
|
|
47560
|
-
|
|
47561
|
-
var config={};
|
|
47562
|
-
if (!pageInfo.IsLast) config.EmptyBGColor=g_JSChartResource.FrameLatestPrice.EmptyBGColor;
|
|
47508
|
+
if (option.Position=='left') info.Message[0]=text;
|
|
47509
|
+
else info.Message[1]=text;
|
|
47563
47510
|
|
|
47564
|
-
|
|
47565
|
-
|
|
47511
|
+
if (!pageInfo.IsLast)
|
|
47512
|
+
{
|
|
47513
|
+
var config={};
|
|
47514
|
+
if (!pageInfo.IsLast) config.EmptyBGColor=g_JSChartResource.FrameLatestPrice.EmptyBGColor;
|
|
47566
47515
|
|
|
47567
|
-
|
|
47568
|
-
|
|
47569
|
-
var sendData={ PreventDefault:false, Label:info, Data:item, IndexName:chart.IndexName, OverlayIdentify:this.OverlayIndex.Identify };
|
|
47570
|
-
event.Callback(event,sendData,this);
|
|
47516
|
+
info.ExtendData={ Custom:config };
|
|
47517
|
+
}
|
|
47571
47518
|
|
|
47572
|
-
if (
|
|
47519
|
+
if (event)
|
|
47520
|
+
{
|
|
47521
|
+
var sendData={ PreventDefault:false, Label:info, Data:item, IndexName:chart.IndexName, FrameID:this.Frame.Identify };
|
|
47522
|
+
event.Callback(event,sendData,this);
|
|
47523
|
+
|
|
47524
|
+
if (sendData.PreventDefault) continue;
|
|
47525
|
+
}
|
|
47526
|
+
|
|
47527
|
+
this.Frame.CustomHorizontalInfo.push(info);
|
|
47573
47528
|
}
|
|
47574
|
-
|
|
47575
|
-
this.Frame.CustomHorizontalInfo.push(info);
|
|
47576
47529
|
}
|
|
47577
47530
|
}
|
|
47578
|
-
|
|
47531
|
+
}
|
|
47532
|
+
|
|
47533
|
+
this.CustomLatestOverlayIndexDataCoordinate=function(option)
|
|
47534
|
+
{
|
|
47535
|
+
var pageInfo=this.GetKLinePageInfo(); //获取当前屏信息
|
|
47536
|
+
if (!pageInfo) return;
|
|
47537
|
+
if (!this.OverlayIndex) return;
|
|
47538
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.OverlayIndex.ChartPaint)) return;
|
|
47539
|
+
|
|
47540
|
+
var event=null;
|
|
47541
|
+
if (this.GetEventCallback)
|
|
47542
|
+
event=this.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_OVERLAY_INDEX_Y_LABEL);
|
|
47543
|
+
|
|
47544
|
+
var endIndex=pageInfo.End.Index;
|
|
47545
|
+
var floatPrecision=2;
|
|
47546
|
+
if (IFrameSplitOperator.IsNumber(this.FloatPrecision)) floatPrecision=this.FloatPrecision;
|
|
47547
|
+
|
|
47548
|
+
for(var i=0, j=0;i<this.OverlayIndex.ChartPaint.length;++i)
|
|
47549
|
+
{
|
|
47550
|
+
var chart=this.OverlayIndex.ChartPaint[i];
|
|
47551
|
+
if (!chart.ChartFrame) continue;
|
|
47552
|
+
if (!chart.GetItemData) continue;
|
|
47553
|
+
|
|
47554
|
+
var aryItem=chart.GetItemData( {Index:endIndex} );
|
|
47555
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(aryItem)) continue;
|
|
47556
|
+
for(j=0; j<aryItem.length; ++j)
|
|
47557
|
+
{
|
|
47558
|
+
var item=aryItem[j];
|
|
47559
|
+
var info=new CoordinateInfo();
|
|
47560
|
+
info.Type=1;
|
|
47561
|
+
info.TextColor=g_JSChartResource.FrameLatestPrice.TextColor;
|
|
47562
|
+
info.LineColor=item.Color;
|
|
47563
|
+
info.LineType=-1; //默认不画线
|
|
47564
|
+
info.IsLast=pageInfo.IsLast;//是否是最后一个数据
|
|
47565
|
+
if (IFrameSplitOperator.IsNumber(option.LineType)) info.LineType=option.LineType;
|
|
47566
|
+
|
|
47567
|
+
info.Value=item.Value;
|
|
47568
|
+
var text=IFrameSplitOperator.FormatValueString(item.Value, floatPrecision,this.LanguageID);
|
|
47569
|
+
|
|
47570
|
+
if (option.Position=='left') info.Message[0]=text;
|
|
47571
|
+
else info.Message[1]=text;
|
|
47572
|
+
|
|
47573
|
+
if (!pageInfo.IsLast)
|
|
47574
|
+
{
|
|
47575
|
+
var config={};
|
|
47576
|
+
if (!pageInfo.IsLast) config.EmptyBGColor=g_JSChartResource.FrameLatestPrice.EmptyBGColor;
|
|
47577
|
+
|
|
47578
|
+
info.ExtendData={ Custom:config };
|
|
47579
|
+
}
|
|
47580
|
+
|
|
47581
|
+
if (event)
|
|
47582
|
+
{
|
|
47583
|
+
var sendData={ PreventDefault:false, Label:info, Data:item, IndexName:chart.IndexName, OverlayIdentify:this.OverlayIndex.Identify };
|
|
47584
|
+
event.Callback(event,sendData,this);
|
|
47585
|
+
|
|
47586
|
+
if (sendData.PreventDefault) continue;
|
|
47587
|
+
}
|
|
47588
|
+
|
|
47589
|
+
this.Frame.CustomHorizontalInfo.push(info);
|
|
47590
|
+
}
|
|
47591
|
+
}
|
|
47592
|
+
},
|
|
47593
|
+
|
|
47594
|
+
//回调外部处理自定义Y轴刻度
|
|
47595
|
+
this.InvokeCustomYCoordinateCallback=function()
|
|
47596
|
+
{
|
|
47597
|
+
if (!this.GetEventCallback) return null;
|
|
47598
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CREATE_CUSTOM_Y_COORDINATE);
|
|
47599
|
+
if (!event || !event.Callback) return null;
|
|
47600
|
+
|
|
47601
|
+
var data={ ID:this.Frame.Identify, Frame:this.Frame, PreventDefault:false, Custom:this.Custom };
|
|
47602
|
+
if (this.OverlayIdentify) data.OverlayIdentify=this.OverlayIdentify;
|
|
47603
|
+
event.Callback(event,data,this);
|
|
47604
|
+
|
|
47605
|
+
return data;
|
|
47606
|
+
}
|
|
47579
47607
|
}
|
|
47580
47608
|
|
|
47581
47609
|
//字符串格式化 千分位分割
|
|
@@ -48576,6 +48604,10 @@ function FrameSplitKLinePriceY()
|
|
|
48576
48604
|
this.CustomCoordinate=function(floatPrecision)
|
|
48577
48605
|
{
|
|
48578
48606
|
this.Frame.CustomHorizontalInfo=[];
|
|
48607
|
+
|
|
48608
|
+
var data=this.InvokeCustomYCoordinateCallback();
|
|
48609
|
+
if (data && data.PreventDefault==true) return;
|
|
48610
|
+
|
|
48579
48611
|
var lastCoordinate, pageLastCoordinate;
|
|
48580
48612
|
for(var i=0; i<this.Custom.length; ++i)
|
|
48581
48613
|
{
|
|
@@ -49223,6 +49255,9 @@ function FrameSplitY()
|
|
|
49223
49255
|
{
|
|
49224
49256
|
this.Frame.CustomHorizontalInfo=[];
|
|
49225
49257
|
|
|
49258
|
+
var data=this.InvokeCustomYCoordinateCallback();
|
|
49259
|
+
if (data && data.PreventDefault==true) return;
|
|
49260
|
+
|
|
49226
49261
|
if (!IFrameSplitOperator.IsNonEmptyArray(this.Custom)) return;
|
|
49227
49262
|
|
|
49228
49263
|
for(var i=0; i<this.Custom.length; ++i)
|
|
@@ -49604,6 +49639,9 @@ function FrameSplitMinutePriceY()
|
|
|
49604
49639
|
|
|
49605
49640
|
this.CustomCoordinate=function() //自定义刻度
|
|
49606
49641
|
{
|
|
49642
|
+
var data=this.InvokeCustomYCoordinateCallback();
|
|
49643
|
+
if (data && data.PreventDefault==true) return;
|
|
49644
|
+
|
|
49607
49645
|
if (!this.Custom) return;
|
|
49608
49646
|
|
|
49609
49647
|
var defaultfloatPrecision=GetfloatPrecision(this.Symbol);
|
|
@@ -70417,12 +70455,47 @@ function KLineChartContainer(uielement,OffscreenElement)
|
|
|
70417
70455
|
}
|
|
70418
70456
|
}
|
|
70419
70457
|
|
|
70420
|
-
if (!isInClient)
|
|
70458
|
+
if (!isInClient)
|
|
70459
|
+
{
|
|
70460
|
+
if (!this.OnWheel_ZoomUpDownFrameY(e,x,y)) return;
|
|
70461
|
+
}
|
|
70421
70462
|
|
|
70422
70463
|
if(e.preventDefault) e.preventDefault();
|
|
70423
70464
|
else e.returnValue = false;
|
|
70424
70465
|
}
|
|
70425
70466
|
|
|
70467
|
+
//通过滚轴缩放Y轴
|
|
70468
|
+
this.OnWheel_ZoomUpDownFrameY=function(e, x, y)
|
|
70469
|
+
{
|
|
70470
|
+
if (!this.EnableYDrag.Wheel) return false;
|
|
70471
|
+
|
|
70472
|
+
var dragY=this.TryYDrag(x,y);
|
|
70473
|
+
if (!dragY) return false;
|
|
70474
|
+
|
|
70475
|
+
if ((dragY.Left && !dragY.IsOverlay) || dragY.Right)
|
|
70476
|
+
{
|
|
70477
|
+
|
|
70478
|
+
}
|
|
70479
|
+
else
|
|
70480
|
+
{
|
|
70481
|
+
return false;
|
|
70482
|
+
}
|
|
70483
|
+
|
|
70484
|
+
var wheelValue=e.wheelDelta;
|
|
70485
|
+
if (!IFrameSplitOperator.IsObjectExist(e.wheelDelta))
|
|
70486
|
+
wheelValue=e.deltaY* -0.01;
|
|
70487
|
+
|
|
70488
|
+
var yMove=this.EnableYDrag.WheelYMove;
|
|
70489
|
+
if (wheelValue>0) yMove*=-1;
|
|
70490
|
+
dragY.Position=0; //只能两边缩放
|
|
70491
|
+
if (!this.Frame.OnZoomUpDownFrameY(dragY, yMove)) return false;
|
|
70492
|
+
|
|
70493
|
+
this.Frame.SetSizeChage(true);
|
|
70494
|
+
this.Draw();
|
|
70495
|
+
|
|
70496
|
+
return true;
|
|
70497
|
+
}
|
|
70498
|
+
|
|
70426
70499
|
//创建
|
|
70427
70500
|
//windowCount 窗口个数
|
|
70428
70501
|
this.Create=function(windowCount, option)
|
|
@@ -114773,7 +114846,7 @@ function ScriptIndex(name,script,args,option)
|
|
|
114773
114846
|
//是否超出执行的最大次数
|
|
114774
114847
|
this.IsExcessRunCount=function()
|
|
114775
114848
|
{
|
|
114776
|
-
if (this.MaxRunCount
|
|
114849
|
+
if (this.MaxRunCount<0) return false; //没有限制
|
|
114777
114850
|
|
|
114778
114851
|
return this.RunCount>=this.MaxRunCount;
|
|
114779
114852
|
}
|
|
@@ -131654,7 +131727,7 @@ function HQChartScriptWorker()
|
|
|
131654
131727
|
|
|
131655
131728
|
|
|
131656
131729
|
|
|
131657
|
-
var HQCHART_VERSION="1.1.
|
|
131730
|
+
var HQCHART_VERSION="1.1.12797";
|
|
131658
131731
|
|
|
131659
131732
|
function PrintHQChartVersion()
|
|
131660
131733
|
{
|