hqchart 1.1.14478 → 1.1.14484
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 +46 -47
- package/package.json +1 -1
- package/src/jscommon/umychart.DialogTooltip.js +10 -2
- package/src/jscommon/umychart.NetworkFilterTest.js +125 -10
- package/src/jscommon/umychart.complier.js +33 -0
- package/src/jscommon/umychart.deal.js +104 -17
- package/src/jscommon/umychart.js +137 -5
- package/src/jscommon/umychart.style.js +6 -1
- package/src/jscommon/umychart.testdata.js +125 -10
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +281 -24
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.NetworkFilterTest.vue.js +125 -10
- package/src/jscommon/umychart.vue/umychart.vue.js +291 -26
|
@@ -6664,6 +6664,11 @@ var JSCHART_EVENT_ID=
|
|
|
6664
6664
|
SEARCH_DIALOG_ON_CLICK_INDEX:163, //切换指标-指标对话框
|
|
6665
6665
|
|
|
6666
6666
|
ON_CALCULATE_CHIP_DATA:164, //计算筹码数据 (筹码图用)
|
|
6667
|
+
|
|
6668
|
+
|
|
6669
|
+
ON_CLICK_DEAL_ROW:165,
|
|
6670
|
+
ON_RCLICK_DEAL_ROW:166,
|
|
6671
|
+
ON_DBCLICK_DEAL_ROW:167,
|
|
6667
6672
|
}
|
|
6668
6673
|
|
|
6669
6674
|
var JSCHART_OPERATOR_ID=
|
|
@@ -29252,7 +29257,7 @@ function IChartPainting()
|
|
|
29252
29257
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth))
|
|
29253
29258
|
{
|
|
29254
29259
|
var data=this.Data.Data[i];
|
|
29255
|
-
if (data.Open==null || data.High==null || data.Low==null || data.Close==null) continue;
|
|
29260
|
+
if (!data || data.Open==null || data.High==null || data.Low==null || data.Close==null) continue;
|
|
29256
29261
|
|
|
29257
29262
|
if (firstOverlayOpen==null) firstOverlayOpen=data.Open;
|
|
29258
29263
|
|
|
@@ -30182,7 +30187,7 @@ function ChartKLine()
|
|
|
30182
30187
|
{
|
|
30183
30188
|
var data=this.Data.Data[i];
|
|
30184
30189
|
this.ShowRange.End=i;
|
|
30185
|
-
if (data.Open==null || data.High==null || data.Low==null || data.Close==null) continue;
|
|
30190
|
+
if (!data || data.Open==null || data.High==null || data.Low==null || data.Close==null) continue;
|
|
30186
30191
|
|
|
30187
30192
|
var left=xOffset;
|
|
30188
30193
|
var right=xOffset+dataWidth;
|
|
@@ -32550,6 +32555,7 @@ function ChartKLine()
|
|
|
32550
32555
|
tooltip.Data=this.Data.Data[index];
|
|
32551
32556
|
tooltip.ChartPaint=this;
|
|
32552
32557
|
tooltip.Type=0; //K线信息
|
|
32558
|
+
tooltip.Symbol=this.Symbol;
|
|
32553
32559
|
return true;
|
|
32554
32560
|
}
|
|
32555
32561
|
}
|
|
@@ -32584,7 +32590,7 @@ function ChartKLine()
|
|
|
32584
32590
|
for(var i=start,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j)
|
|
32585
32591
|
{
|
|
32586
32592
|
var data=this.Data.Data[i];
|
|
32587
|
-
if (!IFrameSplitOperator.IsNumber(data.Close)) continue;
|
|
32593
|
+
if (!data || !IFrameSplitOperator.IsNumber(data.Close)) continue;
|
|
32588
32594
|
|
|
32589
32595
|
if (range.Max==null) range.Max=data.Close;
|
|
32590
32596
|
if (range.Min==null) range.Min=data.Close;
|
|
@@ -32598,7 +32604,7 @@ function ChartKLine()
|
|
|
32598
32604
|
for(var i=start,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j)
|
|
32599
32605
|
{
|
|
32600
32606
|
var data=this.Data.Data[i];
|
|
32601
|
-
if (data.Open==null || data.High==null || data.Low==null || data.Close==null) continue;
|
|
32607
|
+
if (!data || data.Open==null || data.High==null || data.Low==null || data.Close==null) continue;
|
|
32602
32608
|
|
|
32603
32609
|
if (this.DrawType==5 && data.OrderFlow && IFrameSplitOperator.IsNumber(data.OrderFlow.PriceOffset))
|
|
32604
32610
|
{
|
|
@@ -61745,6 +61751,19 @@ function DynamicChartTitlePainting()
|
|
|
61745
61751
|
DownColor:g_JSChartResource.IndexTitle.UpDownArrow.DownColor,
|
|
61746
61752
|
UnchangeColor:g_JSChartResource.IndexTitle.UpDownArrow.UnchangeColor
|
|
61747
61753
|
};
|
|
61754
|
+
|
|
61755
|
+
|
|
61756
|
+
//K线标题颜色
|
|
61757
|
+
this.UpColor=g_JSChartResource.UpTextColor;
|
|
61758
|
+
this.DownColor=g_JSChartResource.DownTextColor;
|
|
61759
|
+
this.UnchangeColor=g_JSChartResource.UnchagneTextColor;
|
|
61760
|
+
|
|
61761
|
+
this.VolColor=g_JSChartResource.Title.VolColor;
|
|
61762
|
+
this.AmountColor=g_JSChartResource.Title.AmountColor;
|
|
61763
|
+
this.DateTimeColor=g_JSChartResource.Title.DateTimeColor;
|
|
61764
|
+
this.NameColor = g_JSChartResource.Title.NameColor;
|
|
61765
|
+
this.PositionColor=g_JSChartResource.Title.PositionColor; //持仓
|
|
61766
|
+
|
|
61748
61767
|
|
|
61749
61768
|
|
|
61750
61769
|
//动态标题
|
|
@@ -61765,6 +61784,15 @@ function DynamicChartTitlePainting()
|
|
|
61765
61784
|
this.BGColor=g_JSChartResource.IndexTitleBGColor;
|
|
61766
61785
|
this.BGBorderColor=g_JSChartResource.IndexTitleBorderColor;
|
|
61767
61786
|
this.BGBorderMoveOnColor=g_JSChartResource.IndexTitleBorderMoveOnColor;
|
|
61787
|
+
|
|
61788
|
+
this.UpColor=g_JSChartResource.UpTextColor;
|
|
61789
|
+
this.DownColor=g_JSChartResource.DownTextColor;
|
|
61790
|
+
this.UnchangeColor=g_JSChartResource.UnchagneTextColor;
|
|
61791
|
+
|
|
61792
|
+
this.VolColor=g_JSChartResource.Title.VolColor;
|
|
61793
|
+
this.AmountColor=g_JSChartResource.Title.AmountColor;
|
|
61794
|
+
this.DateTimeColor=g_JSChartResource.Title.DateTimeColor;
|
|
61795
|
+
this.PositionColor=g_JSChartResource.Title.PositionColor; //持仓
|
|
61768
61796
|
}
|
|
61769
61797
|
|
|
61770
61798
|
this.SetDynamicTitleData=function(outName, args, data)
|
|
@@ -61988,6 +62016,93 @@ function DynamicChartTitlePainting()
|
|
|
61988
62016
|
return aryText;
|
|
61989
62017
|
}
|
|
61990
62018
|
|
|
62019
|
+
this.FromatKLineTitle=function(item, dataInfo)
|
|
62020
|
+
{
|
|
62021
|
+
var defaultfloatPrecision=GetfloatPrecision(dataInfo.Symbol);//价格小数位数
|
|
62022
|
+
var upperSymbol="";
|
|
62023
|
+
if (dataInfo.Symbol) upperSymbol=dataInfo.Symbol.toUpperCase();
|
|
62024
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
62025
|
+
var leftSpace=3*pixelRatio;
|
|
62026
|
+
|
|
62027
|
+
var aryText=[];
|
|
62028
|
+
|
|
62029
|
+
|
|
62030
|
+
if (IFrameSplitOperator.IsNumber(item.Date))
|
|
62031
|
+
{
|
|
62032
|
+
var text=IFrameSplitOperator.FormatDateString(item.Date);
|
|
62033
|
+
aryText.push({ Text:text, Color:this.DateTimeColor });
|
|
62034
|
+
}
|
|
62035
|
+
|
|
62036
|
+
if (IFrameSplitOperator.IsNumber(item.Open))
|
|
62037
|
+
{
|
|
62038
|
+
var color=this.GetColor(item.Open,item.YClose);
|
|
62039
|
+
var text=g_JSChartLocalization.GetText('KTitle-Open',this.LanguageID)+item.Open.toFixed(defaultfloatPrecision);
|
|
62040
|
+
aryText.push({ Text:text, Color:color, LeftSpace:leftSpace});
|
|
62041
|
+
}
|
|
62042
|
+
|
|
62043
|
+
if (IFrameSplitOperator.IsNumber(item.High))
|
|
62044
|
+
{
|
|
62045
|
+
var color=this.GetColor(item.High,item.YClose);
|
|
62046
|
+
var text=g_JSChartLocalization.GetText('KTitle-High',this.LanguageID)+item.High.toFixed(defaultfloatPrecision);
|
|
62047
|
+
aryText.push({ Text:text, Color:color, LeftSpace:leftSpace });
|
|
62048
|
+
}
|
|
62049
|
+
|
|
62050
|
+
if (IFrameSplitOperator.IsNumber(item.Low))
|
|
62051
|
+
{
|
|
62052
|
+
var color=this.GetColor(item.Low,item.YClose);
|
|
62053
|
+
var text=g_JSChartLocalization.GetText('KTitle-Low',this.LanguageID)+item.Low.toFixed(defaultfloatPrecision);
|
|
62054
|
+
aryText.push({ Text:text, Color:color, LeftSpace:leftSpace});
|
|
62055
|
+
}
|
|
62056
|
+
|
|
62057
|
+
if (IFrameSplitOperator.IsNumber(item.Close))
|
|
62058
|
+
{
|
|
62059
|
+
var color=this.GetColor(item.Close,item.YClose);
|
|
62060
|
+
var text=g_JSChartLocalization.GetText('KTitle-Close',this.LanguageID)+item.Close.toFixed(defaultfloatPrecision);
|
|
62061
|
+
aryText.push({ Text:text, Color:color, LeftSpace:leftSpace});
|
|
62062
|
+
}
|
|
62063
|
+
|
|
62064
|
+
//涨幅
|
|
62065
|
+
if (item.YFClose>0 && MARKET_SUFFIX_NAME.IsChinaFutures(upperSymbol))
|
|
62066
|
+
{
|
|
62067
|
+
var value=(item.Close-item.YFClose)/item.YFClose*100;
|
|
62068
|
+
var color = this.GetColor(value, 0);
|
|
62069
|
+
var text = g_JSChartLocalization.GetText('KTitle-Increase',this.LanguageID) + value.toFixed(2)+'%';
|
|
62070
|
+
aryText.push({ Text:text, Color:color, LeftSpace:leftSpace});
|
|
62071
|
+
}
|
|
62072
|
+
else if (item.YClose>0)
|
|
62073
|
+
{
|
|
62074
|
+
var value=(item.Close-item.YClose)/item.YClose*100;
|
|
62075
|
+
var color = this.GetColor(value, 0);
|
|
62076
|
+
var text = g_JSChartLocalization.GetText('KTitle-Increase',this.LanguageID) + value.toFixed(2)+'%';
|
|
62077
|
+
aryText.push({ Text:text, Color:color, LeftSpace:leftSpace});
|
|
62078
|
+
}
|
|
62079
|
+
|
|
62080
|
+
if (IFrameSplitOperator.IsNumber(item.Vol)) //成交量
|
|
62081
|
+
{
|
|
62082
|
+
var unit=MARKET_SUFFIX_NAME.GetVolUnit(upperSymbol);
|
|
62083
|
+
var vol=item.Vol/unit;
|
|
62084
|
+
var text=g_JSChartLocalization.GetText('KTitle-Vol',this.LanguageID)+IFrameSplitOperator.FromatIntegerString(vol,2,this.LanguageID);
|
|
62085
|
+
aryText.push({ Text:text, Color:this.VolColor, LeftSpace:leftSpace});
|
|
62086
|
+
}
|
|
62087
|
+
|
|
62088
|
+
if (IFrameSplitOperator.IsNumber(item.Amount)) //成交金额
|
|
62089
|
+
{
|
|
62090
|
+
var text=g_JSChartLocalization.GetText('KTitle-Amount',this.LanguageID)+IFrameSplitOperator.FormatValueString(item.Amount,2,this.LanguageID);
|
|
62091
|
+
aryText.push({ Text:text, Color:this.AmountColor, LeftSpace:leftSpace});
|
|
62092
|
+
}
|
|
62093
|
+
|
|
62094
|
+
return aryText;
|
|
62095
|
+
}
|
|
62096
|
+
|
|
62097
|
+
this.GetColor=function(price,yClose)
|
|
62098
|
+
{
|
|
62099
|
+
if (!IFrameSplitOperator.IsNumber(yClose)) return this.UnchangeColor;
|
|
62100
|
+
|
|
62101
|
+
if(price>yClose) return this.UpColor;
|
|
62102
|
+
else if (price<yClose) return this.DownColor;
|
|
62103
|
+
else return this.UnchangeColor;
|
|
62104
|
+
}
|
|
62105
|
+
|
|
61991
62106
|
this.ForamtMultiLineTitle=function(dataIndex, dataInfo)
|
|
61992
62107
|
{
|
|
61993
62108
|
if (!IFrameSplitOperator.IsNonEmptyArray(dataInfo.Lines)) return null;
|
|
@@ -62473,6 +62588,12 @@ function DynamicChartTitlePainting()
|
|
|
62473
62588
|
if (!aryText) return null;
|
|
62474
62589
|
return { Text:null, ArrayText:aryText };
|
|
62475
62590
|
}
|
|
62591
|
+
else if (item.DataType=="DRAWKLINE")
|
|
62592
|
+
{
|
|
62593
|
+
aryText=this.FromatKLineTitle(value, item);
|
|
62594
|
+
if (!aryText) return null;
|
|
62595
|
+
return { Text:null, ArrayText:aryText };
|
|
62596
|
+
}
|
|
62476
62597
|
else if (g_ScriptIndexChartFactory.Has(item.DataType)) //外部挂接
|
|
62477
62598
|
{
|
|
62478
62599
|
var find=g_ScriptIndexChartFactory.Get(item.DataType);
|
|
@@ -76415,7 +76536,12 @@ function JSChartResource()
|
|
|
76415
76536
|
|
|
76416
76537
|
UpTextColor:"rgb(238,21,21)", //上涨文字颜色
|
|
76417
76538
|
DownTextColor:"rgb(25,158,0)", //下跌文字颜色
|
|
76418
|
-
UnchagneTextColor:"rgb(0,0,0)" //平盘文字颜色
|
|
76539
|
+
UnchagneTextColor:"rgb(0,0,0)", //平盘文字颜色
|
|
76540
|
+
|
|
76541
|
+
Selected:
|
|
76542
|
+
{
|
|
76543
|
+
BGColor:"rgb(180,240,240)",
|
|
76544
|
+
}
|
|
76419
76545
|
},
|
|
76420
76546
|
|
|
76421
76547
|
//报价列表
|
|
@@ -77468,6 +77594,12 @@ function JSChartResource()
|
|
|
77468
77594
|
this.DealList.FieldColor.Bar[i]=filed.Bar[i];
|
|
77469
77595
|
}
|
|
77470
77596
|
}
|
|
77597
|
+
|
|
77598
|
+
if (item.Selected)
|
|
77599
|
+
{
|
|
77600
|
+
var subItem=item.Selected;
|
|
77601
|
+
if (subItem.BGColor) this.DealList.Selected.BGColor=subItem.BGColor;
|
|
77602
|
+
}
|
|
77471
77603
|
}
|
|
77472
77604
|
|
|
77473
77605
|
if (style.Report) this.SetReportStyle(style.Report);
|
|
@@ -122506,6 +122638,8 @@ var SCRIPT_CHART_NAME=
|
|
|
122506
122638
|
SCATTER_PLOT:"SCATTER_PLOT", //散点图
|
|
122507
122639
|
|
|
122508
122640
|
CLIP_COLOR_STICK:"CLIP_COLOR_STICK", //上下柱子 裁剪
|
|
122641
|
+
|
|
122642
|
+
DRAW_KLINE:"DRAWKLINE"
|
|
122509
122643
|
}
|
|
122510
122644
|
|
|
122511
122645
|
|
|
@@ -123574,6 +123708,26 @@ function ScriptIndex(name,script,args,option)
|
|
|
123574
123708
|
if (varItem.Color) //如果设置了颜色,使用外面设置的颜色
|
|
123575
123709
|
chart.UnchagneColor=chart.DownColor=chart.UpColor=this.GetColor(varItem.Color);
|
|
123576
123710
|
|
|
123711
|
+
if (varItem.Draw.Config)
|
|
123712
|
+
{
|
|
123713
|
+
var config=varItem.Draw.Config;
|
|
123714
|
+
if (IFrameSplitOperator.IsBool(config.IsShowMaxMinPrice)) chart.IsShowMaxMinPrice=config.IsShowMaxMinPrice;
|
|
123715
|
+
if (IFrameSplitOperator.IsBool(config.IsShowKTooltip)) chart.IsShowKTooltip=config.IsShowKTooltip;
|
|
123716
|
+
if (config.Symbol) chart.Symbol=config.Symbol;
|
|
123717
|
+
if (config.Name) chart.Title=config.Name;
|
|
123718
|
+
}
|
|
123719
|
+
|
|
123720
|
+
var bShowTitle=false;
|
|
123721
|
+
if (IFrameSplitOperator.IsBool(varItem.IsShowTitle)) bShowTitle=varItem.IsShowTitle;
|
|
123722
|
+
if (bShowTitle)
|
|
123723
|
+
{
|
|
123724
|
+
let titleIndex=windowIndex+1;
|
|
123725
|
+
var titleData=new DynamicTitleData(chart.Data,varItem.Name,chart.Color); //标题
|
|
123726
|
+
titleData.DataType="DRAWKLINE";
|
|
123727
|
+
titleData.Symbol=chart.Symbol;
|
|
123728
|
+
hqChart.TitlePaint[titleIndex].Data[id]=titleData;
|
|
123729
|
+
}
|
|
123730
|
+
|
|
123577
123731
|
this.SetChartIndexName(chart);
|
|
123578
123732
|
hqChart.ChartPaint.push(chart);
|
|
123579
123733
|
}
|
|
@@ -127533,6 +127687,17 @@ function APIScriptIndex(name,script,args,option, isOverlay)
|
|
|
127533
127687
|
outVarItem.Draw=drawItem;
|
|
127534
127688
|
result.push(outVarItem);
|
|
127535
127689
|
}
|
|
127690
|
+
else if (draw.DrawType==SCRIPT_CHART_NAME.DRAW_KLINE)
|
|
127691
|
+
{
|
|
127692
|
+
drawItem.Name=draw.Name;
|
|
127693
|
+
drawItem.Type=draw.Type;
|
|
127694
|
+
drawItem.DrawType=draw.DrawType;
|
|
127695
|
+
|
|
127696
|
+
drawItem.DrawData=this.FittingArray(draw.DrawData,date,time,hqChart,1);
|
|
127697
|
+
drawItem.Config=draw.Config;
|
|
127698
|
+
outVarItem.Draw=drawItem;
|
|
127699
|
+
result.push(outVarItem);
|
|
127700
|
+
}
|
|
127536
127701
|
else
|
|
127537
127702
|
{
|
|
127538
127703
|
var find=g_ScriptIndexChartFactory.Get(draw.DrawType); //外部挂接
|
|
@@ -129260,7 +129425,12 @@ function GetBlackStyle()
|
|
|
129260
129425
|
|
|
129261
129426
|
UpTextColor:"rgb(238,21,21)", //上涨文字颜色
|
|
129262
129427
|
DownTextColor:"rgb(25,158,0)", //下跌文字颜色
|
|
129263
|
-
UnchagneTextColor:"rgb(228,228,228)" //平盘文字颜色
|
|
129428
|
+
UnchagneTextColor:"rgb(228,228,228)", //平盘文字颜色
|
|
129429
|
+
|
|
129430
|
+
Selected:
|
|
129431
|
+
{
|
|
129432
|
+
BGColor:"rgb(49,48,56)",
|
|
129433
|
+
}
|
|
129264
129434
|
},
|
|
129265
129435
|
|
|
129266
129436
|
//报价列表
|
|
@@ -129619,6 +129789,17 @@ function JSDealChart(divElement)
|
|
|
129619
129789
|
|
|
129620
129790
|
this.JSChartContainer=chart;
|
|
129621
129791
|
this.DivElement.JSChart=this; //div中保存一份
|
|
129792
|
+
|
|
129793
|
+
//注册事件
|
|
129794
|
+
if (option.EventCallback)
|
|
129795
|
+
{
|
|
129796
|
+
for(var i=0;i<option.EventCallback.length;++i)
|
|
129797
|
+
{
|
|
129798
|
+
var item=option.EventCallback[i];
|
|
129799
|
+
chart.AddEventCallback(item);
|
|
129800
|
+
}
|
|
129801
|
+
}
|
|
129802
|
+
|
|
129622
129803
|
if (!option.Symbol)
|
|
129623
129804
|
{
|
|
129624
129805
|
chart.Draw();
|
|
@@ -129843,6 +130024,7 @@ function JSDealChartContainer(uielement)
|
|
|
129843
130024
|
chart.Frame=this.Frame;
|
|
129844
130025
|
chart.ChartBorder=this.Frame.ChartBorder;
|
|
129845
130026
|
chart.Canvas=this.Canvas;
|
|
130027
|
+
chart.UIElement=this.UIElement;
|
|
129846
130028
|
chart.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
129847
130029
|
this.ChartPaint[0]=chart;
|
|
129848
130030
|
|
|
@@ -129870,12 +130052,16 @@ function JSDealChartContainer(uielement)
|
|
|
129870
130052
|
bRegisterWheel=false;
|
|
129871
130053
|
JSConsole.Chart.Log('[JSDealChartContainer::Create] not register wheel event.');
|
|
129872
130054
|
}
|
|
130055
|
+
|
|
130056
|
+
if (IFrameSplitOperator.IsBool(option.EnableSelected)) chart.SelectedData.Enable=option.EnableSelected;
|
|
129873
130057
|
}
|
|
129874
130058
|
|
|
129875
130059
|
if (bRegisterKeydown) this.UIElement.addEventListener("keydown", (e)=>{ this.OnKeyDown(e); }, true); //键盘消息
|
|
129876
130060
|
if (bRegisterWheel) this.UIElement.addEventListener("wheel", (e)=>{ this.OnWheel(e); }, true); //上下滚动消息
|
|
129877
130061
|
|
|
129878
130062
|
this.UIElement.onmousedown=(e)=> { this.UIOnMouseDown(e); }
|
|
130063
|
+
this.UIElement.ondblclick=(e)=>{ this.UIOnDblClick(e); }
|
|
130064
|
+
this.UIElement.oncontextmenu=(e)=> { this.UIOnContextMenu(e); }
|
|
129879
130065
|
}
|
|
129880
130066
|
|
|
129881
130067
|
this.Draw=function()
|
|
@@ -130259,20 +130445,28 @@ function JSDealChartContainer(uielement)
|
|
|
130259
130445
|
var chart=this.ChartPaint[0];
|
|
130260
130446
|
if (!chart) return;
|
|
130261
130447
|
|
|
130262
|
-
/*
|
|
130263
130448
|
var clickData=chart.OnMouseDown(x,y,e);
|
|
130264
130449
|
if (!clickData) return;
|
|
130265
130450
|
|
|
130266
|
-
if ((clickData.Type==
|
|
130451
|
+
if ((clickData.Type==1) && (e.button==0 || e.button==2)) //点击行
|
|
130267
130452
|
{
|
|
130268
130453
|
if (clickData.Redraw==true) this.Draw();
|
|
130269
130454
|
}
|
|
130270
|
-
|
|
130271
|
-
|
|
130272
|
-
|
|
130273
|
-
|
|
130274
|
-
|
|
130275
|
-
|
|
130455
|
+
}
|
|
130456
|
+
|
|
130457
|
+
this.UIOnDblClick=function(e)
|
|
130458
|
+
{
|
|
130459
|
+
var pixelTatio = GetDevicePixelRatio();
|
|
130460
|
+
var x = (e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;
|
|
130461
|
+
var y = (e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;
|
|
130462
|
+
|
|
130463
|
+
var chart=this.ChartPaint[0];
|
|
130464
|
+
if (chart) chart.OnDblClick(x,y,e);
|
|
130465
|
+
}
|
|
130466
|
+
|
|
130467
|
+
this.UIOnContextMenu=function(e)
|
|
130468
|
+
{
|
|
130469
|
+
e.preventDefault();
|
|
130276
130470
|
}
|
|
130277
130471
|
|
|
130278
130472
|
this.GotoNextPage=function()
|
|
@@ -130494,7 +130688,7 @@ function ChartDealList()
|
|
|
130494
130688
|
this.IsSingleTable=false; //单表模式
|
|
130495
130689
|
this.IsShowHeader=true; //是否显示表头
|
|
130496
130690
|
this.ShowOrder=1; //0=顺序 1=倒序
|
|
130497
|
-
this.SelectedData={ Index:
|
|
130691
|
+
this.SelectedData={ Index:null, Guid:null, Enable:false }; //{ Index:序号, Guid, Enable:是否启动 }
|
|
130498
130692
|
|
|
130499
130693
|
this.SizeChange=true;
|
|
130500
130694
|
|
|
@@ -130505,7 +130699,7 @@ function ChartDealList()
|
|
|
130505
130699
|
|
|
130506
130700
|
this.BorderColor=g_JSChartResource.DealList.BorderColor; //边框线
|
|
130507
130701
|
|
|
130508
|
-
this.SelectedConfig={ BGColor:
|
|
130702
|
+
this.SelectedConfig={ BGColor:g_JSChartResource.DealList.Selected.BGColor };
|
|
130509
130703
|
|
|
130510
130704
|
//表头配置
|
|
130511
130705
|
this.HeaderFontConfig={ Size:g_JSChartResource.DealList.Header.Font.Size, Name:g_JSChartResource.DealList.Header.Font.Name };
|
|
@@ -130546,6 +130740,7 @@ function ChartDealList()
|
|
|
130546
130740
|
];
|
|
130547
130741
|
|
|
130548
130742
|
this.RectClient={};
|
|
130743
|
+
this.AryCellRect=[]; //{ Rect:, Type: 1=单行 }
|
|
130549
130744
|
|
|
130550
130745
|
this.ReloadResource=function(resource)
|
|
130551
130746
|
{
|
|
@@ -130646,6 +130841,7 @@ function ChartDealList()
|
|
|
130646
130841
|
|
|
130647
130842
|
this.Draw=function()
|
|
130648
130843
|
{
|
|
130844
|
+
this.AryCellRect=[];
|
|
130649
130845
|
if (this.SizeChange) this.CalculateSize();
|
|
130650
130846
|
else this.UpdateCacheData();
|
|
130651
130847
|
|
|
@@ -130801,7 +130997,7 @@ function ChartDealList()
|
|
|
130801
130997
|
for(j=0;j<this.RowCount && index>=0;++j, --index)
|
|
130802
130998
|
{
|
|
130803
130999
|
var dataItem=this.Data.Data[index];
|
|
130804
|
-
|
|
131000
|
+
this.DrawSelectedRow(dataItem, index, rtRow);
|
|
130805
131001
|
|
|
130806
131002
|
this.DrawRow(dataItem, textLeft, textTop, index);
|
|
130807
131003
|
|
|
@@ -130819,10 +131015,15 @@ function ChartDealList()
|
|
|
130819
131015
|
for(j=0;j<this.RowCount && index<dataCount;++j, ++index)
|
|
130820
131016
|
{
|
|
130821
131017
|
var dataItem=this.Data.Data[index];
|
|
131018
|
+
var rtRow={ Left:textLeft-this.HeaderMergin.Left, Top:textTop, Height:this.RowHeight, Width:this.TableWidth };
|
|
131019
|
+
rtRow.Right=rtRow.Left+rtRow.Width;
|
|
131020
|
+
rtRow.Bottom=rtRow.Top+rtRow.Height;
|
|
130822
131021
|
|
|
130823
|
-
|
|
131022
|
+
this.DrawSelectedRow(dataItem, index, rtRow);
|
|
130824
131023
|
|
|
130825
131024
|
this.DrawRow(dataItem, textLeft, textTop, index);
|
|
131025
|
+
|
|
131026
|
+
this.AryCellRect.push({ Rect:rtRow, Type:1, DataIndex:index });
|
|
130826
131027
|
|
|
130827
131028
|
textTop+=this.RowHeight;
|
|
130828
131029
|
}
|
|
@@ -130928,11 +131129,11 @@ function ChartDealList()
|
|
|
130928
131129
|
}
|
|
130929
131130
|
}
|
|
130930
131131
|
|
|
130931
|
-
this.DrawSelectedRow=function(data,
|
|
131132
|
+
this.DrawSelectedRow=function(data, index, rtRow)
|
|
130932
131133
|
{
|
|
130933
|
-
|
|
130934
|
-
|
|
130935
|
-
|
|
131134
|
+
if (!this.SelectedData) return;
|
|
131135
|
+
if (!this.SelectedData.Enable) return;
|
|
131136
|
+
if (!this.SelectedData.Guid || this.SelectedData.Guid!=data.Guid) return;
|
|
130936
131137
|
|
|
130937
131138
|
this.Canvas.fillStyle=this.SelectedConfig.BGColor;
|
|
130938
131139
|
this.Canvas.fillRect(rtRow.Left,rtRow.Top, rtRow.Width, rtRow.Height);
|
|
@@ -131065,7 +131266,7 @@ function ChartDealList()
|
|
|
131065
131266
|
return GetFontHeight(this.Canvas, font, word);
|
|
131066
131267
|
}
|
|
131067
131268
|
|
|
131068
|
-
this.OnMouseDown=function(x,y,e) //Type:
|
|
131269
|
+
this.OnMouseDown=function(x,y,e) //Type: 1=行
|
|
131069
131270
|
{
|
|
131070
131271
|
if (!this.Data) return null;
|
|
131071
131272
|
|
|
@@ -131076,12 +131277,68 @@ function ChartDealList()
|
|
|
131076
131277
|
else uiElement={Left:null, Top:null};
|
|
131077
131278
|
|
|
131078
131279
|
var row=this.PtInBody(x,y);
|
|
131280
|
+
if (row)
|
|
131281
|
+
{
|
|
131282
|
+
var bRedraw=true;
|
|
131283
|
+
var index=row.DataIndex;
|
|
131284
|
+
var id=row.Item.Guid
|
|
131285
|
+
if (this.SelectedData.Index==index && this.SelectedData.Guid==id) bRedraw=false;
|
|
131286
|
+
|
|
131287
|
+
this.SelectedData.Index=index;
|
|
131288
|
+
this.SelectedData.Guid=id;
|
|
131289
|
+
|
|
131290
|
+
var eventID=JSCHART_EVENT_ID.ON_CLICK_DEAL_ROW;
|
|
131291
|
+
if (e.button==2) eventID=JSCHART_EVENT_ID.ON_RCLICK_DEAL_ROW;
|
|
131292
|
+
|
|
131293
|
+
this.SendClickEvent(eventID, { Data:row, X:x, Y:y, e:e, Inside:insidePoint, UIElement:uiElement });
|
|
131294
|
+
|
|
131295
|
+
return { Type:row.Type, Redraw:bRedraw, Row:row };
|
|
131296
|
+
}
|
|
131297
|
+
|
|
131298
|
+
return null;
|
|
131299
|
+
}
|
|
131300
|
+
|
|
131301
|
+
this.OnDblClick=function(x,y,e)
|
|
131302
|
+
{
|
|
131303
|
+
if (!this.Data) return false;
|
|
131304
|
+
|
|
131305
|
+
var row=this.PtInBody(x,y);
|
|
131306
|
+
if (row)
|
|
131307
|
+
{
|
|
131308
|
+
this.SendClickEvent(JSCHART_EVENT_ID.ON_DBCLICK_DEAL_ROW, { Data:row, X:x, Y:y });
|
|
131309
|
+
return true;
|
|
131310
|
+
}
|
|
131311
|
+
|
|
131312
|
+
return false;
|
|
131079
131313
|
}
|
|
131080
131314
|
|
|
131081
131315
|
this.PtInBody=function(x,y)
|
|
131082
131316
|
{
|
|
131083
131317
|
if (!this.Data) return null;
|
|
131084
131318
|
if (!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return null;
|
|
131319
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.AryCellRect)) return null;
|
|
131320
|
+
|
|
131321
|
+
for(var i=0;i<this.AryCellRect.length;++i)
|
|
131322
|
+
{
|
|
131323
|
+
var item=this.AryCellRect[i];
|
|
131324
|
+
var rtRow=item.Rect;
|
|
131325
|
+
if (x>=rtRow.Left && x<=rtRow.Right && y>=rtRow.Top && y<=rtRow.Bottom)
|
|
131326
|
+
{
|
|
131327
|
+
var data={ Rect:rtRow, DataIndex:item.DataIndex, Item:this.Data.Data[item.DataIndex], Type:item.Type };
|
|
131328
|
+
return data;
|
|
131329
|
+
}
|
|
131330
|
+
}
|
|
131331
|
+
|
|
131332
|
+
return null;
|
|
131333
|
+
}
|
|
131334
|
+
|
|
131335
|
+
this.SendClickEvent=function(id, data)
|
|
131336
|
+
{
|
|
131337
|
+
var event=this.GetEventCallback(id);
|
|
131338
|
+
if (event && event.Callback)
|
|
131339
|
+
{
|
|
131340
|
+
event.Callback(event,data,this);
|
|
131341
|
+
}
|
|
131085
131342
|
}
|
|
131086
131343
|
}
|
|
131087
131344
|
/*
|
|
@@ -150653,14 +150910,21 @@ function JSFloatTooltip()
|
|
|
150653
150910
|
var symbol=data.Symbol;
|
|
150654
150911
|
var name=data.Name;
|
|
150655
150912
|
var bOverlay=false; //是否是叠加指标
|
|
150913
|
+
var bIndexKLine=false;
|
|
150656
150914
|
if (tooltipData.ChartPaint.Name=="Overlay-KLine")
|
|
150657
150915
|
{
|
|
150658
150916
|
symbol=tooltipData.ChartPaint.Symbol;
|
|
150659
150917
|
name=tooltipData.ChartPaint.Title;
|
|
150660
150918
|
bOverlay=true;
|
|
150661
150919
|
}
|
|
150920
|
+
else if (tooltipData.ChartPaint.Name=="DRAWKLINE")
|
|
150921
|
+
{
|
|
150922
|
+
symbol=tooltipData.ChartPaint.Symbol;
|
|
150923
|
+
name=tooltipData.ChartPaint.Title;
|
|
150924
|
+
bIndexKLine=true;
|
|
150925
|
+
}
|
|
150662
150926
|
|
|
150663
|
-
var kItem={ Symbol:symbol, Name:name, Item:CloneData(tooltipData.Data), IsOverlay:bOverlay };
|
|
150927
|
+
var kItem={ Symbol:symbol, Name:name, Item:CloneData(tooltipData.Data), IsOverlay:bOverlay, IsIndexKLine:bIndexKLine };
|
|
150664
150928
|
var strKItem=JSON.stringify(kItem);
|
|
150665
150929
|
var bUpdata=false;
|
|
150666
150930
|
if (this.KItemCacheID!=strKItem) //数据变动的才更新
|
|
@@ -150961,10 +151225,11 @@ function JSFloatTooltip()
|
|
|
150961
151225
|
if (IFrameSplitOperator.IsNumber(data.Time)) timeItem=this.FormatTime(data.Time, this.HQChart.Period, null, 'FloatTooltip-Time');
|
|
150962
151226
|
|
|
150963
151227
|
var overlayItem=null;
|
|
150964
|
-
if (kItem.IsOverlay)
|
|
151228
|
+
if (kItem.IsOverlay || (kItem.IsIndexKLine && kItem.Name))
|
|
150965
151229
|
overlayItem={ Title:"", Text:kItem.Name, Color:this.TextColor, ClassName:this.ValueAlign.Left };
|
|
150966
151230
|
|
|
150967
151231
|
|
|
151232
|
+
|
|
150968
151233
|
var yClose=data.YClose; //昨收价|昨结算价
|
|
150969
151234
|
var aryText=
|
|
150970
151235
|
[
|
|
@@ -153604,7 +153869,7 @@ function HQChartScriptWorker()
|
|
|
153604
153869
|
|
|
153605
153870
|
|
|
153606
153871
|
|
|
153607
|
-
var HQCHART_VERSION="1.1.
|
|
153872
|
+
var HQCHART_VERSION="1.1.14483";
|
|
153608
153873
|
|
|
153609
153874
|
function PrintHQChartVersion()
|
|
153610
153875
|
{
|