hqchart 1.1.14523 → 1.1.14538

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.
@@ -8131,7 +8131,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
8131
8131
 
8132
8132
  var yMove=e.clientY-drag.LastMove.Y;
8133
8133
 
8134
- this.OnMoveFromeBorder(this.BorderDrag.Index, yMove);
8134
+ if (!this.OnMoveFromeBorder(this.BorderDrag.Index, yMove)) return;
8135
8135
 
8136
8136
  drag.LastMove.X=e.clientX;
8137
8137
  drag.LastMove.Y=e.clientY;
@@ -11032,7 +11032,6 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11032
11032
  this.SelectChartDrawPicture=null;
11033
11033
  if (this.ChartPictureMenu) this.ChartPictureMenu.Hide();
11034
11034
  this.ClearChartDrawPicture(drawPicture); //删除选中的画图工具
11035
- this.CloseModifyDrawDialog();
11036
11035
  }
11037
11036
  else if (this.SelectedChart && this.SelectedChart.Selected.Identify)
11038
11037
  {
@@ -11256,14 +11255,16 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11256
11255
 
11257
11256
  this.OnMoveFromeBorder=function(index, yMove)
11258
11257
  {
11259
- if (!this.Frame) return;
11258
+ if (!this.Frame) return false;
11260
11259
 
11261
- if (!this.Frame.OnMoveFromeBorder(index,yMove)) return ;
11260
+ if (!this.Frame.OnMoveFromeBorder(index,yMove)) return false;
11262
11261
 
11263
11262
  //this.Frame.SetSizeChage(true);
11264
11263
  this.Frame.SetFrameBorderSizeChange();
11265
11264
  this.Frame.ReDrawToolbar();
11266
11265
  this.Draw();
11266
+
11267
+ return true;
11267
11268
  }
11268
11269
 
11269
11270
  this.OnZoomUpDownFrameY=function(obj, yMove)
@@ -12850,20 +12851,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
12850
12851
 
12851
12852
  if (!this.DialogModifyDraw) return;
12852
12853
 
12853
- if (chart.ClassName=="ChartDrawPictureText" || chart.ClassName=='ChartDrawVolProfile')
12854
- {
12855
- this.CloseModifyDrawDialog();
12856
-
12857
- if (!this.ChartPictureMenu) this.ChartPictureMenu=g_DialogFactory.Create('ChartPictureSettingMenu', this.UIElement.parentNode);
12858
- if (!this.ChartPictureMenu) return;
12859
-
12860
- var event={ data: { ChartPicture:chart, HQChart:this}};
12861
- this.ChartPictureMenu.DoModal(event);
12862
- }
12863
- else
12864
- {
12865
- this.ShowModifyDrawDialog(chart);
12866
- }
12854
+ this.ShowModifyDrawDialog(chart);
12867
12855
  }
12868
12856
 
12869
12857
  this.FinishMoveChartDrawPicture=function()
@@ -12915,6 +12903,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
12915
12903
 
12916
12904
  if (option && option.Draw==false) bDraw=false;
12917
12905
  if (bDraw) this.Draw();
12906
+ if (this.DialogModifyDraw) this.DialogModifyDraw.OnClearChartDrawPicture(null);
12918
12907
  }
12919
12908
  else
12920
12909
  {
@@ -12934,6 +12923,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
12934
12923
 
12935
12924
  if (option && option.Draw==false) bDraw=false;
12936
12925
  if (bDraw) this.Draw();
12926
+ if (this.DialogModifyDraw) this.DialogModifyDraw.OnClearChartDrawPicture(drawPicture);
12927
+ break;
12937
12928
  }
12938
12929
  }
12939
12930
  }
@@ -23874,11 +23865,37 @@ function HQTradeFrame()
23874
23865
  {
23875
23866
  if (this.SubFrame.length<=0) return false;
23876
23867
 
23877
- var topFrame=this.SubFrame[index];
23868
+ var topFrame=null;
23869
+ var aryTopTitleFrame=[];
23870
+ for(var i=index;i>=0;--i)
23871
+ {
23872
+ var item=this.SubFrame[i];
23873
+
23874
+ if (item.Frame && item.Frame.ChartBorder && item.Frame.ChartBorder.IsShowTitleOnly) //标题模式
23875
+ {
23876
+ aryTopTitleFrame.push(item);
23877
+ continue;
23878
+ }
23879
+
23880
+ if (item.Height>0)
23881
+ {
23882
+ topFrame=item;
23883
+ break;
23884
+ }
23885
+ }
23886
+
23878
23887
  var bottomFrame=null;
23888
+ var aryBottomTitleFrame=[];
23879
23889
  for(var i=index+1;i<this.SubFrame.length;++i)
23880
23890
  {
23881
23891
  var item=this.SubFrame[i];
23892
+
23893
+ if (item.Frame && item.Frame.ChartBorder && item.Frame.ChartBorder.IsShowTitleOnly) //标题模式
23894
+ {
23895
+ aryBottomTitleFrame.push(item);
23896
+ continue;
23897
+ }
23898
+
23882
23899
  if (item.Height>0)
23883
23900
  {
23884
23901
  bottomFrame=item;
@@ -23896,6 +23913,20 @@ function HQTradeFrame()
23896
23913
 
23897
23914
  var height=topFrame.Frame.ChartBorder.GetHeightEx();
23898
23915
  var height2=bottomFrame.Frame.ChartBorder.GetHeightEx();
23916
+
23917
+ for(var i=0;i<aryBottomTitleFrame.length;++i)
23918
+ {
23919
+ var item=aryBottomTitleFrame[i];
23920
+ item.Frame.ChartBorder.Bottom+=yMove;
23921
+ item.Frame.ChartBorder.Top+=yMove;
23922
+ }
23923
+
23924
+ for(var i=0;i<aryTopTitleFrame.length;++i)
23925
+ {
23926
+ var item=aryTopTitleFrame[i];
23927
+ item.Frame.ChartBorder.Bottom+=yMove;
23928
+ item.Frame.ChartBorder.Top+=yMove;
23929
+ }
23899
23930
 
23900
23931
  //缩小的时候 小于最小高度 不处理
23901
23932
  if ((height<this.MinSubFrameHeight && yMove<0) || (height2<this.MinSubFrameHeight && yMove>0))
@@ -24189,11 +24220,25 @@ function HQTradeFrame()
24189
24220
  this.SaveSubFrameHeightRate=function()
24190
24221
  {
24191
24222
  var height=this.ChartBorder.GetHeight();
24223
+ var totalTitleHeight=0;
24224
+ for(var i=0;i<this.SubFrame.length;++i)
24225
+ {
24226
+ var item=this.SubFrame[i];
24227
+ var frame=item.Frame;
24228
+ if (frame && frame.ChartBorder && frame.ChartBorder.IsShowTitleOnly && item.Height>0)
24229
+ totalTitleHeight+=frame.ChartBorder.TitleHeight;
24230
+ }
24231
+ height-=totalTitleHeight;
24192
24232
 
24193
24233
  for(var i=0; i<this.SubFrame.length; ++i)
24194
24234
  {
24195
24235
  var item=this.SubFrame[i];
24236
+ var frame=item.Frame;
24237
+ if (item.Height<=0) continue;
24238
+ if (frame && frame.ChartBorder && frame.ChartBorder.IsShowTitleOnly && item.Height>0) continue;
24239
+
24196
24240
  var subHeight=item.Frame.ChartBorder.GetHeight();
24241
+
24197
24242
  var rate=(subHeight/height)*100;
24198
24243
  item.Height=rate;
24199
24244
  }
@@ -25325,9 +25370,13 @@ function HQTradeFrame()
25325
25370
  var left=item.Frame.ChartBorder.GetLeft();
25326
25371
  var right=item.Frame.ChartBorder.GetRight();
25327
25372
 
25328
- item.Frame.Canvas.beginPath();
25329
- item.Frame.Canvas.rect(left,bottom-height/2,(right-left),height);
25330
- if (item.Frame.Canvas.isPointInPath(x,y))
25373
+ var rtBorder={ Left:left, Right:right, Top:bottom-height/2, Height:height };
25374
+ rtBorder.Bottom=rtBorder.Top+rtBorder.Height;
25375
+ rtBorder.Width=rtBorder.Right-rtBorder.Left;
25376
+ if (x>=rtBorder.Left && x<=rtBorder.Right && y>=rtBorder.Top && y<rtBorder.Bottom)
25377
+ //item.Frame.Canvas.beginPath();
25378
+ //item.Frame.Canvas.rect(left,bottom-height/2,(right-left),height);
25379
+ //if (item.Frame.Canvas.isPointInPath(x,y))
25331
25380
  {
25332
25381
  return { Index:i, Bottom:true };
25333
25382
  }
@@ -68765,15 +68814,13 @@ function ChartDrawPictureText()
68765
68814
  delete this.newMethod;
68766
68815
 
68767
68816
  this.ClassName='ChartDrawPictureText';
68768
- this.Text='文本';
68817
+ this.Text='输入文字';
68769
68818
  this.PointCount=1;
68770
68819
  this.FontOption={ Family:'微软雅黑', Size:20, Weight:null, Style:null }; //Weight(bold 粗体), Style(italic)
68771
68820
  //矢量图片
68772
68821
  //this.Text="\ue606";
68773
68822
  //this.FontOption={ Family:'iconfont', Size:20, Weight:null, Style:null }; //Weight(bold 粗体), Style(italic)
68774
68823
  this.TextRect=null; //文字区域
68775
- this.IsInitialized=false; //是否初始化了
68776
- this.SettingMenu;
68777
68824
  this.HQChart;
68778
68825
 
68779
68826
  this.SetOption=function(option)
@@ -68811,12 +68858,6 @@ function ChartDrawPictureText()
68811
68858
  this.TextRect.Height=textHeight
68812
68859
  //this.Canvas.strokeRect(this.TextRect.Left,this.TextRect.Top,this.TextRect.Width,this.TextRect.Height);
68813
68860
  this.Canvas.restore();
68814
-
68815
- if (this.IsInitialized===false)
68816
- {
68817
- this.SetTextOption();
68818
- this.IsInitialized=true;
68819
- }
68820
68861
  }
68821
68862
 
68822
68863
  //根据设置动态生成字体
@@ -68835,18 +68876,6 @@ function ChartDrawPictureText()
68835
68876
  return font;
68836
68877
  }
68837
68878
 
68838
- this.SetTextOption=function()
68839
- {
68840
- JSConsole.Chart.Log('[ChartDrawPictureText::SetTextOption]');
68841
- //创建div设置窗口
68842
- if (!this.SettingMenu) this.SettingMenu=new ChartPictureTextSettingMenu(this.Frame.ChartBorder.UIElement.parentNode);
68843
-
68844
- this.SettingMenu.ChartPicture=this;
68845
- this.SettingMenu.HQChart=this.HQChart;
68846
- this.SettingMenu.Position={Left:this.TextRect.Left+this.TextRect.Width,Top:this.TextRect.Top};
68847
- this.SettingMenu.DoModal();
68848
- }
68849
-
68850
68879
  this.IsPointIn=function(x,y)
68851
68880
  {
68852
68881
  if (!this.Frame || this.Status!=10) return -1;
@@ -73729,6 +73758,7 @@ function ChartDrawPriceNote()
73729
73758
 
73730
73759
  var price=this.Frame.GetYData(ptStart.Y, false);
73731
73760
  var text=price.toFixed(floatPrecision);
73761
+ this.Canvas.font=font;
73732
73762
  var textHeight=this.Canvas.measureText("擎").width;
73733
73763
  var textWidth=this.Canvas.measureText(text).width;
73734
73764
  var angle=this.CalculateAngle(ptStart.X, ptStart.Y, ptEnd.X, ptEnd.Y);
@@ -75814,6 +75844,15 @@ function JSChartResource()
75814
75844
  TitleBGColor:"rgb(200, 66, 69)", //标题背景颜色
75815
75845
  }
75816
75846
 
75847
+ this.PopKLineChart=
75848
+ {
75849
+ BGColor:"rgba(250,250,250,0.95)",
75850
+ BorderColor:"rgb(0,0,0)",
75851
+
75852
+ TitleColor:'rgb(250,250,250)', //标题颜色
75853
+ TitleBGColor:"rgb(200, 66, 69)", //标题背景颜色
75854
+ }
75855
+
75817
75856
  this.SelectRectBGColor="rgba(1,130,212,0.06)"; //背景色
75818
75857
  // this.SelectRectAlpha=0.06; //透明度
75819
75858
 
@@ -77386,10 +77425,21 @@ function JSChartResource()
77386
77425
  if (style.PopMinuteChart)
77387
77426
  {
77388
77427
  var item=style.PopMinuteChart;
77389
- if (item.BGColor) this.PopMinuteChart.BGColor=item.BGColor;
77390
- if (item.BorderColor) this.PopMinuteChart.BorderColor=item.BorderColor;
77391
- if (item.TitleColor) this.DialogSearchIndex.TitleColor=item.TitleColor;
77392
- if (item.TitleBGColor) this.DialogSearchIndex.TitleBGColor=item.TitleBGColor;
77428
+ var dest=this.PopMinuteChart;
77429
+ if (item.BGColor) dest.BGColor=item.BGColor;
77430
+ if (item.BorderColor) dest.BorderColor=item.BorderColor;
77431
+ if (item.TitleColor) dest.TitleColor=item.TitleColor;
77432
+ if (item.TitleBGColor) dest.TitleBGColor=item.TitleBGColor;
77433
+ }
77434
+
77435
+ if (style.PopKLineChart)
77436
+ {
77437
+ var item=style.PopKLineChart;
77438
+ var dest=this.PopKLineChart;
77439
+ if (item.BGColor) dest.BGColor=item.BGColor;
77440
+ if (item.BorderColor) dest.BorderColor=item.BorderColor;
77441
+ if (item.TitleColor) dest.TitleColor=item.TitleColor;
77442
+ if (item.TitleBGColor) dest.TitleBGColor=item.TitleBGColor;
77393
77443
  }
77394
77444
 
77395
77445
  if (style.DefaultTextColor) this.DefaultTextColor = style.DefaultTextColor;
@@ -81833,7 +81883,15 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
81833
81883
  this.Symbol=data.symbol;
81834
81884
  this.Name=data.name;
81835
81885
 
81836
- this.BindMainData(bindData,this.PageSize);
81886
+ var chartOperator=null; //额外的图形控制
81887
+ if (data && data.ChartOperator)
81888
+ {
81889
+ var item=data.ChartOperator;
81890
+ chartOperator={ };
81891
+ if (item.IsShowAll===true) chartOperator.IsShowAll=true; //全部显示
81892
+ }
81893
+
81894
+ this.BindMainData(bindData,this.PageSize,chartOperator);
81837
81895
  if (this.AfterBindMainData) this.AfterBindMainData("RecvHistoryData");
81838
81896
  this.Frame.SetSizeChage(true);
81839
81897
 
@@ -84655,7 +84713,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
84655
84713
  bindData.Period=this.Period;
84656
84714
  bindData.Right=this.Right;
84657
84715
 
84658
- if (bindData.Right>0 && MARKET_SUFFIX_NAME.IsSHSZStockA(item.Symbol)) //复权数据
84716
+ if (bindData.Right>0 && MARKET_SUFFIX_NAME.IsEnableRight(item.Symbol)) //复权数据
84659
84717
  {
84660
84718
  var rightData=bindData.GetRightData(bindData.Right,{ AlgorithmType: this.RightFormula });
84661
84719
  bindData.Data=rightData;
@@ -85995,8 +86053,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
85995
86053
  var self=this;
85996
86054
  drawPicture.GetActiveDrawPicture=function() { return self.GetActiveDrawPicture(); }
85997
86055
 
85998
- if (drawPicture.ClassName==='ChartDrawPictureText') drawPicture.IsInitialized=true;
85999
-
86000
86056
  this.ChartDrawPicture.push(drawPicture);
86001
86057
  }
86002
86058
 
@@ -93313,7 +93369,6 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
93313
93369
  if (item)
93314
93370
  {
93315
93371
  drawPicture=item.Create();
93316
- if (drawPicture.ClassName=='ChartDrawPictureText') drawPicture.HQChart=this;
93317
93372
  }
93318
93373
 
93319
93374
  if (!drawPicture) //iconfont图标
@@ -93376,7 +93431,6 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
93376
93431
 
93377
93432
  drawPicture.GetActiveDrawPicture=function() { return self.GetActiveDrawPicture(); }
93378
93433
 
93379
- if (drawPicture.ClassName==='ChartDrawPictureText') drawPicture.IsInitialized=true;
93380
93434
  this.ChartDrawPicture.push(drawPicture);
93381
93435
 
93382
93436
  if (obj.Draw==true) this.DrawDynamicInfo();
@@ -93420,8 +93474,6 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
93420
93474
  drawPicture.ValueToPoint();
93421
93475
  drawPicture.GetActiveDrawPicture=()=>{ return this.GetActiveDrawPicture(); }
93422
93476
 
93423
- if (drawPicture.ClassName==='ChartDrawPictureText') drawPicture.IsInitialized=true;
93424
-
93425
93477
  this.ChartDrawPicture.push(drawPicture);
93426
93478
  }
93427
93479
 
@@ -98299,7 +98351,6 @@ function DialogFactory()
98299
98351
  this.DataMap=new Map(
98300
98352
  [
98301
98353
  ["ChartPictureSettingMenu", { Create:function(divElement) { return new ChartPictureSettingMenu(divElement); } }],
98302
- ["ChartPictureTextSettingMenu", { Create:function(divElement) { return new ChartPictureTextSettingMenu(divElement); } }]
98303
98354
  ]);
98304
98355
 
98305
98356
  this.Create=function(name, option)
@@ -98525,239 +98576,6 @@ function ChartPictureSettingMenu(divElement)
98525
98576
  }
98526
98577
  }
98527
98578
 
98528
- //画图工具 文本设置窗口
98529
- function ChartPictureTextSettingMenu(divElement)
98530
- {
98531
- this.newMethod=IDivDialog; //派生
98532
- this.newMethod(divElement);
98533
- delete this.newMethod;
98534
-
98535
- this.ChartPicture;
98536
- this.SettingDiv;
98537
- this.Position;
98538
-
98539
- this.BackupData; //画图工具备份数据
98540
-
98541
- this.Close=function()
98542
- {
98543
- if (this.SettingDiv) this.DivElement.removeChild(this.SettingDiv); //直接删除
98544
- }
98545
-
98546
- this.DoModal=function()
98547
- {
98548
- var text=this.ChartPicture.Text; //显示的文本
98549
- var fontOption=this.ChartPicture.FontOption; //字体设置
98550
- var lineColor=this.ChartPicture.LineColor;
98551
- //数据备份, 点取消的时候把备份数据设置回去
98552
- this.BackupData=
98553
- {
98554
- Text:text,
98555
- LineColor:lineColor,
98556
- FontOption:{Family: fontOption.Family, Size: fontOption.Size, Weight: fontOption.Weight, Style: fontOption.Style }
98557
- };
98558
- JSConsole.Chart.Log('[ChartPictureTextSettingMenu::DoModal] picture info',this.BackupData);
98559
-
98560
- var self=this;
98561
- var div=this.DivElement.getElementsByClassName('chartpicture-text-setting')[0];
98562
- if (!div)
98563
- {
98564
- div=document.createElement("div");
98565
- div.className='chartpicture-text-setting';
98566
- this.DivElement.appendChild(div);
98567
- this.SettingDiv=div;
98568
- }
98569
- else
98570
- {
98571
- this.SettingDiv=div;
98572
- }
98573
-
98574
- var titleContainerStr = '<div class="titleWrap">'+
98575
- '<span class="titleName">样式设置</span>'+
98576
- '<i class="closeBtn iconfont icon-close"></i>'+
98577
- '</div>';
98578
-
98579
- var fontSizeArray = [10,11,12,14,16,20,24,28,32,40];
98580
- var fontArray = ['微软雅黑','宋体','Arial','仿宋'];
98581
- var sizeListStr = "";
98582
- var fontListStr = "";
98583
- fontArray.forEach(function(item,index){
98584
- fontListStr += index !== 0 ? '<p>'+item+'</P>' : '<p class="active">'+item+'</P>';
98585
- });
98586
- fontSizeArray.forEach(function(item,index){
98587
- sizeListStr += index !== 5 ? '<p>'+item+'</P>' : '<p class="active">'+item+'</P>';
98588
- });
98589
- var contentContainerStr = '<div class="contentWrap">'+
98590
- '<div class="styleOptions">'+
98591
- '<span class="colorPicker"><input type="color" id="fontColor" value="#1e90ff"></span>'+
98592
- '<div class="likeSelect fontSelect"><span class="choicedText">微软雅黑</span><div class="selectList">'+fontListStr+'</div><i class="iconfont icon-xia"></i></div>'+
98593
- '<div class="likeSelect fontSizeSelect"><span class="choicedText">20</span><div class="selectList">'+sizeListStr+'</div><i class="iconfont icon-xia"></i></div>'+
98594
- '<span class="strongFont likeBtn"><i class="iconfont icon-jiacu"></i></span>'+
98595
- '<span class="italicsFont likeBtn"><i class="iconfont icon-qingxieL"></i></span>'+
98596
- '</div>'+
98597
- '<textarea class="tArea" id="tArea" placeholder="Text"></textarea>'+
98598
- '</div>';
98599
- var btnContainer = '<div class="btnsContainer">'+
98600
- '<span class="okBtn btn">确认</span>'+
98601
- '<span class="cancelBtn btn">取消</span>'+
98602
- '</div>';
98603
-
98604
- var pixelTatio = GetDevicePixelRatio();
98605
- var DoModalStr = titleContainerStr+contentContainerStr+btnContainer;
98606
- this.SettingDiv.style.left = this.Position.Left/pixelTatio + "px";
98607
- this.SettingDiv.style.top = this.Position.Top/pixelTatio + "px";
98608
- this.SettingDiv.innerHTML=DoModalStr;
98609
- this.SettingDiv.style.position = "absolute";
98610
- this.SettingDiv.style.display = "block";
98611
- $(".chartpicture-text-setting .colorPicker").css({ //初始设置
98612
- "borderColor":self.ChartPicture.LineColor,
98613
- "background-color":self.ChartPicture.LineColor
98614
- });
98615
-
98616
- var family = this.ChartPicture.FontOption.Family;
98617
- $('.chartpicture-text-setting .fontSelect .choicedText').html(family);
98618
- fontArray.forEach(function(item,index){
98619
- if(item == family){
98620
- $('.chartpicture-text-setting .fontSelect p').removeClass('active');
98621
- $('.chartpicture-text-setting .fontSelect p').eq(index).addClass('active');
98622
- }
98623
- });
98624
-
98625
- var size = this.ChartPicture.FontOption.Size;
98626
- $('.chartpicture-text-setting .fontSizeSelect .choicedText').html(size);
98627
- fontSizeArray.forEach(function(item,index){
98628
- if(item == size){
98629
- $('.chartpicture-text-setting .fontSizeSelect p').removeClass('active');
98630
- $('.chartpicture-text-setting .fontSizeSelect p').eq(index).addClass('active');
98631
- }
98632
- });
98633
-
98634
- var weight = this.ChartPicture.FontOption.Weight;
98635
- if( weight != null && weight == 'bold'){
98636
- $('.chartpicture-text-setting .strongFont').addClass('hot');
98637
- }
98638
-
98639
- var style = this.ChartPicture.FontOption.Style;
98640
- if( style != null && style == 'italic'){
98641
- $('.chartpicture-text-setting .italicsFont').addClass('hot');
98642
- }
98643
-
98644
- var text = this.ChartPicture.Text;
98645
- $('.chartpicture-text-setting .tArea').val(text); //结束初始设置
98646
-
98647
- var defaultTextOption = { Family:'微软雅黑', Size:20, Weight:null, Style:null };
98648
- $(".chartpicture-text-setting #fontColor").change(
98649
- {
98650
- Picture:this.ChartPicture
98651
- },
98652
- function(event)
98653
- { //颜色选择
98654
- var value = $(this).val();
98655
- $(this).parent().css({
98656
- "borderColor":value,
98657
- "background-color":value
98658
- });
98659
- var chart=event.data.Picture;
98660
- chart.LineColor = value;
98661
- if (chart.Update) chart.Update(); //更新界面
98662
- }
98663
- );
98664
- $(".chartpicture-text-setting .fontSelect,.chartpicture-text-setting .fontSizeSelect").click(function(){
98665
- $(this).find('.selectList').toggle();
98666
- $(this).toggleClass('hot');
98667
- });
98668
- $(".chartpicture-text-setting .fontSelect p").click(
98669
- {
98670
- Picture:this.ChartPicture
98671
- },
98672
- function(event){ //字体选择
98673
- var choicedText = $(this).closest(".fontSelect").find('.choicedText').html();
98674
- var currentSelect = event.currentTarget.innerHTML;
98675
- if(choicedText !== currentSelect){
98676
- $(this).closest(".fontSelect").find('.choicedText').html(currentSelect);
98677
- $(this).siblings().removeClass('active');
98678
- $(this).addClass('active');
98679
- var chart = event.data.Picture;
98680
- chart.FontOption.Family = currentSelect;
98681
- if (chart.Update) chart.Update(); //更新界面
98682
- }
98683
- });
98684
- $(".chartpicture-text-setting .fontSizeSelect p").click(
98685
- {
98686
- Picture:this.ChartPicture
98687
- },
98688
- function(event){ //字号选择
98689
- var choicedText = $(this).closest(".fontSizeSelect").find('.choicedText').html();
98690
- var currentSelect = event.currentTarget.innerHTML;
98691
- if(choicedText !== currentSelect){
98692
- $(this).closest(".fontSizeSelect").find('.choicedText').html(currentSelect);
98693
- $(this).siblings().removeClass('active');
98694
- $(this).addClass('active');
98695
- var chart = event.data.Picture;
98696
- chart.FontOption.Size = Number(currentSelect);
98697
- if (chart.Update) chart.Update(); //更新界面
98698
- }
98699
- });
98700
- $(".chartpicture-text-setting .strongFont").click(
98701
- {
98702
- Picture:this.ChartPicture
98703
- },
98704
- function(event){
98705
- $(this).toggleClass('hot');
98706
- var classnames = $(this).attr('class');
98707
- if(classnames.indexOf('hot') > 0){
98708
- var chart = event.data.Picture;
98709
- chart.FontOption.Weight = 'bold';
98710
- if (chart.Update) chart.Update(); //更新界面
98711
- }
98712
- });
98713
- $(".chartpicture-text-setting .italicsFont").click(
98714
- {
98715
- Picture:this.ChartPicture
98716
- },
98717
- function(event){
98718
- $(this).toggleClass('hot')
98719
- var classnames = $(this).attr('class');
98720
- if(classnames.indexOf('hot') > 0){
98721
- var chart = event.data.Picture;
98722
- chart.FontOption.Style = 'italic';
98723
- if (chart.Update) chart.Update(); //更新界面
98724
- }
98725
- });
98726
- $(".chartpicture-text-setting .titleWrap .closeBtn,.chartpicture-text-setting .btnsContainer .cancelBtn").click( //取消
98727
- {
98728
- Picture:this.ChartPicture
98729
- },
98730
- function(event){
98731
- var picture = event.data.Picture;
98732
- picture.Text = self.BackupData.Text;
98733
- picture.LineColor = self.BackupData.LineColor;
98734
- picture.FontOption = self.BackupData.FontOption;
98735
- if (picture.Update) picture.Update();
98736
- self.Close();
98737
- });
98738
- $(".chartpicture-text-setting .tArea").keyup( //文本内容
98739
- {
98740
- Picture:this.ChartPicture
98741
- },
98742
- function(event){
98743
- JSConsole.Chart.Log('[ChartPictureTextSettingMenu::DoModal] $(".chartpicture-text-setting .tArea").keyup()');
98744
- var content = $(this).val();
98745
- var chart = event.data.Picture;
98746
- chart.Text = content;
98747
- if (chart.Update) chart.Update(); //更新界面
98748
- });
98749
-
98750
- //确定按钮
98751
- $(".chartpicture-text-setting .btnsContainer .okBtn").click(
98752
- function()
98753
- {
98754
- self.Close();
98755
- if (self.HQChart && self.HQChart.ChartDrawStorage) self.HQChart.ChartDrawStorage.SaveDrawData(self.ChartPicture); //保存下
98756
- }
98757
- );
98758
- }
98759
- }
98760
-
98761
98579
 
98762
98580
  function ChartPictureVolProfileSettingMenu(divElement)
98763
98581
  {
@@ -129430,7 +129248,12 @@ function GetBlackStyle()
129430
129248
  BGColor:"rgba(0,0,0,0.85)",
129431
129249
  BorderColor:"rgb(230,230,230)",
129432
129250
  },
129433
-
129251
+
129252
+ PopKLineChart:
129253
+ {
129254
+ BGColor:"rgba(0,0,0,0.85)",
129255
+ BorderColor:"rgb(230,230,230)",
129256
+ },
129434
129257
 
129435
129258
  DefaultTextColor: "rgb(101,104,112)",
129436
129259
  DefaultTextFont: 14*GetDevicePixelRatio() +'px 微软雅黑',
@@ -132064,6 +131887,7 @@ function JSReportChart(divElement)
132064
131887
  if (option.EnablePopMenuV2===true) chart.InitalPopMenu();
132065
131888
  if (option.FloatTooltip && option.FloatTooltip.Enable) chart.InitalFloatTooltip(option.FloatTooltip); //提示信息
132066
131889
  if (option.MinuteChartTooltip && option.MinuteChartTooltip.Enable) chart.InitalMinuteChartTooltip(option.MinuteChartTooltip);
131890
+ if (option.KLineChartTooltip && option.KLineChartTooltip.Enable) chart.InitalKLineChartTooltip(option.KLineChartTooltip);
132067
131891
 
132068
131892
  if (option.Symbol) chart.Symbol=option.Symbol;
132069
131893
  if (option.Name) chart.Name=option.Name;
@@ -132384,6 +132208,7 @@ function JSReportChartContainer(uielement)
132384
132208
 
132385
132209
  //
132386
132210
  this.TooltipMinuteChart; //分时图
132211
+ this.TooltipKLineChart; //分时图
132387
132212
 
132388
132213
  //MouseOnStatus:{ RowIndex:行, ColumnIndex:列}
132389
132214
  this.LastMouseStatus={ MoveStatus:null, TooltipStatus:null, MouseOnStatus:null };
@@ -132394,6 +132219,7 @@ function JSReportChartContainer(uielement)
132394
132219
  this.StopAutoUpdate();
132395
132220
 
132396
132221
  this.DestroyMinuteChartTooltip();
132222
+ this.DestroyKLineChartTooltip();
132397
132223
  this.DestroyFloatTooltip();
132398
132224
  }
132399
132225
 
@@ -132433,6 +132259,24 @@ function JSReportChartContainer(uielement)
132433
132259
  this.TooltipMinuteChart=null;
132434
132260
  }
132435
132261
 
132262
+ this.InitalKLineChartTooltip=function(option)
132263
+ {
132264
+ if (this.TooltipKLineChart) return;
132265
+
132266
+ this.TooltipKLineChart=new JSTooltipKLineChart();
132267
+ this.TooltipKLineChart.Inital(this, option);
132268
+ this.TooltipKLineChart.Create();
132269
+ }
132270
+
132271
+ this.DestroyKLineChartTooltip=function()
132272
+ {
132273
+ if (!this.TooltipKLineChart) return;
132274
+
132275
+ this.TooltipKLineChart.Destroy();
132276
+ this.TooltipKLineChart=null;
132277
+ }
132278
+
132279
+
132436
132280
  this.InitalFloatTooltip=function(option)
132437
132281
  {
132438
132282
  if (this.FloatTooltip) return;
@@ -132502,6 +132346,35 @@ function JSReportChartContainer(uielement)
132502
132346
  }
132503
132347
 
132504
132348
 
132349
+ this.ShowKLineChartTooltip=function(x,y, data)
132350
+ {
132351
+ if (!this.TooltipKLineChart) return;
132352
+
132353
+ var rtClient=this.UIElement.getBoundingClientRect();
132354
+ var rtScroll=GetScrollPosition();
132355
+
132356
+ var offsetLeft=rtClient.left+rtScroll.Left;
132357
+ var offsetTop=rtClient.top+rtScroll.Top;
132358
+
132359
+ data.Offset={ Left:offsetLeft, Top:offsetTop };
132360
+
132361
+ this.TooltipKLineChart.Show(data, x,y);
132362
+ }
132363
+
132364
+ this.HideKLineChartTooltip=function()
132365
+ {
132366
+ if (!this.TooltipKLineChart) return;
132367
+
132368
+ this.TooltipKLineChart.Hide();
132369
+ }
132370
+
132371
+ this.HideAllTooltip=function()
132372
+ {
132373
+ this.HideKLineChartTooltip();
132374
+ this.HideMinuteChartTooltip();
132375
+ this.HideFloatTooltip();
132376
+ }
132377
+
132505
132378
 
132506
132379
  this.AutoScrollPage=function(step)
132507
132380
  {
@@ -133671,8 +133544,7 @@ function JSReportChartContainer(uielement)
133671
133544
  if (wheelValue<0) //下
133672
133545
  {
133673
133546
  this.LastMouseStatus.TooltipStatus=null;
133674
- this.HideMinuteChartTooltip();
133675
- this.HideFloatTooltip();
133547
+ this.HideAllTooltip();
133676
133548
  if (this.GotoNextItem(1))
133677
133549
  {
133678
133550
  this.Draw();
@@ -133682,8 +133554,7 @@ function JSReportChartContainer(uielement)
133682
133554
  else if (wheelValue>0) //上
133683
133555
  {
133684
133556
  this.LastMouseStatus.TooltipStatus=null;
133685
- this.HideMinuteChartTooltip();
133686
- this.HideFloatTooltip();
133557
+ this.HideAllTooltip();
133687
133558
  if (this.GotoNextItem(-1))
133688
133559
  {
133689
133560
  this.Draw();
@@ -133696,8 +133567,7 @@ function JSReportChartContainer(uielement)
133696
133567
  if (wheelValue<0) //下一页
133697
133568
  {
133698
133569
  this.LastMouseStatus.TooltipStatus=null;
133699
- this.HideMinuteChartTooltip();
133700
- this.HideFloatTooltip();
133570
+ this.HideAllTooltip();
133701
133571
  if (this.GotoNextPage(this.PageUpDownCycle))
133702
133572
  {
133703
133573
  this.Draw();
@@ -133707,8 +133577,7 @@ function JSReportChartContainer(uielement)
133707
133577
  else if (wheelValue>0) //上一页
133708
133578
  {
133709
133579
  this.LastMouseStatus.TooltipStatus=null;
133710
- this.HideMinuteChartTooltip();
133711
- this.HideFloatTooltip();
133580
+ this.HideAllTooltip();
133712
133581
  if (this.GotoPreviousPage(this.PageUpDownCycle))
133713
133582
  {
133714
133583
  this.Draw();
@@ -133730,8 +133599,7 @@ function JSReportChartContainer(uielement)
133730
133599
  var keyID = e.keyCode ? e.keyCode :e.which;
133731
133600
  if (keyID==116) return; //F15刷新不处理
133732
133601
 
133733
- this.HideMinuteChartTooltip();
133734
- this.HideFloatTooltip();
133602
+ this.HideAllTooltip();
133735
133603
  switch(keyID)
133736
133604
  {
133737
133605
  case 33: //page up
@@ -134020,7 +133888,8 @@ function JSReportChartContainer(uielement)
134020
133888
  if (this.LastMouseStatus.TooltipStatus) bDrawTooltip=true;
134021
133889
  this.LastMouseStatus.TooltipStatus=null;
134022
133890
 
134023
- var bShowChartTooltip=false;
133891
+ var bShowKLineTooltip=false;
133892
+ var bShowMinuteTooltip=false;
134024
133893
  var chartTooltipData=null;
134025
133894
 
134026
133895
  if (this.DragRow) return;
@@ -134096,7 +133965,15 @@ function JSReportChartContainer(uielement)
134096
133965
  {
134097
133966
  if (tooltipData.Stock && tooltipData.Stock.Symbol)
134098
133967
  {
134099
- bShowChartTooltip=true;
133968
+ bShowMinuteTooltip=true;
133969
+ chartTooltipData={ Symbol:tooltipData.Stock.OriginalSymbol, Rect:tooltipData.Rect };
133970
+ }
133971
+ }
133972
+ else if (tooltipData.Type==21)
133973
+ {
133974
+ if (tooltipData.Stock && tooltipData.Stock.Symbol)
133975
+ {
133976
+ bShowKLineTooltip=true;
134100
133977
  chartTooltipData={ Symbol:tooltipData.Stock.OriginalSymbol, Rect:tooltipData.Rect };
134101
133978
  }
134102
133979
  }
@@ -134146,20 +134023,17 @@ function JSReportChartContainer(uielement)
134146
134023
  this.HideFloatTooltip();
134147
134024
  }
134148
134025
 
134149
- if (bShowChartTooltip)
134150
- {
134151
- this.ShowMinuteChartTooltip(null, null, chartTooltipData);
134152
- }
134153
- else
134154
- {
134155
- this.HideMinuteChartTooltip();
134156
- }
134026
+ if (!bShowKLineTooltip) this.HideKLineChartTooltip();
134027
+ if (!bShowMinuteTooltip) this.HideMinuteChartTooltip();
134028
+
134029
+ if (bShowMinuteTooltip) this.ShowMinuteChartTooltip(null, null, chartTooltipData);
134030
+ if (bShowKLineTooltip) this.ShowKLineChartTooltip(null, null, chartTooltipData);
134031
+
134157
134032
  }
134158
134033
 
134159
134034
  this.UIOnMounseOut=function(e)
134160
134035
  {
134161
- this.HideMinuteChartTooltip();
134162
- this.HideFloatTooltip();
134036
+ this.HideAllTooltip();
134163
134037
 
134164
134038
  var bDraw=false;
134165
134039
  var tabChart=this.GetTabChart();
@@ -134185,8 +134059,7 @@ function JSReportChartContainer(uielement)
134185
134059
 
134186
134060
  this.UIOnMouseleave=function(e)
134187
134061
  {
134188
- this.HideMinuteChartTooltip();
134189
- this.HideFloatTooltip();
134062
+ this.HideAllTooltip();
134190
134063
 
134191
134064
  var tabChart=this.GetTabChart();
134192
134065
  if (tabChart && tabChart.MoveOnTabIndex>=0)
@@ -134412,7 +134285,7 @@ function JSReportChartContainer(uielement)
134412
134285
  document.onmouseup=null;
134413
134286
 
134414
134287
  this.StopAutoDragScrollTimer();
134415
- this.HideTooltip();
134288
+ this.HideAllTooltip();
134416
134289
  var reportChart=this.GetReportChart();
134417
134290
 
134418
134291
  var mouseStatus={ Cursor:"default", Name:"Default"};; //鼠标状态
@@ -136804,7 +136677,8 @@ function ChartReport()
136804
136677
  if (IFrameSplitOperator.IsNumber(item.FloatPrecision)) colItem.FloatPrecision=item.FloatPrecision; //小数位数
136805
136678
  if (IFrameSplitOperator.IsNumber(item.ColorType)) colItem.ColorType=item.ColorType; //0=默认 1=(>0, =0, <0) 2=(>=0, <0)
136806
136679
  if (item.Icon) colItem.Icon=item.Icon;
136807
- if (IFrameSplitOperator.IsBool(item.EnableChartTooltip)) colItem.EnableChartTooltip=item.EnableChartTooltip;
136680
+ if (IFrameSplitOperator.IsBool(item.EnableChartTooltip)) colItem.ChartTooltip={ Enable:item.EnableChartTooltip, Type:20 };
136681
+ if (item.ChartTooltip) colItem.ChartTooltip={ Enable:item.ChartTooltip.Enable, Type:item.ChartTooltip.Type };
136808
136682
 
136809
136683
  //点击表头弹出菜单
136810
136684
  if (IFrameSplitOperator.IsBool(item.EnablePopupHeaderMenu)) colItem.EnablePopupHeaderMenu=item.EnablePopupHeaderMenu;
@@ -138373,9 +138247,9 @@ function ChartReport()
138373
138247
  var tooltipData={ Rect:rtItem, Stock:stock, Index:index, Column:column, RowType:rowType, Type:drawInfo.Tooltip.Type, Data:drawInfo.Tooltip.Data };
138374
138248
  this.TooltipRect.push(tooltipData);
138375
138249
  }
138376
- else if (column.EnableChartTooltip)
138250
+ else if (column.ChartTooltip && column.ChartTooltip.Enable && IFrameSplitOperator.IsNumber(column.ChartTooltip.Type)) //Type 20分时图 21K线图
138377
138251
  {
138378
- var tooltipData={ Rect:rtItem, Stock:stock, Index:index, Column:column, RowType:rowType, Type:20 };
138252
+ var tooltipData={ Rect:rtItem, Stock:stock, Index:index, Column:column, RowType:rowType, Type:column.ChartTooltip.Type };
138379
138253
  this.TooltipRect.push(tooltipData);
138380
138254
  }
138381
138255
 
@@ -148264,6 +148138,11 @@ var JS_DRAWTOOL_MENU_ID=
148264
148138
  CMD_CHANGE_BORDER_COLOR_ID:9, //边框颜色
148265
148139
 
148266
148140
  CMD_LOCK_DRAW_CHART_ID:10, //上锁
148141
+
148142
+ CMD_ZOOM_FONT_ID:11, //字体放大
148143
+ CMD_ZOOM_OUT_FONT_ID:12, //字体缩小
148144
+ CMD_MODIFY_TEXT_ID:13, //随机生成文字内容
148145
+ CMD_ADVANCED_SETTING_ID:14, //高级设置
148267
148146
  };
148268
148147
 
148269
148148
  function JSDialogDrawTool()
@@ -148356,6 +148235,7 @@ function JSDialogDrawTool()
148356
148235
  { Title: '时间范围', ClassName: 'hqchart_drawtool icon-jiagefanwei', Type:0, Data:{ ID:"DateRange" } },
148357
148236
  { Title: "价格和时间范围", ClassName:"hqchart_drawtool icon-jiagefanwei", Type:0, Data:{ ID:"DatePriceRange" } },
148358
148237
  { Title: "监测线", ClassName:"hqchart_drawtool icon-jiance", Type:0, Data:{ ID:"MonitorLine"} },
148238
+ { Title: "固定范围成交量分布图", ClassName:"hqchart_drawtool icon-tubiao_gudingfanweichengjiaoliangfenbutu", Type:0, Data:{ ID:"固定范围成交量分布图"}}
148359
148239
  ]
148360
148240
  },
148361
148241
  {
@@ -148865,6 +148745,10 @@ function JSDialogModifyDraw()
148865
148745
  this.FontColorButton=null;
148866
148746
  this.BorderColorButton=null;
148867
148747
  this.LockButton=null;
148748
+ this.FontZoomButton=null;
148749
+ this.FontZoomOutButton=null;
148750
+ this.ModifyTextButton=null;
148751
+ this.AdvancedButton=null;
148868
148752
 
148869
148753
  this.RandomLineColor=["rgb(255,69,0)", "rgb(173,255,47)", "rgb(238,154,73)", "rgb(255,105,180)"]; //线段颜色
148870
148754
  this.RandomBGColor=["rgba(210,251,209,0.8)", "rgb(217,217,253)", "rgb(255,208,204)", "rgb(252,249,206)"]; //背景颜色
@@ -148877,9 +148761,13 @@ function JSDialogModifyDraw()
148877
148761
  { Title:"修改字体颜色", ClassName: 'hqchart_drawtool icon-zitiyanse', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_FONT_COLOR_ID }},
148878
148762
  { Title:"修改背景颜色", ClassName: 'hqchart_drawtool icon-zitibeijingse', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BG_COLOR_ID }},
148879
148763
  { Title:"修改边框颜色", ClassName: 'hqchart_drawtool icon-biankuang', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BORDER_COLOR_ID }},
148764
+ { Title:"字体放大", ClassName: 'hqchart_drawtool icon-zoomin', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_ZOOM_FONT_ID }},
148765
+ { Title:"字体缩小", ClassName: 'hqchart_drawtool icon-zoomout', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_ZOOM_OUT_FONT_ID }},
148766
+ { Title:"随机生成文字内容", ClassName: 'hqchart_drawtool icon-bianji', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_MODIFY_TEXT_ID }},
148767
+ { Title:"高级设置", ClassName: 'hqchart_drawtool icon-setting', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_ADVANCED_SETTING_ID }},
148768
+
148880
148769
  { Title:"上锁", ClassName: 'hqchart_drawtool icon-lock', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_LOCK_DRAW_CHART_ID }},
148881
148770
  { Title:"删除图形", ClassName: 'hqchart_drawtool icon-recycle_bin', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_DELETE_DRAW_CHART_ID }},
148882
-
148883
148771
  ];
148884
148772
 
148885
148773
  this.RestoreFocusDelay=800;
@@ -148969,7 +148857,22 @@ function JSDialogModifyDraw()
148969
148857
  this.LockButton=data;
148970
148858
  this.LockButton.Span.style['color']="rgb(220,220,220)";
148971
148859
  break;
148972
-
148860
+ case JS_DRAWTOOL_MENU_ID.CMD_ZOOM_FONT_ID:
148861
+ this.FontZoomButton=data;
148862
+ divItem.style.display="none";
148863
+ break;
148864
+ case JS_DRAWTOOL_MENU_ID.CMD_ZOOM_OUT_FONT_ID:
148865
+ this.FontZoomOutButton=data;
148866
+ divItem.style.display="none";
148867
+ break;
148868
+ case JS_DRAWTOOL_MENU_ID.CMD_MODIFY_TEXT_ID:
148869
+ this.ModifyTextButton=data;
148870
+ divItem.style.display="none";
148871
+ break;
148872
+ case JS_DRAWTOOL_MENU_ID.CMD_ADVANCED_SETTING_ID:
148873
+ this.AdvancedButton=data;
148874
+ divItem.style.display="none";
148875
+ break;
148973
148876
  }
148974
148877
 
148975
148878
  parentDivDom.appendChild(divItem);
@@ -149001,6 +148904,18 @@ function JSDialogModifyDraw()
149001
148904
  case JS_DRAWTOOL_MENU_ID.CMD_LOCK_DRAW_CHART_ID:
149002
148905
  this.ModifyLockChart();
149003
148906
  break;
148907
+ case JS_DRAWTOOL_MENU_ID.CMD_ZOOM_FONT_ID:
148908
+ this.ModifyFontZoom(1);
148909
+ break;
148910
+ case JS_DRAWTOOL_MENU_ID.CMD_ZOOM_OUT_FONT_ID:
148911
+ this.ModifyFontZoom(-1);
148912
+ break;
148913
+ case JS_DRAWTOOL_MENU_ID.CMD_MODIFY_TEXT_ID:
148914
+ this.ModifyText();
148915
+ break;
148916
+ case JS_DRAWTOOL_MENU_ID.CMD_ADVANCED_SETTING_ID:
148917
+ this.AdvancedSetting();
148918
+ break;
149004
148919
  }
149005
148920
  }
149006
148921
 
@@ -149042,6 +148957,19 @@ function JSDialogModifyDraw()
149042
148957
  this.Close();
149043
148958
  }
149044
148959
 
148960
+ this.OnClearChartDrawPicture=function(drawPicture)
148961
+ {
148962
+ if (!this.IsShow()) return;
148963
+
148964
+ if (!drawPicture)
148965
+ {
148966
+ this.Close();
148967
+ return;
148968
+ }
148969
+
148970
+ if (this.ChartPicture && drawPicture.Guid==this.ChartPicture.Guid) this.Close();
148971
+ }
148972
+
149045
148973
  this.ShowButton=function(dom, diaplay)
149046
148974
  {
149047
148975
  if (dom.style.display==diaplay) return;
@@ -149157,6 +149085,65 @@ function JSDialogModifyDraw()
149157
149085
  this.HQChart.Draw();
149158
149086
  }
149159
149087
 
149088
+ this.ModifyFontZoom=function(step)
149089
+ {
149090
+ if (!this.ChartPicture || !this.HQChart) return;
149091
+ if (this.ChartPicture.FontOption.Size+step<=2) return;
149092
+
149093
+ var chart=this.ChartPicture;
149094
+ chart.FontOption.Size+=step;
149095
+
149096
+ if (chart.ClassName=="ChartDrawNote") chart.NoteFontOption.Size+=step;
149097
+
149098
+ this.HQChart.Draw();
149099
+ }
149100
+
149101
+ this.ModifyText=function()
149102
+ {
149103
+ if (!this.ChartPicture || !this.HQChart) return;
149104
+
149105
+ var chart=this.ChartPicture;
149106
+ switch(chart.ClassName)
149107
+ {
149108
+ case "ChartDrawPictureText":
149109
+ chart.Text=this.GetRandomText(chart.Text);
149110
+ break;
149111
+ case "ChartDrawAnchoredText":
149112
+ var text=null;
149113
+ if (IFrameSplitOperator.IsNonEmptyArray(chart.AryText)) text=chart.AryText[0].Text;
149114
+ chart.AryText=[ {Text:this.GetRandomText(text)}, {Text:this.GetRandomText(null)}];
149115
+ break;
149116
+ case "ChartDrawNote":
149117
+ var text=null;
149118
+ if (IFrameSplitOperator.IsNonEmptyArray(chart.AryNoteText)) text=chart.AryNoteText[0].Text;
149119
+ chart.AryNoteText=[ {Text:this.GetRandomText(text)}, {Text:this.GetRandomText(null)}];
149120
+ break;
149121
+ default:
149122
+ return;
149123
+ }
149124
+
149125
+ this.HQChart.Draw();
149126
+ }
149127
+
149128
+ this.GetRandomText=function(text)
149129
+ {
149130
+ var ARY_TEXT=["下跌形态","反转十字星","低位档五阳线","倒V型反转","双顶","持续整理形态"];
149131
+
149132
+ var index=this.GetRandomTestData(0, ARY_TEXT.length-1);
149133
+ for(var i=index;i<10;++i)
149134
+ {
149135
+ var value=ARY_TEXT[i%ARY_TEXT.length];
149136
+ if (value!=text) return value;
149137
+ }
149138
+ }
149139
+
149140
+ this.GetRandomTestData=function(min, max) //测试数据
149141
+ {
149142
+ min = Math.ceil(min);
149143
+ max = Math.floor(max);
149144
+ return Math.floor(Math.random() * (max - min + 1)) + min; //含最大值,含最小值
149145
+ }
149146
+
149160
149147
  this.Show=function(x, y)
149161
149148
  {
149162
149149
  if (!this.DivDialog) this.Create();
@@ -149170,27 +149157,42 @@ function JSDialogModifyDraw()
149170
149157
  {
149171
149158
  this.ChartPicture=chart;
149172
149159
 
149173
- var bShowLineColor=true, bShowBGColor=false, bShowFontColor=false, bShowBorderColor=false;
149160
+ var bShowLineColor=true, bShowBGColor=false, bShowFontColor=false, bShowBorderColor=false, bShowFontZoom=false, bModifyText=false, bAdvanced=false;;
149174
149161
  var bgColor=null, fontColor=null,borderColor=null;
149175
- var ARRAY_TEXT_CHART=['ChartDrawPriceLabel', "ChartDrawAnchoredText","ChartDrawPriceNote"];
149162
+ var ARRAY_TEXT_CHART=['ChartDrawPriceLabel', "ChartDrawAnchoredText","ChartDrawPriceNote", ];
149176
149163
  if (ARRAY_TEXT_CHART.includes(chart.ClassName))
149177
149164
  {
149178
149165
  bShowBGColor=true;
149179
149166
  bShowFontColor=true;
149180
149167
  bShowBorderColor=true;
149168
+ bShowFontZoom=true;
149169
+ if (chart.ClassName=="ChartDrawAnchoredText") bModifyText=true;
149181
149170
  bgColor=chart.BGColor;
149182
149171
  fontColor=chart.TextColor;
149183
149172
  borderColor=chart.BorderColor;
149184
149173
  }
149174
+ else if (chart.ClassName=="ChartDrawPictureText")
149175
+ {
149176
+ bModifyText=true;
149177
+ bShowFontZoom=true;
149178
+ bShowLineColor=true;
149179
+ }
149185
149180
  else if (chart.ClassName=="ChartDrawNote")
149186
149181
  {
149187
149182
  bShowBGColor=true;
149188
149183
  bShowFontColor=true;
149189
149184
  bShowBorderColor=true;
149185
+ bModifyText=true;
149186
+ bShowFontZoom=true;
149190
149187
  bgColor=chart.NoteBGColor;
149191
149188
  fontColor=chart.NoteTextColor;
149192
149189
  borderColor=chart.NoteBorderColor;
149193
149190
  }
149191
+ else if (chart.ClassName=="ChartDrawVolProfile")
149192
+ {
149193
+ bShowLineColor=false;
149194
+ bAdvanced=true;
149195
+ }
149194
149196
 
149195
149197
  if (this.ColorButton)
149196
149198
  {
@@ -149237,6 +149239,30 @@ function JSDialogModifyDraw()
149237
149239
  var item=this.LockButton;
149238
149240
  item.Span.style['color']=this.ChartPicture.EnableMove?"rgb(220,220,220)":"rgb(0,0,0)";
149239
149241
  }
149242
+
149243
+ if (this.FontZoomButton)
149244
+ {
149245
+ var item=this.FontZoomButton;
149246
+ this.ShowButton(item.Div, bShowFontZoom?"inline":"none");
149247
+ }
149248
+
149249
+ if (this.FontZoomOutButton)
149250
+ {
149251
+ var item=this.FontZoomOutButton;
149252
+ this.ShowButton(item.Div, bShowFontZoom?"inline":"none");
149253
+ }
149254
+
149255
+ if (this.ModifyTextButton)
149256
+ {
149257
+ var item=this.ModifyTextButton;
149258
+ this.ShowButton(item.Div, bModifyText?"inline":"none");
149259
+ }
149260
+
149261
+ if (this.AdvancedButton)
149262
+ {
149263
+ var item=this.AdvancedButton;
149264
+ this.ShowButton(item.Div, bAdvanced?"inline":"none");
149265
+ }
149240
149266
  }
149241
149267
 
149242
149268
  this.OnMouseDownTitle=function(e)
@@ -149612,7 +149638,7 @@ function JSTooltipMinuteChart()
149612
149638
 
149613
149639
  this.BGColor=g_JSChartResource.PopMinuteChart.BGColor;
149614
149640
  this.BorderColor=g_JSChartResource.PopMinuteChart.BorderColor;
149615
- this.OnCreateCallback;
149641
+ this.OnCreatedCallback;
149616
149642
 
149617
149643
  this.Minute=
149618
149644
  {
@@ -149632,8 +149658,11 @@ function JSTooltipMinuteChart()
149632
149658
  {
149633
149659
  var item=CloneData(option.Option); //复制一份出来
149634
149660
  this.Minute.Option=Object.assign(this.Minute.Option,item);
149661
+
149662
+ if (IFrameSplitOperator.IsNonEmptyArray(option.Option.EventCallback)) this.Minute.Option.EventCallback=option.Option.EventCallback;
149635
149663
  }
149636
- if (option.OnCreateCallback) this.OnCreateCallback=option.OnCreateCallback;
149664
+ if (option.OnCreatedCallback) this.OnCreatedCallback=option.OnCreatedCallback;
149665
+
149637
149666
  }
149638
149667
  }
149639
149668
 
@@ -149691,7 +149720,7 @@ function JSTooltipMinuteChart()
149691
149720
 
149692
149721
  this.OnCreateHQChart=function(chart)
149693
149722
  {
149694
- if (this.OnCreateCallback) this.OnCreateCallback(chart);
149723
+ if (this.OnCreatedCallback) this.OnCreatedCallback(chart);
149695
149724
  }
149696
149725
 
149697
149726
  this.Destroy=function()
@@ -149857,6 +149886,280 @@ JSTooltipMinuteChart.GetMinuteOption=function()
149857
149886
 
149858
149887
 
149859
149888
 
149889
+
149890
+
149891
+ /*
149892
+ Copyright (c) 2018 jones
149893
+
149894
+ http://www.apache.org/licenses/LICENSE-2.0
149895
+
149896
+ 开源项目 https://github.com/jones2000/HQChart
149897
+
149898
+ jones_2000@163.com
149899
+ */
149900
+
149901
+
149902
+ ///////////////////////////////////////////////////////
149903
+ // K线图提示信息
149904
+ //
149905
+ //////////////////////////////////////////////////////
149906
+
149907
+ function JSTooltipKLineChart()
149908
+ {
149909
+ this.DivDialog=null;
149910
+ this.HQChart=null;
149911
+ this.ID=Guid();
149912
+
149913
+ this.BGColor=g_JSChartResource.PopMinuteChart.BGColor;
149914
+ this.BorderColor=g_JSChartResource.PopMinuteChart.BorderColor;
149915
+ this.OnCreatedCallback=null;
149916
+
149917
+ this.KLine=
149918
+ {
149919
+ Option:JSTooltipKLineChart.GetKLineOption(),
149920
+ JSChart:null,
149921
+ Symbol:null,
149922
+ }
149923
+
149924
+ this.Inital=function(hqchart, option)
149925
+ {
149926
+ this.HQChart=hqchart;
149927
+
149928
+ if (option)
149929
+ {
149930
+ if (IFrameSplitOperator.IsObject(option.Option))
149931
+ {
149932
+ var item=CloneData(option.Option); //复制一份出来
149933
+ this.KLine.Option=Object.assign(this.KLine.Option,item);
149934
+
149935
+ if (IFrameSplitOperator.IsNonEmptyArray(option.Option.EventCallback)) this.KLine.Option.EventCallback=option.Option.EventCallback;
149936
+ }
149937
+ if (option.OnCreatedCallback) this.OnCreatedCallback=option.OnCreatedCallback;
149938
+ }
149939
+ }
149940
+
149941
+ this.Create=function()
149942
+ {
149943
+ var divDom=document.createElement('div');
149944
+ divDom.className='UMyChart_Tooltip_KLine_Div';
149945
+ divDom.id=this.ID;
149946
+
149947
+ var divChart=document.createElement('div');
149948
+ divChart.className='UMyChart_Tooltip_KLine_Chart_Div';
149949
+ divDom.appendChild(divChart);
149950
+
149951
+ this.DivDialog=divDom;
149952
+
149953
+ var chart=JSChart.Init(divChart);
149954
+ this.KLine.JSChart=chart;
149955
+
149956
+ //语言跟主图保持一致
149957
+ if (this.HQChart) this.KLine.Option.Language=g_JSChartLocalization.GetLanguageName(this.HQChart.LanguageID);
149958
+ this.KLine.Option.OnCreatedCallback=(chart)=>{ this.OnCreateHQChart(chart); }
149959
+ this.KLine.Option.NetworkFilter=(data, callback)=>{ this.NetworkFilter(data, callback); }
149960
+ chart.SetOption(this.KLine.Option); //设置K线配置
149961
+
149962
+ document.body.appendChild(divDom);
149963
+
149964
+ this.UpdateStyle();
149965
+ }
149966
+
149967
+ this.UpdateStyle=function()
149968
+ {
149969
+ if (!this.DivDialog) return;
149970
+
149971
+ if (this.BGColor) this.DivDialog.style['background-color']=this.BGColor;
149972
+ if (this.BorderColor) this.DivDialog.style['border-color']=this.BorderColor;
149973
+ }
149974
+
149975
+ this.NetworkFilter=function(data, callback)
149976
+ {
149977
+ if (!this.HQChart || !this.HQChart.NetworkFilter) return;
149978
+
149979
+ this.HQChart.NetworkFilter(data, callback);
149980
+ }
149981
+
149982
+ this.OnCreateHQChart=function(chart)
149983
+ {
149984
+ if (this.OnCreatedCallback) this.OnCreatedCallback(chart);
149985
+ }
149986
+
149987
+ this.Destroy=function()
149988
+ {
149989
+ if (this.DivDialog) document.body.removeChild(this.DivDialog);
149990
+ this.DivDialog=null;
149991
+ this.TitleBox=null;
149992
+ if (!this.KLine.JSChart) this.KLine.JSChart.ChartDestory();
149993
+ this.KLine.JSChart=null;
149994
+ }
149995
+
149996
+ this.IsShow=function()
149997
+ {
149998
+ if (!this.DivDialog) return false;
149999
+
150000
+ return this.DivDialog.style.visibility==='visible';
150001
+ }
150002
+
150003
+ this.Show=function(data, x, y)
150004
+ {
150005
+ if (!this.DivDialog) this.Create();
150006
+ if (!data || !data.Symbol) return;
150007
+
150008
+ var symbol=data.Symbol;
150009
+ if (this.KLine.JSChart)
150010
+ {
150011
+ if (this.KLine.Symbol!=symbol)
150012
+ {
150013
+ this.KLine.Symbol=symbol;
150014
+ this.KLine.JSChart.ChangeSymbol(symbol);
150015
+ }
150016
+ }
150017
+
150018
+ if (!this.KLine.Option.EnableResize)
150019
+ {
150020
+ if (this.KLine.JSChart) this.KLine.JSChart.OnSize({ Type:1 });
150021
+ }
150022
+
150023
+ if (IFrameSplitOperator.IsNumberV2(x,y))
150024
+ {
150025
+
150026
+ }
150027
+ else if (data.Rect)
150028
+ {
150029
+ var rtCell=data.Rect;
150030
+ var pixelRatio=GetDevicePixelRatio();
150031
+ var rtItem={ Left:rtCell.Left/pixelRatio, Right:rtCell.Right/pixelRatio, Bottom:rtCell.Bottom/pixelRatio, Top:rtCell.Top/pixelRatio };
150032
+ rtItem.Width=rtItem.Right-rtItem.Left;
150033
+ rtItem.Height=rtItem.Bottom-rtItem.Top;
150034
+
150035
+ //超出窗口调整位置
150036
+ var height=this.DivDialog.offsetHeight;
150037
+ var width=this.DivDialog.offsetWidth;
150038
+ var x=rtItem.Right+data.Offset.Left;
150039
+ var y=rtItem.Bottom+data.Offset.Top;
150040
+
150041
+ var xRight=window.innerWidth-5;
150042
+ var ybottom=window.innerHeight-5;
150043
+ if (x+width>xRight) x=(rtItem.Left+data.Offset.Left)-width;
150044
+ if (y+height>ybottom) y=(rtItem.Top+data.Offset.Top)-height;
150045
+
150046
+ this.DivDialog.style.visibility='visible';
150047
+ this.DivDialog.style.top = y + "px";
150048
+ this.DivDialog.style.left = x + "px";
150049
+ }
150050
+ }
150051
+
150052
+ this.Hide=function()
150053
+ {
150054
+ if (!this.DivDialog) return;
150055
+ if (this.DivDialog.style.visibility!='hidden')
150056
+ this.DivDialog.style.visibility='hidden';
150057
+ }
150058
+
150059
+
150060
+ this.ReloadResource=function(option)
150061
+ {
150062
+ this.BGColor=g_JSChartResource.PopMinuteChart.BGColor;
150063
+ this.BorderColor=g_JSChartResource.PopMinuteChart.BorderColor;
150064
+
150065
+ if (!this.DivDialog) return;
150066
+
150067
+ this.UpdateStyle();
150068
+
150069
+ if (this.KLine.JSChart) this.KLine.JSChart.ReloadResource(option);
150070
+ }
150071
+
150072
+ }
150073
+
150074
+ JSTooltipKLineChart.GetKLineOption=function()
150075
+ {
150076
+ var option=
150077
+ {
150078
+ Type:'历史K线图', //创建图形类型
150079
+ Windows: //窗口指标
150080
+ [
150081
+ { Index:"MA",Change:false, Modify:false },
150082
+ { Index:"MACD", Close:false, Change:false, Modify:false,MaxMin:false,TitleWindow:false },
150083
+ ],
150084
+
150085
+ //Language:'EN',
150086
+
150087
+ Symbol:null,
150088
+ IsAutoUpdate:false, //是自动更新数据
150089
+ AutoUpdateFrequency:3000, //数据更新频率
150090
+
150091
+
150092
+ SplashTitle:'加载数据中......',
150093
+ IsShowRightMenu:false, //右键菜单
150094
+ CtrlMoveStep:10,
150095
+
150096
+ KLine: //K线设置
150097
+ {
150098
+ DragMode:1, //拖拽模式 0=禁止拖拽 1=数据拖拽 2=区间选择
150099
+ Right:1, //复权 0 不复权 1 前复权 2 后复权
150100
+ Period:0, //周期 0 日线 1 周线 2 月线 3 年线
150101
+ MaxRequestDataCount:3000, //数据个数
150102
+ MaxRequestMinuteDayCount:5, //分钟数据获取几天数据 默认取5天数据
150103
+ IsShowTooltip:false, //是否显示K线提示信息
150104
+ DrawType:0, //K线类型 0=实心K线柱子 1=收盘价线 2=美国线 3=空心K线柱子 4=收盘价面积图
150105
+ KLineDoubleClick:false, //禁止双击弹框
150106
+ RightSpaceCount:0,
150107
+ ZoomType:0,
150108
+ DataWidth:2,
150109
+ },
150110
+
150111
+ StepPixel:0,
150112
+
150113
+ Listener:
150114
+ {
150115
+ KeyDown:false,
150116
+ Wheel:false
150117
+ },
150118
+
150119
+
150120
+
150121
+ KLineTitle: //标题设置
150122
+ {
150123
+ IsShowName:true, //不显示股票名称
150124
+ IsShowSettingInfo:true, //不显示周期/复权
150125
+ IsTitleShowLatestData:true,
150126
+ },
150127
+
150128
+ Border: //边框
150129
+ {
150130
+
150131
+ Left:1, //左边间距
150132
+ Right:20, //右边间距
150133
+ Bottom:25, //底部间距
150134
+ Top:25, //顶部间距
150135
+
150136
+ AutoLeft:{ Blank:10, MinWidth:30 },
150137
+ AutoRight:{ Blank:5, MinWidth:30 },
150138
+ },
150139
+
150140
+ Frame: //子框架设置
150141
+ [
150142
+ {
150143
+ SplitCount:4,
150144
+ IsShowLeftText:false,
150145
+ },
150146
+
150147
+ { SplitCount:3,IsShowLeftText:false, },
150148
+ { SplitCount:3, IsShowLeftText:false,}
150149
+ ],
150150
+ }
150151
+ return option;
150152
+ }
150153
+
150154
+
150155
+
150156
+
150157
+
150158
+
150159
+
150160
+
150161
+
150162
+
149860
150163
  /*
149861
150164
  Copyright (c) 2018 jones
149862
150165
 
@@ -154346,8 +154649,16 @@ function JSDialogModifyIndexParam()
154346
154649
 
154347
154650
  item.Value=value;
154348
154651
 
154349
- if (this.IndexData.Type==1) this.HQChart.UpdateWindowIndex(this.IndexData.WindowIndex);
154350
- else if (this.IndexData.Type==2) this.HQChart.UpdateOverlayIndex(this.IndexData.Identify);
154652
+
154653
+
154654
+ if (this.IndexData.Type==1)
154655
+ {
154656
+ this.HQChart.UpdateWindowIndex(this.IndexData.WindowIndex);
154657
+ }
154658
+ else if (this.IndexData.Type==2)
154659
+ {
154660
+ this.HQChart.UpdateOverlayIndex(this.IndexData.Identify);
154661
+ }
154351
154662
  }
154352
154663
  }
154353
154664
 
@@ -154475,7 +154786,7 @@ function HQChartScriptWorker()
154475
154786
 
154476
154787
 
154477
154788
 
154478
- var HQCHART_VERSION="1.1.14522";
154789
+ var HQCHART_VERSION="1.1.14536";
154479
154790
 
154480
154791
  function PrintHQChartVersion()
154481
154792
  {