hqchart 1.1.13644 → 1.1.13652

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线训练":
@@ -11882,6 +11877,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11882
11877
 
11883
11878
  if (option.Update && this.Update) this.Update( {UpdateCursorIndexType:2} ); //是否立即更新并重绘
11884
11879
  else if (option.Draw==true) this.Draw(); //是否立即重绘
11880
+
11881
+ if (this.PopMinuteChart) this.PopMinuteChart.ReloadResource(option);
11885
11882
  }
11886
11883
 
11887
11884
  this.ReloadBorder=function(option) //根据页面缩放调整对应边框的尺长
@@ -70963,6 +70960,12 @@ function JSChartResource()
70963
70960
  this.TooltipBGColor="rgb(255, 255, 255)"; //背景色
70964
70961
  this.TooltipAlpha=0.92; //透明度
70965
70962
 
70963
+ this.PopMinuteChart=
70964
+ {
70965
+ BGColor:"rgba(250,250,250,0.95)",
70966
+ BorderColor:"rgb(0,0,0)",
70967
+ }
70968
+
70966
70969
  this.SelectRectBGColor="rgba(1,130,212,0.06)"; //背景色
70967
70970
  // this.SelectRectAlpha=0.06; //透明度
70968
70971
 
@@ -72346,6 +72349,13 @@ function JSChartResource()
72346
72349
  }
72347
72350
  }
72348
72351
 
72352
+ if (style.PopMinuteChart)
72353
+ {
72354
+ var item=style.PopMinuteChart;
72355
+ if (item.BGColor) this.PopMinuteChart.BGColor=item.BGColor;
72356
+ if (item.BorderColor) this.PopMinuteChart.BorderColor=item.BorderColor;
72357
+ }
72358
+
72349
72359
  if (style.DefaultTextColor) this.DefaultTextColor = style.DefaultTextColor;
72350
72360
  if (style.DefaultTextFont) this.DefaultTextFont = style.DefaultTextFont;
72351
72361
  if (style.TitleFont) this.TitleFont = style.TitleFont;
@@ -74304,7 +74314,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
74304
74314
  this.StockHistoryDayApiUrl= g_JSChartResource.Domain+'/API/StockHistoryDay'; //股票历史数据
74305
74315
  this.TickApiUrl=g_JSChartResource.Domain+'/API/StockDetail'; //当天分笔数据
74306
74316
 
74307
- this.MinuteDialog; //双击历史K线 弹出分钟走势图
74317
+ this.PopMinuteChart=null; //双击历史K线 弹出分钟走势图
74308
74318
 
74309
74319
  this.BeforeBindMainData=null; //function(funcName) 在BindMainData() 调用前回调用
74310
74320
  this.AfterBindMainData=null; //function(funcName) 在BindMainData() 调用前后调用
@@ -75236,10 +75246,42 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
75236
75246
 
75237
75247
  if (bRegisterKeydown) this.UIElement.addEventListener("keydown", (e)=>{ this.OnKeyDown(e); }, true); //键盘消息
75238
75248
  if (bRegisterWheel) this.UIElement.addEventListener("wheel", (e)=>{ this.OnWheel(e); }, true); //上下滚动消息
75249
+
75250
+ this.InitalPopMinuteChart(option);
75239
75251
  }
75240
75252
 
75241
-
75253
+ this.InitalPopMinuteChart=function(option)
75254
+ {
75255
+ if (!option || !option.KLine) return false;
75256
+ var item=option.KLine;
75257
+ if (item.KLineDoubleClick===true)
75258
+ {
75259
+ this.PopMinuteChart=new JSPopMinuteChart();
75260
+ this.PopMinuteChart.Inital(this);
75261
+ return true;
75262
+ }
75263
+
75264
+ return false;
75265
+ }
75266
+
75267
+ this.ShowMinuteChartDialog=function(data, x,y)
75268
+ {
75269
+ if (!this.PopMinuteChart) return;
75270
+ if (!data.Tooltip || !data.Chart) return;
75271
+
75272
+ var rtClient=this.UIElement.getBoundingClientRect();
75273
+ var rtScroll=GetScrollPosition();
75274
+
75275
+ x+=(rtClient.left+rtScroll.Left);
75276
+ y+=(rtClient.top+rtScroll.Top);
75242
75277
 
75278
+ var date=data.Tooltip.Data.Date;
75279
+ var symbol=data.Chart.Symbol;
75280
+
75281
+ this.PopMinuteChart.Show({ Date:date, Symbol:symbol, Data:data.Tooltip.Data }, x,y);
75282
+ }
75283
+
75284
+
75243
75285
  this.OnCustomKeyDown=function(keyID, e) //自定义键盘事件
75244
75286
  {
75245
75287
  if (keyID==37 && e.ctrlKey) //Ctrl+Left
@@ -80582,16 +80624,13 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
80582
80624
  }
80583
80625
  }
80584
80626
  }
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
80627
 
80591
80628
  var tooltip=new TooltipData();
80592
80629
  if (!this.PtInChartPaintTooltip(x,y,tooltip)) return;
80593
80630
  if (!tooltip.Data) return;
80594
80631
 
80632
+ var event=null;
80633
+ if (this.mapEvent.has(JSCHART_EVENT_ID.DBCLICK_KLINE)) event=this.mapEvent.get(JSCHART_EVENT_ID.DBCLICK_KLINE);
80595
80634
  if (event)
80596
80635
  {
80597
80636
  if (this.ClickChartTimer!=null) //清空单击定时器
@@ -80600,15 +80639,15 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
80600
80639
  this.ClickChartTimer=null;
80601
80640
  }
80602
80641
 
80603
- var data={ Tooltip:tooltip, Stock:{Symbol:this.Symbol, Name:this.Name }, X:e.clientX, Y:e.clientY };
80642
+ var data={ Tooltip:tooltip, Stock:{Symbol:this.Symbol, Name:this.Name }, X:e.clientX, Y:e.clientY, PreventDefault:false };
80604
80643
  event.Callback(event,data,this);
80644
+ if (data.PreventDefault) return;
80605
80645
  }
80606
80646
 
80607
- if (this.MinuteDialog)
80608
- {
80609
- e.data={Chart:this,Tooltip:tooltip};
80610
- this.MinuteDialog.DoModal(e);
80611
- }
80647
+ //内置弹分时图
80648
+ if (!this.PopMinuteChart) return;
80649
+
80650
+ this.ShowMinuteChartDialog({ Chart:this,Tooltip:tooltip, e:e }, x,y);
80612
80651
  }
80613
80652
 
80614
80653
  this.CancelAutoUpdate=function() //关闭停止更新
@@ -83605,6 +83644,17 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
83605
83644
  [
83606
83645
  { Name:"画图工具", Data:{ ID:JSCHART_MENU_ID.CMD_SHOW_DRAWTOOL_ID, Args:[]}, Checked:this.IsShowDrawToolDialog()},
83607
83646
  { Name:"十字光标线", Data:{ ID:JSCHART_MENU_ID.CMD_SHOW_CORSS_LINE_ID, Args:[!bShowCorss]}, Checked:bShowCorss },
83647
+ { Name:JSPopMenu.SEPARATOR_LINE_NAME },
83648
+
83649
+ {
83650
+ Name:"语言设置",
83651
+ SubMenu:
83652
+ [
83653
+ { Name:"中文", Data:{ ID:JSCHART_MENU_ID.CMD_CHANGE_LANGUAGE_ID, Args:["CN"]}, Checked:this.LanguageID==JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID },
83654
+ { Name:"英语", Data:{ ID:JSCHART_MENU_ID.CMD_CHANGE_LANGUAGE_ID, Args:["EN"]}, Checked:this.LanguageID==JSCHART_LANGUAGE_ID.LANGUAGE_ENGLISH_ID },
83655
+ { Name:"繁体", Data:{ ID:JSCHART_MENU_ID.CMD_CHANGE_LANGUAGE_ID, Args:["TC"]}, Checked:this.LanguageID==JSCHART_LANGUAGE_ID.LANGUAGE_TRADITIONAL_CHINESE_ID },
83656
+ ]
83657
+ },
83608
83658
 
83609
83659
  {
83610
83660
  Name:"区间选择样式",
@@ -87999,6 +88049,7 @@ MinuteChartContainer.JosnDataToAfterCloseDataArray=function(data)
87999
88049
  /*
88000
88050
  历史分钟走势图
88001
88051
  */
88052
+ /* 废弃 统一使用 MinuteChartContainer
88002
88053
  function HistoryMinuteChartContainer(uielement)
88003
88054
  {
88004
88055
  this.newMethod=MinuteChartContainer; //派生
@@ -88043,17 +88094,6 @@ function HistoryMinuteChartContainer(uielement)
88043
88094
  this.TitlePaint[0].Frame=this.Frame.SubFrame[0].Frame;
88044
88095
  this.TitlePaint[0].Canvas=this.Canvas;
88045
88096
  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
88097
  }
88058
88098
 
88059
88099
  //设置交易日期
@@ -88199,6 +88239,7 @@ HistoryMinuteChartContainer.JsonDataToMinuteData=function(data)
88199
88239
 
88200
88240
  return aryMinuteData;
88201
88241
  }
88242
+ */
88202
88243
 
88203
88244
  /////////////////////////////////////////////////////////////////////////////
88204
88245
  // 自定义指数
@@ -92780,142 +92821,6 @@ function KLineInfoTooltip(divElement)
92780
92821
  }
92781
92822
  }
92782
92823
 
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
92824
  function MinuteSelectRectDialog(divElement)
92920
92825
  {
92921
92826
  this.newMethod=IDivDialog; //派生
@@ -124137,6 +124042,12 @@ function GetBlackStyle()
124137
124042
  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
124043
  }
124139
124044
  },
124045
+
124046
+ PopMinuteChart:
124047
+ {
124048
+ BGColor:"rgba(0,0,0,0.95)",
124049
+ BorderColor:"rgb(230,230,230)",
124050
+ },
124140
124051
 
124141
124052
 
124142
124053
  DefaultTextColor: "rgb(101,104,112)",
@@ -141296,6 +141207,274 @@ function JSDialogModifyDraw()
141296
141207
 
141297
141208
 
141298
141209
 
141210
+ /*
141211
+ Copyright (c) 2018 jones
141212
+
141213
+ http://www.apache.org/licenses/LICENSE-2.0
141214
+
141215
+ 开源项目 https://github.com/jones2000/HQChart
141216
+
141217
+ jones_2000@163.com
141218
+
141219
+ K线点击弹出指定日期分时图
141220
+ */
141221
+
141222
+
141223
+ function JSPopMinuteChart()
141224
+ {
141225
+ this.DivDialog=null;
141226
+ this.DivInfoText=null;
141227
+ this.HQChart=null;
141228
+ this.DragTitle=null;
141229
+ this.Date=null;
141230
+ this.ID=Guid();
141231
+
141232
+ this.Minute=
141233
+ {
141234
+ Option:JSPopMinuteChart.GetMinuteOption(),
141235
+ JSChart:null,
141236
+ Date:null,
141237
+ }
141238
+
141239
+ this.Inital=function(hqchart)
141240
+ {
141241
+ this.HQChart=hqchart;
141242
+ }
141243
+
141244
+ this.Create=function()
141245
+ {
141246
+ var divDom=document.createElement('div');
141247
+ divDom.className='jchart_pop_minute_dailog';
141248
+ divDom.id=this.ID;
141249
+ divDom.style["background-color"]=g_JSChartResource.PopMinuteChart.BGColor;
141250
+ divDom.style["border-color"]=g_JSChartResource.PopMinuteChart.BorderColor;
141251
+
141252
+ var divTitle=document.createElement("div");
141253
+ divTitle.className='jschart_pop_minute_chart_Title_Div';
141254
+ divTitle.onmousedown=(e)=>{ this.OnMouseDownTitle(e); }
141255
+ divDom.appendChild(divTitle);
141256
+
141257
+ var divInfoText=document.createElement("div");
141258
+ divInfoText.className="";
141259
+ divInfoText.innerText="分时图";
141260
+ this.DivInfoText=divInfoText;
141261
+ divTitle.appendChild(divInfoText);
141262
+
141263
+ var divClose=document.createElement("div");
141264
+ divClose.className='jschart_pop_minute_chart_Close_Div';
141265
+ divClose.innerText="x";
141266
+ divClose.onmousedown=(e)=>{ this.Close(e); }
141267
+ divTitle.appendChild(divClose);
141268
+
141269
+
141270
+ var divChart=document.createElement('div');
141271
+ divChart.className='jschart_pop_minute_chart';
141272
+ divDom.appendChild(divChart);
141273
+
141274
+ this.DivDialog=divDom;
141275
+
141276
+ var chart=JSChart.Init(divChart);
141277
+ this.Minute.JSChart=chart;
141278
+ this.Minute.Option.OnCreatedCallback=(chart)=>{ this.OnCreateHQChart(chart); }
141279
+ this.Minute.Option.NetworkFilter=(data, callback)=>{ this.NetworkFilter(data, callback); }
141280
+ chart.SetOption(this.Minute.Option); //设置K线配置
141281
+
141282
+ document.body.appendChild(divDom);
141283
+ }
141284
+
141285
+ this.NetworkFilter=function(data, callback)
141286
+ {
141287
+ if (!this.HQChart || !this.HQChart.NetworkFilter) return;
141288
+
141289
+ if (data.Name== 'MinuteChartContainer::RequestMinuteData') //分时图数据对接
141290
+ {
141291
+ data.Request.Data.date=this.Date;
141292
+ data.Name="MinuteChartContainer::RequestPopMinuteData";
141293
+ data.Explain="指定日期分时数据"
141294
+ };
141295
+
141296
+ this.HQChart.NetworkFilter(data, callback);
141297
+ }
141298
+
141299
+ this.OnCreateHQChart=function(chart)
141300
+ {
141301
+
141302
+ }
141303
+
141304
+ this.Destroy=function()
141305
+ {
141306
+ document.body.remove(this.DivDialog);
141307
+ this.DivDialog=null;
141308
+ this.DivInfoText=null;
141309
+ this.Minute.JSChart=null;
141310
+ }
141311
+
141312
+ this.IsShow=function()
141313
+ {
141314
+ if (!this.DivDialog) return false;
141315
+
141316
+ return this.DivDialog.style.visibility==='visible';
141317
+ }
141318
+
141319
+ this.Show=function(data, x,y)
141320
+ {
141321
+ if (!this.DivDialog) this.Create();
141322
+ if (!data.Symbol || !IFrameSplitOperator.IsPlusNumber(data.Date));
141323
+
141324
+ this.Date=data.Date;
141325
+ var name=data.Symbol;
141326
+ if (data.Name) name=data.Name;
141327
+ var title=`${name} ${IFrameSplitOperator.FormatDateString(data.Date)} 分时图`
141328
+ this.DivInfoText.innerText=title;
141329
+
141330
+ if (this.Minute.JSChart)
141331
+ {
141332
+ this.Minute.JSChart.ChangeSymbol(data.Symbol);
141333
+ }
141334
+
141335
+ //超出窗口调整位置
141336
+ var height=this.DivDialog.offsetHeight;
141337
+ var width=this.DivDialog.offsetWidth;
141338
+ var xRight=window.innerWidth-5;
141339
+ var ybottom=window.innerHeight-5;
141340
+ if (x+width>xRight) x=xRight-width;
141341
+ if (y+height>ybottom) y=ybottom-height;
141342
+
141343
+ this.DivDialog.style.visibility='visible';
141344
+ this.DivDialog.style.top = y + "px";
141345
+ this.DivDialog.style.left = x + "px";
141346
+ }
141347
+
141348
+ this.Close=function(e)
141349
+ {
141350
+ if (!this.DivDialog) return;
141351
+
141352
+ this.DivDialog.style.visibility='hidden';
141353
+ }
141354
+
141355
+ this.OnMouseDownTitle=function(e)
141356
+ {
141357
+ if (!this.DivDialog) return;
141358
+
141359
+ var dragData={ X:e.clientX, Y:e.clientY };
141360
+ dragData.YOffset=e.clientX - this.DivDialog.offsetLeft;
141361
+ dragData.XOffset=e.clientY - this.DivDialog.offsetTop;
141362
+ this.DragTitle=dragData;
141363
+
141364
+ document.onmousemove=(e)=>{ this.DocOnMouseMoveTitle(e); }
141365
+ document.onmouseup=(e)=>{ this.DocOnMouseUpTitle(e); }
141366
+ }
141367
+
141368
+ this.DocOnMouseMoveTitle=function(e)
141369
+ {
141370
+ if (!this.DragTitle) return;
141371
+
141372
+ var left = e.clientX - this.DragTitle.YOffset;
141373
+ var top = e.clientY - this.DragTitle.XOffset;
141374
+
141375
+ var right=left+this.DivDialog.offsetWidth;
141376
+ var bottom=top+ this.DivDialog.offsetHeight;
141377
+
141378
+ if ((right+5)>=window.innerWidth) left=window.innerWidth-this.DivDialog.offsetWidth-5;
141379
+ if ((bottom+5)>=window.innerHeight) top=window.innerHeight-this.DivDialog.offsetHeight-5;
141380
+
141381
+ this.DivDialog.style.left = left + 'px';
141382
+ this.DivDialog.style.top = top + 'px';
141383
+
141384
+ if(e.preventDefault) e.preventDefault();
141385
+ }
141386
+
141387
+ this.DocOnMouseUpTitle=function(e)
141388
+ {
141389
+ this.DragTitle=null;
141390
+ this.onmousemove = null;
141391
+ this.onmouseup = null;
141392
+ }
141393
+
141394
+ this.ReloadResource=function(option)
141395
+ {
141396
+ if (!this.DivDialog) return;
141397
+
141398
+ this.DivDialog.style["background-color"]=g_JSChartResource.PopMinuteChart.BGColor;
141399
+ this.DivDialog.style["border-color"]=g_JSChartResource.PopMinuteChart.BorderColor;
141400
+
141401
+ if (this.Minute.JSChart) this.Minute.JSChart.ReloadResource(option);
141402
+ }
141403
+ }
141404
+
141405
+
141406
+ JSPopMinuteChart.GetMinuteOption=function()
141407
+ {
141408
+ var option=
141409
+ {
141410
+ Type:'分钟走势图', //创建图形类型
141411
+ Windows: //窗口指标
141412
+ [
141413
+ //{ Index:"VOL" },
141414
+ //{ Index:"RSI" }
141415
+ ],
141416
+
141417
+ Symbol:null, // cf1909.czc
141418
+ IsAutoUpdate:false, //是自动更新数据
141419
+ AutoUpdateFrequency:10000, //数据更新频率
141420
+ DayCount:1, //1 最新交易日数据 >1 多日走势图
141421
+ IsShowRightMenu:false, //是否显示右键菜单
141422
+
141423
+ EnableSelectRect:true,
141424
+ EnableZoomIndexWindow:true,
141425
+ EnableResize:true,
141426
+
141427
+ //BeforeOpen:{IsShow:true, Width:120, IsShowMultiDay:true, MulitiDayWidth:100, },
141428
+ //AfterClose:{IsShow:true, Width:100, IsShowMultiDay:true, MulitiDayWidth:50, ShareVol:2 }, //ShareVol:0=盘后成交量独立坐标, 1==盘后成交量主图共用 2==盘后成交量盘前共用
141429
+
141430
+ CorssCursorInfo:{ Left:2, Right:1, Bottom:1 },
141431
+
141432
+ MinuteLine:
141433
+ {
141434
+
141435
+ },
141436
+
141437
+ MinuteTitle:
141438
+ {
141439
+ IsShowTime:true,
141440
+ IsShowName:false,
141441
+ IsShowDate:true,
141442
+ IsShowVolTitle:true,
141443
+ //IsAlwaysShowLastData:true,
141444
+ IsTitleShowLatestData:true,
141445
+ },
141446
+
141447
+ MinuteVol:
141448
+ {
141449
+ BarColorType:1,
141450
+ },
141451
+
141452
+ //Language:'EN',
141453
+
141454
+ Border: //边框
141455
+ {
141456
+ Left:20, //左边间距
141457
+ Right:20, //右边间距
141458
+ Top:25,
141459
+ Bottom:25,
141460
+
141461
+ AutoLeft:{ Blank:10, MinWidth:60 },
141462
+ AutoRight:{ Blank:10, MinWidth:60 },
141463
+ },
141464
+
141465
+ Frame: //子框架设置
141466
+ [
141467
+ { SplitCount:5 },
141468
+ { SplitCount:3 },
141469
+ { SplitCount:3 },
141470
+ ],
141471
+ }
141472
+
141473
+ return option;
141474
+ }
141475
+
141476
+
141477
+
141299
141478
  ///////////////////////////////////////////////////////////////////////////////////
141300
141479
  // 工作线程计算指标示例
141301
141480
  //
@@ -141417,7 +141596,7 @@ function HQChartScriptWorker()
141417
141596
 
141418
141597
 
141419
141598
 
141420
- var HQCHART_VERSION="1.1.13643";
141599
+ var HQCHART_VERSION="1.1.13651";
141421
141600
 
141422
141601
  function PrintHQChartVersion()
141423
141602
  {