hqchart 1.1.13644 → 1.1.13654

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.
@@ -4025,7 +4025,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4025
4025
  //改参数div
4026
4026
  this.ModifyIndexDialog=new ModifyIndexDialog(divElement);
4027
4027
  this.ChangeIndexDialog=new ChangeIndexDialog(divElement);
4028
- this.MinuteDialog=new MinuteDialog(divElement);
4029
4028
 
4030
4029
  //额外的画布
4031
4030
  this.MapExtraCanvasElement=new Map(); //key=画布名字, value={ Element:, Canvas:}
@@ -4262,7 +4261,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4262
4261
  //创建改参数div
4263
4262
  chart.ModifyIndexDialog=this.ModifyIndexDialog;
4264
4263
  chart.ChangeIndexDialog=this.ChangeIndexDialog;
4265
- chart.MinuteDialog=this.MinuteDialog;
4266
4264
 
4267
4265
  var pixelRatio=GetDevicePixelRatio();
4268
4266
 
@@ -4309,7 +4307,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4309
4307
  if (option.KLine.MaxReqeustDataCount>0) chart.MaxRequestDataCount=option.KLine.MaxReqeustDataCount; //兼容老版本
4310
4308
  if (option.KLine.MaxRequestDataCount>0) chart.MaxRequestDataCount=option.KLine.MaxRequestDataCount;
4311
4309
  if (option.KLine.Info && option.KLine.Info.length>0) chart.SetKLineInfo(option.KLine.Info,false);
4312
- if (option.KLine.KLineDoubleClick==false) chart.MinuteDialog=this.MinuteDialog=null;
4313
4310
  if (IFrameSplitOperator.IsBool(item.IsShowTooltip)) chart.IsShowTooltip=item.IsShowTooltip;
4314
4311
  if (IFrameSplitOperator.IsBool(item.IsShowKLineDivTooltip)) chart.IsShowKLineDivTooltip=item.IsShowKLineDivTooltip;
4315
4312
  if (option.KLine.MaxRequestMinuteDayCount>0) chart.MaxRequestMinuteDayCount=option.KLine.MaxRequestMinuteDayCount;
@@ -4709,7 +4706,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4709
4706
  //创建改参数div
4710
4707
  chart.ModifyIndexDialog=this.ModifyIndexDialog;
4711
4708
  chart.ChangeIndexDialog=this.ChangeIndexDialog;
4712
- chart.MinuteDialog=this.MinuteDialog;
4713
4709
 
4714
4710
  //右键菜单
4715
4711
  if (IFrameSplitOperator.IsBool(option.IsShowRightMenu)) chart.IsShowRightMenu=option.IsShowRightMenu;
@@ -4721,7 +4717,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4721
4717
  if (option.KLine.Period>=0) chart.Period=option.KLine.Period;
4722
4718
  if (option.KLine.MaxRequestDataCount>0) chart.MaxRequestDataCount=option.KLine.MaxRequestDataCount;
4723
4719
  if (option.KLine.Info && option.KLine.Info.length>0) chart.SetKLineInfo(option.KLine.Info,false);
4724
- if (option.KLine.KLineDoubleClick==false) chart.MinuteDialog=this.MinuteDialog=null;
4725
4720
  if (option.KLine.PageSize>0) chart.PageSize=option.KLine.PageSize;
4726
4721
  if (option.KLine.IsShowTooltip==false) chart.IsShowTooltip=false;
4727
4722
  }
@@ -5317,6 +5312,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
5317
5312
 
5318
5313
  }
5319
5314
 
5315
+ /*废弃
5316
+ //统一全部使用 MinuteChartContainer
5320
5317
  //历史分钟走势图
5321
5318
  this.CreateHistoryMinuteChartContainer=function(option)
5322
5319
  {
@@ -5378,6 +5375,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
5378
5375
 
5379
5376
  return chart;
5380
5377
  }
5378
+ */
5381
5379
 
5382
5380
  this.CreateKLineTrainChartContainer=function(option)
5383
5381
  {
@@ -5654,9 +5652,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
5654
5652
  case "迷你分钟走势图":
5655
5653
  chart=this.CreateMinMinuteChartContainer(option);
5656
5654
  break;
5657
- case "历史分钟走势图":
5658
- chart=this.CreateHistoryMinuteChartContainer(option);
5659
- break;
5660
5655
  case 'K线训练':
5661
5656
  case 'K线训练横屏':
5662
5657
  case "简单K线训练":
@@ -6750,6 +6745,7 @@ var JSCHART_MENU_ID=
6750
6745
  CMD_CHANGE_DRAG_RECT_SHOW_MODE_ID:38,
6751
6746
 
6752
6747
  CMD_SHOW_CORSS_LINE_ID:39, //显示十字光标线
6748
+ CMD_ENABLE_POP_MINUTE_CHART_ID:40, //双击弹分时图
6753
6749
 
6754
6750
 
6755
6751
  CMD_REPORT_CHANGE_BLOCK_ID:60, //报价列表 切换板块ID
@@ -11882,6 +11878,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11882
11878
 
11883
11879
  if (option.Update && this.Update) this.Update( {UpdateCursorIndexType:2} ); //是否立即更新并重绘
11884
11880
  else if (option.Draw==true) this.Draw(); //是否立即重绘
11881
+
11882
+ if (this.PopMinuteChart) this.PopMinuteChart.ReloadResource(option);
11885
11883
  }
11886
11884
 
11887
11885
  this.ReloadBorder=function(option) //根据页面缩放调整对应边框的尺长
@@ -13560,6 +13558,21 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
13560
13558
  if (this.ChartCorssCursor) this.ChartCorssCursor.IsShowCorss=srcParam;
13561
13559
  }
13562
13560
  break;
13561
+
13562
+ case JSCHART_MENU_ID.CMD_ENABLE_POP_MINUTE_CHART_ID://双击弹分时图
13563
+ if (IFrameSplitOperator.IsBool(srcParam))
13564
+ {
13565
+ if (srcParam)
13566
+ {
13567
+ this.DestroyPopMinuteChart();
13568
+ this.InitalPopMinuteChart( {KLine:{KLineDoubleClick:true}} );
13569
+ }
13570
+ else
13571
+ {
13572
+ this.DestroyPopMinuteChart();
13573
+ }
13574
+ }
13575
+ break;
13563
13576
  }
13564
13577
  }
13565
13578
 
@@ -70963,6 +70976,12 @@ function JSChartResource()
70963
70976
  this.TooltipBGColor="rgb(255, 255, 255)"; //背景色
70964
70977
  this.TooltipAlpha=0.92; //透明度
70965
70978
 
70979
+ this.PopMinuteChart=
70980
+ {
70981
+ BGColor:"rgba(250,250,250,0.95)",
70982
+ BorderColor:"rgb(0,0,0)",
70983
+ }
70984
+
70966
70985
  this.SelectRectBGColor="rgba(1,130,212,0.06)"; //背景色
70967
70986
  // this.SelectRectAlpha=0.06; //透明度
70968
70987
 
@@ -72346,6 +72365,13 @@ function JSChartResource()
72346
72365
  }
72347
72366
  }
72348
72367
 
72368
+ if (style.PopMinuteChart)
72369
+ {
72370
+ var item=style.PopMinuteChart;
72371
+ if (item.BGColor) this.PopMinuteChart.BGColor=item.BGColor;
72372
+ if (item.BorderColor) this.PopMinuteChart.BorderColor=item.BorderColor;
72373
+ }
72374
+
72349
72375
  if (style.DefaultTextColor) this.DefaultTextColor = style.DefaultTextColor;
72350
72376
  if (style.DefaultTextFont) this.DefaultTextFont = style.DefaultTextFont;
72351
72377
  if (style.TitleFont) this.TitleFont = style.TitleFont;
@@ -74304,7 +74330,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
74304
74330
  this.StockHistoryDayApiUrl= g_JSChartResource.Domain+'/API/StockHistoryDay'; //股票历史数据
74305
74331
  this.TickApiUrl=g_JSChartResource.Domain+'/API/StockDetail'; //当天分笔数据
74306
74332
 
74307
- this.MinuteDialog; //双击历史K线 弹出分钟走势图
74333
+ this.PopMinuteChart=null; //双击历史K线 弹出分钟走势图
74308
74334
 
74309
74335
  this.BeforeBindMainData=null; //function(funcName) 在BindMainData() 调用前回调用
74310
74336
  this.AfterBindMainData=null; //function(funcName) 在BindMainData() 调用前后调用
@@ -75236,10 +75262,50 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
75236
75262
 
75237
75263
  if (bRegisterKeydown) this.UIElement.addEventListener("keydown", (e)=>{ this.OnKeyDown(e); }, true); //键盘消息
75238
75264
  if (bRegisterWheel) this.UIElement.addEventListener("wheel", (e)=>{ this.OnWheel(e); }, true); //上下滚动消息
75265
+
75266
+ this.InitalPopMinuteChart(option);
75239
75267
  }
75240
75268
 
75241
-
75269
+ this.InitalPopMinuteChart=function(option)
75270
+ {
75271
+ if (!option || !option.KLine) return false;
75272
+ var item=option.KLine;
75273
+ if (item.KLineDoubleClick===true)
75274
+ {
75275
+ this.PopMinuteChart=new JSPopMinuteChart();
75276
+ this.PopMinuteChart.Inital(this);
75277
+ return true;
75278
+ }
75279
+
75280
+ return false;
75281
+ }
75282
+
75283
+ this.DestroyPopMinuteChart=function()
75284
+ {
75285
+ if (!this.PopMinuteChart) return;
75286
+
75287
+ this.PopMinuteChart.Destroy();
75288
+ this.PopMinuteChart=null;
75289
+ }
75290
+
75291
+ this.ShowMinuteChartDialog=function(data, x,y)
75292
+ {
75293
+ if (!this.PopMinuteChart) return;
75294
+ if (!data.Tooltip || !data.Chart) return;
75295
+
75296
+ var rtClient=this.UIElement.getBoundingClientRect();
75297
+ var rtScroll=GetScrollPosition();
75298
+
75299
+ x+=(rtClient.left+rtScroll.Left);
75300
+ y+=(rtClient.top+rtScroll.Top);
75301
+
75302
+ var date=data.Tooltip.Data.Date;
75303
+ var symbol=data.Chart.Symbol;
75242
75304
 
75305
+ this.PopMinuteChart.Show({ Date:date, Symbol:symbol, Data:data.Tooltip.Data }, x,y);
75306
+ }
75307
+
75308
+
75243
75309
  this.OnCustomKeyDown=function(keyID, e) //自定义键盘事件
75244
75310
  {
75245
75311
  if (keyID==37 && e.ctrlKey) //Ctrl+Left
@@ -79867,6 +79933,9 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
79867
79933
  var bShowCorss=false; //十字光标十字线
79868
79934
  if (this.ChartCorssCursor) bShowCorss=this.ChartCorssCursor.IsShowCorss;
79869
79935
 
79936
+ var bPopMinuteChart=false;
79937
+ if (this.PopMinuteChart) bPopMinuteChart=true;
79938
+
79870
79939
  var aryMenu=
79871
79940
  [
79872
79941
  {
@@ -80028,6 +80097,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
80028
80097
 
80029
80098
  { Name:"十字光标线", Data:{ ID:JSCHART_MENU_ID.CMD_SHOW_CORSS_LINE_ID, Args:[!bShowCorss]}, Checked:bShowCorss },
80030
80099
 
80100
+ { Name:"双击弹分时图", Data:{ ID:JSCHART_MENU_ID.CMD_ENABLE_POP_MINUTE_CHART_ID, Args:[!bPopMinuteChart]}, Checked:bPopMinuteChart},
80101
+
80031
80102
  { Name:JSPopMenu.SEPARATOR_LINE_NAME },
80032
80103
  {
80033
80104
  Name:"鼠标形状",
@@ -80582,16 +80653,13 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
80582
80653
  }
80583
80654
  }
80584
80655
  }
80585
-
80586
- var event=null;
80587
- if (this.mapEvent.has(JSCHART_EVENT_ID.DBCLICK_KLINE)) event=this.mapEvent.get(JSCHART_EVENT_ID.DBCLICK_KLINE);
80588
-
80589
- if (!this.MinuteDialog && !event) return;
80590
80656
 
80591
80657
  var tooltip=new TooltipData();
80592
80658
  if (!this.PtInChartPaintTooltip(x,y,tooltip)) return;
80593
80659
  if (!tooltip.Data) return;
80594
80660
 
80661
+ var event=null;
80662
+ if (this.mapEvent.has(JSCHART_EVENT_ID.DBCLICK_KLINE)) event=this.mapEvent.get(JSCHART_EVENT_ID.DBCLICK_KLINE);
80595
80663
  if (event)
80596
80664
  {
80597
80665
  if (this.ClickChartTimer!=null) //清空单击定时器
@@ -80600,15 +80668,15 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
80600
80668
  this.ClickChartTimer=null;
80601
80669
  }
80602
80670
 
80603
- var data={ Tooltip:tooltip, Stock:{Symbol:this.Symbol, Name:this.Name }, X:e.clientX, Y:e.clientY };
80671
+ var data={ Tooltip:tooltip, Stock:{Symbol:this.Symbol, Name:this.Name }, X:e.clientX, Y:e.clientY, PreventDefault:false };
80604
80672
  event.Callback(event,data,this);
80673
+ if (data.PreventDefault) return;
80605
80674
  }
80606
80675
 
80607
- if (this.MinuteDialog)
80608
- {
80609
- e.data={Chart:this,Tooltip:tooltip};
80610
- this.MinuteDialog.DoModal(e);
80611
- }
80676
+ //内置弹分时图
80677
+ if (!this.PopMinuteChart) return;
80678
+
80679
+ this.ShowMinuteChartDialog({ Chart:this,Tooltip:tooltip, e:e }, x,y);
80612
80680
  }
80613
80681
 
80614
80682
  this.CancelAutoUpdate=function() //关闭停止更新
@@ -83605,6 +83673,17 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
83605
83673
  [
83606
83674
  { Name:"画图工具", Data:{ ID:JSCHART_MENU_ID.CMD_SHOW_DRAWTOOL_ID, Args:[]}, Checked:this.IsShowDrawToolDialog()},
83607
83675
  { Name:"十字光标线", Data:{ ID:JSCHART_MENU_ID.CMD_SHOW_CORSS_LINE_ID, Args:[!bShowCorss]}, Checked:bShowCorss },
83676
+ { Name:JSPopMenu.SEPARATOR_LINE_NAME },
83677
+
83678
+ {
83679
+ Name:"语言设置",
83680
+ SubMenu:
83681
+ [
83682
+ { Name:"中文", Data:{ ID:JSCHART_MENU_ID.CMD_CHANGE_LANGUAGE_ID, Args:["CN"]}, Checked:this.LanguageID==JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID },
83683
+ { Name:"英语", Data:{ ID:JSCHART_MENU_ID.CMD_CHANGE_LANGUAGE_ID, Args:["EN"]}, Checked:this.LanguageID==JSCHART_LANGUAGE_ID.LANGUAGE_ENGLISH_ID },
83684
+ { Name:"繁体", Data:{ ID:JSCHART_MENU_ID.CMD_CHANGE_LANGUAGE_ID, Args:["TC"]}, Checked:this.LanguageID==JSCHART_LANGUAGE_ID.LANGUAGE_TRADITIONAL_CHINESE_ID },
83685
+ ]
83686
+ },
83608
83687
 
83609
83688
  {
83610
83689
  Name:"区间选择样式",
@@ -87999,6 +88078,7 @@ MinuteChartContainer.JosnDataToAfterCloseDataArray=function(data)
87999
88078
  /*
88000
88079
  历史分钟走势图
88001
88080
  */
88081
+ /* 废弃 统一使用 MinuteChartContainer
88002
88082
  function HistoryMinuteChartContainer(uielement)
88003
88083
  {
88004
88084
  this.newMethod=MinuteChartContainer; //派生
@@ -88043,17 +88123,6 @@ function HistoryMinuteChartContainer(uielement)
88043
88123
  this.TitlePaint[0].Frame=this.Frame.SubFrame[0].Frame;
88044
88124
  this.TitlePaint[0].Canvas=this.Canvas;
88045
88125
  this.TitlePaint[0].IsShowDate=true;
88046
-
88047
- /*
88048
- //主图叠加画法
88049
- var paint=new ChartOverlayKLine();
88050
- paint.Canvas=this.Canvas;
88051
- paint.ChartBorder=this.Frame.SubFrame[0].Frame.ChartBorder;
88052
- paint.ChartFrame=this.Frame.SubFrame[0].Frame;
88053
- paint.Name="Overlay-KLine";
88054
- this.OverlayChartPaint[0]=paint;
88055
- */
88056
-
88057
88126
  }
88058
88127
 
88059
88128
  //设置交易日期
@@ -88199,6 +88268,7 @@ HistoryMinuteChartContainer.JsonDataToMinuteData=function(data)
88199
88268
 
88200
88269
  return aryMinuteData;
88201
88270
  }
88271
+ */
88202
88272
 
88203
88273
  /////////////////////////////////////////////////////////////////////////////
88204
88274
  // 自定义指数
@@ -92780,142 +92850,6 @@ function KLineInfoTooltip(divElement)
92780
92850
  }
92781
92851
  }
92782
92852
 
92783
- //历史K线上双击 弹出分钟走势图框
92784
- function MinuteDialog(divElement)
92785
- {
92786
- this.newMethod=IDivDialog; //派生
92787
- this.newMethod(divElement);
92788
- delete this.newMethod;
92789
-
92790
-
92791
- this.JSChart=null;
92792
- this.Height=500;
92793
- this.Width=600;
92794
- this.Symbol;
92795
- this.TradeDate;
92796
- this.HistoryData;
92797
-
92798
- //显示窗口
92799
- this.Show=function(left,top,width,height)
92800
- {
92801
- var div=document.getElementById(this.ID);
92802
- if (!div) return false;
92803
-
92804
- var findDiv=div.getElementsByClassName("minute-hqchart");
92805
- if (!findDiv || findDiv.length!=1) return false;
92806
- var klineDiv=findDiv[0];
92807
-
92808
- if (IFrameSplitOperator.IsNumber(width)) div.style.width=width+"px";
92809
- if (IFrameSplitOperator.IsNumber(height)) div.style.height=height+"px";
92810
- if (IFrameSplitOperator.IsNumber(left)) div.style.left=left+"px";
92811
- if (IFrameSplitOperator.IsNumber(top)) div.style.top=top+"px";
92812
-
92813
- div.style.display='block';
92814
-
92815
- var klineWdith=klineDiv.offsetWidth;
92816
- var klineTop=klineDiv.offsetTop;
92817
- klineDiv.style.width=klineWdith+"px";
92818
- klineDiv.style.height=(height-klineTop-5)+"px";
92819
- }
92820
-
92821
- this.Create=function()
92822
- {
92823
- this.ID=Guid();
92824
- var div=document.createElement('div');
92825
- div.className='jchart-kline-minute-box';
92826
- div.id=this.ID;
92827
- var hqchartID=Guid();
92828
- div.innerHTML=`<div><div class='minute-dialog-title'><span></span><strong class='close-munite icon iconfont icon-close'></strong></div><div class='minute-hqchart' id='${hqchartID}' ></div></div>`;
92829
- div.style.width=this.Height+'px';
92830
- div.style.height=this.Width+'px';
92831
-
92832
- this.DivElement.appendChild(div);
92833
- this.JSChart=JSChart.Init(document.getElementById(hqchartID));
92834
-
92835
- var option=
92836
- {
92837
- Type:'历史分钟走势图',
92838
- Symbol:this.Symbol, //股票代码
92839
- IsAutoUpdate:false, //是自动更新数据
92840
-
92841
- IsShowRightMenu:false, //右键菜单
92842
- HistoryMinute: { TradeDate:this.TradeDate, IsShowName:false, IsShowDate:false } //显示的交易日期
92843
- };
92844
-
92845
- this.JSChart.SetOption(option);
92846
- }
92847
-
92848
- this.BindClose=function(chart)
92849
- {
92850
- //关闭按钮
92851
- $("#"+this.ID+" .close-munite").click(
92852
- {
92853
- Chart:chart
92854
- },
92855
- function(event)
92856
- {
92857
- var chart=event.data.Chart;
92858
- chart.MinuteDialog.Hide();
92859
- }
92860
- );
92861
- }
92862
-
92863
- this.DoModal=function(event)
92864
- {
92865
- this.UpColor=g_JSChartResource.UpTextColor;
92866
- this.DownColor=g_JSChartResource.DownTextColor;
92867
- this.UnchagneColor=g_JSChartResource.UnchagneTextColor;
92868
-
92869
- var chart=event.data.Chart;
92870
- var tooltip=event.data.Tooltip;
92871
- var dialog=chart.MinuteDialog;
92872
-
92873
- dialog.Symbol=chart.Symbol;
92874
- dialog.TradeDate=tooltip.Data.Date;
92875
-
92876
- if(!dialog) return;
92877
- if (dialog.ID==null)
92878
- {
92879
- dialog.Create(); //第1次 需要创建div
92880
- }
92881
- else
92882
- {
92883
- dialog.JSChart.JSChartContainer.TradeDate=dialog.TradeDate;
92884
- dialog.JSChart.ChangeSymbol(this.Symbol);
92885
- }
92886
-
92887
- var left=event.clientX;
92888
- var top=event.clientY+10;
92889
-
92890
- var pixelTatio=GetDevicePixelRatio();
92891
- dialog.Show(500/pixelTatio,100/pixelTatio,600,500);
92892
- dialog.JSChart.OnSize();
92893
-
92894
- this.BindClose(chart);
92895
-
92896
- this.GetColor=function(price,yclse)
92897
- {
92898
- if(price>yclse) return this.UpColor;
92899
- else if (price<yclse) return this.DownColor;
92900
- else return this.UnchagneColor;
92901
- }
92902
-
92903
- var strName = event.data.Chart.Name;
92904
- var strData=event.data.Tooltip.Data;
92905
- var date=new Date(parseInt(strData.Date/10000),(strData.Date/100%100-1),strData.Date%100);
92906
- var strDate = strData.Date.toString();
92907
- var strNewDate=strDate.substring(0,4)+"-"+strDate.substring(4,6)+"-"+strDate.substring(6,8); //转换时间格式
92908
- var str = "<span>"+strName+"</span>"+"<span>"+strNewDate+"</span>&nbsp;"+
92909
- "<span style='color:"+this.GetColor(strData.Open,strData.YClose)+";'>开:"+strData.Open.toFixed(2)+"</span>"+
92910
- "<span style='color:"+this.GetColor(strData.High,strData.YClose)+";'>高:"+strData.High.toFixed(2)+"</span>"+
92911
- "<span style='color:"+this.GetColor(strData.Low,strData.YClose)+";'>低:"+strData.Low.toFixed(2)+"</span>"+
92912
- "<span style='color:"+this.GetColor(strData.Close,strData.YClose)+";'>收:"+strData.Close.toFixed(2)+"</span>"+
92913
- "<span style='color:"+this.VolColor+";'>量:"+IFrameSplitOperator.FormatValueString(strData.Vol,2)+"</span>"+
92914
- "<span style='color:"+this.AmountColor+";'>额:"+IFrameSplitOperator.FormatValueString(strData.Amount,2)+"</span>";
92915
- $(".minute-dialog-title span").html(str);
92916
- }
92917
- }
92918
-
92919
92853
  function MinuteSelectRectDialog(divElement)
92920
92854
  {
92921
92855
  this.newMethod=IDivDialog; //派生
@@ -124137,6 +124071,12 @@ function GetBlackStyle()
124137
124071
  Night: { Color:"rgb(153,153,153)", BGColor:"rgb(51,51,51)", BorderColor:"rgb(51,51,51)", Margin:{ Left:5, Top:2, Bottom:2, Right:5 } },
124138
124072
  }
124139
124073
  },
124074
+
124075
+ PopMinuteChart:
124076
+ {
124077
+ BGColor:"rgba(0,0,0,0.95)",
124078
+ BorderColor:"rgb(230,230,230)",
124079
+ },
124140
124080
 
124141
124081
 
124142
124082
  DefaultTextColor: "rgb(101,104,112)",
@@ -140501,7 +140441,7 @@ function JSDialogDrawTool()
140501
140441
  this.Destroy=function()
140502
140442
  {
140503
140443
  this.AryDivChart=[];
140504
- document.body.remove(this.DivDialog);
140444
+ if (this.DivDialog) document.body.removeChild(this.DivDialog);
140505
140445
  this.DivDialog=null;
140506
140446
  }
140507
140447
 
@@ -141296,6 +141236,274 @@ function JSDialogModifyDraw()
141296
141236
 
141297
141237
 
141298
141238
 
141239
+ /*
141240
+ Copyright (c) 2018 jones
141241
+
141242
+ http://www.apache.org/licenses/LICENSE-2.0
141243
+
141244
+ 开源项目 https://github.com/jones2000/HQChart
141245
+
141246
+ jones_2000@163.com
141247
+
141248
+ K线点击弹出指定日期分时图
141249
+ */
141250
+
141251
+
141252
+ function JSPopMinuteChart()
141253
+ {
141254
+ this.DivDialog=null;
141255
+ this.DivInfoText=null;
141256
+ this.HQChart=null;
141257
+ this.DragTitle=null;
141258
+ this.Date=null;
141259
+ this.ID=Guid();
141260
+
141261
+ this.Minute=
141262
+ {
141263
+ Option:JSPopMinuteChart.GetMinuteOption(),
141264
+ JSChart:null,
141265
+ Date:null,
141266
+ }
141267
+
141268
+ this.Inital=function(hqchart)
141269
+ {
141270
+ this.HQChart=hqchart;
141271
+ }
141272
+
141273
+ this.Create=function()
141274
+ {
141275
+ var divDom=document.createElement('div');
141276
+ divDom.className='jchart_pop_minute_dailog';
141277
+ divDom.id=this.ID;
141278
+ divDom.style["background-color"]=g_JSChartResource.PopMinuteChart.BGColor;
141279
+ divDom.style["border-color"]=g_JSChartResource.PopMinuteChart.BorderColor;
141280
+
141281
+ var divTitle=document.createElement("div");
141282
+ divTitle.className='jschart_pop_minute_chart_Title_Div';
141283
+ divTitle.onmousedown=(e)=>{ this.OnMouseDownTitle(e); }
141284
+ divDom.appendChild(divTitle);
141285
+
141286
+ var divInfoText=document.createElement("div");
141287
+ divInfoText.className="";
141288
+ divInfoText.innerText="分时图";
141289
+ this.DivInfoText=divInfoText;
141290
+ divTitle.appendChild(divInfoText);
141291
+
141292
+ var divClose=document.createElement("div");
141293
+ divClose.className='jschart_pop_minute_chart_Close_Div';
141294
+ divClose.innerText="x";
141295
+ divClose.onmousedown=(e)=>{ this.Close(e); }
141296
+ divTitle.appendChild(divClose);
141297
+
141298
+
141299
+ var divChart=document.createElement('div');
141300
+ divChart.className='jschart_pop_minute_chart';
141301
+ divDom.appendChild(divChart);
141302
+
141303
+ this.DivDialog=divDom;
141304
+
141305
+ var chart=JSChart.Init(divChart);
141306
+ this.Minute.JSChart=chart;
141307
+ this.Minute.Option.OnCreatedCallback=(chart)=>{ this.OnCreateHQChart(chart); }
141308
+ this.Minute.Option.NetworkFilter=(data, callback)=>{ this.NetworkFilter(data, callback); }
141309
+ chart.SetOption(this.Minute.Option); //设置K线配置
141310
+
141311
+ document.body.appendChild(divDom);
141312
+ }
141313
+
141314
+ this.NetworkFilter=function(data, callback)
141315
+ {
141316
+ if (!this.HQChart || !this.HQChart.NetworkFilter) return;
141317
+
141318
+ if (data.Name== 'MinuteChartContainer::RequestMinuteData') //分时图数据对接
141319
+ {
141320
+ data.Request.Data.date=this.Date;
141321
+ data.Name="MinuteChartContainer::RequestPopMinuteData";
141322
+ data.Explain="指定日期分时数据"
141323
+ };
141324
+
141325
+ this.HQChart.NetworkFilter(data, callback);
141326
+ }
141327
+
141328
+ this.OnCreateHQChart=function(chart)
141329
+ {
141330
+
141331
+ }
141332
+
141333
+ this.Destroy=function()
141334
+ {
141335
+ if (this.DivDialog) document.body.removeChild(this.DivDialog);
141336
+ this.DivDialog=null;
141337
+ this.DivInfoText=null;
141338
+ this.Minute.JSChart=null;
141339
+ }
141340
+
141341
+ this.IsShow=function()
141342
+ {
141343
+ if (!this.DivDialog) return false;
141344
+
141345
+ return this.DivDialog.style.visibility==='visible';
141346
+ }
141347
+
141348
+ this.Show=function(data, x,y)
141349
+ {
141350
+ if (!this.DivDialog) this.Create();
141351
+ if (!data.Symbol || !IFrameSplitOperator.IsPlusNumber(data.Date));
141352
+
141353
+ this.Date=data.Date;
141354
+ var name=data.Symbol;
141355
+ if (data.Name) name=data.Name;
141356
+ var title=`${name} ${IFrameSplitOperator.FormatDateString(data.Date)} 分时图`
141357
+ this.DivInfoText.innerText=title;
141358
+
141359
+ if (this.Minute.JSChart)
141360
+ {
141361
+ this.Minute.JSChart.ChangeSymbol(data.Symbol);
141362
+ }
141363
+
141364
+ //超出窗口调整位置
141365
+ var height=this.DivDialog.offsetHeight;
141366
+ var width=this.DivDialog.offsetWidth;
141367
+ var xRight=window.innerWidth-5;
141368
+ var ybottom=window.innerHeight-5;
141369
+ if (x+width>xRight) x=xRight-width;
141370
+ if (y+height>ybottom) y=ybottom-height;
141371
+
141372
+ this.DivDialog.style.visibility='visible';
141373
+ this.DivDialog.style.top = y + "px";
141374
+ this.DivDialog.style.left = x + "px";
141375
+ }
141376
+
141377
+ this.Close=function(e)
141378
+ {
141379
+ if (!this.DivDialog) return;
141380
+
141381
+ this.DivDialog.style.visibility='hidden';
141382
+ }
141383
+
141384
+ this.OnMouseDownTitle=function(e)
141385
+ {
141386
+ if (!this.DivDialog) return;
141387
+
141388
+ var dragData={ X:e.clientX, Y:e.clientY };
141389
+ dragData.YOffset=e.clientX - this.DivDialog.offsetLeft;
141390
+ dragData.XOffset=e.clientY - this.DivDialog.offsetTop;
141391
+ this.DragTitle=dragData;
141392
+
141393
+ document.onmousemove=(e)=>{ this.DocOnMouseMoveTitle(e); }
141394
+ document.onmouseup=(e)=>{ this.DocOnMouseUpTitle(e); }
141395
+ }
141396
+
141397
+ this.DocOnMouseMoveTitle=function(e)
141398
+ {
141399
+ if (!this.DragTitle) return;
141400
+
141401
+ var left = e.clientX - this.DragTitle.YOffset;
141402
+ var top = e.clientY - this.DragTitle.XOffset;
141403
+
141404
+ var right=left+this.DivDialog.offsetWidth;
141405
+ var bottom=top+ this.DivDialog.offsetHeight;
141406
+
141407
+ if ((right+5)>=window.innerWidth) left=window.innerWidth-this.DivDialog.offsetWidth-5;
141408
+ if ((bottom+5)>=window.innerHeight) top=window.innerHeight-this.DivDialog.offsetHeight-5;
141409
+
141410
+ this.DivDialog.style.left = left + 'px';
141411
+ this.DivDialog.style.top = top + 'px';
141412
+
141413
+ if(e.preventDefault) e.preventDefault();
141414
+ }
141415
+
141416
+ this.DocOnMouseUpTitle=function(e)
141417
+ {
141418
+ this.DragTitle=null;
141419
+ this.onmousemove = null;
141420
+ this.onmouseup = null;
141421
+ }
141422
+
141423
+ this.ReloadResource=function(option)
141424
+ {
141425
+ if (!this.DivDialog) return;
141426
+
141427
+ this.DivDialog.style["background-color"]=g_JSChartResource.PopMinuteChart.BGColor;
141428
+ this.DivDialog.style["border-color"]=g_JSChartResource.PopMinuteChart.BorderColor;
141429
+
141430
+ if (this.Minute.JSChart) this.Minute.JSChart.ReloadResource(option);
141431
+ }
141432
+ }
141433
+
141434
+
141435
+ JSPopMinuteChart.GetMinuteOption=function()
141436
+ {
141437
+ var option=
141438
+ {
141439
+ Type:'分钟走势图', //创建图形类型
141440
+ Windows: //窗口指标
141441
+ [
141442
+ //{ Index:"VOL" },
141443
+ //{ Index:"RSI" }
141444
+ ],
141445
+
141446
+ Symbol:null, // cf1909.czc
141447
+ IsAutoUpdate:false, //是自动更新数据
141448
+ AutoUpdateFrequency:10000, //数据更新频率
141449
+ DayCount:1, //1 最新交易日数据 >1 多日走势图
141450
+ IsShowRightMenu:false, //是否显示右键菜单
141451
+
141452
+ EnableSelectRect:true,
141453
+ EnableZoomIndexWindow:true,
141454
+ EnableResize:true,
141455
+
141456
+ //BeforeOpen:{IsShow:true, Width:120, IsShowMultiDay:true, MulitiDayWidth:100, },
141457
+ //AfterClose:{IsShow:true, Width:100, IsShowMultiDay:true, MulitiDayWidth:50, ShareVol:2 }, //ShareVol:0=盘后成交量独立坐标, 1==盘后成交量主图共用 2==盘后成交量盘前共用
141458
+
141459
+ CorssCursorInfo:{ Left:2, Right:1, Bottom:1 },
141460
+
141461
+ MinuteLine:
141462
+ {
141463
+
141464
+ },
141465
+
141466
+ MinuteTitle:
141467
+ {
141468
+ IsShowTime:true,
141469
+ IsShowName:false,
141470
+ IsShowDate:true,
141471
+ IsShowVolTitle:true,
141472
+ //IsAlwaysShowLastData:true,
141473
+ IsTitleShowLatestData:true,
141474
+ },
141475
+
141476
+ MinuteVol:
141477
+ {
141478
+ BarColorType:1,
141479
+ },
141480
+
141481
+ //Language:'EN',
141482
+
141483
+ Border: //边框
141484
+ {
141485
+ Left:20, //左边间距
141486
+ Right:20, //右边间距
141487
+ Top:25,
141488
+ Bottom:25,
141489
+
141490
+ AutoLeft:{ Blank:10, MinWidth:60 },
141491
+ AutoRight:{ Blank:10, MinWidth:60 },
141492
+ },
141493
+
141494
+ Frame: //子框架设置
141495
+ [
141496
+ { SplitCount:5 },
141497
+ { SplitCount:3 },
141498
+ { SplitCount:3 },
141499
+ ],
141500
+ }
141501
+
141502
+ return option;
141503
+ }
141504
+
141505
+
141506
+
141299
141507
  ///////////////////////////////////////////////////////////////////////////////////
141300
141508
  // 工作线程计算指标示例
141301
141509
  //
@@ -141417,7 +141625,7 @@ function HQChartScriptWorker()
141417
141625
 
141418
141626
 
141419
141627
 
141420
- var HQCHART_VERSION="1.1.13643";
141628
+ var HQCHART_VERSION="1.1.13653";
141421
141629
 
141422
141630
  function PrintHQChartVersion()
141423
141631
  {