hqchart 1.1.15390 → 1.1.15428
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 +60 -29
- package/package.json +1 -1
- package/src/jscommon/umychart.StockInfo.js +1192 -0
- package/src/jscommon/umychart.TReport.js +11 -11
- package/src/jscommon/umychart.complier.js +14 -24
- package/src/jscommon/umychart.deal.js +71 -21
- package/src/jscommon/umychart.js +225 -0
- package/src/jscommon/umychart.style.js +61 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +372 -46
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +383 -57
|
@@ -17,17 +17,17 @@ function JSTReportChart(divElement)
|
|
|
17
17
|
this.JSChartContainer; //表格控件
|
|
18
18
|
this.ResizeListener; //大小变动监听
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
//h5 canvas
|
|
21
|
+
this.CanvasElement=document.createElement("canvas");
|
|
22
|
+
this.CanvasElement.className='jstreport-drawing';
|
|
23
|
+
this.CanvasElement.id=Guid();
|
|
24
|
+
this.CanvasElement.setAttribute("tabindex",0);
|
|
25
|
+
if (this.CanvasElement.style) this.CanvasElement.style.outline='none';
|
|
26
|
+
if(divElement.hasChildNodes())
|
|
27
|
+
{
|
|
28
|
+
JSConsole.Chart.Log("[JSTReportChart::JSReportChart] divElement hasChildNodes", divElement.childNodes);
|
|
29
|
+
}
|
|
30
|
+
divElement.appendChild(this.CanvasElement);
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
this.OnSize=function()
|
|
@@ -12424,13 +12424,13 @@ function JSSymbolData(ast,option,jsExecute)
|
|
|
12424
12424
|
|
|
12425
12425
|
this.GetDynaCacheData=function(name)
|
|
12426
12426
|
{
|
|
12427
|
+
var data=null;
|
|
12427
12428
|
if (MAP_DYNAINFO_SHORTCUT.has(name))
|
|
12428
12429
|
{
|
|
12429
12430
|
var item=MAP_DYNAINFO_SHORTCUT.get(name);
|
|
12430
|
-
|
|
12431
|
+
data=this.GetLatestCacheData(item.ID);
|
|
12431
12432
|
}
|
|
12432
|
-
|
|
12433
|
-
return null;
|
|
12433
|
+
return data;
|
|
12434
12434
|
}
|
|
12435
12435
|
|
|
12436
12436
|
this.GetLatestIndexData=function()
|
|
@@ -13506,12 +13506,7 @@ function JSSymbolData(ast,option,jsExecute)
|
|
|
13506
13506
|
{ Url:self.RealtimeApiUrl, Type:'POST' ,
|
|
13507
13507
|
Data:
|
|
13508
13508
|
{
|
|
13509
|
-
|
|
13510
|
-
"symbol": self.Symbol,
|
|
13511
|
-
"start": -1,
|
|
13512
|
-
"count": self.MaxRequestDataCount,
|
|
13513
|
-
"period":this.Period,
|
|
13514
|
-
"right":this.Right
|
|
13509
|
+
symbol: self.Symbol,count: self.MaxRequestDataCount, period:this.Period,right:this.Right
|
|
13515
13510
|
}
|
|
13516
13511
|
},
|
|
13517
13512
|
Self:this,
|
|
@@ -13523,6 +13518,7 @@ function JSSymbolData(ast,option,jsExecute)
|
|
|
13523
13518
|
obj.Request.KLineDataTimeRange={Start:{ Date:this.KLineDateTimeRange.Start.Date}, End:{ Date:this.KLineDateTimeRange.End.Date} };
|
|
13524
13519
|
if (this.IsNumber(this.KLineDateTimeRange.Start.Time)) obj.Request.KLineDataTimeRange.Start.Time=this.KLineDateTimeRange.Start.Time;
|
|
13525
13520
|
if (this.IsNumber(this.KLineDateTimeRange.End.Time)) obj.Request.KLineDataTimeRange.End.Time=this.KLineDateTimeRange.End.Time;
|
|
13521
|
+
obj.Request.Data.dateRange=obj.Request.KLineDataTimeRange;
|
|
13526
13522
|
}
|
|
13527
13523
|
|
|
13528
13524
|
this.NetworkFilter(obj, function(data)
|
|
@@ -15884,13 +15880,14 @@ function JSSymbolData(ast,option,jsExecute)
|
|
|
15884
15880
|
if (readArgument.Value=='') readArgument.Value=this.Symbol; //缺省使用股票代码
|
|
15885
15881
|
|
|
15886
15882
|
var symbol=readArgument.Value;
|
|
15883
|
+
var upperSymbol=symbol.toUpperCase();
|
|
15887
15884
|
|
|
15888
15885
|
//支持 SH60000, SZ000001
|
|
15889
15886
|
//A股后缀小写
|
|
15890
|
-
if (
|
|
15891
|
-
else if (
|
|
15892
|
-
else if (
|
|
15893
|
-
else if (
|
|
15887
|
+
if (upperSymbol.indexOf('.SH')>0) result.Symbol=symbol.replace('.SH', ".sh");
|
|
15888
|
+
else if (upperSymbol.indexOf('.SZ')>0) result.Symbol=symbol.replace('.SZ', ".sz");
|
|
15889
|
+
else if (upperSymbol.indexOf("SH")==0) result.Symbol=symbol.slice(2)+".sh";
|
|
15890
|
+
else if (upperSymbol.indexOf("SZ")==0) result.Symbol=symbol.slice(2)+".sz";
|
|
15894
15891
|
else result.Symbol=symbol;
|
|
15895
15892
|
|
|
15896
15893
|
return true;
|
|
@@ -17586,6 +17583,8 @@ function JSExecute(ast,option)
|
|
|
17586
17583
|
|
|
17587
17584
|
this.ReadSymbolData=function(name,node)
|
|
17588
17585
|
{
|
|
17586
|
+
if (MAP_DYNAINFO_SHORTCUT.has(name)) return this.SymbolData.GetDynaCacheData(name);
|
|
17587
|
+
|
|
17589
17588
|
switch(name)
|
|
17590
17589
|
{
|
|
17591
17590
|
case 'CLOSE':
|
|
@@ -17653,7 +17652,6 @@ function JSExecute(ast,option)
|
|
|
17653
17652
|
case 'CAPITAL':
|
|
17654
17653
|
case 'EXCHANGE':
|
|
17655
17654
|
case "HSL":
|
|
17656
|
-
|
|
17657
17655
|
case "HYBLOCK":
|
|
17658
17656
|
case "DYBLOCK":
|
|
17659
17657
|
case "GNBLOCK":
|
|
@@ -17754,14 +17752,6 @@ function JSExecute(ast,option)
|
|
|
17754
17752
|
return this.SymbolData.WEEKOFYEAR();
|
|
17755
17753
|
case "DAYSTOTODAY":
|
|
17756
17754
|
return this.SymbolData.DAYSTOTODAY();
|
|
17757
|
-
|
|
17758
|
-
case "DYNA_NOW":
|
|
17759
|
-
case "DYNA_ZAF":
|
|
17760
|
-
case "DYNA_LB":
|
|
17761
|
-
case "DYNA_ZAS":
|
|
17762
|
-
case "SELLVOL":
|
|
17763
|
-
case "BUYVOL":
|
|
17764
|
-
return this.SymbolData.GetDynaCacheData(name);
|
|
17765
17755
|
}
|
|
17766
17756
|
|
|
17767
17757
|
this.ThrowUnexpectedNode(node, '变量'+name+'不存在', name);
|
|
@@ -27120,8 +27110,8 @@ function DownloadFinanceData(obj)
|
|
|
27120
27110
|
{
|
|
27121
27111
|
case 1: //FINANCE(1) 总股本(随时间可能有变化) 股
|
|
27122
27112
|
case 7: //FINANCE(7) 流通股本(随时间可能有变化) 股
|
|
27123
|
-
case "EXCHANGE": //换手率
|
|
27124
27113
|
case "HSL"://换手率
|
|
27114
|
+
case "EXCHANGE": //换手率
|
|
27125
27115
|
this.DownloadHistoryData(id);
|
|
27126
27116
|
break;
|
|
27127
27117
|
case 3:
|
|
@@ -27382,7 +27372,7 @@ function DownloadFinanceData(obj)
|
|
|
27382
27372
|
if (!item.capital) return null;
|
|
27383
27373
|
return { Date:date, Value:item.capital.total };
|
|
27384
27374
|
case 7:
|
|
27385
|
-
case "HSL":
|
|
27375
|
+
case "HSL":
|
|
27386
27376
|
case "EXCHANGE": //换手率 历史流通股本
|
|
27387
27377
|
if (!item.capital) return null;
|
|
27388
27378
|
return { Date:date, Value:item.capital.a };
|
|
@@ -33,9 +33,18 @@ function JSDealChart(divElement)
|
|
|
33
33
|
this.OnSize=function()
|
|
34
34
|
{
|
|
35
35
|
//画布大小通过div获取
|
|
36
|
-
var height=
|
|
36
|
+
var height=this.DivElement.offsetHeight;
|
|
37
|
+
var width=this.DivElement.offsetWidth;
|
|
38
|
+
if (this.DivElement.style.height && this.DivElement.style.width)
|
|
39
|
+
{
|
|
40
|
+
if (this.DivElement.style.height.includes("px"))
|
|
41
|
+
height=parseInt(this.DivElement.style.height.replace("px",""));
|
|
42
|
+
if (this.DivElement.style.width.includes("px"))
|
|
43
|
+
width=parseInt(this.DivElement.style.width.replace("px",""));
|
|
44
|
+
}
|
|
45
|
+
|
|
37
46
|
this.CanvasElement.height=height;
|
|
38
|
-
this.CanvasElement.width=
|
|
47
|
+
this.CanvasElement.width=width;
|
|
39
48
|
this.CanvasElement.style.width=this.CanvasElement.width+'px';
|
|
40
49
|
this.CanvasElement.style.height=this.CanvasElement.height+'px';
|
|
41
50
|
|
|
@@ -500,8 +509,8 @@ function JSDealChartContainer(uielement)
|
|
|
500
509
|
this.ChangeSymbol=function(symbol, option)
|
|
501
510
|
{
|
|
502
511
|
this.Symbol=symbol;
|
|
503
|
-
this.Data=
|
|
504
|
-
this.SourceData=
|
|
512
|
+
this.Data={ DataOffset:0, Data:[] }; //分笔数据
|
|
513
|
+
this.SourceData={DataOffset:0, Data:[] }; //原始分笔数据
|
|
505
514
|
|
|
506
515
|
var chart=this.ChartPaint[0];
|
|
507
516
|
if (chart) chart.Data=null;
|
|
@@ -1148,17 +1157,23 @@ JSDealChartContainer.JsonDataToDealData=function(data)
|
|
|
1148
1157
|
|
|
1149
1158
|
if (item[100]) dealItem.Guid=item[100];
|
|
1150
1159
|
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1160
|
+
//柱子类型
|
|
1161
|
+
if (item[50]) dealItem.MultiBar1=item[50];
|
|
1162
|
+
if (item[51]) dealItem.MultiBar2=item[51];
|
|
1163
|
+
if (item[52]) dealItem.MultiBar3=item[52];
|
|
1164
|
+
if (item[53]) dealItem.MultiBar4=item[53];
|
|
1165
|
+
|
|
1166
|
+
//10个数值型 101-199
|
|
1167
|
+
if (IFrameSplitOperator.IsNumber(item[101])) dealItem.ReserveNumber1=item[101];
|
|
1168
|
+
if (IFrameSplitOperator.IsNumber(item[102])) dealItem.ReserveNumber2=item[102];
|
|
1169
|
+
if (IFrameSplitOperator.IsNumber(item[103])) dealItem.ReserveNumber3=item[103];
|
|
1170
|
+
if (IFrameSplitOperator.IsNumber(item[104])) dealItem.ReserveNumber4=item[104];
|
|
1171
|
+
if (IFrameSplitOperator.IsNumber(item[105])) dealItem.ReserveNumber5=item[105];
|
|
1172
|
+
if (IFrameSplitOperator.IsNumber(item[106])) dealItem.ReserveNumber6=item[106];
|
|
1173
|
+
if (IFrameSplitOperator.IsNumber(item[107])) dealItem.ReserveNumber7=item[107];
|
|
1174
|
+
if (IFrameSplitOperator.IsNumber(item[108])) dealItem.ReserveNumber8=item[108];
|
|
1175
|
+
if (IFrameSplitOperator.IsNumber(item[109])) dealItem.ReserveNumber9=item[109];
|
|
1176
|
+
if (IFrameSplitOperator.IsNumber(item[110])) dealItem.ReserveNumber10=item[110];
|
|
1162
1177
|
|
|
1163
1178
|
//10个字符型 201-299
|
|
1164
1179
|
if (IFrameSplitOperator.IsString(item[201]) || IFrameSplitOperator.IsObject(item[201])) dealItem.ReserveString1=item[201];
|
|
@@ -1269,13 +1284,14 @@ var DEAL_COLUMN_ID=
|
|
|
1269
1284
|
UPDOWN_ID:5, //涨跌
|
|
1270
1285
|
STRING_TIME_ID:6, //字符串时间
|
|
1271
1286
|
INDEX_ID:7, //序号 从1开始
|
|
1272
|
-
|
|
1287
|
+
|
|
1273
1288
|
CENTER_BAR_ID:9, //中心柱子
|
|
1274
1289
|
CUSTOM_TEXT_ID:10, //自定义文本
|
|
1275
1290
|
|
|
1276
1291
|
SYMBOL_ID:11, //股票代码
|
|
1277
1292
|
NAME_ID:12, //股票名称
|
|
1278
1293
|
|
|
1294
|
+
|
|
1279
1295
|
|
|
1280
1296
|
//预留数值类型 10个
|
|
1281
1297
|
RESERVE_NUMBER1_ID:201, //ReserveNumber1:
|
|
@@ -1300,6 +1316,11 @@ var DEAL_COLUMN_ID=
|
|
|
1300
1316
|
RESERVE_STRING8_ID:308,
|
|
1301
1317
|
RESERVE_STRING9_ID:309,
|
|
1302
1318
|
RESERVE_STRING10_ID:310,
|
|
1319
|
+
|
|
1320
|
+
MULTI_BAR_ID:50, //多颜色柱子
|
|
1321
|
+
MULTI_BAR2_ID:51,
|
|
1322
|
+
MULTI_BAR3_ID:52,
|
|
1323
|
+
MULTI_BAR4_ID:53
|
|
1303
1324
|
}
|
|
1304
1325
|
|
|
1305
1326
|
var MAP_DEAL_COLUMN_FIELD=new Map(
|
|
@@ -1308,6 +1329,11 @@ var MAP_DEAL_COLUMN_FIELD=new Map(
|
|
|
1308
1329
|
[DEAL_COLUMN_ID.NAME_ID, "Name"],
|
|
1309
1330
|
[DEAL_COLUMN_ID.PRICE_ID, "Price"],
|
|
1310
1331
|
|
|
1332
|
+
[DEAL_COLUMN_ID.MULTI_BAR_ID, "MultiBar1"],
|
|
1333
|
+
[DEAL_COLUMN_ID.MULTI_BAR2_ID, "MultiBar2"],
|
|
1334
|
+
[DEAL_COLUMN_ID.MULTI_BAR3_ID, "MultiBar3"],
|
|
1335
|
+
[DEAL_COLUMN_ID.MULTI_BAR4_ID, "MultiBar4"],
|
|
1336
|
+
|
|
1311
1337
|
[DEAL_COLUMN_ID.RESERVE_NUMBER1_ID,"ReserveNumber1"],
|
|
1312
1338
|
[DEAL_COLUMN_ID.RESERVE_NUMBER2_ID,"ReserveNumber2"],
|
|
1313
1339
|
[DEAL_COLUMN_ID.RESERVE_NUMBER3_ID,"ReserveNumber3"],
|
|
@@ -1464,7 +1490,7 @@ function ChartDealList()
|
|
|
1464
1490
|
|
|
1465
1491
|
if (item.ChartTooltip) colItem.ChartTooltip={ Enable:item.ChartTooltip.Enable, Type:item.ChartTooltip.Type }; //图形提示信息
|
|
1466
1492
|
|
|
1467
|
-
if (item.Type==DEAL_COLUMN_ID.
|
|
1493
|
+
if (item.Type==DEAL_COLUMN_ID.CENTER_BAR_ID)
|
|
1468
1494
|
{
|
|
1469
1495
|
if (!IFrameSplitOperator.IsNumber(item.DataIndex)) continue;
|
|
1470
1496
|
colItem.DataIndex=item.DataIndex; //柱子数据所在原始数据索引列
|
|
@@ -1477,6 +1503,8 @@ function ChartDealList()
|
|
|
1477
1503
|
{
|
|
1478
1504
|
if (item.Format) colItem.Format=item.Format; //数据格式化设置{ Type:1=原始 2=千分位分割 3=万亿转换, ExFloatPrecision:万亿转换以后的小数位数 }
|
|
1479
1505
|
if (IFrameSplitOperator.IsNumber(item.ColorType)) colItem.ColorType=item.ColorType; //0=默认 1=(>0, =0, <0) 2=(>=0, <0)
|
|
1506
|
+
if (IFrameSplitOperator.IsNumber(item.FloatPrecision)) colItem.FloatPrecision=item.FloatPrecision;
|
|
1507
|
+
if (item.StringFormat) colItem.StringFormat=item.StringFormat; //"{0}%" 输出增加固定字符
|
|
1480
1508
|
}
|
|
1481
1509
|
|
|
1482
1510
|
this.Column.push(colItem);
|
|
@@ -1496,7 +1524,7 @@ function ChartDealList()
|
|
|
1496
1524
|
{ Type:DEAL_COLUMN_ID.STRING_TIME_ID, Title:"时间", TextAlign:"center", Width:null, TextColor:g_JSChartResource.DealList.FieldColor.Time, MaxText:"88:88:88" },
|
|
1497
1525
|
{ Type:DEAL_COLUMN_ID.INDEX_ID, Title:"序号", TextAlign:"center", Width:null, TextColor:g_JSChartResource.DealList.FieldColor.Index, MaxText:"88888" },
|
|
1498
1526
|
|
|
1499
|
-
|
|
1527
|
+
|
|
1500
1528
|
{ Type:DEAL_COLUMN_ID.CENTER_BAR_ID, Title:"柱子2", TextAlign:"center", Width:null, TextColor:g_JSChartResource.DealList.FieldColor.BarTitle, MaxText:"888888" },
|
|
1501
1529
|
{ Type:DEAL_COLUMN_ID.CUSTOM_TEXT_ID, Title:"自定义", TextAlign:"center", Width:null, TextColor:g_JSChartResource.DealList.FieldColor.Text, MaxText:"擎擎擎擎擎" },
|
|
1502
1530
|
|
|
@@ -1524,6 +1552,11 @@ function ChartDealList()
|
|
|
1524
1552
|
{ Type:DEAL_COLUMN_ID.RESERVE_STRING8_ID, Title:"文字8", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"擎擎擎擎擎擎" },
|
|
1525
1553
|
{ Type:DEAL_COLUMN_ID.RESERVE_STRING9_ID, Title:"文字9", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"擎擎擎擎擎擎" },
|
|
1526
1554
|
{ Type:DEAL_COLUMN_ID.RESERVE_STRING10_ID, Title:"文字10", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"擎擎擎擎擎擎" },
|
|
1555
|
+
|
|
1556
|
+
{ Type:DEAL_COLUMN_ID.MULTI_BAR_ID, Title:"柱子", TextAlign:"center", Width:null, TextColor:g_JSChartResource.DealList.FieldColor.BarTitle, MaxText:"888888" },
|
|
1557
|
+
{ Type:DEAL_COLUMN_ID.MULTI_BAR2_ID, Title:"柱子2", TextAlign:"center", Width:null, TextColor:g_JSChartResource.DealList.FieldColor.BarTitle, MaxText:"888888" },
|
|
1558
|
+
{ Type:DEAL_COLUMN_ID.MULTI_BAR3_ID, Title:"柱子3", TextAlign:"center", Width:null, TextColor:g_JSChartResource.DealList.FieldColor.BarTitle, MaxText:"888888" },
|
|
1559
|
+
{ Type:DEAL_COLUMN_ID.MULTI_BAR4_ID, Title:"柱子4", TextAlign:"center", Width:null, TextColor:g_JSChartResource.DealList.FieldColor.BarTitle, MaxText:"888888" },
|
|
1527
1560
|
|
|
1528
1561
|
];
|
|
1529
1562
|
|
|
@@ -1864,7 +1897,7 @@ function ChartDealList()
|
|
|
1864
1897
|
{
|
|
1865
1898
|
text=(dataIndex+1).toString();
|
|
1866
1899
|
}
|
|
1867
|
-
else if (item.Type
|
|
1900
|
+
else if (this.IsMulitBar(item.Type))
|
|
1868
1901
|
{
|
|
1869
1902
|
var rtItem={Left:left, Top:top, Width:itemWidth, Height:this.RowHeight};
|
|
1870
1903
|
this.DrawMultiBar(item, data, rtItem);
|
|
@@ -1965,6 +1998,11 @@ function ChartDealList()
|
|
|
1965
1998
|
break;
|
|
1966
1999
|
}
|
|
1967
2000
|
}
|
|
2001
|
+
|
|
2002
|
+
if (column.StringFormat && text)
|
|
2003
|
+
{
|
|
2004
|
+
text=column.StringFormat.replace("{0}", text);
|
|
2005
|
+
}
|
|
1968
2006
|
|
|
1969
2007
|
drawInfo.Text=text;
|
|
1970
2008
|
}
|
|
@@ -2086,8 +2124,10 @@ function ChartDealList()
|
|
|
2086
2124
|
|
|
2087
2125
|
this.DrawMultiBar=function(colunmInfo, data, rtItem)
|
|
2088
2126
|
{
|
|
2089
|
-
|
|
2090
|
-
|
|
2127
|
+
var fieldName=MAP_DEAL_COLUMN_FIELD.get(colunmInfo.Type);
|
|
2128
|
+
if (!data || !fieldName) return;
|
|
2129
|
+
|
|
2130
|
+
var barData=data[fieldName]; //{ Value:[0.4,0,2], Color:[0,1] };
|
|
2091
2131
|
if (!barData) return false;
|
|
2092
2132
|
if (!IFrameSplitOperator.IsNonEmptyArray(barData.Value)) return false;
|
|
2093
2133
|
|
|
@@ -2275,6 +2315,16 @@ function ChartDealList()
|
|
|
2275
2315
|
return ARARY_TYPE.includes(value);
|
|
2276
2316
|
}
|
|
2277
2317
|
|
|
2318
|
+
this.IsMulitBar=function(value)
|
|
2319
|
+
{
|
|
2320
|
+
var ARARY_TYPE=
|
|
2321
|
+
[
|
|
2322
|
+
DEAL_COLUMN_ID.MULTI_BAR_ID,DEAL_COLUMN_ID.MULTI_BAR2_ID,DEAL_COLUMN_ID.MULTI_BAR3_ID,DEAL_COLUMN_ID.MULTI_BAR4_ID,
|
|
2323
|
+
];
|
|
2324
|
+
|
|
2325
|
+
return ARARY_TYPE.includes(value);
|
|
2326
|
+
}
|
|
2327
|
+
|
|
2278
2328
|
this.IsReserveNumber=function(value)
|
|
2279
2329
|
{
|
|
2280
2330
|
var ARARY_TYPE=
|
package/src/jscommon/umychart.js
CHANGED
|
@@ -28064,6 +28064,12 @@ function ChartKLine()
|
|
|
28064
28064
|
TextColor: g_JSChartResource.DaySummaryKLine.TextColor,
|
|
28065
28065
|
LeftMargin:g_JSChartResource.DaySummaryKLine.LeftMargin,
|
|
28066
28066
|
}
|
|
28067
|
+
|
|
28068
|
+
this.PriceGapStyple=
|
|
28069
|
+
{
|
|
28070
|
+
Line:{ Color:g_JSChartResource.PriceGapStyple.Line.Color },
|
|
28071
|
+
Text:{ Color:g_JSChartResource.PriceGapStyple.Text.Color, Font: g_JSChartResource.PriceGapStyple.Text.Font }
|
|
28072
|
+
};
|
|
28067
28073
|
|
|
28068
28074
|
}
|
|
28069
28075
|
|
|
@@ -56068,6 +56074,11 @@ IFrameSplitOperator.RemoveMarketSuffix=function(symbol)
|
|
|
56068
56074
|
return symbol;
|
|
56069
56075
|
}
|
|
56070
56076
|
|
|
56077
|
+
IFrameSplitOperator.IsNumberString=function(strValue)
|
|
56078
|
+
{
|
|
56079
|
+
return /^\d+$/.test(strValue);
|
|
56080
|
+
}
|
|
56081
|
+
|
|
56071
56082
|
function FrameSplitKLinePriceY()
|
|
56072
56083
|
{
|
|
56073
56084
|
this.newMethod=IFrameSplitOperator; //派生
|
|
@@ -79738,6 +79749,70 @@ function JSChartResource()
|
|
|
79738
79749
|
}
|
|
79739
79750
|
}
|
|
79740
79751
|
|
|
79752
|
+
//买卖5档
|
|
79753
|
+
this.StockInfo=
|
|
79754
|
+
{
|
|
79755
|
+
Header:
|
|
79756
|
+
{
|
|
79757
|
+
Name:
|
|
79758
|
+
{
|
|
79759
|
+
Font:`${20*GetDevicePixelRatio()}px 微软雅黑`,
|
|
79760
|
+
Color:"rgb(90,90,90)",
|
|
79761
|
+
Margin:{ Left:5, Top:10, Bottom:5, Right:5, YOffset:0 },
|
|
79762
|
+
},
|
|
79763
|
+
|
|
79764
|
+
Symbol:
|
|
79765
|
+
{
|
|
79766
|
+
Font:`${18*GetDevicePixelRatio()}px 微软雅黑`,
|
|
79767
|
+
Color:"rgb(90,90,90)",
|
|
79768
|
+
Margin:{ Left:5, Top:10, Bottom:5, Right:5, YOffset:0 },
|
|
79769
|
+
},
|
|
79770
|
+
|
|
79771
|
+
AryCell:
|
|
79772
|
+
[
|
|
79773
|
+
{ Font:`bold ${16*GetDevicePixelRatio()}px 微软雅黑`,Color:"rgb(90,90,90)", Margin:{ Left:5, Top:5, Bottom:5, Right:5, YOffset:0 } },
|
|
79774
|
+
{ Font:`${16*GetDevicePixelRatio()}px 微软雅黑`,Color:"rgb(90,90,90)", Margin:{ Left:5, Top:5, Bottom:5, Right:5, YOffset:0 } },
|
|
79775
|
+
{ Font:`${16*GetDevicePixelRatio()}px 微软雅黑`,Color:"rgb(90,90,90)", Margin:{ Left:5, Top:5, Bottom:5, Right:5, YOffset:0 } }
|
|
79776
|
+
],
|
|
79777
|
+
|
|
79778
|
+
TextColor:"rgb(100,100,10)",
|
|
79779
|
+
|
|
79780
|
+
BottomLine:{ Enable:true, Color:"rgb(192,192,192)"} , //底部分割线
|
|
79781
|
+
},
|
|
79782
|
+
|
|
79783
|
+
BuySell:
|
|
79784
|
+
{
|
|
79785
|
+
Font:14*GetDevicePixelRatio() +'px 微软雅黑',
|
|
79786
|
+
TitleColor:"rgb(90,90,90)",
|
|
79787
|
+
VolColor:"rgb(90,90,90)",
|
|
79788
|
+
Margin:{ Left:0, Top:0, Bottom:0, Right:0 },
|
|
79789
|
+
CellMargin:{ Top:5, Bottom:5, Left:5, Right:5, YOffset:0 },
|
|
79790
|
+
BottomLine:{ Enable:true, Color:"rgb(192,192,192)"}, //底部分割线
|
|
79791
|
+
TopLine:{ Enable:false, Color:"rgb(192,192,192)"}, //底部分割线
|
|
79792
|
+
|
|
79793
|
+
CenterLine:
|
|
79794
|
+
{
|
|
79795
|
+
BuyColor:"rgb(228, 164, 54)",SellColor:"rgb(61, 147, 219)", NoneColor:"rgb(90,90,90)",
|
|
79796
|
+
Width:2*GetDevicePixelRatio()
|
|
79797
|
+
}
|
|
79798
|
+
},
|
|
79799
|
+
|
|
79800
|
+
Table:
|
|
79801
|
+
{
|
|
79802
|
+
Font:14*GetDevicePixelRatio() +'px 微软雅黑',
|
|
79803
|
+
TitleColor:"rgb(90,90,90)",
|
|
79804
|
+
TextColor:"rgb(90,90,90)",
|
|
79805
|
+
Margin:{ Left:0, Top:0, Bottom:0, Right:0 },
|
|
79806
|
+
CellMargin:{ Top:5, Bottom:5, Left:5, Right:5, YOffset:0 },
|
|
79807
|
+
},
|
|
79808
|
+
|
|
79809
|
+
UpTextColor:"rgb(238,21,21)", //上涨文字颜色
|
|
79810
|
+
DownTextColor:"rgb(25,158,0)", //下跌文字颜色
|
|
79811
|
+
UnchangeTextColor:"rgb(90,90,90)", //平盘文字颜色
|
|
79812
|
+
|
|
79813
|
+
BorderColor:"rgb(192,192,192)"
|
|
79814
|
+
}
|
|
79815
|
+
|
|
79741
79816
|
|
|
79742
79817
|
//自定义风格
|
|
79743
79818
|
this.SetStyle=function(style)
|
|
@@ -80706,9 +80781,131 @@ function JSChartResource()
|
|
|
80706
80781
|
if (style.KLineCountDownPaint) this.SetKLineCountDownPaint(style.KLineCountDownPaint);
|
|
80707
80782
|
|
|
80708
80783
|
if (style.SmallFloatTooltipV2) this.SetSmallFloatTooltipV2(style.SmallFloatTooltipV2);
|
|
80784
|
+
if (style.StockInfo) this.SetStockInfo(style.StockInfo);
|
|
80709
80785
|
|
|
80710
80786
|
}
|
|
80711
80787
|
|
|
80788
|
+
this.SetStockInfo=function(style)
|
|
80789
|
+
{
|
|
80790
|
+
var dest=this.StockInfo;
|
|
80791
|
+
|
|
80792
|
+
if (style.BuySell)
|
|
80793
|
+
{
|
|
80794
|
+
var item=style.BuySell;
|
|
80795
|
+
if (item.Font) dest.BuySell.Font=item.Font;
|
|
80796
|
+
if (item.TitleColor) dest.BuySell.TitleColor=item.TitleColor;
|
|
80797
|
+
if (item.VolColor) dest.BuySell.VolColor=item.VolColor;
|
|
80798
|
+
CopyMarginConfig(dest.BuySell.Margin, item.Margin);
|
|
80799
|
+
if (item.CellMargin)
|
|
80800
|
+
{
|
|
80801
|
+
var subItem=item.CellMargin;
|
|
80802
|
+
CopyMarginConfig(dest.BuySell.CellMargin, subItem);
|
|
80803
|
+
if (IFrameSplitOperator.IsNumber(subItem.YOffset)) dest.BuySell.CellMargin.YOffset=subItem.YOffset
|
|
80804
|
+
}
|
|
80805
|
+
|
|
80806
|
+
if (item.BottomLine)
|
|
80807
|
+
{
|
|
80808
|
+
var subItem=item.BottomLine;
|
|
80809
|
+
if (subItem.Color) dest.BuySell.BottomLine.Color=subItem.Color;
|
|
80810
|
+
if (IFrameSplitOperator.IsBool(subItem.Enable)) dest.BuySell.BottomLine.Enable=subItem.Enable;
|
|
80811
|
+
}
|
|
80812
|
+
|
|
80813
|
+
if (item.TopLine)
|
|
80814
|
+
{
|
|
80815
|
+
var subItem=item.TopLine;
|
|
80816
|
+
if (subItem.Color) dest.BuySell.TopLine.Color=subItem.Color;
|
|
80817
|
+
if (IFrameSplitOperator.IsBool(subItem.Enable)) dest.BuySell.TopLine.Enable=subItem.Enable;
|
|
80818
|
+
}
|
|
80819
|
+
|
|
80820
|
+
if (item.CenterLine)
|
|
80821
|
+
{
|
|
80822
|
+
var subItem=item.CenterLine;
|
|
80823
|
+
if (subItem.BuyColor) dest.BuySell.CenterLine.BuyColor=subItem.BuyColor;
|
|
80824
|
+
if (subItem.SellColor) dest.BuySell.CenterLine.SellColor=subItem.SellColor;
|
|
80825
|
+
if (subItem.NoneColor) dest.BuySell.CenterLine.NoneColor=subItem.NoneColor;
|
|
80826
|
+
if (IFrameSplitOperator.IsNumber(subItem.Width)) dest.BuySell.CenterLine.Width=subItem.Width;
|
|
80827
|
+
}
|
|
80828
|
+
|
|
80829
|
+
|
|
80830
|
+
}
|
|
80831
|
+
|
|
80832
|
+
if (style.Table)
|
|
80833
|
+
{
|
|
80834
|
+
var item=style.Table;
|
|
80835
|
+
if (item.Font) dest.Table.Font=item.Font;
|
|
80836
|
+
if (item.TitleColor) dest.Table.TitleColor=item.TitleColor;
|
|
80837
|
+
if (item.TextColor) dest.Table.TextColor=item.TextColor;
|
|
80838
|
+
CopyMarginConfig(dest.Table.Margin, item.Margin);
|
|
80839
|
+
if (item.CellMargin)
|
|
80840
|
+
{
|
|
80841
|
+
var subItem=item.CellMargin;
|
|
80842
|
+
CopyMarginConfig(dest.Table.CellMargin, subItem);
|
|
80843
|
+
if (IFrameSplitOperator.IsNumber(subItem.YOffset)) dest.Table.CellMargin.YOffset=subItem.YOffset
|
|
80844
|
+
}
|
|
80845
|
+
}
|
|
80846
|
+
|
|
80847
|
+
if (style.Header)
|
|
80848
|
+
{
|
|
80849
|
+
var item=style.Header;
|
|
80850
|
+
if (item.Font) dest.Header.Font=item.Font;
|
|
80851
|
+
if (item.TextColor) dest.Header.TextColor=item.TextColor;
|
|
80852
|
+
if (item.Name)
|
|
80853
|
+
{
|
|
80854
|
+
var subItem=item.Name;
|
|
80855
|
+
if (subItem.Font) dest.Header.Name.Font=subItem.Font;
|
|
80856
|
+
if (subItem.Color) dest.Header.Name.Color=subItem.Color;
|
|
80857
|
+
if (subItem.Margin)
|
|
80858
|
+
{
|
|
80859
|
+
var margin=subItem.Margin;
|
|
80860
|
+
CopyMarginConfig(dest.Header.Name.Margin, margin);
|
|
80861
|
+
if (IFrameSplitOperator.IsNumber(margin.YOffset)) dest.Header.Name.Margin.YOffset=margin.YOffset
|
|
80862
|
+
}
|
|
80863
|
+
}
|
|
80864
|
+
|
|
80865
|
+
if (item.Symbol)
|
|
80866
|
+
{
|
|
80867
|
+
var subItem=item.Symbol;
|
|
80868
|
+
if (subItem.Font) dest.Header.Symbol.Font=subItem.Font;
|
|
80869
|
+
if (subItem.Color) dest.Header.Symbol.Color=subItem.Color;
|
|
80870
|
+
if (subItem.Margin)
|
|
80871
|
+
{
|
|
80872
|
+
var margin=subItem.Margin;
|
|
80873
|
+
CopyMarginConfig(dest.Header.Symbol.Margin, margin);
|
|
80874
|
+
if (IFrameSplitOperator.IsNumber(margin.YOffset)) dest.Header.Symbol.Margin.YOffset=margin.YOffset
|
|
80875
|
+
}
|
|
80876
|
+
}
|
|
80877
|
+
|
|
80878
|
+
if (IFrameSplitOperator.IsNonEmptyArray(item.AryCell))
|
|
80879
|
+
{
|
|
80880
|
+
for(var i=0;i<item.AryCell.length;++i)
|
|
80881
|
+
{
|
|
80882
|
+
var subItem=item.AryCell[i];
|
|
80883
|
+
if (!dest.Header.AryCell[i]) dest.Header.AryCell[i]={ };
|
|
80884
|
+
var subDest=dest.Header.AryCell[i];
|
|
80885
|
+
if (subItem.Font) subDest.Font=subItem.Font;
|
|
80886
|
+
if (subItem.Margin)
|
|
80887
|
+
{
|
|
80888
|
+
var margin=subItem.Margin;
|
|
80889
|
+
CopyMarginConfig(subDest.Margin, margin);
|
|
80890
|
+
if (IFrameSplitOperator.IsNumber(margin.YOffset)) subDest.YOffset=margin.YOffset
|
|
80891
|
+
}
|
|
80892
|
+
}
|
|
80893
|
+
}
|
|
80894
|
+
|
|
80895
|
+
if (item.BottomLine)
|
|
80896
|
+
{
|
|
80897
|
+
var subItem=item.BottomLine;
|
|
80898
|
+
if (subItem.Color) dest.Header.BottomLine.Color=subItem.Color;
|
|
80899
|
+
if (IFrameSplitOperator.IsBool(subItem.Enable)) dest.Header.BottomLine.Enable=subItem.Enable;
|
|
80900
|
+
}
|
|
80901
|
+
}
|
|
80902
|
+
|
|
80903
|
+
if (style.UpTextColor) dest.UpTextColor=style.UpTextColor;
|
|
80904
|
+
if (style.DownTextColor) dest.DownTextColor=style.DownTextColor;
|
|
80905
|
+
if (style.UnchangeTextColor) dest.UnchangeTextColor=style.UnchangeTextColor;
|
|
80906
|
+
if (style.BorderColor) dest.BorderColor=style.BorderColor;
|
|
80907
|
+
}
|
|
80908
|
+
|
|
80712
80909
|
this.SetSmallFloatTooltipV2=function(style)
|
|
80713
80910
|
{
|
|
80714
80911
|
var dest=this.SmallFloatTooltipV2;
|
|
@@ -87303,6 +87500,9 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
87303
87500
|
if (!option.Windows) return;
|
|
87304
87501
|
var count=option.Windows.length;
|
|
87305
87502
|
if (count<=0) return;
|
|
87503
|
+
|
|
87504
|
+
this.Frame.RestoreIndexWindows();
|
|
87505
|
+
|
|
87306
87506
|
var currentLength=this.Frame.SubFrame.length;
|
|
87307
87507
|
|
|
87308
87508
|
var period=null, right=null, symbol=null;
|
|
@@ -94233,6 +94433,8 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
94233
94433
|
this.ChangeIndexTemplate=function(option) //切换指标模板 可以设置指标窗口个数 每个窗口的指标, 只能从第3个指标窗口开始设置,前面2个指标窗口固定无法设置
|
|
94234
94434
|
{
|
|
94235
94435
|
if (!Array.isArray(option.Windows)) return;
|
|
94436
|
+
this.Frame.RestoreIndexWindows();
|
|
94437
|
+
|
|
94236
94438
|
var count=option.Windows.length;
|
|
94237
94439
|
var currentLength=this.Frame.SubFrame.length;
|
|
94238
94440
|
var startWindowIndex=2;
|
|
@@ -102691,6 +102893,18 @@ var MARKET_SUFFIX_NAME=
|
|
|
102691
102893
|
return false;
|
|
102692
102894
|
},
|
|
102693
102895
|
|
|
102896
|
+
IsHKStock:function(symbol) //港股股票 全是数字
|
|
102897
|
+
{
|
|
102898
|
+
if (!symbol) return false;
|
|
102899
|
+
var upperSymbol=symbol.toUpperCase();
|
|
102900
|
+
if (!this.IsHK(upperSymbol)) return false;
|
|
102901
|
+
|
|
102902
|
+
var shortSymbol=this.GetShortSymbol(symbol);
|
|
102903
|
+
if (IFrameSplitOperator.IsNumberString(shortSymbol)) return true;
|
|
102904
|
+
|
|
102905
|
+
return false;
|
|
102906
|
+
},
|
|
102907
|
+
|
|
102694
102908
|
GetMarketStatus:function(symbol) //获取市场状态 0=闭市 1=盘前 2=盘中 3=盘后
|
|
102695
102909
|
{
|
|
102696
102910
|
if (!symbol) return 0;
|
|
@@ -103031,7 +103245,18 @@ var MARKET_SUFFIX_NAME=
|
|
|
103031
103245
|
if (MARKET_SUFFIX_NAME.IsBJ(upperSymbol)) return 100; //单位手=100股
|
|
103032
103246
|
|
|
103033
103247
|
return 1;
|
|
103248
|
+
},
|
|
103249
|
+
|
|
103250
|
+
//获取不带后缀的代码
|
|
103251
|
+
GetShortSymbol:function(symbol)
|
|
103252
|
+
{
|
|
103253
|
+
if (!IFrameSplitOperator.IsString(symbol)) return null;
|
|
103254
|
+
var pos=symbol.lastIndexOf(".");
|
|
103255
|
+
if (pos<=0) return symbol;
|
|
103256
|
+
|
|
103257
|
+
return symbol.slice(0,pos);
|
|
103034
103258
|
}
|
|
103259
|
+
|
|
103035
103260
|
}
|
|
103036
103261
|
|
|
103037
103262
|
|