hqchart 1.1.13403 → 1.1.13409
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 +50 -33
- package/package.json +1 -1
- package/src/jscommon/umychart.js +366 -69
- package/src/jscommon/umychart.style.js +7 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +374 -70
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +374 -70
|
@@ -3996,6 +3996,17 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
3996
3996
|
if (IFrameSplitOperator.IsNumber(option.ZIndex)) element.style["z-index"]=option.ZIndex;
|
|
3997
3997
|
}
|
|
3998
3998
|
|
|
3999
|
+
if (this.CanvasElement)
|
|
4000
|
+
{
|
|
4001
|
+
element.height=this.CanvasElement.height;
|
|
4002
|
+
element.width=this.CanvasElement.width;
|
|
4003
|
+
if (element.style)
|
|
4004
|
+
{
|
|
4005
|
+
element.style.width=this.CanvasElement.style.width;
|
|
4006
|
+
element.style.height=this.CanvasElement.style.height
|
|
4007
|
+
}
|
|
4008
|
+
}
|
|
4009
|
+
|
|
3999
4010
|
divElement.appendChild(element);
|
|
4000
4011
|
|
|
4001
4012
|
var item={ Element:element, Canvas:null };
|
|
@@ -4332,6 +4343,22 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4332
4343
|
}
|
|
4333
4344
|
}
|
|
4334
4345
|
|
|
4346
|
+
if (chart.ClassName=="KLineChartContainer")
|
|
4347
|
+
{
|
|
4348
|
+
if (!option.DragSelectRect)
|
|
4349
|
+
{
|
|
4350
|
+
option.DragSelectRect={ Enable:true }; //默认开启区间选中画布
|
|
4351
|
+
}
|
|
4352
|
+
|
|
4353
|
+
if (option.DragSelectRect)
|
|
4354
|
+
{
|
|
4355
|
+
var zindex=10;
|
|
4356
|
+
var item=option.DragSelectRect;
|
|
4357
|
+
if (IFrameSplitOperator.IsNumber(item.ZIndex)) zindex=item.ZIndex;
|
|
4358
|
+
if (item.Enable) this.CreateExtraCanvasElement(JSChart.RectDragCanvasKey, { ZIndex:zindex }); //创建独立的区间选择画布
|
|
4359
|
+
}
|
|
4360
|
+
}
|
|
4361
|
+
|
|
4335
4362
|
//创建子窗口
|
|
4336
4363
|
chart.Create(option.Windows.length, option);
|
|
4337
4364
|
|
|
@@ -4339,6 +4366,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4339
4366
|
|
|
4340
4367
|
this.AdjustChartBorder(chart);
|
|
4341
4368
|
|
|
4369
|
+
|
|
4342
4370
|
if (option.KLine)
|
|
4343
4371
|
{
|
|
4344
4372
|
if (option.KLine.PageSize > 0) //一屏显示的数据个数
|
|
@@ -4811,6 +4839,22 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4811
4839
|
if (IFrameSplitOperator.IsBool(item.EnableMoveOn)) chart.SelectedChart.EnableMoveOn=item.EnableMoveOn;
|
|
4812
4840
|
}
|
|
4813
4841
|
|
|
4842
|
+
if (chart.ClassName=="MinuteChartContainer")
|
|
4843
|
+
{
|
|
4844
|
+
if (!option.DragSelectRect)
|
|
4845
|
+
{
|
|
4846
|
+
option.DragSelectRect={ Enable:true }; //默认开启区间选中画布
|
|
4847
|
+
}
|
|
4848
|
+
|
|
4849
|
+
if (option.DragSelectRect)
|
|
4850
|
+
{
|
|
4851
|
+
var item=option.DragSelectRect;
|
|
4852
|
+
var zindex=10;
|
|
4853
|
+
if (IFrameSplitOperator.IsNumber(item.ZIndex)) zindex=item.ZIndex;
|
|
4854
|
+
if (item.Enable) this.CreateExtraCanvasElement(JSChart.RectDragCanvasKey, { ZIndex:zindex }); //创建独立的区间选择画布
|
|
4855
|
+
}
|
|
4856
|
+
}
|
|
4857
|
+
|
|
4814
4858
|
//分页
|
|
4815
4859
|
if (option.PageInfo) chart.SetPageInfo(option.PageInfo);
|
|
4816
4860
|
|
|
@@ -6064,6 +6108,7 @@ JSChart.LastVersion=null; //最新的版本号
|
|
|
6064
6108
|
JSChart.EnableCanvasWillReadFrequently=false; //https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently
|
|
6065
6109
|
JSChart.CorssCursorCanvasKey="hqchart_corsscursor";
|
|
6066
6110
|
JSChart.TooltipCursorCanvasKey="hqchart_tooltip";
|
|
6111
|
+
JSChart.RectDragCanvasKey="hqchart_drag_rect";
|
|
6067
6112
|
|
|
6068
6113
|
//初始化
|
|
6069
6114
|
JSChart.Init=function(divElement,bScreen,bCacheCanvas)
|
|
@@ -6607,6 +6652,8 @@ var JSCHART_MENU_ID=
|
|
|
6607
6652
|
CMD_ADD_OVERLAY_INDEX_ID:36, //添加叠加指标
|
|
6608
6653
|
|
|
6609
6654
|
CMD_CHANGE_LANGUAGE_ID:37, //语言切换
|
|
6655
|
+
|
|
6656
|
+
CMD_CHANGE_DRAG_RECT_SHOW_MODE_ID:38,
|
|
6610
6657
|
}
|
|
6611
6658
|
|
|
6612
6659
|
|
|
@@ -6690,6 +6737,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
6690
6737
|
this.EnableShowCorssCursor={ DrawPicture:true }; //DrawPicture=画图是否显示十字光标
|
|
6691
6738
|
this.ChartPictureMenu; //画图工具 单个图形设置菜单
|
|
6692
6739
|
this.ChartCorssCursor; //十字光标
|
|
6740
|
+
this.ChartDragSelectRect; //选择区间选中
|
|
6693
6741
|
this.IsClickShowCorssCursor=false; //手势点击显示十字光标
|
|
6694
6742
|
this.ChartSplashPaint=null; //等待提示
|
|
6695
6743
|
this.LoadDataSplashTitle="数据加载中"; //下载数据提示信息
|
|
@@ -6763,16 +6811,6 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
6763
6811
|
this.IsShowTooltip=true; //是否显示K线tooltip
|
|
6764
6812
|
this.TooltipCache={ Type:null, IsShow:false, X:null, Y:null, Data:null, InnerHTML:null }; //缓存tooltip数据
|
|
6765
6813
|
|
|
6766
|
-
//区间选择
|
|
6767
|
-
this.SelectRect=document.createElement("div");
|
|
6768
|
-
this.SelectRect.className="jschart-selectrect";
|
|
6769
|
-
this.SelectRect.style.background=g_JSChartResource.SelectRectBGColor;
|
|
6770
|
-
this.SelectRect.style["pointer-events"]="none";
|
|
6771
|
-
//this.SelectRect.style.opacity=g_JSChartResource.SelectRectAlpha;
|
|
6772
|
-
this.SelectRect.id=Guid();
|
|
6773
|
-
this.SelectRect.oncontextmenu=function() { return false; }; //屏蔽选中区域系统右键菜单
|
|
6774
|
-
uielement.parentNode.appendChild(this.SelectRect);
|
|
6775
|
-
|
|
6776
6814
|
//坐标轴风格方法 double-更加数值型分割 price-更加股票价格分割
|
|
6777
6815
|
this.FrameSplitData=new Map();
|
|
6778
6816
|
this.FrameSplitData.set("double",new SplitData());
|
|
@@ -7330,6 +7368,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7330
7368
|
}
|
|
7331
7369
|
|
|
7332
7370
|
this.HideSelectRect();
|
|
7371
|
+
this.ClearDragSelectRect();
|
|
7333
7372
|
if (this.ChartPictureMenu) this.ChartPictureMenu.Hide();
|
|
7334
7373
|
|
|
7335
7374
|
var paint=this.GetRectSelectPaint();
|
|
@@ -7733,13 +7772,11 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7733
7772
|
|
|
7734
7773
|
if (moveSetp<5 && yMoveSetp<5) return;
|
|
7735
7774
|
|
|
7736
|
-
//this.UIElement.style.cursor="default";
|
|
7737
7775
|
this.SetCursor({Cursor:"default"});
|
|
7738
|
-
var
|
|
7739
|
-
var
|
|
7740
|
-
|
|
7741
|
-
|
|
7742
|
-
this.ShowSelectRect(x,y,x2,y2);
|
|
7776
|
+
var ptStart=this.PointAbsoluteToRelative(drag.Click.X, drag.Click.Y);
|
|
7777
|
+
var ptEnd=this.PointAbsoluteToRelative(e.clientX, e.clientY);
|
|
7778
|
+
|
|
7779
|
+
this.ShowDragSelectRect(ptStart, ptEnd);
|
|
7743
7780
|
|
|
7744
7781
|
drag.LastMove.X=e.clientX;
|
|
7745
7782
|
drag.LastMove.Y=e.clientY;
|
|
@@ -7951,7 +7988,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7951
7988
|
selectData.JSChartContainer=this;
|
|
7952
7989
|
selectData.Stock={Symbol:this.Symbol, Name:this.Name};
|
|
7953
7990
|
|
|
7954
|
-
if (!this.BorderDrag && this.GetSelectRectData(selectData))
|
|
7991
|
+
if (this.ChartDragSelectRect.Enable && !this.BorderDrag && this.GetSelectRectData(selectData))
|
|
7955
7992
|
{
|
|
7956
7993
|
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_SELECT_RECT);
|
|
7957
7994
|
var paint=this.GetRectSelectPaint();
|
|
@@ -7962,7 +7999,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7962
7999
|
{
|
|
7963
8000
|
X:drag.LastMove.X-uielement.getBoundingClientRect().left,
|
|
7964
8001
|
Y:drag.LastMove.Y-uielement.getBoundingClientRect().top,
|
|
7965
|
-
SelectData:selectData,
|
|
8002
|
+
SelectData:selectData, //区间选择的数据
|
|
7966
8003
|
RectSelectPaint:paint, //区间选择背景
|
|
7967
8004
|
IsShowMenu:true,
|
|
7968
8005
|
e,e
|
|
@@ -9041,6 +9078,15 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
9041
9078
|
}
|
|
9042
9079
|
}
|
|
9043
9080
|
|
|
9081
|
+
//清空画布
|
|
9082
|
+
this.ClearCanvas=function(canvas)
|
|
9083
|
+
{
|
|
9084
|
+
if (!canvas) return;
|
|
9085
|
+
if (!this.UIElement) return;
|
|
9086
|
+
|
|
9087
|
+
canvas.clearRect(0,0,this.UIElement.width,this.UIElement.height);
|
|
9088
|
+
}
|
|
9089
|
+
|
|
9044
9090
|
this.Draw=function()
|
|
9045
9091
|
{
|
|
9046
9092
|
if (this.ChartCorssCursor) this.ChartCorssCursor.Status=0;
|
|
@@ -10879,36 +10925,6 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
10879
10925
|
if (this.Tooltip.style.display!="none") this.Tooltip.style.display = "none";
|
|
10880
10926
|
}
|
|
10881
10927
|
|
|
10882
|
-
this.ShowSelectRect=function(x,y,x2,y2)
|
|
10883
|
-
{
|
|
10884
|
-
var left = x;
|
|
10885
|
-
var top = y;
|
|
10886
|
-
|
|
10887
|
-
var border=this.Frame.ChartBorder.GetBorder();
|
|
10888
|
-
|
|
10889
|
-
var borderRight=border.Right;
|
|
10890
|
-
var borderLeft=border.Left;
|
|
10891
|
-
|
|
10892
|
-
if (x>borderRight) x=borderRight;
|
|
10893
|
-
if (x2>borderRight) x2=borderRight;
|
|
10894
|
-
|
|
10895
|
-
if (x<borderLeft) x=borderLeft;
|
|
10896
|
-
if (x2<borderLeft) x2=borderLeft;
|
|
10897
|
-
|
|
10898
|
-
if (x>x2) left=x2;
|
|
10899
|
-
if (y>y2) top=y2;
|
|
10900
|
-
|
|
10901
|
-
var width=Math.abs(x-x2);
|
|
10902
|
-
var height=Math.abs(y-y2);
|
|
10903
|
-
|
|
10904
|
-
this.SelectRect.style.width = width+"px";
|
|
10905
|
-
this.SelectRect.style.height =height+"px";
|
|
10906
|
-
this.SelectRect.style.position = "absolute";
|
|
10907
|
-
this.SelectRect.style.left = left +"px";
|
|
10908
|
-
this.SelectRect.style.top = top +"px";
|
|
10909
|
-
this.SelectRect.style.display = "block";
|
|
10910
|
-
}
|
|
10911
|
-
|
|
10912
10928
|
this.UpdateSelectRect=function(start,end)
|
|
10913
10929
|
{
|
|
10914
10930
|
if (!this.ChartPaint[0].Data) return;
|
|
@@ -10928,7 +10944,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
10928
10944
|
|
|
10929
10945
|
this.HideSelectRect=function()
|
|
10930
10946
|
{
|
|
10931
|
-
this.
|
|
10947
|
+
this.ClearDragSelectRect();
|
|
10932
10948
|
}
|
|
10933
10949
|
|
|
10934
10950
|
this.ResetFrameXYSplit=function()
|
|
@@ -11723,11 +11739,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
11723
11739
|
|
|
11724
11740
|
this.ReloadExtendChartPaintResource=function(resource) //扩展画法重新加载配置
|
|
11725
11741
|
{
|
|
11726
|
-
for(var i
|
|
11742
|
+
for(var i=0;i<this.ExtendChartPaint.length; ++i)
|
|
11727
11743
|
{
|
|
11728
11744
|
var item=this.ExtendChartPaint[i];
|
|
11729
11745
|
if (item.ReloadResource) item.ReloadResource(resource);
|
|
11730
11746
|
}
|
|
11747
|
+
|
|
11748
|
+
if (this.ChartDragSelectRect && this.ChartDragSelectRect.ReloadResource) this.ChartDragSelectRect.ReloadResource(resource);
|
|
11731
11749
|
}
|
|
11732
11750
|
|
|
11733
11751
|
this.ReloadChartDrawPictureResource=function(resource)
|
|
@@ -12428,14 +12446,19 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
12428
12446
|
//区间选择
|
|
12429
12447
|
this.GetRectSelectPaint=function()
|
|
12430
12448
|
{
|
|
12431
|
-
|
|
12432
|
-
|
|
12433
|
-
var item=this.ExtendChartPaint[i];
|
|
12434
|
-
if (item.ClassName=="RectSelectPaint")
|
|
12435
|
-
return item;
|
|
12436
|
-
}
|
|
12449
|
+
var finder=this.GetExtendChartByClassName("RectSelectPaint");
|
|
12450
|
+
if (!finder) return null;
|
|
12437
12451
|
|
|
12438
|
-
return
|
|
12452
|
+
return finder.Chart;
|
|
12453
|
+
}
|
|
12454
|
+
|
|
12455
|
+
//鼠标拖动区域
|
|
12456
|
+
this.GetRectDragPaint=function()
|
|
12457
|
+
{
|
|
12458
|
+
var finder=this.GetExtendChartByClassName("RectDragPaint");
|
|
12459
|
+
if (!finder) return null;
|
|
12460
|
+
|
|
12461
|
+
return finder.Chart;
|
|
12439
12462
|
}
|
|
12440
12463
|
|
|
12441
12464
|
this.SetRectSelectData=function(kItem, index)
|
|
@@ -13401,6 +13424,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
13401
13424
|
case JSCHART_MENU_ID.CMD_CHANGE_LANGUAGE_ID:
|
|
13402
13425
|
if (srcParam) this.SetLanguage(srcParam);
|
|
13403
13426
|
break;
|
|
13427
|
+
|
|
13428
|
+
case JSCHART_MENU_ID.CMD_CHANGE_DRAG_RECT_SHOW_MODE_ID:
|
|
13429
|
+
if (param!=null)
|
|
13430
|
+
{
|
|
13431
|
+
if (this.ChartDragSelectRect) this.ChartDragSelectRect.ShowMode=param;
|
|
13432
|
+
}
|
|
13433
|
+
break;
|
|
13404
13434
|
}
|
|
13405
13435
|
}
|
|
13406
13436
|
|
|
@@ -13544,6 +13574,37 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
13544
13574
|
{
|
|
13545
13575
|
this.CurrentChartDrawPicture=null;
|
|
13546
13576
|
}
|
|
13577
|
+
|
|
13578
|
+
|
|
13579
|
+
this.CreateDragSelectRect=function(option)
|
|
13580
|
+
{
|
|
13581
|
+
var chart=g_ExtendChartPaintFactory.Create("RectDragPaint",option);
|
|
13582
|
+
if (!chart) return null;
|
|
13583
|
+
|
|
13584
|
+
if (option && option.Enable===true) chart.Enable=true;
|
|
13585
|
+
chart.ChartBorder=this.Frame.ChartBorder;
|
|
13586
|
+
chart.ChartFrame=this.Frame;
|
|
13587
|
+
chart.HQChart=this;
|
|
13588
|
+
chart.SetOption(option);
|
|
13589
|
+
|
|
13590
|
+
this.ChartDragSelectRect=chart;
|
|
13591
|
+
}
|
|
13592
|
+
|
|
13593
|
+
this.ClearDragSelectRect=function()
|
|
13594
|
+
{
|
|
13595
|
+
if (!this.ChartDragSelectRect) return;
|
|
13596
|
+
|
|
13597
|
+
this.ChartDragSelectRect.ClearPoint();
|
|
13598
|
+
}
|
|
13599
|
+
|
|
13600
|
+
this.ShowDragSelectRect=function(ptStart, ptEnd)
|
|
13601
|
+
{
|
|
13602
|
+
if (!this.ChartDragSelectRect) return;
|
|
13603
|
+
|
|
13604
|
+
this.ChartDragSelectRect.SetFirstPoint(ptStart.X, ptStart.Y);
|
|
13605
|
+
this.ChartDragSelectRect.SetSecondPoint(ptEnd.X, ptEnd.Y);
|
|
13606
|
+
this.ChartDragSelectRect.Draw();
|
|
13607
|
+
}
|
|
13547
13608
|
}
|
|
13548
13609
|
|
|
13549
13610
|
function GetDevicePixelRatio()
|
|
@@ -23600,6 +23661,8 @@ function HistoryData()
|
|
|
23600
23661
|
this.BFactor; //前复权
|
|
23601
23662
|
this.AFactor; //后复权
|
|
23602
23663
|
|
|
23664
|
+
this.RightSeed; //本地计算的复权系数
|
|
23665
|
+
|
|
23603
23666
|
/*
|
|
23604
23667
|
{
|
|
23605
23668
|
PriceOffset: 每个单元的价格间距,
|
|
@@ -24605,7 +24668,10 @@ function ChartData()
|
|
|
24605
24668
|
for(--index; index>=0; --index)
|
|
24606
24669
|
{
|
|
24607
24670
|
if (yClose!=this.Data[index].Close) break;
|
|
24608
|
-
|
|
24671
|
+
var newItem=HistoryData.Copy(this.Data[index]);
|
|
24672
|
+
newItem.RightSeed=seed;
|
|
24673
|
+
result[index]=newItem;
|
|
24674
|
+
|
|
24609
24675
|
yClose=this.Data[index].YClose;
|
|
24610
24676
|
}
|
|
24611
24677
|
|
|
@@ -24615,7 +24681,9 @@ function ChartData()
|
|
|
24615
24681
|
if(yClose!=value && value!=0)
|
|
24616
24682
|
seed *= yClose/value;
|
|
24617
24683
|
|
|
24618
|
-
|
|
24684
|
+
var newItem=HistoryData.CopyRight(this.Data[index],seed);
|
|
24685
|
+
newItem.RightSeed=seed;
|
|
24686
|
+
result[index]=newItem
|
|
24619
24687
|
|
|
24620
24688
|
yClose=this.Data[index].YClose;
|
|
24621
24689
|
}
|
|
@@ -24630,7 +24698,9 @@ function ChartData()
|
|
|
24630
24698
|
for(++index;index<this.Data.length;++index)
|
|
24631
24699
|
{
|
|
24632
24700
|
if (close!=this.Data[index].YClose) break;
|
|
24633
|
-
|
|
24701
|
+
var newItem=HistoryData.Copy(this.Data[index]);
|
|
24702
|
+
newItem.RightSeed=seed;
|
|
24703
|
+
result[index]=newItem;
|
|
24634
24704
|
close=this.Data[index].Close;
|
|
24635
24705
|
}
|
|
24636
24706
|
|
|
@@ -24639,7 +24709,9 @@ function ChartData()
|
|
|
24639
24709
|
if(close!=this.Data[index].YClose)
|
|
24640
24710
|
seed *= close/this.Data[index].YClose;
|
|
24641
24711
|
|
|
24642
|
-
|
|
24712
|
+
var newItem=HistoryData.CopyRight(this.Data[index],seed);
|
|
24713
|
+
newItem.RightSeed=seed;
|
|
24714
|
+
result[index]=newItem;
|
|
24643
24715
|
|
|
24644
24716
|
close=this.Data[index].Close;
|
|
24645
24717
|
}
|
|
@@ -44230,6 +44302,7 @@ function ExtendChartPaintFactory()
|
|
|
44230
44302
|
[
|
|
44231
44303
|
["FrameSplitPaint", { Create:function() { return new FrameSplitPaint(); } }],
|
|
44232
44304
|
["RectSelectPaint", { Create:function() { return new RectSelectPaint(); } }],
|
|
44305
|
+
["RectDragPaint", { Create:function() { return new RectDragPaint(); } }],
|
|
44233
44306
|
["DragMovePaint", { Create:function() { return new DragMovePaint(); } }],
|
|
44234
44307
|
["SessionBreaksPaint", { Create:function() { return new SessionBreaksPaint(); }}],
|
|
44235
44308
|
["FrameButtomToolbarPaint", {Create:function() { return new FrameButtomToolbarPaint(); }}]
|
|
@@ -47216,6 +47289,189 @@ function RectSelectPaint()
|
|
|
47216
47289
|
}
|
|
47217
47290
|
}
|
|
47218
47291
|
}
|
|
47292
|
+
|
|
47293
|
+
//鼠标拖动选中区域
|
|
47294
|
+
function RectDragPaint()
|
|
47295
|
+
{
|
|
47296
|
+
this.newMethod=IExtendChartPainting; //派生
|
|
47297
|
+
this.newMethod();
|
|
47298
|
+
delete this.newMethod;
|
|
47299
|
+
|
|
47300
|
+
this.ClassName='RectDragPaint';
|
|
47301
|
+
this.LineColor=g_JSChartResource.RectDrag.LineColor; //竖线
|
|
47302
|
+
this.LineWidth=g_JSChartResource.RectDrag.LineWidth;
|
|
47303
|
+
this.BGColor=g_JSChartResource.RectDrag.BGColor;
|
|
47304
|
+
this.ShowMode=0; //0=只画边框 1=遮挡未选中区域 2=整体全选
|
|
47305
|
+
this.Enable=false;
|
|
47306
|
+
|
|
47307
|
+
this.FirstPoint;
|
|
47308
|
+
this.SecondPoint;
|
|
47309
|
+
|
|
47310
|
+
this.IsClearCanvas=true; //画布是否是清空状态
|
|
47311
|
+
|
|
47312
|
+
//设置参数接口
|
|
47313
|
+
this.SetOption=function(option)
|
|
47314
|
+
{
|
|
47315
|
+
if (option)
|
|
47316
|
+
{
|
|
47317
|
+
if (option.LineColor) this.LineColor=option.LineColor;
|
|
47318
|
+
if (option.BGColor) this.BGColor=option.BGColor;
|
|
47319
|
+
if (IFrameSplitOperator.IsNumber(option.ShowMode)) this.ShowMode=option.ShowMode;
|
|
47320
|
+
}
|
|
47321
|
+
}
|
|
47322
|
+
|
|
47323
|
+
this.ReloadResource=function(resource)
|
|
47324
|
+
{
|
|
47325
|
+
this.LineColor=g_JSChartResource.RectDrag.LineColor; //竖线
|
|
47326
|
+
this.LineWidth=g_JSChartResource.RectDrag.LineWidth;
|
|
47327
|
+
this.BGColor=g_JSChartResource.RectDrag.BGColor; //面积
|
|
47328
|
+
}
|
|
47329
|
+
|
|
47330
|
+
this.ClearPoint=function()
|
|
47331
|
+
{
|
|
47332
|
+
this.FirstPoint=null;
|
|
47333
|
+
this.SecondPoint=null;
|
|
47334
|
+
|
|
47335
|
+
if (!this.IsClearCanvas) this.Draw();
|
|
47336
|
+
}
|
|
47337
|
+
|
|
47338
|
+
this.SetFirstPoint=function(x, y)
|
|
47339
|
+
{
|
|
47340
|
+
this.FirstPoint={ X:x, Y:y };
|
|
47341
|
+
}
|
|
47342
|
+
|
|
47343
|
+
this.SetSecondPoint=function(x, y)
|
|
47344
|
+
{
|
|
47345
|
+
this.SecondPoint={ X:x, Y:y };
|
|
47346
|
+
}
|
|
47347
|
+
|
|
47348
|
+
this.DrawSelectedBorderMode=function(rtSelect)
|
|
47349
|
+
{
|
|
47350
|
+
this.Canvas.strokeStyle=this.LineColor;
|
|
47351
|
+
this.Canvas.strokeRect(ToFixedPoint(rtSelect.Left),ToFixedPoint(rtSelect.Top),ToFixedRect(rtSelect.Width),ToFixedRect(rtSelect.Height));
|
|
47352
|
+
}
|
|
47353
|
+
|
|
47354
|
+
this.DrawUnselectedMaskMode=function(rtSelect, rtClient)
|
|
47355
|
+
{
|
|
47356
|
+
if (this.BGColor)
|
|
47357
|
+
{
|
|
47358
|
+
this.Canvas.save();
|
|
47359
|
+
|
|
47360
|
+
var clipPath=new Path2D();
|
|
47361
|
+
clipPath.rect(rtClient.Left, rtClient.Top, rtClient.Width, rtSelect.Top-rtClient.Top);
|
|
47362
|
+
|
|
47363
|
+
var leftPath=new Path2D();
|
|
47364
|
+
leftPath.rect(rtClient.Left,rtSelect.Top, rtSelect.Left-rtClient.Left, rtSelect.Height);
|
|
47365
|
+
clipPath.addPath(leftPath);
|
|
47366
|
+
|
|
47367
|
+
var rightPath=new Path2D();
|
|
47368
|
+
rightPath.rect(rtSelect.Right,rtSelect.Top, rtClient.Right-rtSelect.Right, rtSelect.Height);
|
|
47369
|
+
clipPath.addPath(rightPath);
|
|
47370
|
+
|
|
47371
|
+
var bottmPath=new Path2D();
|
|
47372
|
+
bottmPath.rect(rtClient.Left,rtSelect.Bottom, rtClient.Width, rtClient.Bottom-rtSelect.Bottom);
|
|
47373
|
+
clipPath.addPath(bottmPath);
|
|
47374
|
+
|
|
47375
|
+
this.Canvas.clip(clipPath);
|
|
47376
|
+
|
|
47377
|
+
this.Canvas.fillStyle=this.BGColor;
|
|
47378
|
+
this.Canvas.fillRect(rtClient.Left,rtClient.Top,rtClient.Width,rtClient.Height);
|
|
47379
|
+
|
|
47380
|
+
this.Canvas.restore();
|
|
47381
|
+
}
|
|
47382
|
+
|
|
47383
|
+
this.Canvas.strokeStyle=this.LineColor;
|
|
47384
|
+
this.Canvas.strokeRect(ToFixedPoint(rtSelect.Left),ToFixedPoint(rtSelect.Top),ToFixedRect(rtSelect.Width),ToFixedRect(rtSelect.Height));
|
|
47385
|
+
}
|
|
47386
|
+
|
|
47387
|
+
this.DrawFullselectedMode=function(rtSelect, rtClient)
|
|
47388
|
+
{
|
|
47389
|
+
if (this.BGColor)
|
|
47390
|
+
{
|
|
47391
|
+
this.Canvas.save();
|
|
47392
|
+
|
|
47393
|
+
var clipPath=new Path2D();
|
|
47394
|
+
clipPath.rect(rtClient.Left, rtClient.Top, rtSelect.Left-rtClient.Left, rtClient.Height);
|
|
47395
|
+
|
|
47396
|
+
var rightPath=new Path2D();
|
|
47397
|
+
rightPath.rect(rtSelect.Right,rtClient.Top, rtClient.Right-rtSelect.Right, rtClient.Height);
|
|
47398
|
+
clipPath.addPath(rightPath);
|
|
47399
|
+
|
|
47400
|
+
this.Canvas.clip(clipPath);
|
|
47401
|
+
|
|
47402
|
+
this.Canvas.fillStyle=this.BGColor;
|
|
47403
|
+
this.Canvas.fillRect(rtClient.Left,rtClient.Top,rtClient.Width,rtClient.Height);
|
|
47404
|
+
|
|
47405
|
+
this.Canvas.restore();
|
|
47406
|
+
}
|
|
47407
|
+
|
|
47408
|
+
this.Canvas.strokeStyle=this.LineColor;
|
|
47409
|
+
this.Canvas.strokeRect(ToFixedPoint(rtSelect.Left),ToFixedPoint(rtClient.Top),ToFixedRect(rtSelect.Width),ToFixedRect(rtClient.Height));
|
|
47410
|
+
}
|
|
47411
|
+
|
|
47412
|
+
this.Draw=function()
|
|
47413
|
+
{
|
|
47414
|
+
if (!this.Enable) return;
|
|
47415
|
+
if (!this.HQChart) return;
|
|
47416
|
+
|
|
47417
|
+
var finder=this.HQChart.GetExtraCanvas(JSChart.RectDragCanvasKey);
|
|
47418
|
+
if (!finder) return;
|
|
47419
|
+
|
|
47420
|
+
this.Canvas=finder.Canvas;
|
|
47421
|
+
this.HQChart.ClearCanvas(this.Canvas);
|
|
47422
|
+
this.IsClearCanvas=true;
|
|
47423
|
+
|
|
47424
|
+
if (!this.FirstPoint && !this.SecondPoint) return;
|
|
47425
|
+
|
|
47426
|
+
var top=this.ChartBorder.GetTop();
|
|
47427
|
+
var bottom=this.ChartBorder.GetBottom();
|
|
47428
|
+
var left=this.ChartBorder.GetLeft();
|
|
47429
|
+
var right=this.ChartBorder.GetRight();
|
|
47430
|
+
|
|
47431
|
+
var rtClient={Left:left, Top:top, Right:right, Bottom:bottom };
|
|
47432
|
+
rtClient.Width=rtClient.Right-rtClient.Left;
|
|
47433
|
+
rtClient.Height=rtClient.Bottom-rtClient.Top;
|
|
47434
|
+
|
|
47435
|
+
var rtSelect=
|
|
47436
|
+
{
|
|
47437
|
+
Left:Math.min(this.FirstPoint.X,this.SecondPoint.X),
|
|
47438
|
+
Right:Math.max(this.FirstPoint.X,this.SecondPoint.X),
|
|
47439
|
+
Top:Math.min(this.FirstPoint.Y,this.SecondPoint.Y),
|
|
47440
|
+
Bottom:Math.max(this.FirstPoint.Y,this.SecondPoint.Y)
|
|
47441
|
+
}
|
|
47442
|
+
|
|
47443
|
+
if (rtSelect.Top<top) rtSelect.Top=top;
|
|
47444
|
+
else if (rtSelect.Top>bottom) rtSelect.Top=bottom;
|
|
47445
|
+
if (rtSelect.Bottom<top) rtSelect.Bottom=top;
|
|
47446
|
+
else if (rtSelect.Bottom>bottom) rtSelect.Bottom=bottom;
|
|
47447
|
+
|
|
47448
|
+
if (rtSelect.Left<left) rtSelect.Left=left;
|
|
47449
|
+
else if (rtSelect.Left>right) rtSelect.Left=right;
|
|
47450
|
+
if (rtSelect.Right<left) rtSelect.Right=left;
|
|
47451
|
+
else if (rtSelect.Right>right) rtSelect.Right=right;
|
|
47452
|
+
|
|
47453
|
+
rtSelect.Width=rtSelect.Right-rtSelect.Left;
|
|
47454
|
+
rtSelect.Height=rtSelect.Bottom-rtSelect.Top;
|
|
47455
|
+
|
|
47456
|
+
switch(this.ShowMode)
|
|
47457
|
+
{
|
|
47458
|
+
case 1:
|
|
47459
|
+
this.DrawUnselectedMaskMode(rtSelect,rtClient);
|
|
47460
|
+
break;
|
|
47461
|
+
case 2:
|
|
47462
|
+
this.DrawFullselectedMode(rtSelect,rtClient);
|
|
47463
|
+
break;
|
|
47464
|
+
default:
|
|
47465
|
+
this.DrawSelectedBorderMode(rtSelect);
|
|
47466
|
+
break;
|
|
47467
|
+
}
|
|
47468
|
+
|
|
47469
|
+
|
|
47470
|
+
|
|
47471
|
+
this.IsClearCanvas=false;
|
|
47472
|
+
}
|
|
47473
|
+
}
|
|
47474
|
+
|
|
47219
47475
|
//深度图 支持横屏
|
|
47220
47476
|
/*
|
|
47221
47477
|
数据格式:
|
|
@@ -61318,8 +61574,8 @@ function ChartDrawHLine()
|
|
|
61318
61574
|
var bottom=this.Frame.ChartBorder.GetBottomEx();
|
|
61319
61575
|
var pixelTatio = GetDevicePixelRatio();
|
|
61320
61576
|
|
|
61321
|
-
if (IFrameSplitOperator.IsNumber(labInfo.TopOffset)) top-=labInfo.TopOffset;
|
|
61322
|
-
if (IFrameSplitOperator.IsNumber(labInfo.BottomOffset)) bottom+=labInfo.BottomOffset;
|
|
61577
|
+
if (labInfo && IFrameSplitOperator.IsNumber(labInfo.TopOffset)) top-=labInfo.TopOffset;
|
|
61578
|
+
if (labInfo && IFrameSplitOperator.IsNumber(labInfo.BottomOffset)) bottom+=labInfo.BottomOffset;
|
|
61323
61579
|
|
|
61324
61580
|
var yValue=this.Frame.GetYData(y,false);
|
|
61325
61581
|
var strValue=yValue.toFixed(this.Precision);
|
|
@@ -70396,6 +70652,7 @@ function JSChartResource()
|
|
|
70396
70652
|
RangeTextSubBGColor:'rgb(54,54,54)',
|
|
70397
70653
|
}
|
|
70398
70654
|
|
|
70655
|
+
//选中图形
|
|
70399
70656
|
this.SelectedChart=
|
|
70400
70657
|
{
|
|
70401
70658
|
LineWidth:1,
|
|
@@ -70405,6 +70662,14 @@ function JSChartResource()
|
|
|
70405
70662
|
BGColor:"rgb(255,255,255)"
|
|
70406
70663
|
}
|
|
70407
70664
|
|
|
70665
|
+
//鼠标区间选中
|
|
70666
|
+
this.RectDrag=
|
|
70667
|
+
{
|
|
70668
|
+
LineColor:"rgb(0,0,0)", //竖线
|
|
70669
|
+
LineWidth:1*GetDevicePixelRatio(),
|
|
70670
|
+
BGColor:"rgba(128,128,128,0.2)", //面积
|
|
70671
|
+
}
|
|
70672
|
+
|
|
70408
70673
|
this.DragMovePaint=
|
|
70409
70674
|
{
|
|
70410
70675
|
TextColor:"rgb(0,0,0)",
|
|
@@ -71138,6 +71403,16 @@ function JSChartResource()
|
|
|
71138
71403
|
if (item.RangeTextSubBGColor) this.RectSelect.RangeTextSubBGColor=item.RangeTextSubBGColor;
|
|
71139
71404
|
}
|
|
71140
71405
|
|
|
71406
|
+
if (style.RectDrag)
|
|
71407
|
+
{
|
|
71408
|
+
var item=style.RectDrag;
|
|
71409
|
+
var dest=this.RectDrag;
|
|
71410
|
+
|
|
71411
|
+
if (item.LineColor) dest.LineColor=item.LineColor;
|
|
71412
|
+
if (IFrameSplitOperator.IsPlusNumber(item.LineWidth)) dest.LineWidth=item.LineWidth;
|
|
71413
|
+
if (item.BGColor) dest.BGColor=item.BGColor;
|
|
71414
|
+
}
|
|
71415
|
+
|
|
71141
71416
|
if (style.OrderFlow)
|
|
71142
71417
|
{
|
|
71143
71418
|
item=style.OrderFlow;
|
|
@@ -73533,6 +73808,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
73533
73808
|
this.CreateMainKLine();
|
|
73534
73809
|
this.CreateExtendChart("RectSelectPaint", option? option.SelectRect:null); //区间统计
|
|
73535
73810
|
if (this.EnableIndexChartDrag) this.CreateExtendChart("DragMovePaint");
|
|
73811
|
+
this.CreateDragSelectRect(option? option.DragSelectRect:null);
|
|
73536
73812
|
|
|
73537
73813
|
//子窗口动态标题
|
|
73538
73814
|
for(var i in this.Frame.SubFrame)
|
|
@@ -73573,6 +73849,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
73573
73849
|
if (bRegisterWheel) this.UIElement.addEventListener("wheel", (e)=>{ this.OnWheel(e); }, true); //上下滚动消息
|
|
73574
73850
|
}
|
|
73575
73851
|
|
|
73852
|
+
|
|
73853
|
+
|
|
73576
73854
|
this.OnCustomKeyDown=function(keyID, e) //自定义键盘事件
|
|
73577
73855
|
{
|
|
73578
73856
|
if (keyID==37 && e.ctrlKey) //Ctrl+Left
|
|
@@ -78345,7 +78623,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
78345
78623
|
|
|
78346
78624
|
{ Name:"禁止拖拽", Data:{ ID:JSCHART_MENU_ID.CMD_CHANGE_DRAG_MODE_ID, Args:[0]}, Checked:0==this.DragMode },
|
|
78347
78625
|
{ Name:"启动拖拽", Data:{ ID:JSCHART_MENU_ID.CMD_CHANGE_DRAG_MODE_ID, Args:[1]}, Checked:1==this.DragMode },
|
|
78348
|
-
{ Name:"
|
|
78626
|
+
{ Name:"左键区间选择", Data:{ ID:JSCHART_MENU_ID.CMD_CHANGE_DRAG_MODE_ID, Args:[2]}, Checked:2==this.DragMode },
|
|
78349
78627
|
{ Name:JSPopMenu.SEPARATOR_LINE_NAME },
|
|
78350
78628
|
|
|
78351
78629
|
{ Name:"背景分割", Data:{ ID:JSCHART_MENU_ID.CMD_CHANGE_BG_SPLIT_ID, Args:[!bBGSpit]}, Checked:bBGSpit},
|
|
@@ -78371,6 +78649,15 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
78371
78649
|
{ Name:"繁体", Data:{ ID:JSCHART_MENU_ID.CMD_CHANGE_LANGUAGE_ID, Args:["TC"]}, Checked:this.LanguageID==JSCHART_LANGUAGE_ID.LANGUAGE_TRADITIONAL_CHINESE_ID },
|
|
78372
78650
|
]
|
|
78373
78651
|
},
|
|
78652
|
+
{
|
|
78653
|
+
Name:"区间选择样式",
|
|
78654
|
+
SubMenu:
|
|
78655
|
+
[
|
|
78656
|
+
{ Name:"样式1(默认)", Data:{ ID:JSCHART_MENU_ID.CMD_CHANGE_DRAG_RECT_SHOW_MODE_ID, Args:[0]}, Checked:0==this.ChartDragSelectRect.ShowMode },
|
|
78657
|
+
{ Name:"样式2", Data:{ ID:JSCHART_MENU_ID.CMD_CHANGE_DRAG_RECT_SHOW_MODE_ID, Args:[1]}, Checked:1==this.ChartDragSelectRect.ShowMode },
|
|
78658
|
+
{ Name:"样式3", Data:{ ID:JSCHART_MENU_ID.CMD_CHANGE_DRAG_RECT_SHOW_MODE_ID, Args:[2]}, Checked:2==this.ChartDragSelectRect.ShowMode },
|
|
78659
|
+
]
|
|
78660
|
+
}
|
|
78374
78661
|
]
|
|
78375
78662
|
}
|
|
78376
78663
|
];
|
|
@@ -80740,11 +81027,10 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
80740
81027
|
|
|
80741
81028
|
//this.UIElement.style.cursor="default";
|
|
80742
81029
|
this.SetCursor({Cursor:"default"});
|
|
80743
|
-
var
|
|
80744
|
-
var
|
|
80745
|
-
|
|
80746
|
-
|
|
80747
|
-
this.ShowSelectRect(x,y,x2,y2);
|
|
81030
|
+
var ptStart=this.PointAbsoluteToRelative(drag.Click.X, drag.Click.Y);
|
|
81031
|
+
var ptEnd=this.PointAbsoluteToRelative(e.clientX, e.clientY);
|
|
81032
|
+
|
|
81033
|
+
this.ShowDragSelectRect(ptStart, ptEnd);
|
|
80748
81034
|
|
|
80749
81035
|
drag.LastMove.X=e.clientX;
|
|
80750
81036
|
drag.LastMove.Y=e.clientY;
|
|
@@ -81915,6 +82201,16 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
81915
82201
|
SubMenu:
|
|
81916
82202
|
[
|
|
81917
82203
|
{ Name:"画图工具", Data:{ ID:JSCHART_MENU_ID.CMD_SHOW_DRAWTOOL_ID, Args:[]}, Checked:this.IsShowDrawToolDialog()},
|
|
82204
|
+
|
|
82205
|
+
{
|
|
82206
|
+
Name:"区间选择样式",
|
|
82207
|
+
SubMenu:
|
|
82208
|
+
[
|
|
82209
|
+
{ Name:"样式1(默认)", Data:{ ID:JSCHART_MENU_ID.CMD_CHANGE_DRAG_RECT_SHOW_MODE_ID, Args:[0]}, Checked:0==this.ChartDragSelectRect.ShowMode },
|
|
82210
|
+
{ Name:"样式2", Data:{ ID:JSCHART_MENU_ID.CMD_CHANGE_DRAG_RECT_SHOW_MODE_ID, Args:[1]}, Checked:1==this.ChartDragSelectRect.ShowMode },
|
|
82211
|
+
{ Name:"样式3", Data:{ ID:JSCHART_MENU_ID.CMD_CHANGE_DRAG_RECT_SHOW_MODE_ID, Args:[2]}, Checked:2==this.ChartDragSelectRect.ShowMode },
|
|
82212
|
+
]
|
|
82213
|
+
}
|
|
81918
82214
|
]
|
|
81919
82215
|
}
|
|
81920
82216
|
|
|
@@ -82105,6 +82401,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
82105
82401
|
this.CreateMainKLine();
|
|
82106
82402
|
this.CreateExtendChart("RectSelectPaint", option? option.SelectRect:null); //区间统计
|
|
82107
82403
|
if (this.EnableIndexChartDrag) this.CreateExtendChart("DragMovePaint");
|
|
82404
|
+
this.CreateDragSelectRect(option? option.DragSelectRect:null);
|
|
82108
82405
|
|
|
82109
82406
|
//子窗口动态标题
|
|
82110
82407
|
for(var i=0;i<this.Frame.SubFrame.length; ++i)
|
|
@@ -122713,6 +123010,13 @@ function GetBlackStyle()
|
|
|
122713
123010
|
AreaColor:"rgba(26,13,7,0.5)", //面积
|
|
122714
123011
|
},
|
|
122715
123012
|
|
|
123013
|
+
RectDrag:
|
|
123014
|
+
{
|
|
123015
|
+
LineColor:"rgb(220,220,220)",
|
|
123016
|
+
LineWidth:1*GetDevicePixelRatio(),
|
|
123017
|
+
BGColor:"rgba(220,220,220,0.2)", //面积
|
|
123018
|
+
},
|
|
123019
|
+
|
|
122716
123020
|
SelectedChart:
|
|
122717
123021
|
{
|
|
122718
123022
|
LineWidth:1,
|
|
@@ -133729,7 +134033,7 @@ function ScrollBarBGChart()
|
|
|
133729
134033
|
|
|
133730
134034
|
|
|
133731
134035
|
|
|
133732
|
-
var HQCHART_VERSION="1.1.
|
|
134036
|
+
var HQCHART_VERSION="1.1.13408";
|
|
133733
134037
|
|
|
133734
134038
|
function PrintHQChartVersion()
|
|
133735
134039
|
{
|