hqchart 1.1.13640 → 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.
- package/lib/umychart.NetworkFilterTest.vue.js +8 -3
- package/lib/umychart.vue.js +314 -74
- package/package.json +1 -1
- package/src/jscommon/umychart.NetworkFilterTest.js +85 -26
- package/src/jscommon/umychart.PopMinuteChart.js +268 -0
- package/src/jscommon/umychart.js +95 -172
- package/src/jscommon/umychart.resource/css/tools.css +42 -0
- package/src/jscommon/umychart.style.js +6 -0
- package/src/jscommon/umychart.testdata.js +87 -28
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +102 -173
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.NetworkFilterTest.vue.js +85 -26
- package/src/jscommon/umychart.vue/umychart.vue.js +370 -173
|
@@ -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) //根据页面缩放调整对应边框的尺长
|
|
@@ -19154,6 +19151,7 @@ function OverlayMinuteFrame()
|
|
|
19154
19151
|
this.IsShow=true; //坐标是否显示
|
|
19155
19152
|
this.IsShareY=false; //使用和主框架公用Y轴
|
|
19156
19153
|
this.IsCalculateYMaxMin=true; //是否计算Y最大最小值
|
|
19154
|
+
this.IsShowMainFrame=0; //是否显示在主框架坐标上 1=左边 2=右边
|
|
19157
19155
|
|
|
19158
19156
|
this.Draw=function()
|
|
19159
19157
|
{
|
|
@@ -60689,6 +60687,7 @@ IChartDrawPicture.ArrayDrawPricture=
|
|
|
60689
60687
|
{ Name:"InfoLine", ClassName:"ChartInfoLine", Create:function() { return new ChartInfoLine(); }},
|
|
60690
60688
|
{ Name:"TrendAngle", ClassName:"ChartTrendAngle", Create:function() { return new ChartTrendAngle(); }},
|
|
60691
60689
|
{ Name:"ArrowMarker", ClassName:"ChartArrowMarker", Create:function() { return new ChartArrowMarker(); } },
|
|
60690
|
+
{ Name:"BarsPattern", ClassName:"ChartBarsPattern", Create:function() { return new ChartBarsPattern(); } },
|
|
60692
60691
|
];
|
|
60693
60692
|
|
|
60694
60693
|
IChartDrawPicture.MapIonFont=new Map(
|
|
@@ -70586,6 +70585,22 @@ function ChartInfoLine()
|
|
|
70586
70585
|
}
|
|
70587
70586
|
}
|
|
70588
70587
|
|
|
70588
|
+
function ChartBarsPattern()
|
|
70589
|
+
{
|
|
70590
|
+
this.newMethod=IChartDrawPicture; //派生
|
|
70591
|
+
this.newMethod();
|
|
70592
|
+
delete this.newMethod;
|
|
70593
|
+
|
|
70594
|
+
this.ClassName='ChartBarsPattern';
|
|
70595
|
+
this.PointCount=2;
|
|
70596
|
+
this.KData=null; //K线数据 []
|
|
70597
|
+
|
|
70598
|
+
this.Draw=function()
|
|
70599
|
+
{
|
|
70600
|
+
|
|
70601
|
+
}
|
|
70602
|
+
}
|
|
70603
|
+
|
|
70589
70604
|
|
|
70590
70605
|
function ChartDrawStorage()
|
|
70591
70606
|
{
|
|
@@ -70945,6 +70960,12 @@ function JSChartResource()
|
|
|
70945
70960
|
this.TooltipBGColor="rgb(255, 255, 255)"; //背景色
|
|
70946
70961
|
this.TooltipAlpha=0.92; //透明度
|
|
70947
70962
|
|
|
70963
|
+
this.PopMinuteChart=
|
|
70964
|
+
{
|
|
70965
|
+
BGColor:"rgba(250,250,250,0.95)",
|
|
70966
|
+
BorderColor:"rgb(0,0,0)",
|
|
70967
|
+
}
|
|
70968
|
+
|
|
70948
70969
|
this.SelectRectBGColor="rgba(1,130,212,0.06)"; //背景色
|
|
70949
70970
|
// this.SelectRectAlpha=0.06; //透明度
|
|
70950
70971
|
|
|
@@ -72328,6 +72349,13 @@ function JSChartResource()
|
|
|
72328
72349
|
}
|
|
72329
72350
|
}
|
|
72330
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
|
+
|
|
72331
72359
|
if (style.DefaultTextColor) this.DefaultTextColor = style.DefaultTextColor;
|
|
72332
72360
|
if (style.DefaultTextFont) this.DefaultTextFont = style.DefaultTextFont;
|
|
72333
72361
|
if (style.TitleFont) this.TitleFont = style.TitleFont;
|
|
@@ -74286,7 +74314,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
74286
74314
|
this.StockHistoryDayApiUrl= g_JSChartResource.Domain+'/API/StockHistoryDay'; //股票历史数据
|
|
74287
74315
|
this.TickApiUrl=g_JSChartResource.Domain+'/API/StockDetail'; //当天分笔数据
|
|
74288
74316
|
|
|
74289
|
-
this.
|
|
74317
|
+
this.PopMinuteChart=null; //双击历史K线 弹出分钟走势图
|
|
74290
74318
|
|
|
74291
74319
|
this.BeforeBindMainData=null; //function(funcName) 在BindMainData() 调用前回调用
|
|
74292
74320
|
this.AfterBindMainData=null; //function(funcName) 在BindMainData() 调用前后调用
|
|
@@ -75218,10 +75246,42 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
75218
75246
|
|
|
75219
75247
|
if (bRegisterKeydown) this.UIElement.addEventListener("keydown", (e)=>{ this.OnKeyDown(e); }, true); //键盘消息
|
|
75220
75248
|
if (bRegisterWheel) this.UIElement.addEventListener("wheel", (e)=>{ this.OnWheel(e); }, true); //上下滚动消息
|
|
75249
|
+
|
|
75250
|
+
this.InitalPopMinuteChart(option);
|
|
75221
75251
|
}
|
|
75222
75252
|
|
|
75223
|
-
|
|
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
|
+
}
|
|
75224
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);
|
|
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
|
+
|
|
75225
75285
|
this.OnCustomKeyDown=function(keyID, e) //自定义键盘事件
|
|
75226
75286
|
{
|
|
75227
75287
|
if (keyID==37 && e.ctrlKey) //Ctrl+Left
|
|
@@ -80564,16 +80624,13 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
80564
80624
|
}
|
|
80565
80625
|
}
|
|
80566
80626
|
}
|
|
80567
|
-
|
|
80568
|
-
var event=null;
|
|
80569
|
-
if (this.mapEvent.has(JSCHART_EVENT_ID.DBCLICK_KLINE)) event=this.mapEvent.get(JSCHART_EVENT_ID.DBCLICK_KLINE);
|
|
80570
|
-
|
|
80571
|
-
if (!this.MinuteDialog && !event) return;
|
|
80572
80627
|
|
|
80573
80628
|
var tooltip=new TooltipData();
|
|
80574
80629
|
if (!this.PtInChartPaintTooltip(x,y,tooltip)) return;
|
|
80575
80630
|
if (!tooltip.Data) return;
|
|
80576
80631
|
|
|
80632
|
+
var event=null;
|
|
80633
|
+
if (this.mapEvent.has(JSCHART_EVENT_ID.DBCLICK_KLINE)) event=this.mapEvent.get(JSCHART_EVENT_ID.DBCLICK_KLINE);
|
|
80577
80634
|
if (event)
|
|
80578
80635
|
{
|
|
80579
80636
|
if (this.ClickChartTimer!=null) //清空单击定时器
|
|
@@ -80582,15 +80639,15 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
80582
80639
|
this.ClickChartTimer=null;
|
|
80583
80640
|
}
|
|
80584
80641
|
|
|
80585
|
-
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 };
|
|
80586
80643
|
event.Callback(event,data,this);
|
|
80644
|
+
if (data.PreventDefault) return;
|
|
80587
80645
|
}
|
|
80588
80646
|
|
|
80589
|
-
|
|
80590
|
-
|
|
80591
|
-
|
|
80592
|
-
|
|
80593
|
-
}
|
|
80647
|
+
//内置弹分时图
|
|
80648
|
+
if (!this.PopMinuteChart) return;
|
|
80649
|
+
|
|
80650
|
+
this.ShowMinuteChartDialog({ Chart:this,Tooltip:tooltip, e:e }, x,y);
|
|
80594
80651
|
}
|
|
80595
80652
|
|
|
80596
80653
|
this.CancelAutoUpdate=function() //关闭停止更新
|
|
@@ -82142,7 +82199,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
82142
82199
|
{
|
|
82143
82200
|
this.ShowCallAuctionData({ Left:false, Right:false, MultiDay:{ Left:false, Right:false } });
|
|
82144
82201
|
}
|
|
82145
|
-
if (button.ID==JSCHART_BUTTON_ID.CLOSE_OVERLAY_INDEX)
|
|
82202
|
+
else if (button.ID==JSCHART_BUTTON_ID.CLOSE_OVERLAY_INDEX)
|
|
82146
82203
|
{
|
|
82147
82204
|
var id=button.IndexID;
|
|
82148
82205
|
if (id) this.DeleteOverlayWindowsIndex(id);
|
|
@@ -83587,6 +83644,17 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
83587
83644
|
[
|
|
83588
83645
|
{ Name:"画图工具", Data:{ ID:JSCHART_MENU_ID.CMD_SHOW_DRAWTOOL_ID, Args:[]}, Checked:this.IsShowDrawToolDialog()},
|
|
83589
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
|
+
},
|
|
83590
83658
|
|
|
83591
83659
|
{
|
|
83592
83660
|
Name:"区间选择样式",
|
|
@@ -86642,10 +86710,10 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
86642
86710
|
frame.MainFrame=subFrame.Frame;
|
|
86643
86711
|
frame.ChartBorder=subFrame.Frame.ChartBorder;
|
|
86644
86712
|
frame.GlobalOption=this.GlobalOption;
|
|
86645
|
-
if (obj.ShowRightText
|
|
86646
|
-
|
|
86647
|
-
if (obj.IsShareY===true) frame.IsShareY=true;
|
|
86713
|
+
if (IFrameSplitOperator.IsBool(obj.ShowRightText)) frame.IsShow=obj.ShowRightText;
|
|
86714
|
+
if (IFrameSplitOperator.IsBool(obj.IsShareY)) frame.IsShareY=obj.IsShareY;
|
|
86648
86715
|
if (IFrameSplitOperator.IsBool(obj.IsCalculateYMaxMin)) frame.IsCalculateYMaxMin=obj.IsCalculateYMaxMin; //是否计算Y最大最小值
|
|
86716
|
+
if (IFrameSplitOperator.IsNumber(obj.IsShowMainFrame)) frame.IsShowMainFrame=obj.IsShowMainFrame;
|
|
86649
86717
|
|
|
86650
86718
|
frame.YSplitOperator=new FrameSplitY();
|
|
86651
86719
|
frame.YSplitOperator.LanguageID=this.LanguageID;
|
|
@@ -87981,6 +88049,7 @@ MinuteChartContainer.JosnDataToAfterCloseDataArray=function(data)
|
|
|
87981
88049
|
/*
|
|
87982
88050
|
历史分钟走势图
|
|
87983
88051
|
*/
|
|
88052
|
+
/* 废弃 统一使用 MinuteChartContainer
|
|
87984
88053
|
function HistoryMinuteChartContainer(uielement)
|
|
87985
88054
|
{
|
|
87986
88055
|
this.newMethod=MinuteChartContainer; //派生
|
|
@@ -88025,17 +88094,6 @@ function HistoryMinuteChartContainer(uielement)
|
|
|
88025
88094
|
this.TitlePaint[0].Frame=this.Frame.SubFrame[0].Frame;
|
|
88026
88095
|
this.TitlePaint[0].Canvas=this.Canvas;
|
|
88027
88096
|
this.TitlePaint[0].IsShowDate=true;
|
|
88028
|
-
|
|
88029
|
-
/*
|
|
88030
|
-
//主图叠加画法
|
|
88031
|
-
var paint=new ChartOverlayKLine();
|
|
88032
|
-
paint.Canvas=this.Canvas;
|
|
88033
|
-
paint.ChartBorder=this.Frame.SubFrame[0].Frame.ChartBorder;
|
|
88034
|
-
paint.ChartFrame=this.Frame.SubFrame[0].Frame;
|
|
88035
|
-
paint.Name="Overlay-KLine";
|
|
88036
|
-
this.OverlayChartPaint[0]=paint;
|
|
88037
|
-
*/
|
|
88038
|
-
|
|
88039
88097
|
}
|
|
88040
88098
|
|
|
88041
88099
|
//设置交易日期
|
|
@@ -88181,6 +88239,7 @@ HistoryMinuteChartContainer.JsonDataToMinuteData=function(data)
|
|
|
88181
88239
|
|
|
88182
88240
|
return aryMinuteData;
|
|
88183
88241
|
}
|
|
88242
|
+
*/
|
|
88184
88243
|
|
|
88185
88244
|
/////////////////////////////////////////////////////////////////////////////
|
|
88186
88245
|
// 自定义指数
|
|
@@ -92762,142 +92821,6 @@ function KLineInfoTooltip(divElement)
|
|
|
92762
92821
|
}
|
|
92763
92822
|
}
|
|
92764
92823
|
|
|
92765
|
-
//历史K线上双击 弹出分钟走势图框
|
|
92766
|
-
function MinuteDialog(divElement)
|
|
92767
|
-
{
|
|
92768
|
-
this.newMethod=IDivDialog; //派生
|
|
92769
|
-
this.newMethod(divElement);
|
|
92770
|
-
delete this.newMethod;
|
|
92771
|
-
|
|
92772
|
-
|
|
92773
|
-
this.JSChart=null;
|
|
92774
|
-
this.Height=500;
|
|
92775
|
-
this.Width=600;
|
|
92776
|
-
this.Symbol;
|
|
92777
|
-
this.TradeDate;
|
|
92778
|
-
this.HistoryData;
|
|
92779
|
-
|
|
92780
|
-
//显示窗口
|
|
92781
|
-
this.Show=function(left,top,width,height)
|
|
92782
|
-
{
|
|
92783
|
-
var div=document.getElementById(this.ID);
|
|
92784
|
-
if (!div) return false;
|
|
92785
|
-
|
|
92786
|
-
var findDiv=div.getElementsByClassName("minute-hqchart");
|
|
92787
|
-
if (!findDiv || findDiv.length!=1) return false;
|
|
92788
|
-
var klineDiv=findDiv[0];
|
|
92789
|
-
|
|
92790
|
-
if (IFrameSplitOperator.IsNumber(width)) div.style.width=width+"px";
|
|
92791
|
-
if (IFrameSplitOperator.IsNumber(height)) div.style.height=height+"px";
|
|
92792
|
-
if (IFrameSplitOperator.IsNumber(left)) div.style.left=left+"px";
|
|
92793
|
-
if (IFrameSplitOperator.IsNumber(top)) div.style.top=top+"px";
|
|
92794
|
-
|
|
92795
|
-
div.style.display='block';
|
|
92796
|
-
|
|
92797
|
-
var klineWdith=klineDiv.offsetWidth;
|
|
92798
|
-
var klineTop=klineDiv.offsetTop;
|
|
92799
|
-
klineDiv.style.width=klineWdith+"px";
|
|
92800
|
-
klineDiv.style.height=(height-klineTop-5)+"px";
|
|
92801
|
-
}
|
|
92802
|
-
|
|
92803
|
-
this.Create=function()
|
|
92804
|
-
{
|
|
92805
|
-
this.ID=Guid();
|
|
92806
|
-
var div=document.createElement('div');
|
|
92807
|
-
div.className='jchart-kline-minute-box';
|
|
92808
|
-
div.id=this.ID;
|
|
92809
|
-
var hqchartID=Guid();
|
|
92810
|
-
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>`;
|
|
92811
|
-
div.style.width=this.Height+'px';
|
|
92812
|
-
div.style.height=this.Width+'px';
|
|
92813
|
-
|
|
92814
|
-
this.DivElement.appendChild(div);
|
|
92815
|
-
this.JSChart=JSChart.Init(document.getElementById(hqchartID));
|
|
92816
|
-
|
|
92817
|
-
var option=
|
|
92818
|
-
{
|
|
92819
|
-
Type:'历史分钟走势图',
|
|
92820
|
-
Symbol:this.Symbol, //股票代码
|
|
92821
|
-
IsAutoUpdate:false, //是自动更新数据
|
|
92822
|
-
|
|
92823
|
-
IsShowRightMenu:false, //右键菜单
|
|
92824
|
-
HistoryMinute: { TradeDate:this.TradeDate, IsShowName:false, IsShowDate:false } //显示的交易日期
|
|
92825
|
-
};
|
|
92826
|
-
|
|
92827
|
-
this.JSChart.SetOption(option);
|
|
92828
|
-
}
|
|
92829
|
-
|
|
92830
|
-
this.BindClose=function(chart)
|
|
92831
|
-
{
|
|
92832
|
-
//关闭按钮
|
|
92833
|
-
$("#"+this.ID+" .close-munite").click(
|
|
92834
|
-
{
|
|
92835
|
-
Chart:chart
|
|
92836
|
-
},
|
|
92837
|
-
function(event)
|
|
92838
|
-
{
|
|
92839
|
-
var chart=event.data.Chart;
|
|
92840
|
-
chart.MinuteDialog.Hide();
|
|
92841
|
-
}
|
|
92842
|
-
);
|
|
92843
|
-
}
|
|
92844
|
-
|
|
92845
|
-
this.DoModal=function(event)
|
|
92846
|
-
{
|
|
92847
|
-
this.UpColor=g_JSChartResource.UpTextColor;
|
|
92848
|
-
this.DownColor=g_JSChartResource.DownTextColor;
|
|
92849
|
-
this.UnchagneColor=g_JSChartResource.UnchagneTextColor;
|
|
92850
|
-
|
|
92851
|
-
var chart=event.data.Chart;
|
|
92852
|
-
var tooltip=event.data.Tooltip;
|
|
92853
|
-
var dialog=chart.MinuteDialog;
|
|
92854
|
-
|
|
92855
|
-
dialog.Symbol=chart.Symbol;
|
|
92856
|
-
dialog.TradeDate=tooltip.Data.Date;
|
|
92857
|
-
|
|
92858
|
-
if(!dialog) return;
|
|
92859
|
-
if (dialog.ID==null)
|
|
92860
|
-
{
|
|
92861
|
-
dialog.Create(); //第1次 需要创建div
|
|
92862
|
-
}
|
|
92863
|
-
else
|
|
92864
|
-
{
|
|
92865
|
-
dialog.JSChart.JSChartContainer.TradeDate=dialog.TradeDate;
|
|
92866
|
-
dialog.JSChart.ChangeSymbol(this.Symbol);
|
|
92867
|
-
}
|
|
92868
|
-
|
|
92869
|
-
var left=event.clientX;
|
|
92870
|
-
var top=event.clientY+10;
|
|
92871
|
-
|
|
92872
|
-
var pixelTatio=GetDevicePixelRatio();
|
|
92873
|
-
dialog.Show(500/pixelTatio,100/pixelTatio,600,500);
|
|
92874
|
-
dialog.JSChart.OnSize();
|
|
92875
|
-
|
|
92876
|
-
this.BindClose(chart);
|
|
92877
|
-
|
|
92878
|
-
this.GetColor=function(price,yclse)
|
|
92879
|
-
{
|
|
92880
|
-
if(price>yclse) return this.UpColor;
|
|
92881
|
-
else if (price<yclse) return this.DownColor;
|
|
92882
|
-
else return this.UnchagneColor;
|
|
92883
|
-
}
|
|
92884
|
-
|
|
92885
|
-
var strName = event.data.Chart.Name;
|
|
92886
|
-
var strData=event.data.Tooltip.Data;
|
|
92887
|
-
var date=new Date(parseInt(strData.Date/10000),(strData.Date/100%100-1),strData.Date%100);
|
|
92888
|
-
var strDate = strData.Date.toString();
|
|
92889
|
-
var strNewDate=strDate.substring(0,4)+"-"+strDate.substring(4,6)+"-"+strDate.substring(6,8); //转换时间格式
|
|
92890
|
-
var str = "<span>"+strName+"</span>"+"<span>"+strNewDate+"</span> "+
|
|
92891
|
-
"<span style='color:"+this.GetColor(strData.Open,strData.YClose)+";'>开:"+strData.Open.toFixed(2)+"</span>"+
|
|
92892
|
-
"<span style='color:"+this.GetColor(strData.High,strData.YClose)+";'>高:"+strData.High.toFixed(2)+"</span>"+
|
|
92893
|
-
"<span style='color:"+this.GetColor(strData.Low,strData.YClose)+";'>低:"+strData.Low.toFixed(2)+"</span>"+
|
|
92894
|
-
"<span style='color:"+this.GetColor(strData.Close,strData.YClose)+";'>收:"+strData.Close.toFixed(2)+"</span>"+
|
|
92895
|
-
"<span style='color:"+this.VolColor+";'>量:"+IFrameSplitOperator.FormatValueString(strData.Vol,2)+"</span>"+
|
|
92896
|
-
"<span style='color:"+this.AmountColor+";'>额:"+IFrameSplitOperator.FormatValueString(strData.Amount,2)+"</span>";
|
|
92897
|
-
$(".minute-dialog-title span").html(str);
|
|
92898
|
-
}
|
|
92899
|
-
}
|
|
92900
|
-
|
|
92901
92824
|
function MinuteSelectRectDialog(divElement)
|
|
92902
92825
|
{
|
|
92903
92826
|
this.newMethod=IDivDialog; //派生
|
|
@@ -124119,6 +124042,12 @@ function GetBlackStyle()
|
|
|
124119
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 } },
|
|
124120
124043
|
}
|
|
124121
124044
|
},
|
|
124045
|
+
|
|
124046
|
+
PopMinuteChart:
|
|
124047
|
+
{
|
|
124048
|
+
BGColor:"rgba(0,0,0,0.95)",
|
|
124049
|
+
BorderColor:"rgb(230,230,230)",
|
|
124050
|
+
},
|
|
124122
124051
|
|
|
124123
124052
|
|
|
124124
124053
|
DefaultTextColor: "rgb(101,104,112)",
|
|
@@ -141278,6 +141207,274 @@ function JSDialogModifyDraw()
|
|
|
141278
141207
|
|
|
141279
141208
|
|
|
141280
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
|
+
|
|
141281
141478
|
///////////////////////////////////////////////////////////////////////////////////
|
|
141282
141479
|
// 工作线程计算指标示例
|
|
141283
141480
|
//
|
|
@@ -141399,7 +141596,7 @@ function HQChartScriptWorker()
|
|
|
141399
141596
|
|
|
141400
141597
|
|
|
141401
141598
|
|
|
141402
|
-
var HQCHART_VERSION="1.1.
|
|
141599
|
+
var HQCHART_VERSION="1.1.13651";
|
|
141403
141600
|
|
|
141404
141601
|
function PrintHQChartVersion()
|
|
141405
141602
|
{
|