hqchart 1.1.14836 → 1.1.14846
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.vue.js +25 -16
- package/package.json +1 -1
- package/src/jscommon/umychart.DialogTooltip.js +30 -13
- package/src/jscommon/umychart.NetworkFilterTest.js +184 -22
- package/src/jscommon/umychart.complier.js +72 -1
- package/src/jscommon/umychart.js +215 -2
- package/src/jscommon/umychart.testdata.js +184 -22
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +288 -4
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.NetworkFilterTest.vue.js +184 -22
- package/src/jscommon/umychart.vue/umychart.vue.js +318 -17
package/src/jscommon/umychart.js
CHANGED
|
@@ -41447,6 +41447,201 @@ function ChartMACD()
|
|
|
41447
41447
|
}
|
|
41448
41448
|
}
|
|
41449
41449
|
|
|
41450
|
+
//基准线上下柱子
|
|
41451
|
+
function ChartBaseLineBar()
|
|
41452
|
+
{
|
|
41453
|
+
this.newMethod=IChartPainting; //派生
|
|
41454
|
+
this.newMethod();
|
|
41455
|
+
delete this.newMethod;
|
|
41456
|
+
|
|
41457
|
+
this.ClassName="ChartBaseLineBar";
|
|
41458
|
+
this.UpColor=g_JSChartResource.ChartBaseLineBar.UpColor;
|
|
41459
|
+
this.DownColor=g_JSChartResource.ChartBaseLineBar.DownColor;
|
|
41460
|
+
this.LineWidth=1;
|
|
41461
|
+
this.IsDrawFirst=true;
|
|
41462
|
+
this.AryData=[]; //{ Date, Time, Up, Down }
|
|
41463
|
+
this.DefaultMax; //默认最大值
|
|
41464
|
+
|
|
41465
|
+
this.MaxValue;
|
|
41466
|
+
this.YBaseLine;
|
|
41467
|
+
this.BarMaxHeight; //{ Up:, Down: }
|
|
41468
|
+
|
|
41469
|
+
this.Draw=function()
|
|
41470
|
+
{
|
|
41471
|
+
this.YBaseLine=null;
|
|
41472
|
+
this.BarMaxHeight=null;
|
|
41473
|
+
if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
|
|
41474
|
+
if (this.IsShowIndexTitleOnly()) return;
|
|
41475
|
+
if (this.IsHideScriptIndex()) return;
|
|
41476
|
+
if (!this.HQChart) return;
|
|
41477
|
+
if(!this.Data || !IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return;
|
|
41478
|
+
if (!IFrameSplitOperator.IsNumber(this.MaxValue)) return;
|
|
41479
|
+
this.CalculateBaseLine();
|
|
41480
|
+
|
|
41481
|
+
if (!IFrameSplitOperator.IsNumber(this.YBaseLine)) return;
|
|
41482
|
+
if (!IFrameSplitOperator.IsPlusNumber(this.BarMaxHeight)) return;
|
|
41483
|
+
|
|
41484
|
+
var bHScreen=(this.ChartFrame.IsHScreen===true);
|
|
41485
|
+
var bMinute=this.IsMinuteFrame();
|
|
41486
|
+
var dataWidth=this.ChartFrame.DataWidth;
|
|
41487
|
+
var distanceWidth=this.ChartFrame.DistanceWidth;
|
|
41488
|
+
var xPointCount=this.ChartFrame.XPointCount;
|
|
41489
|
+
var border=this.ChartFrame.GetBorder();
|
|
41490
|
+
|
|
41491
|
+
if (bHScreen)
|
|
41492
|
+
{
|
|
41493
|
+
var chartright=border.BottomEx;
|
|
41494
|
+
var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
|
|
41495
|
+
}
|
|
41496
|
+
else
|
|
41497
|
+
{
|
|
41498
|
+
var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
|
|
41499
|
+
var chartright=border.RightEx;
|
|
41500
|
+
}
|
|
41501
|
+
|
|
41502
|
+
var yCenter=this.YBaseLine;
|
|
41503
|
+
var aryUpBar=[], aryDownBar=[];
|
|
41504
|
+
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth))
|
|
41505
|
+
{
|
|
41506
|
+
var kItem=this.Data.Data[i];
|
|
41507
|
+
if (!kItem) continue;
|
|
41508
|
+
var key=this.BuildKey(kItem);
|
|
41509
|
+
if (!this.MapCache.has(key)) continue;
|
|
41510
|
+
|
|
41511
|
+
var item=this.MapCache.get(key);
|
|
41512
|
+
|
|
41513
|
+
if (bMinute)
|
|
41514
|
+
{
|
|
41515
|
+
var x=this.ChartFrame.GetXFromIndex(j);
|
|
41516
|
+
}
|
|
41517
|
+
else
|
|
41518
|
+
{
|
|
41519
|
+
var left=xOffset;
|
|
41520
|
+
var right=xOffset+dataWidth;
|
|
41521
|
+
if (right>chartright) break;
|
|
41522
|
+
var x=left+(right-left)/2;
|
|
41523
|
+
}
|
|
41524
|
+
|
|
41525
|
+
if (IFrameSplitOperator.IsNumber(item.Up))
|
|
41526
|
+
{
|
|
41527
|
+
var y=yCenter-(item.Up*this.BarMaxHeight/this.MaxValue);
|
|
41528
|
+
aryUpBar.push({ X:x, Y:y});
|
|
41529
|
+
}
|
|
41530
|
+
|
|
41531
|
+
if (IFrameSplitOperator.IsNumber(item.Down))
|
|
41532
|
+
{
|
|
41533
|
+
var y=yCenter+(Math.abs(item.Down)*this.BarMaxHeight/this.MaxValue);
|
|
41534
|
+
aryDownBar.push({X:x, Y:y});
|
|
41535
|
+
}
|
|
41536
|
+
}
|
|
41537
|
+
|
|
41538
|
+
this.DrawBars(aryUpBar, this.UpColor);
|
|
41539
|
+
this.DrawBars(aryDownBar,this.DownColor);
|
|
41540
|
+
}
|
|
41541
|
+
|
|
41542
|
+
this.CalculateBaseLine=function()
|
|
41543
|
+
{
|
|
41544
|
+
if (!this.HQChart) return;
|
|
41545
|
+
|
|
41546
|
+
var bHScreen=(this.ChartFrame.IsHScreen===true);
|
|
41547
|
+
var bMinute=this.IsMinuteFrame();
|
|
41548
|
+
var border=this.ChartFrame.GetBorder();
|
|
41549
|
+
|
|
41550
|
+
if (bMinute)
|
|
41551
|
+
{
|
|
41552
|
+
var chart=this.HQChart.ChartPaint[0];
|
|
41553
|
+
if (!chart || !IFrameSplitOperator.IsNumber(chart.YClose)) return;
|
|
41554
|
+
|
|
41555
|
+
this.YBaseLine=this.ChartFrame.GetYFromData(chart.YClose);
|
|
41556
|
+
if (bHScreen)
|
|
41557
|
+
{
|
|
41558
|
+
this.BarMaxHeight=(border.RightEx-this.YBaseLine)/3;
|
|
41559
|
+
}
|
|
41560
|
+
else
|
|
41561
|
+
{
|
|
41562
|
+
this.BarMaxHeight=(this.YBaseLine-border.TopEx)/3;
|
|
41563
|
+
}
|
|
41564
|
+
}
|
|
41565
|
+
else
|
|
41566
|
+
{
|
|
41567
|
+
//TODO:K线
|
|
41568
|
+
}
|
|
41569
|
+
}
|
|
41570
|
+
|
|
41571
|
+
this.DrawBars=function(aryBar, barColor)
|
|
41572
|
+
{
|
|
41573
|
+
var bHScreen=(this.ChartFrame.IsHScreen===true);
|
|
41574
|
+
var yCenter=this.YBaseLine;
|
|
41575
|
+
this.Canvas.strokeStyle=barColor;
|
|
41576
|
+
this.Canvas.beginPath();
|
|
41577
|
+
var barCount=0;
|
|
41578
|
+
for (var i=0;i<aryBar.length;++i)
|
|
41579
|
+
{
|
|
41580
|
+
var item=aryBar[i];
|
|
41581
|
+
var x=ToFixedPoint(item.X)
|
|
41582
|
+
if (bHScreen)
|
|
41583
|
+
{
|
|
41584
|
+
this.Canvas.moveTo(yCenter,x);
|
|
41585
|
+
this.Canvas.lineTo(item.Y,x);
|
|
41586
|
+
}
|
|
41587
|
+
else
|
|
41588
|
+
{
|
|
41589
|
+
this.Canvas.moveTo(x,yCenter);
|
|
41590
|
+
this.Canvas.lineTo(x,item.Y);
|
|
41591
|
+
}
|
|
41592
|
+
++barCount;
|
|
41593
|
+
}
|
|
41594
|
+
if (barCount>0) this.Canvas.stroke();
|
|
41595
|
+
}
|
|
41596
|
+
|
|
41597
|
+
this.BuildCacheData=function()
|
|
41598
|
+
{
|
|
41599
|
+
this.MaxValue=null;
|
|
41600
|
+
var mapData=new Map();
|
|
41601
|
+
this.MapCache=mapData;
|
|
41602
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.AryData)) return;
|
|
41603
|
+
|
|
41604
|
+
var max=null, min=null;
|
|
41605
|
+
for(var i=0;i<this.AryData.length;++i)
|
|
41606
|
+
{
|
|
41607
|
+
var item=this.AryData[i];
|
|
41608
|
+
if (!item) continue;
|
|
41609
|
+
|
|
41610
|
+
var key=this.BuildKey(item);
|
|
41611
|
+
mapData.set(key,item);
|
|
41612
|
+
|
|
41613
|
+
if (IFrameSplitOperator.IsNumber(item.Up))
|
|
41614
|
+
{
|
|
41615
|
+
if (!max) max={ Value:item.Up };
|
|
41616
|
+
else if (max.Value<item.Up) max.Value=item.Up;
|
|
41617
|
+
|
|
41618
|
+
if (!min) min={ Value:item.Up };
|
|
41619
|
+
else if (min.Value>item.Up) min.Value=item.Up;
|
|
41620
|
+
}
|
|
41621
|
+
|
|
41622
|
+
if (IFrameSplitOperator.IsNumber(item.Down))
|
|
41623
|
+
{
|
|
41624
|
+
if (!max) max={ Value:item.Down };
|
|
41625
|
+
else if (max.Value<item.Down) max.Value=item.Down;
|
|
41626
|
+
|
|
41627
|
+
if (!min) min={ Value:item.Down };
|
|
41628
|
+
else if (min.Value>item.Down) min.Value=item.Down;
|
|
41629
|
+
}
|
|
41630
|
+
}
|
|
41631
|
+
|
|
41632
|
+
if (max && min)
|
|
41633
|
+
{
|
|
41634
|
+
this.MaxValue=Math.max(Math.abs(max.Value),Math.abs(min.Value));
|
|
41635
|
+
if (IFrameSplitOperator.IsNumber(this.DefaultMax)) this.MaxValue=Math.max(this.DefaultMax,this.MaxValue);
|
|
41636
|
+
}
|
|
41637
|
+
}
|
|
41638
|
+
|
|
41639
|
+
this.GetMaxMin=function()
|
|
41640
|
+
{
|
|
41641
|
+
return {Min:null, Max:null};
|
|
41642
|
+
}
|
|
41643
|
+
}
|
|
41644
|
+
|
|
41450
41645
|
function ChartClipColorStick()
|
|
41451
41646
|
{
|
|
41452
41647
|
this.newMethod=IChartPainting; //派生
|
|
@@ -75534,6 +75729,12 @@ function JSChartResource()
|
|
|
75534
75729
|
],
|
|
75535
75730
|
}
|
|
75536
75731
|
|
|
75732
|
+
this.ChartBaseLineBar=
|
|
75733
|
+
{
|
|
75734
|
+
UpColor:"rgb(238,21,21)",
|
|
75735
|
+
DownColor:"rgb(25,158,0)"
|
|
75736
|
+
}
|
|
75737
|
+
|
|
75537
75738
|
//手机端tooltip
|
|
75538
75739
|
this.TooltipPaint = {
|
|
75539
75740
|
BGColor:'rgba(250,250,250,0.8)', //背景色
|
|
@@ -76886,6 +77087,8 @@ function JSChartResource()
|
|
|
76886
77087
|
if (style.ChartSimpleDoughnut) this.SetChartSimpleDoughnut(style.ChartSimpleDoughnut);
|
|
76887
77088
|
|
|
76888
77089
|
if (style.ChartSimpleRadar) this.SetChartSimpleRadar(style.ChartSimpleRadar);
|
|
77090
|
+
|
|
77091
|
+
if (style.ChartBaseLineBar) this.SetChartBaseLineBar(style.ChartBaseLineBar);
|
|
76889
77092
|
|
|
76890
77093
|
if (style.DRAWICON)
|
|
76891
77094
|
{
|
|
@@ -78043,6 +78246,14 @@ function JSChartResource()
|
|
|
78043
78246
|
if (IFrameSplitOperator.IsNonEmptyArray(style.AryArea)) dest.AryArea=style.AryArea.slice();
|
|
78044
78247
|
}
|
|
78045
78248
|
|
|
78249
|
+
this.SetChartBaseLineBar=function(style)
|
|
78250
|
+
{
|
|
78251
|
+
var dest=this.ChartBaseLineBar;
|
|
78252
|
+
|
|
78253
|
+
if (style.UpColor) dest.UpColor=style.UpColor;
|
|
78254
|
+
if (style.DownColor) dest.DownColor=style.DownColor;
|
|
78255
|
+
}
|
|
78256
|
+
|
|
78046
78257
|
this.SetIndexLock=function(style)
|
|
78047
78258
|
{
|
|
78048
78259
|
var item=style;
|
|
@@ -78127,6 +78338,7 @@ function JSChartLocalization()
|
|
|
78127
78338
|
['DialogTooltip-AC-AvPrice', {CN:'匹配均价', EN:'AVPrice', TC:'匹配均價'}],
|
|
78128
78339
|
['DialogTooltip-AC-Increase', {CN:'竞价涨幅', EN:'Increase', TC:'競價漲幅'}],
|
|
78129
78340
|
['DialogTooltip-AC-Vol', {CN:'匹配量', EN:'Vol', TC:'匹配量'}],
|
|
78341
|
+
['DialogTooltip-AC-NotMatchVol', {CN:'未匹配量:', EN:'NV:', TC:'未匹配量'}],
|
|
78130
78342
|
['DialogTooltip-Value', {CN:'数值', EN:'Value', TC:'数值'}],
|
|
78131
78343
|
|
|
78132
78344
|
['FloatTooltip-Date', {CN:'日期', EN:'Date', TC:'日期'}],
|
|
@@ -81206,7 +81418,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
81206
81418
|
else
|
|
81207
81419
|
{
|
|
81208
81420
|
self.AutoUpdateEvent(true,'KLineChartContainer::RequestHistoryData');
|
|
81209
|
-
self.AutoUpdate();
|
|
81421
|
+
self.AutoUpdate(500);
|
|
81210
81422
|
}
|
|
81211
81423
|
});
|
|
81212
81424
|
|
|
@@ -81526,7 +81738,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
81526
81738
|
else
|
|
81527
81739
|
{
|
|
81528
81740
|
self.AutoUpdateEvent(true,'KLineChartContainer::ReqeustHistoryMinuteData');
|
|
81529
|
-
self.AutoUpdate();
|
|
81741
|
+
self.AutoUpdate(500);
|
|
81530
81742
|
}
|
|
81531
81743
|
});
|
|
81532
81744
|
|
|
@@ -86022,6 +86234,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
86022
86234
|
}
|
|
86023
86235
|
|
|
86024
86236
|
var frequency=this.AutoUpdateFrequency;
|
|
86237
|
+
if (IFrameSplitOperator.IsPlusNumber(waitTime)) frequency=waitTime;
|
|
86025
86238
|
if (marketStatus==1) //盘前
|
|
86026
86239
|
{
|
|
86027
86240
|
this.AutoUpdateTimer=setTimeout(function()
|
|
@@ -204,8 +204,11 @@ HQData.Minute_RequestMinuteData=function(data, callback)
|
|
|
204
204
|
var fullData=HQData.GetDayMinuteDataBySymbol(symbol);
|
|
205
205
|
var srcStock=fullData[0];
|
|
206
206
|
var stockItem={ date:srcStock.date, minute:srcStock.minute, yclose:srcStock.yclose, symbol:symbol, name:symbol };
|
|
207
|
+
|
|
208
|
+
//盘前
|
|
207
209
|
if (callcation.Before)
|
|
208
210
|
{
|
|
211
|
+
/*
|
|
209
212
|
var before=
|
|
210
213
|
[
|
|
211
214
|
//[交易时间, 价格,成交量, 成交金额, 日期(可选,YYYYMMDD)],
|
|
@@ -224,14 +227,74 @@ HQData.Minute_RequestMinuteData=function(data, callback)
|
|
|
224
227
|
|
|
225
228
|
var beforeinfo={ totalcount:11, ver:1.0 };
|
|
226
229
|
|
|
230
|
+
stockItem.before=before;
|
|
231
|
+
stockItem.beforeinfo=beforeinfo;
|
|
232
|
+
*/
|
|
233
|
+
|
|
234
|
+
var before=[];
|
|
235
|
+
var beforeinfo={ totalcount:60*10, ver:2.0 }; //9:15-9:25 集合竞价15分钟 1s一个数据
|
|
236
|
+
var price=srcStock.yclose+0.01;
|
|
237
|
+
|
|
238
|
+
var date=new Date(2021,5,2, 9,15, 0);
|
|
239
|
+
var mapTest=new Map(
|
|
240
|
+
[
|
|
241
|
+
[91505, [91505,price+0.01, 400, 300, 1, 800]],
|
|
242
|
+
[91550, [91550,price+0.02, 550, 600, 0, 1500]],
|
|
243
|
+
[91603, [91603,price+0.03, 300, 600, 1, 3600]],
|
|
244
|
+
[91613, [91613,price+0.03, 150, 320, 1, 3600]],
|
|
245
|
+
[91623, [91623,price+0.04, 200, 400, 1, 3600]],
|
|
246
|
+
[91635, [91635,price+0.05, 100, 100, 1, 3600]],
|
|
247
|
+
[91640, [91640,price+0.03, 350, 210, 2, 1600]],
|
|
248
|
+
[91711, [91711,price+0.02, 3210, 350, 2, 3700]],
|
|
249
|
+
[91731, [91731,price+0.04, 110, 450, 1, 3700]],
|
|
250
|
+
[91825, [91825,price-0.01, 210, 650, 2, 3700]],
|
|
251
|
+
[91855, [91855,price-0.02, 330, 440, 1, 1000]],
|
|
252
|
+
[91915, [91915,price-0.03, 630, 640, 1, 1200]],
|
|
253
|
+
[92022, [92022,price+0.01, 260, 550, 2, 1000]],
|
|
254
|
+
[92304, [92304,price-0.02, 300, 100, 2, 1000]],
|
|
255
|
+
[92314, [92314,price-0.03, 550, 150, 2, 1000]],
|
|
256
|
+
[92344, [92344,price-0.04, 550, 150, 1, 1000]],
|
|
257
|
+
[92357, [92357,price-0.05, 250, 750, 1, 1500]],
|
|
258
|
+
[92405, [92405,price-0.07, 450, 50, 2, 1000]],
|
|
259
|
+
[92435, [92435,price-0.08, 650, 250, 1, 1000]],
|
|
260
|
+
[92458, [92458,price-0.12, 350, 350, 2, 1000]],
|
|
261
|
+
])
|
|
262
|
+
|
|
263
|
+
for(var i=0;i<beforeinfo.totalcount; ++i) //1s一个数据
|
|
264
|
+
{
|
|
265
|
+
var time=date.getHours()*10000+date.getMinutes()*100+date.getSeconds();
|
|
266
|
+
|
|
267
|
+
var item=[ time, null, null, null, null, null ];
|
|
268
|
+
if (mapTest.has(time))
|
|
269
|
+
{
|
|
270
|
+
item=mapTest.get(time);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
date.setSeconds(date.getSeconds()+1);
|
|
274
|
+
before.push(item);
|
|
275
|
+
}
|
|
276
|
+
|
|
227
277
|
stockItem.before=before;
|
|
228
278
|
stockItem.beforeinfo=beforeinfo;
|
|
229
279
|
}
|
|
230
280
|
|
|
231
|
-
|
|
281
|
+
//盘中
|
|
282
|
+
//stockItem.minute.length=2;
|
|
283
|
+
//测试用 这里可以修改数据
|
|
284
|
+
//var lastItem=srcStock.minute[srcStock.minute.length-1];
|
|
285
|
+
//lastItem.price+=Math.ceil(Math.random()*10)/1000*lastItem.price;
|
|
286
|
+
/*
|
|
287
|
+
for(var i=0;i<srcStock.minute.length;++i)
|
|
288
|
+
{
|
|
289
|
+
var item=srcStock.minute[i];
|
|
290
|
+
if (item.amount<1000000) item.amount*=100000;
|
|
291
|
+
}
|
|
292
|
+
*/
|
|
232
293
|
|
|
233
294
|
if (bBuySellBar) //盘口分析
|
|
234
295
|
{
|
|
296
|
+
var lastPrice=srcStock.yclose;
|
|
297
|
+
if (stockItem.minute.length>0) lastPrice=stockItem.minute[stockItem.minute.length-1].price;
|
|
235
298
|
var aryBuy=[];
|
|
236
299
|
var value=lastPrice+0.01;
|
|
237
300
|
for(var i=0;i<10;++i)
|
|
@@ -250,20 +313,54 @@ HQData.Minute_RequestMinuteData=function(data, callback)
|
|
|
250
313
|
stockItem.BuySellData={ AryBuy:aryBuy, ArySell:arySell };
|
|
251
314
|
}
|
|
252
315
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
//lastItem.price+=Math.ceil(Math.random()*10)/1000*lastItem.price;
|
|
256
|
-
/*
|
|
257
|
-
for(var i=0;i<srcStock.minute.length;++i)
|
|
316
|
+
//盘后
|
|
317
|
+
if (callcation.After && stockItem.minute.length>=240)
|
|
258
318
|
{
|
|
259
|
-
var
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
319
|
+
var price=stockItem.minute[stockItem.minute.length-1].price;
|
|
320
|
+
var afterData=[]
|
|
321
|
+
var afterInfo={ ver:2.0, totalcount:60*3 } //14:57-15:00
|
|
322
|
+
var date=new Date(2021,5,2, 14,57, 0);
|
|
323
|
+
var mapTest=new Map(
|
|
324
|
+
[
|
|
325
|
+
[145708, [145708,price+0.01, 400, 300, 1, 800]],
|
|
326
|
+
[145718, [145718,price+0.02, 550, 600, 0, 1500]],
|
|
327
|
+
[145738, [145738,price+0.02, 150, 800, 0, 1500]],
|
|
328
|
+
[145748, [145748,price+0.02, 150, 800, 0, 1500]],
|
|
329
|
+
[145803, [145803,price+0.03, 300, 600, 1, 3600]],
|
|
330
|
+
[145815, [145815,price+0.03, 350, 210, 2, 1600]],
|
|
331
|
+
[145826, [145826,price+0.02, 1210, 350, 2, 2700]],
|
|
332
|
+
[145833, [145833,price+0.01, 260, 550, 2, 1000]],
|
|
333
|
+
[145845, [145845,price+0.02, 160, 750, 2, 1000]],
|
|
334
|
+
[145858, [145858,price-0.01, 460, 650, 2, 1500]],
|
|
335
|
+
[145905, [145905,price-0.02, 160, 450, 1, 1500]],
|
|
336
|
+
[145928, [145928,price-0.02, 260, 250, 1, 1500]],
|
|
337
|
+
[145948, [145948,price-0.02, 860, 150, 1, 1500]],
|
|
338
|
+
])
|
|
339
|
+
|
|
340
|
+
for(var i=0;i<afterInfo.totalcount; ++i) //1s一个数据
|
|
341
|
+
{
|
|
342
|
+
var time=date.getHours()*10000+date.getMinutes()*100+date.getSeconds();
|
|
343
|
+
|
|
344
|
+
var item=[ time, null, null, null, null, null ];
|
|
345
|
+
|
|
346
|
+
if (mapTest.has(time))
|
|
347
|
+
{
|
|
348
|
+
item=mapTest.get(time);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
date.setSeconds(date.getSeconds()+1);
|
|
352
|
+
afterData.push(item);
|
|
353
|
+
}
|
|
263
354
|
|
|
264
|
-
|
|
355
|
+
stockItem.after=afterData;
|
|
356
|
+
stockItem.afterinfo=afterInfo;
|
|
357
|
+
}
|
|
265
358
|
|
|
266
359
|
var hqchartData={code:0, stock:[stockItem] };
|
|
360
|
+
|
|
361
|
+
var time=new Date();
|
|
362
|
+
if (time.getSeconds()%3==1)
|
|
363
|
+
hqchartData.LatestPointFlash={ FlashCount:2 };
|
|
267
364
|
|
|
268
365
|
|
|
269
366
|
callback(hqchartData);
|
|
@@ -299,15 +396,16 @@ HQData.Minute_RequestMinuteDataV2=function(data, callback)
|
|
|
299
396
|
var date=new Date(parseInt(stockItem.date/10000),(stockItem.date/100%100-1),stockItem.date%100, 9, 15, 0);
|
|
300
397
|
var count=10*60; //9:15-9:25
|
|
301
398
|
var before=[];
|
|
302
|
-
for(var i=0;i<count;++i)
|
|
399
|
+
for(var i=0, j=0;i<count;++i)
|
|
303
400
|
{
|
|
304
401
|
var time=date.getHours()*10000+date.getMinutes()*100+date.getSeconds();
|
|
305
|
-
var testIndex=
|
|
402
|
+
var testIndex=j%TEST_BEFORE_DATA.length;
|
|
306
403
|
var testData=TEST_BEFORE_DATA[testIndex];
|
|
307
404
|
var item=[ time, null, null, null, null, null ];
|
|
308
405
|
if (i%20==0 || i==count-1)
|
|
309
406
|
{
|
|
310
407
|
item=[ time, testData[0], testData[1], testData[2], testData[3], (testData[1]+testData[2])*1.5 ];
|
|
408
|
+
++j;
|
|
311
409
|
}
|
|
312
410
|
before.push(item);
|
|
313
411
|
date.setSeconds(date.getSeconds()+1);
|
|
@@ -333,15 +431,16 @@ HQData.Minute_RequestMinuteDataV2=function(data, callback)
|
|
|
333
431
|
var date=new Date(parseInt(stockItem.date/10000),(stockItem.date/100%100-1),stockItem.date%100, 14, 57, 0);
|
|
334
432
|
var count=3*60; //14:57-15:00
|
|
335
433
|
var after=[];
|
|
336
|
-
for(var i=0;i<count;++i)
|
|
434
|
+
for(var i=0,j=0;i<count;++i)
|
|
337
435
|
{
|
|
338
436
|
var time=date.getHours()*10000+date.getMinutes()*100+date.getSeconds();
|
|
339
|
-
var testIndex=
|
|
437
|
+
var testIndex=j%TEST_AFTER_DATA.length;
|
|
340
438
|
var testData=TEST_AFTER_DATA[testIndex];
|
|
341
439
|
var item=[ time, null, null, null, null, null ];
|
|
342
440
|
if (i%10==0 || i==count-1)
|
|
343
441
|
{
|
|
344
442
|
item=[ time, testData[0], testData[1], testData[2], testData[3], (testData[1]+testData[2])*1.5 ];
|
|
443
|
+
++j;
|
|
345
444
|
}
|
|
346
445
|
after.push(item);
|
|
347
446
|
date.setSeconds(date.getSeconds()+1);
|
|
@@ -1403,11 +1502,11 @@ HQData.Report_RequestStockData=function(data, callback)
|
|
|
1403
1502
|
//名字字段
|
|
1404
1503
|
var symbolEx={ Text:name };
|
|
1405
1504
|
if (i%20==5)
|
|
1406
|
-
symbolEx.Symbol={ Family:'iconfont', Size:
|
|
1505
|
+
symbolEx.Symbol={ Family:'iconfont', Size:14, Data:[ { Text:'\ue629', Color:'rgb(255,165,0)'}, { Text:'\ue627', Color:'#1c65db'} ] };
|
|
1407
1506
|
else if (i%20==9)
|
|
1408
|
-
symbolEx.Symbol={ Family:'iconfont', Size:
|
|
1507
|
+
symbolEx.Symbol={ Family:'iconfont', Size:14, Data:[ { Text:'\ue629', Color:'rgb(255,165,0)'}] } ;
|
|
1409
1508
|
else if (i%20==18)
|
|
1410
|
-
symbolEx.Symbol={ Family:'iconfont', Size:
|
|
1509
|
+
symbolEx.Symbol={ Family:'iconfont', Size:14, Data:[ { Text:'\ue627', Color:'#1c65db'}] } ;
|
|
1411
1510
|
|
|
1412
1511
|
newItem[27]=symbolEx;
|
|
1413
1512
|
|
|
@@ -1518,6 +1617,7 @@ HQData.Report_RequestStockSortData=function(data, callback)
|
|
|
1518
1617
|
var column=data.Request.Data.column; //排序列信息
|
|
1519
1618
|
var sortType=data.Request.Data.sort; //排序方向
|
|
1520
1619
|
var pageSize=data.Request.Data.pageSize;
|
|
1620
|
+
var hqchart=data.Self;
|
|
1521
1621
|
data.PreventDefault=true;
|
|
1522
1622
|
|
|
1523
1623
|
var start=range.start;
|
|
@@ -1642,6 +1742,7 @@ HQData.Report_RequestVirtualStockData=function(data, callback)
|
|
|
1642
1742
|
var column=data.Request.Data.column; //排序列信息
|
|
1643
1743
|
var sortType=data.Request.Data.sort; //排序方向
|
|
1644
1744
|
var pageSize=data.Request.Data.pageSize;
|
|
1745
|
+
var hqchart=data.Self;
|
|
1645
1746
|
data.PreventDefault=true;
|
|
1646
1747
|
|
|
1647
1748
|
var start=range.start;
|
|
@@ -1701,6 +1802,21 @@ HQData.Report_RequestVirtualStockData=function(data, callback)
|
|
|
1701
1802
|
//换手率
|
|
1702
1803
|
newItem[23]=(Math.round(Math.random()*60))/100;
|
|
1703
1804
|
|
|
1805
|
+
//行业
|
|
1806
|
+
newItem[201]="行业X";
|
|
1807
|
+
if (i%10==4) newItem[201]={ Text:"金融", TextColor:"rgb(0,206,209)"};
|
|
1808
|
+
else if (i%10==9) newItem[201]={ Text:"航天", TextColor:"rgb(0,0,0)", BGColor:"rgb(45,222,179)"};
|
|
1809
|
+
//地区
|
|
1810
|
+
newItem[202]="地区X";
|
|
1811
|
+
|
|
1812
|
+
newItem[101]=(Math.round(Math.random()*60))/100;
|
|
1813
|
+
newItem[102]=(Math.round(Math.random()*60))/100;
|
|
1814
|
+
newItem[103]=(Math.round(Math.random()*60))/100;
|
|
1815
|
+
|
|
1816
|
+
//日期
|
|
1817
|
+
newItem[401]={ DateTime:new Date() };
|
|
1818
|
+
newItem[402]={ DateTime:new Date() };
|
|
1819
|
+
|
|
1704
1820
|
//名字字段
|
|
1705
1821
|
var symbolEx={ Text:name };
|
|
1706
1822
|
if (i%20==5)
|
|
@@ -1717,10 +1833,7 @@ HQData.Report_RequestVirtualStockData=function(data, callback)
|
|
|
1717
1833
|
var extendData=[];
|
|
1718
1834
|
newItem[30]=extendData;
|
|
1719
1835
|
|
|
1720
|
-
|
|
1721
|
-
extendData[0]="行业X";
|
|
1722
|
-
//地区
|
|
1723
|
-
extendData[1]="地区X";
|
|
1836
|
+
|
|
1724
1837
|
|
|
1725
1838
|
//PE|PB
|
|
1726
1839
|
extendData[2]=(Math.round(Math.random()*60))/100;
|
|
@@ -1738,9 +1851,18 @@ HQData.Report_RequestVirtualStockData=function(data, callback)
|
|
|
1738
1851
|
newItem[351]={Title:"启动"};
|
|
1739
1852
|
newItem[352]={Title:"加入"};
|
|
1740
1853
|
|
|
1854
|
+
if (i%20==3) newItem[80]='rgb(132,112,255)';
|
|
1855
|
+
else newItem[80]=null;
|
|
1856
|
+
|
|
1741
1857
|
|
|
1742
1858
|
aryData.push(newItem);
|
|
1743
1859
|
aryIndex.push(start+i);
|
|
1860
|
+
|
|
1861
|
+
|
|
1862
|
+
if (i==0)
|
|
1863
|
+
{
|
|
1864
|
+
hqchart.SetFlashBGItem(symbol, { ID:-1 , Color:"rgb(200,0,200)" });
|
|
1865
|
+
}
|
|
1744
1866
|
}
|
|
1745
1867
|
}
|
|
1746
1868
|
|
|
@@ -2155,6 +2277,8 @@ HQData.Report_APIIndex=function(data, callback)
|
|
|
2155
2277
|
HQData.APIIndex_KLINE_TABLE(data, callback);
|
|
2156
2278
|
else if (request.Data.indexname=="API_DRAWSVG")
|
|
2157
2279
|
HQData.APIIndex_DRAWSVG(data, callback);
|
|
2280
|
+
else if (request.Data.indexname=="API_BASELINE_BAR")
|
|
2281
|
+
HQData.APIIndex_BASELINE_BAR(data, callback);
|
|
2158
2282
|
}
|
|
2159
2283
|
|
|
2160
2284
|
|
|
@@ -3503,3 +3627,41 @@ HQData.RequestVolumeProfileData=function(data, callback)
|
|
|
3503
3627
|
}
|
|
3504
3628
|
|
|
3505
3629
|
|
|
3630
|
+
HQData.APIIndex_BASELINE_BAR=function(data, callback)
|
|
3631
|
+
{
|
|
3632
|
+
data.PreventDefault=true;
|
|
3633
|
+
var hqchart=data.HQChart;
|
|
3634
|
+
var kData=hqchart.GetKData();
|
|
3635
|
+
|
|
3636
|
+
var pointData=
|
|
3637
|
+
{
|
|
3638
|
+
name:"BASELINE_BAR", type:1,
|
|
3639
|
+
Draw:
|
|
3640
|
+
{
|
|
3641
|
+
Name:"BASELINE_BAR",
|
|
3642
|
+
DrawType:"BASELINE_BAR",
|
|
3643
|
+
DrawData:[],
|
|
3644
|
+
Config:{ UpColor:"rgb(255,0,255)", DownColor:"rgb(255,165,0)"},
|
|
3645
|
+
},
|
|
3646
|
+
};
|
|
3647
|
+
|
|
3648
|
+
for(var i=0;i<kData.Data.length;++i)
|
|
3649
|
+
{
|
|
3650
|
+
var kItem=kData.Data[i];
|
|
3651
|
+
|
|
3652
|
+
var item={ Date:kItem.Date, Time:kItem.Time, Up:kItem.Vol*0.2, Down:(kItem.Vol*0.35)*-1 };
|
|
3653
|
+
pointData.Draw.DrawData.push(item);
|
|
3654
|
+
}
|
|
3655
|
+
|
|
3656
|
+
var apiData=
|
|
3657
|
+
{
|
|
3658
|
+
code:0,
|
|
3659
|
+
stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
|
|
3660
|
+
outdata: { date:kData.GetDate(), time:kData.GetTime(), outvar:[ pointData] },
|
|
3661
|
+
};
|
|
3662
|
+
|
|
3663
|
+
console.log('[HQData.APIIndex_BASELINE_BAR] apiData ', apiData);
|
|
3664
|
+
callback(apiData);
|
|
3665
|
+
}
|
|
3666
|
+
|
|
3667
|
+
|