hqchart 1.1.15060 → 1.1.15066

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.
@@ -7470,6 +7470,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7470
7470
  this.DialogSearchIndex; //指标搜索
7471
7471
  this.DialogModifyIndexParam; //指标参数修改
7472
7472
  this.SmallFloatTooltipGroup; //小浮框tooltip信息集合
7473
+ this.JSToolbarTooltip; //指标标题工具栏tooltip信息
7473
7474
 
7474
7475
 
7475
7476
  this.RestoreFocusTimer=null; //恢复焦点定时器
@@ -13932,6 +13933,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
13932
13933
  if (overlayItem.Frame && overlayItem.Frame.ReloadResource) overlayItem.Frame.ReloadResource(resource);
13933
13934
  }
13934
13935
  }
13936
+
13937
+ if (this.JSToolbarTooltip) this.JSToolbarTooltip.ReloadResource(resource); //工具栏提示框
13935
13938
  }
13936
13939
 
13937
13940
  this.ReloadChartPaint=function(resource)
@@ -14460,6 +14463,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
14460
14463
  if (!option) return;
14461
14464
 
14462
14465
  var frame=subFrame.Frame;
14466
+ var pixelRatio=GetDevicePixelRatio();
14463
14467
 
14464
14468
  if (option.Window)
14465
14469
  {
@@ -14499,6 +14503,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
14499
14503
  if (IFrameSplitOperator.IsBool(option.IsShowYLine)) subFrame.Frame.IsShowYLine=option.IsShowYLine;
14500
14504
  if (IFrameSplitOperator.IsBool(option.IsShowIndexTitle)) subFrame.Frame.IsShowIndexTitle=option.IsShowIndexTitle;
14501
14505
  if (IFrameSplitOperator.IsNumber(option.Height)) subFrame.Height=option.Height; //高度
14506
+ if (IFrameSplitOperator.IsNumber(option.TopSpace)) frame.ChartBorder.TopSpace=option.TopSpace*pixelRatio;
14507
+ if (IFrameSplitOperator.IsNumber(option.BottomSpace)) frame.ChartBorder.BottomSpace=option.BottomSpace*pixelRatio;
14502
14508
 
14503
14509
 
14504
14510
  if (IFrameSplitOperator.IsBool(option.IsShowLeftText))
@@ -17668,6 +17674,8 @@ function AverageWidthFrame()
17668
17674
  this.BeforeDrawXYCallback; //坐标绘制前回调,绘制深度图
17669
17675
  this.GetEventCallback; //事件回调
17670
17676
 
17677
+ this.DivFrameToolbar;
17678
+
17671
17679
  //工具栏的按钮样式
17672
17680
  this.ToolbarButtonStyle=g_JSChartResource.ToolbarButtonStyle;
17673
17681
  this.CloseWindowButton=CloneData(g_JSChartResource.Buttons.CloseWindow);
@@ -17717,6 +17725,8 @@ function AverageWidthFrame()
17717
17725
  this.ButtonTooltip=CloneData(g_JSChartResource.Buttons.Tooltip);
17718
17726
  this.AddIndexWindowButton=CloneData(g_JSChartResource.Buttons.AddIndexWindow);
17719
17727
  }
17728
+
17729
+ if (this.DivFrameToolbar) this.DivFrameToolbar.ReloadResource(resource);
17720
17730
  }
17721
17731
 
17722
17732
  this.DrawFrame=function()
@@ -20286,7 +20296,6 @@ function AverageWidthFrame()
20286
20296
  }
20287
20297
  }
20288
20298
 
20289
-
20290
20299
  if (IFrameSplitOperator.IsNumber(width.Right)) width.Right+=rightExtendWidth;
20291
20300
  if (IFrameSplitOperator.IsNumber(width.Left)) width.Left+=this.YTextPadding[0]+leftExtendLineWidth;
20292
20301
  if (IFrameSplitOperator.IsNumber(width.Right)) width.Right+=this.YTextPadding[1]+rightExtendLineWidth;
@@ -20294,25 +20303,34 @@ function AverageWidthFrame()
20294
20303
  return { TextWidth:width };
20295
20304
  }
20296
20305
 
20306
+ this.CreateDivFrameToolbar=function(hqchart, frameID, divHQChart)
20307
+ {
20308
+ if (this.ToolbarButtonStyle==1) return;
20309
+ if (this.DivFrameToolbar) return;
20310
+
20311
+ if (this.ClassName=="MinuteFrame" || this.ClassName=="KLineFrame")
20312
+ {
20313
+ this.DivFrameToolbar=new JSDivFrameToolbar();
20314
+ this.DivFrameToolbar.HQChart=hqchart;
20315
+ this.DivFrameToolbar.DivHQChart=divHQChart;
20316
+ this.DivFrameToolbar.FrameID=frameID;
20317
+ this.DivFrameToolbar.Create();
20318
+ }
20319
+ }
20320
+
20297
20321
  this.ClearToolbar=function()
20298
20322
  {
20299
- if (!this.ToolbarID) return;
20323
+ if (!this.DivFrameToolbar) return;
20300
20324
 
20301
- var divToolbar=document.getElementById(this.ToolbarID);
20302
- if (!divToolbar) return;
20303
- this.ChartBorder.UIElement.parentNode.removeChild(divToolbar);
20304
- this.ToolbarRect=null;
20325
+ this.DivFrameToolbar.Destroy();
20326
+ this.DivFrameToolbar=null;
20305
20327
  }
20306
20328
 
20307
20329
  this.HideToolbar=function()
20308
20330
  {
20309
- if (!this.ToolbarID) return;
20331
+ if (!this.DivFrameToolbar) return;
20310
20332
 
20311
- this.ToolbarRect=null;
20312
- var divToolbar=document.getElementById(this.ToolbarID);
20313
- if (!divToolbar) return;
20314
-
20315
- if (divToolbar.style.display!='none') divToolbar.style.display='none';
20333
+ this.DivFrameToolbar.Hide();
20316
20334
  }
20317
20335
 
20318
20336
  this.GetMainOverlayFrame=function()
@@ -20350,7 +20368,6 @@ function MinuteFrame()
20350
20368
  this.MultiDayBorderPen=g_JSChartResource.MultiDayBorderPen;
20351
20369
  this.CustomHorizontalInfo=[];
20352
20370
  this.RightFrame=null; //右侧多重坐标
20353
- this.ToolbarID=Guid(); //工具条Div id
20354
20371
  this.ReDrawToolbar=false;
20355
20372
  this.DayCount=1; //显示天数
20356
20373
 
@@ -20363,7 +20380,6 @@ function MinuteFrame()
20363
20380
  this.OverlayIndex=g_JSChartResource.MinuteToolbar.OverlayIndex; //是否显示叠加指标
20364
20381
  this.AddIndexWindow=g_JSChartResource.MinuteToolbar.AddIndexWindow; //是否显示'增加指标窗口'菜单
20365
20382
 
20366
- this.ToolbarRect=null; //保存工具条的位置
20367
20383
  this.IsShowPositionTitle=false; //是否显示持仓标题
20368
20384
 
20369
20385
  this.LastCalculateStatus={ Width:0, XPointCount:0 }; //最后一次计算宽度的状态
@@ -20495,112 +20511,8 @@ function MinuteFrame()
20495
20511
  if (this.ToolbarButtonStyle==1) return;
20496
20512
  if (g_JSChartResource.IsDOMFrameToolbar===true) return;
20497
20513
 
20498
- if (typeof($)=="undefined") return;
20499
-
20500
- if (this.Identify<2) return;
20501
- if (!this.ChartBorder.UIElement) return;
20502
-
20503
- var divToolbar=document.getElementById(this.ToolbarID);
20504
- if (divToolbar && this.SizeChange==false && this.ReDrawToolbar==false) return;
20505
-
20506
- if (!divToolbar)
20507
- {
20508
- divToolbar=document.createElement("div");
20509
- divToolbar.className='klineframe-toolbar';
20510
- divToolbar.id=this.ToolbarID;
20511
- divToolbar.oncontextmenu = function() { return false;}; //屏蔽右键系统菜单
20512
- //为divToolbar添加属性identify
20513
- divToolbar.setAttribute("identify",this.Identify.toString());
20514
- this.ChartBorder.UIElement.parentNode.appendChild(divToolbar);
20515
- }
20516
-
20517
- if (!this.ModifyIndex && !this.ChangeIndex && !this.OverlayIndex && !this.CloseIndex)
20518
- {
20519
- if (divToolbar.style.display!='none')
20520
- divToolbar.style.display='none';
20521
- return;
20522
- }
20523
-
20524
- //使用外城div尺寸 画图尺寸是被放大的
20525
- var pixelTatio = GetDevicePixelRatio();
20526
- var chartWidth=parseInt(this.ChartBorder.UIElement.parentElement.style.width.replace("px",""));
20527
- var chartHeight=parseInt(this.ChartBorder.UIElement.parentElement.style.height.replace("px",""));
20528
- //JSConsole.Chart.Log('[KLineFrame::DrawToolbar] ',chartWidth,chartHeight,pixelTatio);
20529
-
20530
- var toolbarWidth=100;
20531
- var toolbarHeight=this.ChartBorder.GetTitleHeight();
20532
- var left=chartWidth-(this.ChartBorder.Right/pixelTatio)-toolbarWidth;
20533
- var top=this.ChartBorder.GetTop()/pixelTatio;
20534
-
20535
- if (this.ToolbarRect)
20536
- {
20537
- //尺寸变动移动才重新设置DOM
20538
- if (this.ToolbarRect.Left==left && this.ToolbarRect.Top==top &&
20539
- this.ToolbarRect.Width==toolbarWidth && this.ToolbarRect.Height==toolbarHeight/pixelTatio)
20540
- {
20541
- return;
20542
- }
20543
- }
20544
-
20545
- this.ToolbarRect={ Left:left, Top:top, Width:toolbarWidth, Height:toolbarHeight/pixelTatio };
20546
-
20547
- const modifyButton=`<span class='index_param icon iconfont icon-index_param' id='modifyindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='调整指标参数'></span>`;
20548
- const changeButton=`<span class='index_change icon iconfont icon-change_index' id='changeindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='切换指标'></span>`;
20549
- const closeButton=`<span class='index_close icon iconfont icon-close' id='closeindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='关闭指标窗口'></span>`;
20550
-
20551
- var spanIcon=modifyButton+changeButton;
20552
- if (this.CloseIndex)
20553
- {
20554
- spanIcon+=closeButton;
20555
- }
20556
-
20557
- //var scrollPos=GetScrollPosition();
20558
- //left = left+scrollPos.Left;
20559
- //top = top+scrollPos.Top;
20560
- divToolbar.style.left = left + "px";
20561
- divToolbar.style.top = top + "px";
20562
- divToolbar.style.width=toolbarWidth+"px"; //宽度先不调整吧
20563
- divToolbar.style.height=(toolbarHeight/pixelTatio)+'px'; //只调整高度
20564
- divToolbar.innerHTML=spanIcon;
20565
-
20566
- var chart=this.ChartBorder.UIElement.JSChartContainer;
20567
- var identify=this.Identify;
20568
- if (!this.ModifyIndex) //隐藏'改参数'
20569
- $("#"+divToolbar.id+" .index_param").hide();
20570
- else if (typeof(this.ModifyIndexEvent)=='function') //绑定点击事件
20571
- $("#"+divToolbar.id+" .index_param").click(
20572
- {
20573
- Chart:this.ChartBorder.UIElement.JSChartContainer,
20574
- Identify:this.Identify
20575
- },this.ModifyIndexEvent);
20576
-
20577
- if (!this.ChangeIndex) //隐藏'换指标'
20578
- {
20579
- $("#"+divToolbar.id+" .index_change").hide();
20580
- }
20581
- else if (typeof(this.ChangeIndexEvent)=='function')
20582
- {
20583
- $("#"+divToolbar.id+" .index_change").click(
20584
- {
20585
- Chart:this.ChartBorder.UIElement.JSChartContainer,
20586
- Identify:this.Identify,
20587
- IsOverlay:false
20588
- },this.ChangeIndexEvent);
20589
- }
20590
-
20591
- $("#"+divToolbar.id+" .index_close").click(
20592
- {
20593
- Chart:this.ChartBorder.UIElement.JSChartContainer,
20594
- Identify:this.Identify
20595
- },
20596
- function(event)
20597
- {
20598
- var hqChart=event.data.Chart;
20599
- var id=event.data.Identify;
20600
- hqChart.RemoveIndexWindow(id);
20601
- });
20602
-
20603
- divToolbar.style.display = "block";
20514
+ if (!this.DivFrameToolbar) return;
20515
+ this.DivFrameToolbar.Show(this.Identify);
20604
20516
  }
20605
20517
 
20606
20518
  //手绘,不用DOM,使用DOM太麻烦了
@@ -22782,7 +22694,6 @@ function KLineFrame()
22782
22694
  delete this.newMethod;
22783
22695
 
22784
22696
  this.ClassName='KLineFrame';
22785
- this.ToolbarID=Guid(); //工具条Div id
22786
22697
 
22787
22698
  this.ModifyIndex=g_JSChartResource.KLineToolbar.ModifyIndex; //是否显示'改参数'菜单
22788
22699
  this.ChangeIndex=g_JSChartResource.KLineToolbar.ChangeIndex; //是否显示'换指标'菜单
@@ -22795,7 +22706,6 @@ function KLineFrame()
22795
22706
 
22796
22707
  this.SelBorderColor=g_JSChartResource.SelFrameBorderColor;
22797
22708
 
22798
- this.ToolbarRect=null; //保存工具条的位置
22799
22709
  this.ReDrawToolbar=false;
22800
22710
 
22801
22711
  this.LastCalculateStatus={ Width:0, XPointCount:0 }; //最后一次计算宽度的状态
@@ -22819,6 +22729,11 @@ function KLineFrame()
22819
22729
  {
22820
22730
  if (this.ToolbarButtonStyle==1) return;
22821
22731
  if (g_JSChartResource.IsDOMFrameToolbar===true) return;
22732
+ if (!this.DivFrameToolbar) return;
22733
+
22734
+ this.DivFrameToolbar.Show(this.Identify);
22735
+
22736
+ return;
22822
22737
 
22823
22738
  if (typeof($)=="undefined") return;
22824
22739
 
@@ -57240,6 +57155,10 @@ function KLineCountDownPaint()
57240
57155
  this.CanvasEx.fillStyle=out.BGColor;
57241
57156
  this.CanvasEx.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
57242
57157
  }
57158
+ else
57159
+ {
57160
+ return;
57161
+ }
57243
57162
 
57244
57163
  this.Canvas.textAlign = "left";
57245
57164
  this.Canvas.textBaseline = "bottom";
@@ -81573,6 +81492,12 @@ function JSChartResource()
81573
81492
  Mergin:{ Left:4, Right:4, Top:2, Bottom:3 },
81574
81493
  }
81575
81494
  }
81495
+
81496
+ this.DivFrameToolbar=
81497
+ {
81498
+ Icon:{ Color:"rgb(0,0,0)", HoverColor:"rgb(30,144,255)" },
81499
+ Tooltip:{ BGColor:"rgb(255,255,255)", TextColor:"rgb(71,71,71)", BorderColor:"rgb(0,0,0)" },
81500
+ }
81576
81501
 
81577
81502
  //画图工具
81578
81503
  this.DrawPicture=
@@ -83551,6 +83476,29 @@ function JSChartResource()
83551
83476
  if (style.KLineCountDownPaint) this.SetKLineCountDownPaint(style.KLineCountDownPaint);
83552
83477
 
83553
83478
  if (style.SmallFloatTooltipV2) this.SetSmallFloatTooltipV2(style.SmallFloatTooltipV2);
83479
+
83480
+ if (style.DivFrameToolbar) this.SetDivFrameToolbar(style.DivFrameToolbar);
83481
+ }
83482
+
83483
+ this.SetDivFrameToolbar=function(style)
83484
+ {
83485
+ var dest=this.DivFrameToolbar;
83486
+ if (style.Icon)
83487
+ {
83488
+ var item=style.Icon;
83489
+ var subDest=dest.Icon;
83490
+ if (item.Color) subDest.Color=item.Color;
83491
+ if (item.HoverColor) subDest.HoverColor=item.HoverColor;
83492
+ }
83493
+
83494
+ if (style.Tooltip)
83495
+ {
83496
+ var item=style.Tooltip;
83497
+ var subDest=dest.Tooltip;
83498
+ if (item.TextColor) subDest.TextColor=item.TextColor;
83499
+ if (item.BorderColor) subDest.BorderColor=item.BorderColor;
83500
+ if (item.BGColor) subDest.BGColor=item.BGColor;
83501
+ }
83554
83502
  }
83555
83503
 
83556
83504
  this.SetSmallFloatTooltipV2=function(style)
@@ -86887,6 +86835,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
86887
86835
  frame.RightSpaceCount=this.RightSpaceCount; //右边
86888
86836
  frame.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
86889
86837
  frame.GlobalOption=this.GlobalOption;
86838
+ frame.CreateDivFrameToolbar(this, i, this.UIElement.parentNode);
86890
86839
 
86891
86840
  frame.HorizontalMax=20;
86892
86841
  frame.HorizontalMin=10;
@@ -86987,6 +86936,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
86987
86936
  frame.YSplitOperator.HQChart=this;
86988
86937
  frame.XSplitOperator.Symbol=this.Symbol;
86989
86938
  frame.XSplitOperator.Period=this.Period;
86939
+ frame.CreateDivFrameToolbar(this, id, this.UIElement.parentNode);
86990
86940
 
86991
86941
  //K线数据绑定
86992
86942
  var xPointCouont=this.Frame.SubFrame[0].Frame.XPointCount;
@@ -89577,7 +89527,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
89577
89527
  if (bChanged)
89578
89528
  {
89579
89529
  frame.SizeChange=true;
89580
- frame.ToolbarRect=null; //清空工具栏缓存
89581
89530
  frame.DrawToolbar();
89582
89531
  }
89583
89532
  }
@@ -96548,7 +96497,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
96548
96497
 
96549
96498
  if (i>=2)
96550
96499
  {
96551
-
96500
+ frame.CreateDivFrameToolbar(this, i, this.UIElement.parentNode);
96552
96501
  }
96553
96502
 
96554
96503
  var DEFAULT_HORIZONTAL=[9,8,7,6,5,4,3,2,1];
@@ -96655,6 +96604,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
96655
96604
  frame.XSplitOperator.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
96656
96605
  frame.YSplitOperator.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
96657
96606
  frame.XSplitOperator.Symbol=this.Symbol;
96607
+ frame.CreateDivFrameToolbar(this, id, this.UIElement.parentNode);
96658
96608
 
96659
96609
  if (this.DayCount>1)
96660
96610
  {
@@ -109401,6 +109351,304 @@ Path2DHelper.PtInRect=function(x, y, rect)
109401
109351
  }
109402
109352
 
109403
109353
 
109354
+ ////////////////////////////////////////////////////////////////////////////////////
109355
+ // 指标窗口顶部工具条
109356
+ //
109357
+ //
109358
+ ///////////////////////////////////////////////////////////////////////////////////
109359
+
109360
+
109361
+ function JSDivFrameToolbar()
109362
+ {
109363
+ this.DivToolbar=null;
109364
+ this.DivHQChart=null;
109365
+ this.HQChart=null;
109366
+ this.FrameID=-1; //指标窗口ID
109367
+ this.ID=Guid();
109368
+ this.Left=-1;
109369
+ this.Top=-1;
109370
+
109371
+ this.IconConfig=
109372
+ {
109373
+ Color:g_JSChartResource.DivFrameToolbar.Icon.Color,
109374
+ HoverColor:g_JSChartResource.DivFrameToolbar.Icon.HoverColor
109375
+ }
109376
+
109377
+ this.AryButton=
109378
+ [
109379
+ {
109380
+ ID:JSCHART_BUTTON_ID.MODIFY_INDEX_PARAM, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-index_param", Tooltip:{ Text:"修改参数"},
109381
+ Span:null, Div:null, TooltipSpan:null
109382
+ },
109383
+ {
109384
+ ID:JSCHART_BUTTON_ID.CHANGE_INDEX, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-change_index", Tooltip:{ Text:"切换指标"},
109385
+ Span:null,Div:null, TooltipSpan:null
109386
+ },
109387
+ {
109388
+ ID:JSCHART_BUTTON_ID.OVERLAY_INDEX, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-overlay_index", Tooltip:{ Text:"叠加指标"},
109389
+ Span:null,Div:null, TooltipSpan:null
109390
+ },
109391
+ {
109392
+ ID:JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-close", Tooltip:{ Text:"关闭窗口"},
109393
+ Span:null,Div:null, TooltipSpan:null
109394
+ },
109395
+ ];
109396
+
109397
+ this.SetToolbar=function(aryButton)
109398
+ {
109399
+ //清空原来的按钮
109400
+ for(var i=0; i<this.AryButton.length; i++)
109401
+ {
109402
+ var item=this.AryButton[i];
109403
+ if (item.Div && this.DivToolbar) this.DivToolbar.removeChild(item.Div);
109404
+ item.Div=null;
109405
+ item.Span=null;
109406
+ item.TooltipSpan=null;
109407
+ }
109408
+ this.AryButton=[];
109409
+
109410
+ //重新创建
109411
+ for(var i=0;i<aryButton.length; i++)
109412
+ {
109413
+ var item=aryButton[i];
109414
+ if (!item.ID || !item.ClassName) continue;
109415
+ var newItem={ ID:item.ID, ClassName:item.ClassName, Span:null,Div:null, TooltipSpan:null };
109416
+ if (item.Tooltip && item.Tooltip.Text) newItem.Tooltip={ Text:item.Tooltip.Text };
109417
+
109418
+ this.AryButton.push(newItem);
109419
+
109420
+ if (this.DivToolbar) this.CreateButton(newItem, this.DivToolbar);
109421
+ }
109422
+
109423
+ this.UpdateStyle();
109424
+ }
109425
+
109426
+ this.Destroy=function()
109427
+ {
109428
+ if (this.DivToolbar)
109429
+ {
109430
+ if (this.DivHQChart.removeChild) this.DivHQChart.removeChild(this.DivToolbar);
109431
+ this.DivToolbar=null;
109432
+ }
109433
+
109434
+ this.HQChart=null;
109435
+ this.DivHQChart=null;
109436
+ this.FrameID=-1;
109437
+ }
109438
+
109439
+ this.Create=function()
109440
+ {
109441
+ var divToolbar=document.createElement("div");
109442
+ divToolbar.className='UMyChart_FrameToolbar_Div';
109443
+ divToolbar.id=this.ID;
109444
+ divToolbar.oncontextmenu = function() { return false; }; //屏蔽右键系统菜单
109445
+
109446
+ for(var i=0;i<this.AryButton.length; i++)
109447
+ {
109448
+ var item=this.AryButton[i];
109449
+ if (this.FrameID==0 && item.ID==JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW) continue; //第一个指标窗口不显示关闭按钮
109450
+ this.CreateButton(item, divToolbar);
109451
+ }
109452
+
109453
+ this.DivHQChart.appendChild(divToolbar);
109454
+
109455
+ this.DivToolbar=divToolbar;
109456
+
109457
+ this.UpdateStyle();
109458
+
109459
+ if (!this.HQChart.JSToolbarTooltip)
109460
+ {
109461
+ this.HQChart.JSToolbarTooltip=new JSToolbarTooltip();
109462
+ this.HQChart.JSToolbarTooltip.DivHQChart=this.DivHQChart;
109463
+ this.HQChart.JSToolbarTooltip.Create();
109464
+ }
109465
+ }
109466
+
109467
+ this.UpdateStyle=function()
109468
+ {
109469
+ if (!this.DivToolbar) return;
109470
+
109471
+ for(var i=0;i<this.AryButton.length; i++)
109472
+ {
109473
+ var item=this.AryButton[i]
109474
+ if (!item.Span) continue;
109475
+ item.Span.style["color"]=this.IconConfig.Color;
109476
+ }
109477
+ }
109478
+
109479
+ this.ReloadResource=function(option)
109480
+ {
109481
+ this.IconConfig.Color=g_JSChartResource.DivFrameToolbar.Icon.Color,
109482
+ this.IconConfig.HoverColor=g_JSChartResource.DivFrameToolbar.Icon.HoverColor;
109483
+
109484
+ this.UpdateStyle();
109485
+ }
109486
+
109487
+ this.CreateButton=function(item, divDom)
109488
+ {
109489
+ var btnDiv=document.createElement("div");
109490
+ btnDiv.className="UMyChart_FrameToolbar_Div_Button";
109491
+ btnDiv.onmouseover=(e)=> { this.OnHoverButton(e, item); }
109492
+ btnDiv.onmouseout=(e)=>{ this.OnLeaveButton(e, item); }
109493
+ item.Div=btnDiv;
109494
+
109495
+ var spanDom=document.createElement("span");
109496
+ spanDom.className=item.ClassName;
109497
+ spanDom.onmousedown=(e)=>{ this.OnClickButton(e, item); };
109498
+ item.Span=spanDom;
109499
+ btnDiv.appendChild(spanDom);
109500
+
109501
+ divDom.appendChild(btnDiv);
109502
+ }
109503
+
109504
+ this.OnClickButton=function(e, item)
109505
+ {
109506
+ if (!this.FrameID<0) return;
109507
+ if (!this.HQChart) return;
109508
+
109509
+ var frame=this.HQChart.Frame.SubFrame[this.FrameID].Frame;
109510
+
109511
+ var button={ ID:item.ID, Frame:frame };
109512
+ this.HQChart.ClickFrameButton(button, e);
109513
+ }
109514
+
109515
+ this.OnHoverButton=function(e, item)
109516
+ {
109517
+ if (!item.Span) return;
109518
+
109519
+ item.Span.style["color"]=this.IconConfig.HoverColor;
109520
+
109521
+ this.ShowTooltip(e, item);
109522
+ }
109523
+
109524
+ this.OnLeaveButton=function(e, item)
109525
+ {
109526
+ if (!item.Span) return;
109527
+ item.Span.style["color"]=this.IconConfig.Color;
109528
+
109529
+ this.HideTooltip();
109530
+ }
109531
+
109532
+ this.Show=function(frameID)
109533
+ {
109534
+ this.FrameID=frameID;
109535
+ if (!this.FrameID<0) return;
109536
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.HQChart.Frame.SubFrame)) return;
109537
+ if (!this.HQChart.Frame.SubFrame[this.FrameID]) return;
109538
+
109539
+ var pixelTatio = GetDevicePixelRatio();
109540
+ var frame=this.HQChart.Frame.SubFrame[this.FrameID].Frame;
109541
+ var border=frame.GetBorder();
109542
+
109543
+ var top=border.Top/pixelTatio;
109544
+ var right=border.RightEx/pixelTatio;
109545
+ var left=right-this.DivToolbar.offsetWidth-2;
109546
+
109547
+ if (this.Top!=top || this.Left!=left)
109548
+ {
109549
+ this.DivToolbar.style.top = top + "px";
109550
+ this.DivToolbar.style.left = left + "px";
109551
+ this.DivToolbar.style.height=frame.ChartBorder.TitleHeight/pixelTatio + "px";
109552
+ this.Top=top;
109553
+ this.Left=left;
109554
+ }
109555
+
109556
+ if (this.DivToolbar.style.visibility!='visible') this.DivToolbar.style.visibility='visible';
109557
+ }
109558
+
109559
+ this.Hide=function()
109560
+ {
109561
+ if (this.DivToolbar) this.DivToolbar.style.visibility="hidden";
109562
+ }
109563
+
109564
+ this.HideTooltip=function()
109565
+ {
109566
+ if (this.HQChart.JSToolbarTooltip) this.HQChart.JSToolbarTooltip.Hide();
109567
+ }
109568
+
109569
+ this.ShowTooltip=function(e, item)
109570
+ {
109571
+ if (!this.HQChart.JSToolbarTooltip) return;
109572
+ if (!item.Div) return;
109573
+
109574
+ var rtButton=item.Div.getBoundingClientRect();
109575
+ var rtHQChart=this.DivHQChart.getBoundingClientRect();
109576
+ var left=rtButton.left-rtHQChart.left;
109577
+ var top=rtButton.bottom-rtHQChart.top+2;
109578
+ this.HQChart.JSToolbarTooltip.Show(top, left, { Text:item.Tooltip.Text });
109579
+ }
109580
+ }
109581
+
109582
+
109583
+ function JSToolbarTooltip()
109584
+ {
109585
+ this.DivTooltip=null;
109586
+ this.DivHQChart=null;
109587
+ this.Text=null;
109588
+ this.Left=-1;
109589
+ this.Top=-1;
109590
+
109591
+ this.BGColor=g_JSChartResource.DivFrameToolbar.Tooltip.BGColor;
109592
+ this.TextColor=g_JSChartResource.DivFrameToolbar.Tooltip.TextColor;
109593
+ this.BorderColor=g_JSChartResource.DivFrameToolbar.Tooltip.BorderColor;
109594
+
109595
+ this.Create=function()
109596
+ {
109597
+ var divDom=document.createElement("div");
109598
+ divDom.className='UMyChart_Toolbar_Tooltip_Div';
109599
+ this.DivHQChart.appendChild(divDom);
109600
+
109601
+ this.DivTooltip=divDom;
109602
+
109603
+ this.UpdateStyle();
109604
+ }
109605
+
109606
+ this.ReloadResource=function(option)
109607
+ {
109608
+ this.BGColor=g_JSChartResource.DivFrameToolbar.Tooltip.BGColor;
109609
+ this.TextColor=g_JSChartResource.DivFrameToolbar.Tooltip.TextColor;
109610
+ this.BorderColor=g_JSChartResource.DivFrameToolbar.Tooltip.BorderColor;
109611
+
109612
+ this.UpdateStyle();
109613
+ }
109614
+
109615
+ this.UpdateStyle=function()
109616
+ {
109617
+ if (!this.DivTooltip) return;
109618
+
109619
+ this.DivTooltip.style["background-color"]=this.BGColor;
109620
+ this.DivTooltip.style["color"]=this.TextColor;
109621
+ this.DivTooltip.style["border"]="1px solid " + this.BorderColor;
109622
+ }
109623
+
109624
+ this.Show=function(top, left, tooltipData)
109625
+ {
109626
+ if (!this.DivTooltip) return;
109627
+
109628
+ if (this.Text!=tooltipData.Text) this.DivTooltip.innerHTML=tooltipData.Text;
109629
+ var right=left+this.DivTooltip.offsetWidth;
109630
+ if ((right+5)>=window.innerWidth) left=left-this.DivTooltip.offsetWidth;
109631
+
109632
+ if (this.Top!=top || this.Left!=left)
109633
+ {
109634
+ this.DivTooltip.style.top = top + "px";
109635
+ this.DivTooltip.style.left = left + "px";
109636
+ this.Top=top;
109637
+ this.Left=left;
109638
+ }
109639
+
109640
+ if (this.DivTooltip.style.visibility!='visible') this.DivTooltip.style.visibility='visible';
109641
+ }
109642
+
109643
+ this.Hide=function()
109644
+ {
109645
+ if (!this.DivTooltip) return;
109646
+
109647
+ if (this.DivTooltip.style["visibility"]!='hidden') this.DivTooltip.style["visibility"]="hidden";
109648
+ }
109649
+ }
109650
+
109651
+
109404
109652
 
109405
109653
 
109406
109654
 
@@ -136627,6 +136875,12 @@ function GetBlackStyle()
136627
136875
  //Mergin:{ Left:4, Right:4, Top:2, Bottom:4 },
136628
136876
  }
136629
136877
  },
136878
+
136879
+ DivFrameToolbar:
136880
+ {
136881
+ Icon:{ Color:"rgb(156,156,156)", HoverColor:"rgb(255,255,255)" },
136882
+ Tooltip:{ BGColor:"rgb(32,32,32)", TextColor:"rgb(204,204,204)", BorderColor:"rgb(69,69,69)" },
136883
+ },
136630
136884
 
136631
136885
  DrawPicture: //画图工具
136632
136886
  {
@@ -153365,7 +153619,7 @@ function ScrollBarBGChart()
153365
153619
 
153366
153620
 
153367
153621
 
153368
- var HQCHART_VERSION="1.1.15059";
153622
+ var HQCHART_VERSION="1.1.15065";
153369
153623
 
153370
153624
  function PrintHQChartVersion()
153371
153625
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.15059";
8
+ var HQCHART_VERSION="1.1.15065";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {