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.
- package/lib/umychart.NetworkFilterTest.vue.js +7 -2
- package/lib/umychart.vue.js +306 -69
- package/package.json +1 -1
- package/src/jscommon/umychart.NetworkFilterTest.js +57 -0
- package/src/jscommon/umychart.PopMinuteChart.js +268 -0
- package/src/jscommon/umychart.js +73 -168
- package/src/jscommon/umychart.resource/css/tools.css +42 -0
- package/src/jscommon/umychart.style.js +6 -0
- package/src/jscommon/umychart.testdata.js +57 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +80 -169
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.NetworkFilterTest.vue.js +57 -0
- package/src/jscommon/umychart.vue/umychart.vue.js +348 -169
package/src/jscommon/umychart.js
CHANGED
|
@@ -56,7 +56,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
56
56
|
//改参数div
|
|
57
57
|
this.ModifyIndexDialog=new ModifyIndexDialog(divElement);
|
|
58
58
|
this.ChangeIndexDialog=new ChangeIndexDialog(divElement);
|
|
59
|
-
this.MinuteDialog=new MinuteDialog(divElement);
|
|
60
59
|
|
|
61
60
|
//额外的画布
|
|
62
61
|
this.MapExtraCanvasElement=new Map(); //key=画布名字, value={ Element:, Canvas:}
|
|
@@ -293,7 +292,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
293
292
|
//创建改参数div
|
|
294
293
|
chart.ModifyIndexDialog=this.ModifyIndexDialog;
|
|
295
294
|
chart.ChangeIndexDialog=this.ChangeIndexDialog;
|
|
296
|
-
chart.MinuteDialog=this.MinuteDialog;
|
|
297
295
|
|
|
298
296
|
var pixelRatio=GetDevicePixelRatio();
|
|
299
297
|
|
|
@@ -340,7 +338,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
340
338
|
if (option.KLine.MaxReqeustDataCount>0) chart.MaxRequestDataCount=option.KLine.MaxReqeustDataCount; //兼容老版本
|
|
341
339
|
if (option.KLine.MaxRequestDataCount>0) chart.MaxRequestDataCount=option.KLine.MaxRequestDataCount;
|
|
342
340
|
if (option.KLine.Info && option.KLine.Info.length>0) chart.SetKLineInfo(option.KLine.Info,false);
|
|
343
|
-
if (option.KLine.KLineDoubleClick==false) chart.MinuteDialog=this.MinuteDialog=null;
|
|
344
341
|
if (IFrameSplitOperator.IsBool(item.IsShowTooltip)) chart.IsShowTooltip=item.IsShowTooltip;
|
|
345
342
|
if (IFrameSplitOperator.IsBool(item.IsShowKLineDivTooltip)) chart.IsShowKLineDivTooltip=item.IsShowKLineDivTooltip;
|
|
346
343
|
if (option.KLine.MaxRequestMinuteDayCount>0) chart.MaxRequestMinuteDayCount=option.KLine.MaxRequestMinuteDayCount;
|
|
@@ -740,7 +737,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
740
737
|
//创建改参数div
|
|
741
738
|
chart.ModifyIndexDialog=this.ModifyIndexDialog;
|
|
742
739
|
chart.ChangeIndexDialog=this.ChangeIndexDialog;
|
|
743
|
-
chart.MinuteDialog=this.MinuteDialog;
|
|
744
740
|
|
|
745
741
|
//右键菜单
|
|
746
742
|
if (IFrameSplitOperator.IsBool(option.IsShowRightMenu)) chart.IsShowRightMenu=option.IsShowRightMenu;
|
|
@@ -752,7 +748,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
752
748
|
if (option.KLine.Period>=0) chart.Period=option.KLine.Period;
|
|
753
749
|
if (option.KLine.MaxRequestDataCount>0) chart.MaxRequestDataCount=option.KLine.MaxRequestDataCount;
|
|
754
750
|
if (option.KLine.Info && option.KLine.Info.length>0) chart.SetKLineInfo(option.KLine.Info,false);
|
|
755
|
-
if (option.KLine.KLineDoubleClick==false) chart.MinuteDialog=this.MinuteDialog=null;
|
|
756
751
|
if (option.KLine.PageSize>0) chart.PageSize=option.KLine.PageSize;
|
|
757
752
|
if (option.KLine.IsShowTooltip==false) chart.IsShowTooltip=false;
|
|
758
753
|
}
|
|
@@ -1348,6 +1343,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
1348
1343
|
|
|
1349
1344
|
}
|
|
1350
1345
|
|
|
1346
|
+
/*废弃
|
|
1347
|
+
//统一全部使用 MinuteChartContainer
|
|
1351
1348
|
//历史分钟走势图
|
|
1352
1349
|
this.CreateHistoryMinuteChartContainer=function(option)
|
|
1353
1350
|
{
|
|
@@ -1409,6 +1406,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
1409
1406
|
|
|
1410
1407
|
return chart;
|
|
1411
1408
|
}
|
|
1409
|
+
*/
|
|
1412
1410
|
|
|
1413
1411
|
this.CreateKLineTrainChartContainer=function(option)
|
|
1414
1412
|
{
|
|
@@ -1685,9 +1683,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
1685
1683
|
case "迷你分钟走势图":
|
|
1686
1684
|
chart=this.CreateMinMinuteChartContainer(option);
|
|
1687
1685
|
break;
|
|
1688
|
-
case "历史分钟走势图":
|
|
1689
|
-
chart=this.CreateHistoryMinuteChartContainer(option);
|
|
1690
|
-
break;
|
|
1691
1686
|
case 'K线训练':
|
|
1692
1687
|
case 'K线训练横屏':
|
|
1693
1688
|
case "简单K线训练":
|
|
@@ -7913,6 +7908,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7913
7908
|
|
|
7914
7909
|
if (option.Update && this.Update) this.Update( {UpdateCursorIndexType:2} ); //是否立即更新并重绘
|
|
7915
7910
|
else if (option.Draw==true) this.Draw(); //是否立即重绘
|
|
7911
|
+
|
|
7912
|
+
if (this.PopMinuteChart) this.PopMinuteChart.ReloadResource(option);
|
|
7916
7913
|
}
|
|
7917
7914
|
|
|
7918
7915
|
this.ReloadBorder=function(option) //根据页面缩放调整对应边框的尺长
|
|
@@ -66994,6 +66991,12 @@ function JSChartResource()
|
|
|
66994
66991
|
this.TooltipBGColor="rgb(255, 255, 255)"; //背景色
|
|
66995
66992
|
this.TooltipAlpha=0.92; //透明度
|
|
66996
66993
|
|
|
66994
|
+
this.PopMinuteChart=
|
|
66995
|
+
{
|
|
66996
|
+
BGColor:"rgba(250,250,250,0.95)",
|
|
66997
|
+
BorderColor:"rgb(0,0,0)",
|
|
66998
|
+
}
|
|
66999
|
+
|
|
66997
67000
|
this.SelectRectBGColor="rgba(1,130,212,0.06)"; //背景色
|
|
66998
67001
|
// this.SelectRectAlpha=0.06; //透明度
|
|
66999
67002
|
|
|
@@ -68377,6 +68380,13 @@ function JSChartResource()
|
|
|
68377
68380
|
}
|
|
68378
68381
|
}
|
|
68379
68382
|
|
|
68383
|
+
if (style.PopMinuteChart)
|
|
68384
|
+
{
|
|
68385
|
+
var item=style.PopMinuteChart;
|
|
68386
|
+
if (item.BGColor) this.PopMinuteChart.BGColor=item.BGColor;
|
|
68387
|
+
if (item.BorderColor) this.PopMinuteChart.BorderColor=item.BorderColor;
|
|
68388
|
+
}
|
|
68389
|
+
|
|
68380
68390
|
if (style.DefaultTextColor) this.DefaultTextColor = style.DefaultTextColor;
|
|
68381
68391
|
if (style.DefaultTextFont) this.DefaultTextFont = style.DefaultTextFont;
|
|
68382
68392
|
if (style.TitleFont) this.TitleFont = style.TitleFont;
|
|
@@ -70335,7 +70345,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
70335
70345
|
this.StockHistoryDayApiUrl= g_JSChartResource.Domain+'/API/StockHistoryDay'; //股票历史数据
|
|
70336
70346
|
this.TickApiUrl=g_JSChartResource.Domain+'/API/StockDetail'; //当天分笔数据
|
|
70337
70347
|
|
|
70338
|
-
this.
|
|
70348
|
+
this.PopMinuteChart=null; //双击历史K线 弹出分钟走势图
|
|
70339
70349
|
|
|
70340
70350
|
this.BeforeBindMainData=null; //function(funcName) 在BindMainData() 调用前回调用
|
|
70341
70351
|
this.AfterBindMainData=null; //function(funcName) 在BindMainData() 调用前后调用
|
|
@@ -71267,10 +71277,42 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
71267
71277
|
|
|
71268
71278
|
if (bRegisterKeydown) this.UIElement.addEventListener("keydown", (e)=>{ this.OnKeyDown(e); }, true); //键盘消息
|
|
71269
71279
|
if (bRegisterWheel) this.UIElement.addEventListener("wheel", (e)=>{ this.OnWheel(e); }, true); //上下滚动消息
|
|
71280
|
+
|
|
71281
|
+
this.InitalPopMinuteChart(option);
|
|
71270
71282
|
}
|
|
71271
71283
|
|
|
71272
|
-
|
|
71284
|
+
this.InitalPopMinuteChart=function(option)
|
|
71285
|
+
{
|
|
71286
|
+
if (!option || !option.KLine) return false;
|
|
71287
|
+
var item=option.KLine;
|
|
71288
|
+
if (item.KLineDoubleClick===true)
|
|
71289
|
+
{
|
|
71290
|
+
this.PopMinuteChart=new JSPopMinuteChart();
|
|
71291
|
+
this.PopMinuteChart.Inital(this);
|
|
71292
|
+
return true;
|
|
71293
|
+
}
|
|
71294
|
+
|
|
71295
|
+
return false;
|
|
71296
|
+
}
|
|
71297
|
+
|
|
71298
|
+
this.ShowMinuteChartDialog=function(data, x,y)
|
|
71299
|
+
{
|
|
71300
|
+
if (!this.PopMinuteChart) return;
|
|
71301
|
+
if (!data.Tooltip || !data.Chart) return;
|
|
71302
|
+
|
|
71303
|
+
var rtClient=this.UIElement.getBoundingClientRect();
|
|
71304
|
+
var rtScroll=GetScrollPosition();
|
|
71305
|
+
|
|
71306
|
+
x+=(rtClient.left+rtScroll.Left);
|
|
71307
|
+
y+=(rtClient.top+rtScroll.Top);
|
|
71308
|
+
|
|
71309
|
+
var date=data.Tooltip.Data.Date;
|
|
71310
|
+
var symbol=data.Chart.Symbol;
|
|
71273
71311
|
|
|
71312
|
+
this.PopMinuteChart.Show({ Date:date, Symbol:symbol, Data:data.Tooltip.Data }, x,y);
|
|
71313
|
+
}
|
|
71314
|
+
|
|
71315
|
+
|
|
71274
71316
|
this.OnCustomKeyDown=function(keyID, e) //自定义键盘事件
|
|
71275
71317
|
{
|
|
71276
71318
|
if (keyID==37 && e.ctrlKey) //Ctrl+Left
|
|
@@ -76613,16 +76655,13 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
76613
76655
|
}
|
|
76614
76656
|
}
|
|
76615
76657
|
}
|
|
76616
|
-
|
|
76617
|
-
var event=null;
|
|
76618
|
-
if (this.mapEvent.has(JSCHART_EVENT_ID.DBCLICK_KLINE)) event=this.mapEvent.get(JSCHART_EVENT_ID.DBCLICK_KLINE);
|
|
76619
|
-
|
|
76620
|
-
if (!this.MinuteDialog && !event) return;
|
|
76621
76658
|
|
|
76622
76659
|
var tooltip=new TooltipData();
|
|
76623
76660
|
if (!this.PtInChartPaintTooltip(x,y,tooltip)) return;
|
|
76624
76661
|
if (!tooltip.Data) return;
|
|
76625
76662
|
|
|
76663
|
+
var event=null;
|
|
76664
|
+
if (this.mapEvent.has(JSCHART_EVENT_ID.DBCLICK_KLINE)) event=this.mapEvent.get(JSCHART_EVENT_ID.DBCLICK_KLINE);
|
|
76626
76665
|
if (event)
|
|
76627
76666
|
{
|
|
76628
76667
|
if (this.ClickChartTimer!=null) //清空单击定时器
|
|
@@ -76631,15 +76670,15 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
76631
76670
|
this.ClickChartTimer=null;
|
|
76632
76671
|
}
|
|
76633
76672
|
|
|
76634
|
-
var data={ Tooltip:tooltip, Stock:{Symbol:this.Symbol, Name:this.Name }, X:e.clientX, Y:e.clientY };
|
|
76673
|
+
var data={ Tooltip:tooltip, Stock:{Symbol:this.Symbol, Name:this.Name }, X:e.clientX, Y:e.clientY, PreventDefault:false };
|
|
76635
76674
|
event.Callback(event,data,this);
|
|
76675
|
+
if (data.PreventDefault) return;
|
|
76636
76676
|
}
|
|
76637
76677
|
|
|
76638
|
-
|
|
76639
|
-
|
|
76640
|
-
|
|
76641
|
-
|
|
76642
|
-
}
|
|
76678
|
+
//内置弹分时图
|
|
76679
|
+
if (!this.PopMinuteChart) return;
|
|
76680
|
+
|
|
76681
|
+
this.ShowMinuteChartDialog({ Chart:this,Tooltip:tooltip, e:e }, x,y);
|
|
76643
76682
|
}
|
|
76644
76683
|
|
|
76645
76684
|
this.CancelAutoUpdate=function() //关闭停止更新
|
|
@@ -79636,6 +79675,17 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
79636
79675
|
[
|
|
79637
79676
|
{ Name:"画图工具", Data:{ ID:JSCHART_MENU_ID.CMD_SHOW_DRAWTOOL_ID, Args:[]}, Checked:this.IsShowDrawToolDialog()},
|
|
79638
79677
|
{ Name:"十字光标线", Data:{ ID:JSCHART_MENU_ID.CMD_SHOW_CORSS_LINE_ID, Args:[!bShowCorss]}, Checked:bShowCorss },
|
|
79678
|
+
{ Name:JSPopMenu.SEPARATOR_LINE_NAME },
|
|
79679
|
+
|
|
79680
|
+
{
|
|
79681
|
+
Name:"语言设置",
|
|
79682
|
+
SubMenu:
|
|
79683
|
+
[
|
|
79684
|
+
{ Name:"中文", Data:{ ID:JSCHART_MENU_ID.CMD_CHANGE_LANGUAGE_ID, Args:["CN"]}, Checked:this.LanguageID==JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID },
|
|
79685
|
+
{ Name:"英语", Data:{ ID:JSCHART_MENU_ID.CMD_CHANGE_LANGUAGE_ID, Args:["EN"]}, Checked:this.LanguageID==JSCHART_LANGUAGE_ID.LANGUAGE_ENGLISH_ID },
|
|
79686
|
+
{ Name:"繁体", Data:{ ID:JSCHART_MENU_ID.CMD_CHANGE_LANGUAGE_ID, Args:["TC"]}, Checked:this.LanguageID==JSCHART_LANGUAGE_ID.LANGUAGE_TRADITIONAL_CHINESE_ID },
|
|
79687
|
+
]
|
|
79688
|
+
},
|
|
79639
79689
|
|
|
79640
79690
|
{
|
|
79641
79691
|
Name:"区间选择样式",
|
|
@@ -84030,6 +84080,7 @@ MinuteChartContainer.JosnDataToAfterCloseDataArray=function(data)
|
|
|
84030
84080
|
/*
|
|
84031
84081
|
历史分钟走势图
|
|
84032
84082
|
*/
|
|
84083
|
+
/* 废弃 统一使用 MinuteChartContainer
|
|
84033
84084
|
function HistoryMinuteChartContainer(uielement)
|
|
84034
84085
|
{
|
|
84035
84086
|
this.newMethod=MinuteChartContainer; //派生
|
|
@@ -84074,17 +84125,6 @@ function HistoryMinuteChartContainer(uielement)
|
|
|
84074
84125
|
this.TitlePaint[0].Frame=this.Frame.SubFrame[0].Frame;
|
|
84075
84126
|
this.TitlePaint[0].Canvas=this.Canvas;
|
|
84076
84127
|
this.TitlePaint[0].IsShowDate=true;
|
|
84077
|
-
|
|
84078
|
-
/*
|
|
84079
|
-
//主图叠加画法
|
|
84080
|
-
var paint=new ChartOverlayKLine();
|
|
84081
|
-
paint.Canvas=this.Canvas;
|
|
84082
|
-
paint.ChartBorder=this.Frame.SubFrame[0].Frame.ChartBorder;
|
|
84083
|
-
paint.ChartFrame=this.Frame.SubFrame[0].Frame;
|
|
84084
|
-
paint.Name="Overlay-KLine";
|
|
84085
|
-
this.OverlayChartPaint[0]=paint;
|
|
84086
|
-
*/
|
|
84087
|
-
|
|
84088
84128
|
}
|
|
84089
84129
|
|
|
84090
84130
|
//设置交易日期
|
|
@@ -84230,6 +84270,7 @@ HistoryMinuteChartContainer.JsonDataToMinuteData=function(data)
|
|
|
84230
84270
|
|
|
84231
84271
|
return aryMinuteData;
|
|
84232
84272
|
}
|
|
84273
|
+
*/
|
|
84233
84274
|
|
|
84234
84275
|
/////////////////////////////////////////////////////////////////////////////
|
|
84235
84276
|
// 自定义指数
|
|
@@ -88811,142 +88852,6 @@ function KLineInfoTooltip(divElement)
|
|
|
88811
88852
|
}
|
|
88812
88853
|
}
|
|
88813
88854
|
|
|
88814
|
-
//历史K线上双击 弹出分钟走势图框
|
|
88815
|
-
function MinuteDialog(divElement)
|
|
88816
|
-
{
|
|
88817
|
-
this.newMethod=IDivDialog; //派生
|
|
88818
|
-
this.newMethod(divElement);
|
|
88819
|
-
delete this.newMethod;
|
|
88820
|
-
|
|
88821
|
-
|
|
88822
|
-
this.JSChart=null;
|
|
88823
|
-
this.Height=500;
|
|
88824
|
-
this.Width=600;
|
|
88825
|
-
this.Symbol;
|
|
88826
|
-
this.TradeDate;
|
|
88827
|
-
this.HistoryData;
|
|
88828
|
-
|
|
88829
|
-
//显示窗口
|
|
88830
|
-
this.Show=function(left,top,width,height)
|
|
88831
|
-
{
|
|
88832
|
-
var div=document.getElementById(this.ID);
|
|
88833
|
-
if (!div) return false;
|
|
88834
|
-
|
|
88835
|
-
var findDiv=div.getElementsByClassName("minute-hqchart");
|
|
88836
|
-
if (!findDiv || findDiv.length!=1) return false;
|
|
88837
|
-
var klineDiv=findDiv[0];
|
|
88838
|
-
|
|
88839
|
-
if (IFrameSplitOperator.IsNumber(width)) div.style.width=width+"px";
|
|
88840
|
-
if (IFrameSplitOperator.IsNumber(height)) div.style.height=height+"px";
|
|
88841
|
-
if (IFrameSplitOperator.IsNumber(left)) div.style.left=left+"px";
|
|
88842
|
-
if (IFrameSplitOperator.IsNumber(top)) div.style.top=top+"px";
|
|
88843
|
-
|
|
88844
|
-
div.style.display='block';
|
|
88845
|
-
|
|
88846
|
-
var klineWdith=klineDiv.offsetWidth;
|
|
88847
|
-
var klineTop=klineDiv.offsetTop;
|
|
88848
|
-
klineDiv.style.width=klineWdith+"px";
|
|
88849
|
-
klineDiv.style.height=(height-klineTop-5)+"px";
|
|
88850
|
-
}
|
|
88851
|
-
|
|
88852
|
-
this.Create=function()
|
|
88853
|
-
{
|
|
88854
|
-
this.ID=Guid();
|
|
88855
|
-
var div=document.createElement('div');
|
|
88856
|
-
div.className='jchart-kline-minute-box';
|
|
88857
|
-
div.id=this.ID;
|
|
88858
|
-
var hqchartID=Guid();
|
|
88859
|
-
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>`;
|
|
88860
|
-
div.style.width=this.Height+'px';
|
|
88861
|
-
div.style.height=this.Width+'px';
|
|
88862
|
-
|
|
88863
|
-
this.DivElement.appendChild(div);
|
|
88864
|
-
this.JSChart=JSChart.Init(document.getElementById(hqchartID));
|
|
88865
|
-
|
|
88866
|
-
var option=
|
|
88867
|
-
{
|
|
88868
|
-
Type:'历史分钟走势图',
|
|
88869
|
-
Symbol:this.Symbol, //股票代码
|
|
88870
|
-
IsAutoUpdate:false, //是自动更新数据
|
|
88871
|
-
|
|
88872
|
-
IsShowRightMenu:false, //右键菜单
|
|
88873
|
-
HistoryMinute: { TradeDate:this.TradeDate, IsShowName:false, IsShowDate:false } //显示的交易日期
|
|
88874
|
-
};
|
|
88875
|
-
|
|
88876
|
-
this.JSChart.SetOption(option);
|
|
88877
|
-
}
|
|
88878
|
-
|
|
88879
|
-
this.BindClose=function(chart)
|
|
88880
|
-
{
|
|
88881
|
-
//关闭按钮
|
|
88882
|
-
$("#"+this.ID+" .close-munite").click(
|
|
88883
|
-
{
|
|
88884
|
-
Chart:chart
|
|
88885
|
-
},
|
|
88886
|
-
function(event)
|
|
88887
|
-
{
|
|
88888
|
-
var chart=event.data.Chart;
|
|
88889
|
-
chart.MinuteDialog.Hide();
|
|
88890
|
-
}
|
|
88891
|
-
);
|
|
88892
|
-
}
|
|
88893
|
-
|
|
88894
|
-
this.DoModal=function(event)
|
|
88895
|
-
{
|
|
88896
|
-
this.UpColor=g_JSChartResource.UpTextColor;
|
|
88897
|
-
this.DownColor=g_JSChartResource.DownTextColor;
|
|
88898
|
-
this.UnchagneColor=g_JSChartResource.UnchagneTextColor;
|
|
88899
|
-
|
|
88900
|
-
var chart=event.data.Chart;
|
|
88901
|
-
var tooltip=event.data.Tooltip;
|
|
88902
|
-
var dialog=chart.MinuteDialog;
|
|
88903
|
-
|
|
88904
|
-
dialog.Symbol=chart.Symbol;
|
|
88905
|
-
dialog.TradeDate=tooltip.Data.Date;
|
|
88906
|
-
|
|
88907
|
-
if(!dialog) return;
|
|
88908
|
-
if (dialog.ID==null)
|
|
88909
|
-
{
|
|
88910
|
-
dialog.Create(); //第1次 需要创建div
|
|
88911
|
-
}
|
|
88912
|
-
else
|
|
88913
|
-
{
|
|
88914
|
-
dialog.JSChart.JSChartContainer.TradeDate=dialog.TradeDate;
|
|
88915
|
-
dialog.JSChart.ChangeSymbol(this.Symbol);
|
|
88916
|
-
}
|
|
88917
|
-
|
|
88918
|
-
var left=event.clientX;
|
|
88919
|
-
var top=event.clientY+10;
|
|
88920
|
-
|
|
88921
|
-
var pixelTatio=GetDevicePixelRatio();
|
|
88922
|
-
dialog.Show(500/pixelTatio,100/pixelTatio,600,500);
|
|
88923
|
-
dialog.JSChart.OnSize();
|
|
88924
|
-
|
|
88925
|
-
this.BindClose(chart);
|
|
88926
|
-
|
|
88927
|
-
this.GetColor=function(price,yclse)
|
|
88928
|
-
{
|
|
88929
|
-
if(price>yclse) return this.UpColor;
|
|
88930
|
-
else if (price<yclse) return this.DownColor;
|
|
88931
|
-
else return this.UnchagneColor;
|
|
88932
|
-
}
|
|
88933
|
-
|
|
88934
|
-
var strName = event.data.Chart.Name;
|
|
88935
|
-
var strData=event.data.Tooltip.Data;
|
|
88936
|
-
var date=new Date(parseInt(strData.Date/10000),(strData.Date/100%100-1),strData.Date%100);
|
|
88937
|
-
var strDate = strData.Date.toString();
|
|
88938
|
-
var strNewDate=strDate.substring(0,4)+"-"+strDate.substring(4,6)+"-"+strDate.substring(6,8); //转换时间格式
|
|
88939
|
-
var str = "<span>"+strName+"</span>"+"<span>"+strNewDate+"</span> "+
|
|
88940
|
-
"<span style='color:"+this.GetColor(strData.Open,strData.YClose)+";'>开:"+strData.Open.toFixed(2)+"</span>"+
|
|
88941
|
-
"<span style='color:"+this.GetColor(strData.High,strData.YClose)+";'>高:"+strData.High.toFixed(2)+"</span>"+
|
|
88942
|
-
"<span style='color:"+this.GetColor(strData.Low,strData.YClose)+";'>低:"+strData.Low.toFixed(2)+"</span>"+
|
|
88943
|
-
"<span style='color:"+this.GetColor(strData.Close,strData.YClose)+";'>收:"+strData.Close.toFixed(2)+"</span>"+
|
|
88944
|
-
"<span style='color:"+this.VolColor+";'>量:"+IFrameSplitOperator.FormatValueString(strData.Vol,2)+"</span>"+
|
|
88945
|
-
"<span style='color:"+this.AmountColor+";'>额:"+IFrameSplitOperator.FormatValueString(strData.Amount,2)+"</span>";
|
|
88946
|
-
$(".minute-dialog-title span").html(str);
|
|
88947
|
-
}
|
|
88948
|
-
}
|
|
88949
|
-
|
|
88950
88855
|
function MinuteSelectRectDialog(divElement)
|
|
88951
88856
|
{
|
|
88952
88857
|
this.newMethod=IDivDialog; //派生
|
|
@@ -1496,6 +1496,48 @@ input[type="color"] {
|
|
|
1496
1496
|
}
|
|
1497
1497
|
|
|
1498
1498
|
|
|
1499
|
+
/*
|
|
1500
|
+
弹出分时图对话框
|
|
1501
|
+
*/
|
|
1502
|
+
.jchart_pop_minute_dailog
|
|
1503
|
+
{
|
|
1504
|
+
position: absolute;
|
|
1505
|
+
height: 500px;
|
|
1506
|
+
width: 600px;
|
|
1507
|
+
z-index: 999;
|
|
1508
|
+
visibility:'hidden';
|
|
1509
|
+
background-color: rgba(255,255,255,0.95);
|
|
1510
|
+
border: solid 1px rgba(200, 210, 219, 0.92);
|
|
1511
|
+
display: flex;
|
|
1512
|
+
flex-flow: column;
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
.jschart_pop_minute_chart
|
|
1516
|
+
{
|
|
1517
|
+
flex: 1
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
.jschart_pop_minute_chart_Title_Div
|
|
1521
|
+
{
|
|
1522
|
+
padding-left: 2px;
|
|
1523
|
+
height:20px;
|
|
1524
|
+
border-bottom: 1px solid;
|
|
1525
|
+
border-color: rgb(204,204,204);
|
|
1526
|
+
display: flex;
|
|
1527
|
+
cursor: default;
|
|
1528
|
+
user-select: none;
|
|
1529
|
+
background-color:rgb(222,222,222)
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
.jschart_pop_minute_chart_Close_Div
|
|
1533
|
+
{
|
|
1534
|
+
margin-left: auto;
|
|
1535
|
+
padding-right: 4px;
|
|
1536
|
+
cursor:pointer;
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
|
|
1540
|
+
|
|
1499
1541
|
|
|
1500
1542
|
|
|
1501
1543
|
|
|
@@ -90,6 +90,12 @@ function GetBlackStyle()
|
|
|
90
90
|
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 } },
|
|
91
91
|
}
|
|
92
92
|
},
|
|
93
|
+
|
|
94
|
+
PopMinuteChart:
|
|
95
|
+
{
|
|
96
|
+
BGColor:"rgba(0,0,0,0.95)",
|
|
97
|
+
BorderColor:"rgb(230,230,230)",
|
|
98
|
+
},
|
|
93
99
|
|
|
94
100
|
|
|
95
101
|
DefaultTextColor: "rgb(101,104,112)",
|
|
@@ -26,6 +26,11 @@ HQData.NetworkFilter=function(data, callback)
|
|
|
26
26
|
HQData.RequestMinuteDaysData(data, callback);
|
|
27
27
|
break;
|
|
28
28
|
|
|
29
|
+
case "MinuteChartContainer::RequestPopMinuteData": //弹出分时图数据
|
|
30
|
+
//HQChart使用教程29-走势图如何对接第3方数据2-最新分时数据 格式跟这个一样
|
|
31
|
+
HQData.RequestPopMinuteData(data, callback);
|
|
32
|
+
break;
|
|
33
|
+
|
|
29
34
|
//HQChart使用教程30-K线图如何对接第3方数据1
|
|
30
35
|
case 'KLineChartContainer::RequestHistoryData': //日线全量数据下载
|
|
31
36
|
//HQChart使用教程30-K线图如何对接第3方数据2-日K数据
|
|
@@ -165,6 +170,58 @@ HQData.RequestMinuteData=function(data, callback)
|
|
|
165
170
|
}, 50);
|
|
166
171
|
}
|
|
167
172
|
|
|
173
|
+
HQData.RequestPopMinuteData=function(data, callback)
|
|
174
|
+
{
|
|
175
|
+
data.PreventDefault=true;
|
|
176
|
+
var symbol=data.Request.Data.symbol[0]; //请求的股票代码
|
|
177
|
+
var date=data.Request.Data.date;
|
|
178
|
+
var callcation=data.Request.Data.callcation; //集合竞价
|
|
179
|
+
console.log(`[HQData::RequestPopMinuteData] Symbol=${symbol} Date=${date}`);
|
|
180
|
+
|
|
181
|
+
setTimeout(()=>{
|
|
182
|
+
var srcStock=MINUTE_1DAY_DATA.stock[0];
|
|
183
|
+
var stockItem={ date:date, minute:[], yclose:srcStock.yclose, symbol:srcStock.symbol, name:srcStock.symbol, IsHistoryMinute:true };
|
|
184
|
+
if (callcation.Before)
|
|
185
|
+
{
|
|
186
|
+
var before=
|
|
187
|
+
[
|
|
188
|
+
//[交易时间, 价格,成交量, 成交金额, 日期(可选,YYYYMMDD)],
|
|
189
|
+
[915, srcStock.yclose,0,0],
|
|
190
|
+
[916, srcStock.yclose+0.01,0,0],
|
|
191
|
+
[917, srcStock.yclose+0.03,0,0],
|
|
192
|
+
[918, srcStock.yclose+0.02,0,0],
|
|
193
|
+
[919, srcStock.yclose+0.02,0,0],
|
|
194
|
+
[920, srcStock.yclose+0.01,0,0],
|
|
195
|
+
[921, srcStock.yclose,0,0],
|
|
196
|
+
[922, srcStock.yclose-0.02,0,0],
|
|
197
|
+
[923, srcStock.yclose-0.03,0,0],
|
|
198
|
+
[924, srcStock.yclose,0,0],
|
|
199
|
+
[925, srcStock.yclose,0,0],
|
|
200
|
+
];
|
|
201
|
+
|
|
202
|
+
var beforeinfo={ totalcount:11, ver:1.0 };
|
|
203
|
+
|
|
204
|
+
stockItem.before=before;
|
|
205
|
+
stockItem.beforeinfo=beforeinfo;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
for(var i=0;i<srcStock.minute.length;++i)
|
|
209
|
+
{
|
|
210
|
+
var item=srcStock.minute[i];
|
|
211
|
+
var newItem=CloneData(item);
|
|
212
|
+
newItem.date=date;
|
|
213
|
+
|
|
214
|
+
stockItem.minute.push(newItem);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
var hqchartData={code:0, stock:[stockItem] };
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
callback(hqchartData);
|
|
221
|
+
}, 50);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
|
|
168
225
|
HQData.RequestMinuteDaysData=function(data, callback)
|
|
169
226
|
{
|
|
170
227
|
data.PreventDefault=true;
|