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.
@@ -7514,6 +7514,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7514
7514
  this.DialogSearchIndex; //指标搜索
7515
7515
  this.DialogModifyIndexParam; //指标参数修改
7516
7516
  this.SmallFloatTooltipGroup; //小浮框tooltip信息集合
7517
+ this.JSToolbarTooltip; //指标标题工具栏tooltip信息
7517
7518
 
7518
7519
 
7519
7520
  this.RestoreFocusTimer=null; //恢复焦点定时器
@@ -13976,6 +13977,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
13976
13977
  if (overlayItem.Frame && overlayItem.Frame.ReloadResource) overlayItem.Frame.ReloadResource(resource);
13977
13978
  }
13978
13979
  }
13980
+
13981
+ if (this.JSToolbarTooltip) this.JSToolbarTooltip.ReloadResource(resource); //工具栏提示框
13979
13982
  }
13980
13983
 
13981
13984
  this.ReloadChartPaint=function(resource)
@@ -14504,6 +14507,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
14504
14507
  if (!option) return;
14505
14508
 
14506
14509
  var frame=subFrame.Frame;
14510
+ var pixelRatio=GetDevicePixelRatio();
14507
14511
 
14508
14512
  if (option.Window)
14509
14513
  {
@@ -14543,6 +14547,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
14543
14547
  if (IFrameSplitOperator.IsBool(option.IsShowYLine)) subFrame.Frame.IsShowYLine=option.IsShowYLine;
14544
14548
  if (IFrameSplitOperator.IsBool(option.IsShowIndexTitle)) subFrame.Frame.IsShowIndexTitle=option.IsShowIndexTitle;
14545
14549
  if (IFrameSplitOperator.IsNumber(option.Height)) subFrame.Height=option.Height; //高度
14550
+ if (IFrameSplitOperator.IsNumber(option.TopSpace)) frame.ChartBorder.TopSpace=option.TopSpace*pixelRatio;
14551
+ if (IFrameSplitOperator.IsNumber(option.BottomSpace)) frame.ChartBorder.BottomSpace=option.BottomSpace*pixelRatio;
14546
14552
 
14547
14553
 
14548
14554
  if (IFrameSplitOperator.IsBool(option.IsShowLeftText))
@@ -17712,6 +17718,8 @@ function AverageWidthFrame()
17712
17718
  this.BeforeDrawXYCallback; //坐标绘制前回调,绘制深度图
17713
17719
  this.GetEventCallback; //事件回调
17714
17720
 
17721
+ this.DivFrameToolbar;
17722
+
17715
17723
  //工具栏的按钮样式
17716
17724
  this.ToolbarButtonStyle=g_JSChartResource.ToolbarButtonStyle;
17717
17725
  this.CloseWindowButton=CloneData(g_JSChartResource.Buttons.CloseWindow);
@@ -17761,6 +17769,8 @@ function AverageWidthFrame()
17761
17769
  this.ButtonTooltip=CloneData(g_JSChartResource.Buttons.Tooltip);
17762
17770
  this.AddIndexWindowButton=CloneData(g_JSChartResource.Buttons.AddIndexWindow);
17763
17771
  }
17772
+
17773
+ if (this.DivFrameToolbar) this.DivFrameToolbar.ReloadResource(resource);
17764
17774
  }
17765
17775
 
17766
17776
  this.DrawFrame=function()
@@ -20330,7 +20340,6 @@ function AverageWidthFrame()
20330
20340
  }
20331
20341
  }
20332
20342
 
20333
-
20334
20343
  if (IFrameSplitOperator.IsNumber(width.Right)) width.Right+=rightExtendWidth;
20335
20344
  if (IFrameSplitOperator.IsNumber(width.Left)) width.Left+=this.YTextPadding[0]+leftExtendLineWidth;
20336
20345
  if (IFrameSplitOperator.IsNumber(width.Right)) width.Right+=this.YTextPadding[1]+rightExtendLineWidth;
@@ -20338,25 +20347,34 @@ function AverageWidthFrame()
20338
20347
  return { TextWidth:width };
20339
20348
  }
20340
20349
 
20350
+ this.CreateDivFrameToolbar=function(hqchart, frameID, divHQChart)
20351
+ {
20352
+ if (this.ToolbarButtonStyle==1) return;
20353
+ if (this.DivFrameToolbar) return;
20354
+
20355
+ if (this.ClassName=="MinuteFrame" || this.ClassName=="KLineFrame")
20356
+ {
20357
+ this.DivFrameToolbar=new JSDivFrameToolbar();
20358
+ this.DivFrameToolbar.HQChart=hqchart;
20359
+ this.DivFrameToolbar.DivHQChart=divHQChart;
20360
+ this.DivFrameToolbar.FrameID=frameID;
20361
+ this.DivFrameToolbar.Create();
20362
+ }
20363
+ }
20364
+
20341
20365
  this.ClearToolbar=function()
20342
20366
  {
20343
- if (!this.ToolbarID) return;
20367
+ if (!this.DivFrameToolbar) return;
20344
20368
 
20345
- var divToolbar=document.getElementById(this.ToolbarID);
20346
- if (!divToolbar) return;
20347
- this.ChartBorder.UIElement.parentNode.removeChild(divToolbar);
20348
- this.ToolbarRect=null;
20369
+ this.DivFrameToolbar.Destroy();
20370
+ this.DivFrameToolbar=null;
20349
20371
  }
20350
20372
 
20351
20373
  this.HideToolbar=function()
20352
20374
  {
20353
- if (!this.ToolbarID) return;
20354
-
20355
- this.ToolbarRect=null;
20356
- var divToolbar=document.getElementById(this.ToolbarID);
20357
- if (!divToolbar) return;
20375
+ if (!this.DivFrameToolbar) return;
20358
20376
 
20359
- if (divToolbar.style.display!='none') divToolbar.style.display='none';
20377
+ this.DivFrameToolbar.Hide();
20360
20378
  }
20361
20379
 
20362
20380
  this.GetMainOverlayFrame=function()
@@ -20394,7 +20412,6 @@ function MinuteFrame()
20394
20412
  this.MultiDayBorderPen=g_JSChartResource.MultiDayBorderPen;
20395
20413
  this.CustomHorizontalInfo=[];
20396
20414
  this.RightFrame=null; //右侧多重坐标
20397
- this.ToolbarID=Guid(); //工具条Div id
20398
20415
  this.ReDrawToolbar=false;
20399
20416
  this.DayCount=1; //显示天数
20400
20417
 
@@ -20407,7 +20424,6 @@ function MinuteFrame()
20407
20424
  this.OverlayIndex=g_JSChartResource.MinuteToolbar.OverlayIndex; //是否显示叠加指标
20408
20425
  this.AddIndexWindow=g_JSChartResource.MinuteToolbar.AddIndexWindow; //是否显示'增加指标窗口'菜单
20409
20426
 
20410
- this.ToolbarRect=null; //保存工具条的位置
20411
20427
  this.IsShowPositionTitle=false; //是否显示持仓标题
20412
20428
 
20413
20429
  this.LastCalculateStatus={ Width:0, XPointCount:0 }; //最后一次计算宽度的状态
@@ -20539,112 +20555,8 @@ function MinuteFrame()
20539
20555
  if (this.ToolbarButtonStyle==1) return;
20540
20556
  if (g_JSChartResource.IsDOMFrameToolbar===true) return;
20541
20557
 
20542
- if (typeof($)=="undefined") return;
20543
-
20544
- if (this.Identify<2) return;
20545
- if (!this.ChartBorder.UIElement) return;
20546
-
20547
- var divToolbar=document.getElementById(this.ToolbarID);
20548
- if (divToolbar && this.SizeChange==false && this.ReDrawToolbar==false) return;
20549
-
20550
- if (!divToolbar)
20551
- {
20552
- divToolbar=document.createElement("div");
20553
- divToolbar.className='klineframe-toolbar';
20554
- divToolbar.id=this.ToolbarID;
20555
- divToolbar.oncontextmenu = function() { return false;}; //屏蔽右键系统菜单
20556
- //为divToolbar添加属性identify
20557
- divToolbar.setAttribute("identify",this.Identify.toString());
20558
- this.ChartBorder.UIElement.parentNode.appendChild(divToolbar);
20559
- }
20560
-
20561
- if (!this.ModifyIndex && !this.ChangeIndex && !this.OverlayIndex && !this.CloseIndex)
20562
- {
20563
- if (divToolbar.style.display!='none')
20564
- divToolbar.style.display='none';
20565
- return;
20566
- }
20567
-
20568
- //使用外城div尺寸 画图尺寸是被放大的
20569
- var pixelTatio = GetDevicePixelRatio();
20570
- var chartWidth=parseInt(this.ChartBorder.UIElement.parentElement.style.width.replace("px",""));
20571
- var chartHeight=parseInt(this.ChartBorder.UIElement.parentElement.style.height.replace("px",""));
20572
- //JSConsole.Chart.Log('[KLineFrame::DrawToolbar] ',chartWidth,chartHeight,pixelTatio);
20573
-
20574
- var toolbarWidth=100;
20575
- var toolbarHeight=this.ChartBorder.GetTitleHeight();
20576
- var left=chartWidth-(this.ChartBorder.Right/pixelTatio)-toolbarWidth;
20577
- var top=this.ChartBorder.GetTop()/pixelTatio;
20578
-
20579
- if (this.ToolbarRect)
20580
- {
20581
- //尺寸变动移动才重新设置DOM
20582
- if (this.ToolbarRect.Left==left && this.ToolbarRect.Top==top &&
20583
- this.ToolbarRect.Width==toolbarWidth && this.ToolbarRect.Height==toolbarHeight/pixelTatio)
20584
- {
20585
- return;
20586
- }
20587
- }
20588
-
20589
- this.ToolbarRect={ Left:left, Top:top, Width:toolbarWidth, Height:toolbarHeight/pixelTatio };
20590
-
20591
- const modifyButton=`<span class='index_param icon iconfont icon-index_param' id='modifyindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='调整指标参数'></span>`;
20592
- const changeButton=`<span class='index_change icon iconfont icon-change_index' id='changeindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='切换指标'></span>`;
20593
- const closeButton=`<span class='index_close icon iconfont icon-close' id='closeindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='关闭指标窗口'></span>`;
20594
-
20595
- var spanIcon=modifyButton+changeButton;
20596
- if (this.CloseIndex)
20597
- {
20598
- spanIcon+=closeButton;
20599
- }
20600
-
20601
- //var scrollPos=GetScrollPosition();
20602
- //left = left+scrollPos.Left;
20603
- //top = top+scrollPos.Top;
20604
- divToolbar.style.left = left + "px";
20605
- divToolbar.style.top = top + "px";
20606
- divToolbar.style.width=toolbarWidth+"px"; //宽度先不调整吧
20607
- divToolbar.style.height=(toolbarHeight/pixelTatio)+'px'; //只调整高度
20608
- divToolbar.innerHTML=spanIcon;
20609
-
20610
- var chart=this.ChartBorder.UIElement.JSChartContainer;
20611
- var identify=this.Identify;
20612
- if (!this.ModifyIndex) //隐藏'改参数'
20613
- $("#"+divToolbar.id+" .index_param").hide();
20614
- else if (typeof(this.ModifyIndexEvent)=='function') //绑定点击事件
20615
- $("#"+divToolbar.id+" .index_param").click(
20616
- {
20617
- Chart:this.ChartBorder.UIElement.JSChartContainer,
20618
- Identify:this.Identify
20619
- },this.ModifyIndexEvent);
20620
-
20621
- if (!this.ChangeIndex) //隐藏'换指标'
20622
- {
20623
- $("#"+divToolbar.id+" .index_change").hide();
20624
- }
20625
- else if (typeof(this.ChangeIndexEvent)=='function')
20626
- {
20627
- $("#"+divToolbar.id+" .index_change").click(
20628
- {
20629
- Chart:this.ChartBorder.UIElement.JSChartContainer,
20630
- Identify:this.Identify,
20631
- IsOverlay:false
20632
- },this.ChangeIndexEvent);
20633
- }
20634
-
20635
- $("#"+divToolbar.id+" .index_close").click(
20636
- {
20637
- Chart:this.ChartBorder.UIElement.JSChartContainer,
20638
- Identify:this.Identify
20639
- },
20640
- function(event)
20641
- {
20642
- var hqChart=event.data.Chart;
20643
- var id=event.data.Identify;
20644
- hqChart.RemoveIndexWindow(id);
20645
- });
20646
-
20647
- divToolbar.style.display = "block";
20558
+ if (!this.DivFrameToolbar) return;
20559
+ this.DivFrameToolbar.Show(this.Identify);
20648
20560
  }
20649
20561
 
20650
20562
  //手绘,不用DOM,使用DOM太麻烦了
@@ -22826,7 +22738,6 @@ function KLineFrame()
22826
22738
  delete this.newMethod;
22827
22739
 
22828
22740
  this.ClassName='KLineFrame';
22829
- this.ToolbarID=Guid(); //工具条Div id
22830
22741
 
22831
22742
  this.ModifyIndex=g_JSChartResource.KLineToolbar.ModifyIndex; //是否显示'改参数'菜单
22832
22743
  this.ChangeIndex=g_JSChartResource.KLineToolbar.ChangeIndex; //是否显示'换指标'菜单
@@ -22839,7 +22750,6 @@ function KLineFrame()
22839
22750
 
22840
22751
  this.SelBorderColor=g_JSChartResource.SelFrameBorderColor;
22841
22752
 
22842
- this.ToolbarRect=null; //保存工具条的位置
22843
22753
  this.ReDrawToolbar=false;
22844
22754
 
22845
22755
  this.LastCalculateStatus={ Width:0, XPointCount:0 }; //最后一次计算宽度的状态
@@ -22863,6 +22773,11 @@ function KLineFrame()
22863
22773
  {
22864
22774
  if (this.ToolbarButtonStyle==1) return;
22865
22775
  if (g_JSChartResource.IsDOMFrameToolbar===true) return;
22776
+ if (!this.DivFrameToolbar) return;
22777
+
22778
+ this.DivFrameToolbar.Show(this.Identify);
22779
+
22780
+ return;
22866
22781
 
22867
22782
  if (typeof($)=="undefined") return;
22868
22783
 
@@ -57284,6 +57199,10 @@ function KLineCountDownPaint()
57284
57199
  this.CanvasEx.fillStyle=out.BGColor;
57285
57200
  this.CanvasEx.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
57286
57201
  }
57202
+ else
57203
+ {
57204
+ return;
57205
+ }
57287
57206
 
57288
57207
  this.Canvas.textAlign = "left";
57289
57208
  this.Canvas.textBaseline = "bottom";
@@ -81617,6 +81536,12 @@ function JSChartResource()
81617
81536
  Mergin:{ Left:4, Right:4, Top:2, Bottom:3 },
81618
81537
  }
81619
81538
  }
81539
+
81540
+ this.DivFrameToolbar=
81541
+ {
81542
+ Icon:{ Color:"rgb(0,0,0)", HoverColor:"rgb(30,144,255)" },
81543
+ Tooltip:{ BGColor:"rgb(255,255,255)", TextColor:"rgb(71,71,71)", BorderColor:"rgb(0,0,0)" },
81544
+ }
81620
81545
 
81621
81546
  //画图工具
81622
81547
  this.DrawPicture=
@@ -83595,6 +83520,29 @@ function JSChartResource()
83595
83520
  if (style.KLineCountDownPaint) this.SetKLineCountDownPaint(style.KLineCountDownPaint);
83596
83521
 
83597
83522
  if (style.SmallFloatTooltipV2) this.SetSmallFloatTooltipV2(style.SmallFloatTooltipV2);
83523
+
83524
+ if (style.DivFrameToolbar) this.SetDivFrameToolbar(style.DivFrameToolbar);
83525
+ }
83526
+
83527
+ this.SetDivFrameToolbar=function(style)
83528
+ {
83529
+ var dest=this.DivFrameToolbar;
83530
+ if (style.Icon)
83531
+ {
83532
+ var item=style.Icon;
83533
+ var subDest=dest.Icon;
83534
+ if (item.Color) subDest.Color=item.Color;
83535
+ if (item.HoverColor) subDest.HoverColor=item.HoverColor;
83536
+ }
83537
+
83538
+ if (style.Tooltip)
83539
+ {
83540
+ var item=style.Tooltip;
83541
+ var subDest=dest.Tooltip;
83542
+ if (item.TextColor) subDest.TextColor=item.TextColor;
83543
+ if (item.BorderColor) subDest.BorderColor=item.BorderColor;
83544
+ if (item.BGColor) subDest.BGColor=item.BGColor;
83545
+ }
83598
83546
  }
83599
83547
 
83600
83548
  this.SetSmallFloatTooltipV2=function(style)
@@ -86931,6 +86879,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
86931
86879
  frame.RightSpaceCount=this.RightSpaceCount; //右边
86932
86880
  frame.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
86933
86881
  frame.GlobalOption=this.GlobalOption;
86882
+ frame.CreateDivFrameToolbar(this, i, this.UIElement.parentNode);
86934
86883
 
86935
86884
  frame.HorizontalMax=20;
86936
86885
  frame.HorizontalMin=10;
@@ -87031,6 +86980,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
87031
86980
  frame.YSplitOperator.HQChart=this;
87032
86981
  frame.XSplitOperator.Symbol=this.Symbol;
87033
86982
  frame.XSplitOperator.Period=this.Period;
86983
+ frame.CreateDivFrameToolbar(this, id, this.UIElement.parentNode);
87034
86984
 
87035
86985
  //K线数据绑定
87036
86986
  var xPointCouont=this.Frame.SubFrame[0].Frame.XPointCount;
@@ -89621,7 +89571,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
89621
89571
  if (bChanged)
89622
89572
  {
89623
89573
  frame.SizeChange=true;
89624
- frame.ToolbarRect=null; //清空工具栏缓存
89625
89574
  frame.DrawToolbar();
89626
89575
  }
89627
89576
  }
@@ -96592,7 +96541,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
96592
96541
 
96593
96542
  if (i>=2)
96594
96543
  {
96595
-
96544
+ frame.CreateDivFrameToolbar(this, i, this.UIElement.parentNode);
96596
96545
  }
96597
96546
 
96598
96547
  var DEFAULT_HORIZONTAL=[9,8,7,6,5,4,3,2,1];
@@ -96699,6 +96648,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
96699
96648
  frame.XSplitOperator.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
96700
96649
  frame.YSplitOperator.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
96701
96650
  frame.XSplitOperator.Symbol=this.Symbol;
96651
+ frame.CreateDivFrameToolbar(this, id, this.UIElement.parentNode);
96702
96652
 
96703
96653
  if (this.DayCount>1)
96704
96654
  {
@@ -109445,6 +109395,304 @@ Path2DHelper.PtInRect=function(x, y, rect)
109445
109395
  }
109446
109396
 
109447
109397
 
109398
+ ////////////////////////////////////////////////////////////////////////////////////
109399
+ // 指标窗口顶部工具条
109400
+ //
109401
+ //
109402
+ ///////////////////////////////////////////////////////////////////////////////////
109403
+
109404
+
109405
+ function JSDivFrameToolbar()
109406
+ {
109407
+ this.DivToolbar=null;
109408
+ this.DivHQChart=null;
109409
+ this.HQChart=null;
109410
+ this.FrameID=-1; //指标窗口ID
109411
+ this.ID=Guid();
109412
+ this.Left=-1;
109413
+ this.Top=-1;
109414
+
109415
+ this.IconConfig=
109416
+ {
109417
+ Color:g_JSChartResource.DivFrameToolbar.Icon.Color,
109418
+ HoverColor:g_JSChartResource.DivFrameToolbar.Icon.HoverColor
109419
+ }
109420
+
109421
+ this.AryButton=
109422
+ [
109423
+ {
109424
+ ID:JSCHART_BUTTON_ID.MODIFY_INDEX_PARAM, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-index_param", Tooltip:{ Text:"修改参数"},
109425
+ Span:null, Div:null, TooltipSpan:null
109426
+ },
109427
+ {
109428
+ ID:JSCHART_BUTTON_ID.CHANGE_INDEX, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-change_index", Tooltip:{ Text:"切换指标"},
109429
+ Span:null,Div:null, TooltipSpan:null
109430
+ },
109431
+ {
109432
+ ID:JSCHART_BUTTON_ID.OVERLAY_INDEX, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-overlay_index", Tooltip:{ Text:"叠加指标"},
109433
+ Span:null,Div:null, TooltipSpan:null
109434
+ },
109435
+ {
109436
+ ID:JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-close", Tooltip:{ Text:"关闭窗口"},
109437
+ Span:null,Div:null, TooltipSpan:null
109438
+ },
109439
+ ];
109440
+
109441
+ this.SetToolbar=function(aryButton)
109442
+ {
109443
+ //清空原来的按钮
109444
+ for(var i=0; i<this.AryButton.length; i++)
109445
+ {
109446
+ var item=this.AryButton[i];
109447
+ if (item.Div && this.DivToolbar) this.DivToolbar.removeChild(item.Div);
109448
+ item.Div=null;
109449
+ item.Span=null;
109450
+ item.TooltipSpan=null;
109451
+ }
109452
+ this.AryButton=[];
109453
+
109454
+ //重新创建
109455
+ for(var i=0;i<aryButton.length; i++)
109456
+ {
109457
+ var item=aryButton[i];
109458
+ if (!item.ID || !item.ClassName) continue;
109459
+ var newItem={ ID:item.ID, ClassName:item.ClassName, Span:null,Div:null, TooltipSpan:null };
109460
+ if (item.Tooltip && item.Tooltip.Text) newItem.Tooltip={ Text:item.Tooltip.Text };
109461
+
109462
+ this.AryButton.push(newItem);
109463
+
109464
+ if (this.DivToolbar) this.CreateButton(newItem, this.DivToolbar);
109465
+ }
109466
+
109467
+ this.UpdateStyle();
109468
+ }
109469
+
109470
+ this.Destroy=function()
109471
+ {
109472
+ if (this.DivToolbar)
109473
+ {
109474
+ if (this.DivHQChart.removeChild) this.DivHQChart.removeChild(this.DivToolbar);
109475
+ this.DivToolbar=null;
109476
+ }
109477
+
109478
+ this.HQChart=null;
109479
+ this.DivHQChart=null;
109480
+ this.FrameID=-1;
109481
+ }
109482
+
109483
+ this.Create=function()
109484
+ {
109485
+ var divToolbar=document.createElement("div");
109486
+ divToolbar.className='UMyChart_FrameToolbar_Div';
109487
+ divToolbar.id=this.ID;
109488
+ divToolbar.oncontextmenu = function() { return false; }; //屏蔽右键系统菜单
109489
+
109490
+ for(var i=0;i<this.AryButton.length; i++)
109491
+ {
109492
+ var item=this.AryButton[i];
109493
+ if (this.FrameID==0 && item.ID==JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW) continue; //第一个指标窗口不显示关闭按钮
109494
+ this.CreateButton(item, divToolbar);
109495
+ }
109496
+
109497
+ this.DivHQChart.appendChild(divToolbar);
109498
+
109499
+ this.DivToolbar=divToolbar;
109500
+
109501
+ this.UpdateStyle();
109502
+
109503
+ if (!this.HQChart.JSToolbarTooltip)
109504
+ {
109505
+ this.HQChart.JSToolbarTooltip=new JSToolbarTooltip();
109506
+ this.HQChart.JSToolbarTooltip.DivHQChart=this.DivHQChart;
109507
+ this.HQChart.JSToolbarTooltip.Create();
109508
+ }
109509
+ }
109510
+
109511
+ this.UpdateStyle=function()
109512
+ {
109513
+ if (!this.DivToolbar) return;
109514
+
109515
+ for(var i=0;i<this.AryButton.length; i++)
109516
+ {
109517
+ var item=this.AryButton[i]
109518
+ if (!item.Span) continue;
109519
+ item.Span.style["color"]=this.IconConfig.Color;
109520
+ }
109521
+ }
109522
+
109523
+ this.ReloadResource=function(option)
109524
+ {
109525
+ this.IconConfig.Color=g_JSChartResource.DivFrameToolbar.Icon.Color,
109526
+ this.IconConfig.HoverColor=g_JSChartResource.DivFrameToolbar.Icon.HoverColor;
109527
+
109528
+ this.UpdateStyle();
109529
+ }
109530
+
109531
+ this.CreateButton=function(item, divDom)
109532
+ {
109533
+ var btnDiv=document.createElement("div");
109534
+ btnDiv.className="UMyChart_FrameToolbar_Div_Button";
109535
+ btnDiv.onmouseover=(e)=> { this.OnHoverButton(e, item); }
109536
+ btnDiv.onmouseout=(e)=>{ this.OnLeaveButton(e, item); }
109537
+ item.Div=btnDiv;
109538
+
109539
+ var spanDom=document.createElement("span");
109540
+ spanDom.className=item.ClassName;
109541
+ spanDom.onmousedown=(e)=>{ this.OnClickButton(e, item); };
109542
+ item.Span=spanDom;
109543
+ btnDiv.appendChild(spanDom);
109544
+
109545
+ divDom.appendChild(btnDiv);
109546
+ }
109547
+
109548
+ this.OnClickButton=function(e, item)
109549
+ {
109550
+ if (!this.FrameID<0) return;
109551
+ if (!this.HQChart) return;
109552
+
109553
+ var frame=this.HQChart.Frame.SubFrame[this.FrameID].Frame;
109554
+
109555
+ var button={ ID:item.ID, Frame:frame };
109556
+ this.HQChart.ClickFrameButton(button, e);
109557
+ }
109558
+
109559
+ this.OnHoverButton=function(e, item)
109560
+ {
109561
+ if (!item.Span) return;
109562
+
109563
+ item.Span.style["color"]=this.IconConfig.HoverColor;
109564
+
109565
+ this.ShowTooltip(e, item);
109566
+ }
109567
+
109568
+ this.OnLeaveButton=function(e, item)
109569
+ {
109570
+ if (!item.Span) return;
109571
+ item.Span.style["color"]=this.IconConfig.Color;
109572
+
109573
+ this.HideTooltip();
109574
+ }
109575
+
109576
+ this.Show=function(frameID)
109577
+ {
109578
+ this.FrameID=frameID;
109579
+ if (!this.FrameID<0) return;
109580
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.HQChart.Frame.SubFrame)) return;
109581
+ if (!this.HQChart.Frame.SubFrame[this.FrameID]) return;
109582
+
109583
+ var pixelTatio = GetDevicePixelRatio();
109584
+ var frame=this.HQChart.Frame.SubFrame[this.FrameID].Frame;
109585
+ var border=frame.GetBorder();
109586
+
109587
+ var top=border.Top/pixelTatio;
109588
+ var right=border.RightEx/pixelTatio;
109589
+ var left=right-this.DivToolbar.offsetWidth-2;
109590
+
109591
+ if (this.Top!=top || this.Left!=left)
109592
+ {
109593
+ this.DivToolbar.style.top = top + "px";
109594
+ this.DivToolbar.style.left = left + "px";
109595
+ this.DivToolbar.style.height=frame.ChartBorder.TitleHeight/pixelTatio + "px";
109596
+ this.Top=top;
109597
+ this.Left=left;
109598
+ }
109599
+
109600
+ if (this.DivToolbar.style.visibility!='visible') this.DivToolbar.style.visibility='visible';
109601
+ }
109602
+
109603
+ this.Hide=function()
109604
+ {
109605
+ if (this.DivToolbar) this.DivToolbar.style.visibility="hidden";
109606
+ }
109607
+
109608
+ this.HideTooltip=function()
109609
+ {
109610
+ if (this.HQChart.JSToolbarTooltip) this.HQChart.JSToolbarTooltip.Hide();
109611
+ }
109612
+
109613
+ this.ShowTooltip=function(e, item)
109614
+ {
109615
+ if (!this.HQChart.JSToolbarTooltip) return;
109616
+ if (!item.Div) return;
109617
+
109618
+ var rtButton=item.Div.getBoundingClientRect();
109619
+ var rtHQChart=this.DivHQChart.getBoundingClientRect();
109620
+ var left=rtButton.left-rtHQChart.left;
109621
+ var top=rtButton.bottom-rtHQChart.top+2;
109622
+ this.HQChart.JSToolbarTooltip.Show(top, left, { Text:item.Tooltip.Text });
109623
+ }
109624
+ }
109625
+
109626
+
109627
+ function JSToolbarTooltip()
109628
+ {
109629
+ this.DivTooltip=null;
109630
+ this.DivHQChart=null;
109631
+ this.Text=null;
109632
+ this.Left=-1;
109633
+ this.Top=-1;
109634
+
109635
+ this.BGColor=g_JSChartResource.DivFrameToolbar.Tooltip.BGColor;
109636
+ this.TextColor=g_JSChartResource.DivFrameToolbar.Tooltip.TextColor;
109637
+ this.BorderColor=g_JSChartResource.DivFrameToolbar.Tooltip.BorderColor;
109638
+
109639
+ this.Create=function()
109640
+ {
109641
+ var divDom=document.createElement("div");
109642
+ divDom.className='UMyChart_Toolbar_Tooltip_Div';
109643
+ this.DivHQChart.appendChild(divDom);
109644
+
109645
+ this.DivTooltip=divDom;
109646
+
109647
+ this.UpdateStyle();
109648
+ }
109649
+
109650
+ this.ReloadResource=function(option)
109651
+ {
109652
+ this.BGColor=g_JSChartResource.DivFrameToolbar.Tooltip.BGColor;
109653
+ this.TextColor=g_JSChartResource.DivFrameToolbar.Tooltip.TextColor;
109654
+ this.BorderColor=g_JSChartResource.DivFrameToolbar.Tooltip.BorderColor;
109655
+
109656
+ this.UpdateStyle();
109657
+ }
109658
+
109659
+ this.UpdateStyle=function()
109660
+ {
109661
+ if (!this.DivTooltip) return;
109662
+
109663
+ this.DivTooltip.style["background-color"]=this.BGColor;
109664
+ this.DivTooltip.style["color"]=this.TextColor;
109665
+ this.DivTooltip.style["border"]="1px solid " + this.BorderColor;
109666
+ }
109667
+
109668
+ this.Show=function(top, left, tooltipData)
109669
+ {
109670
+ if (!this.DivTooltip) return;
109671
+
109672
+ if (this.Text!=tooltipData.Text) this.DivTooltip.innerHTML=tooltipData.Text;
109673
+ var right=left+this.DivTooltip.offsetWidth;
109674
+ if ((right+5)>=window.innerWidth) left=left-this.DivTooltip.offsetWidth;
109675
+
109676
+ if (this.Top!=top || this.Left!=left)
109677
+ {
109678
+ this.DivTooltip.style.top = top + "px";
109679
+ this.DivTooltip.style.left = left + "px";
109680
+ this.Top=top;
109681
+ this.Left=left;
109682
+ }
109683
+
109684
+ if (this.DivTooltip.style.visibility!='visible') this.DivTooltip.style.visibility='visible';
109685
+ }
109686
+
109687
+ this.Hide=function()
109688
+ {
109689
+ if (!this.DivTooltip) return;
109690
+
109691
+ if (this.DivTooltip.style["visibility"]!='hidden') this.DivTooltip.style["visibility"]="hidden";
109692
+ }
109693
+ }
109694
+
109695
+
109448
109696
 
109449
109697
 
109450
109698
 
@@ -136671,6 +136919,12 @@ function GetBlackStyle()
136671
136919
  //Mergin:{ Left:4, Right:4, Top:2, Bottom:4 },
136672
136920
  }
136673
136921
  },
136922
+
136923
+ DivFrameToolbar:
136924
+ {
136925
+ Icon:{ Color:"rgb(156,156,156)", HoverColor:"rgb(255,255,255)" },
136926
+ Tooltip:{ BGColor:"rgb(32,32,32)", TextColor:"rgb(204,204,204)", BorderColor:"rgb(69,69,69)" },
136927
+ },
136674
136928
 
136675
136929
  DrawPicture: //画图工具
136676
136930
  {
@@ -165245,7 +165499,7 @@ function HQChartScriptWorker()
165245
165499
 
165246
165500
 
165247
165501
 
165248
- var HQCHART_VERSION="1.1.15059";
165502
+ var HQCHART_VERSION="1.1.15065";
165249
165503
 
165250
165504
  function PrintHQChartVersion()
165251
165505
  {