hqchart 1.1.14617 → 1.1.14621
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 +27 -8
- package/package.json +1 -1
- package/src/jscommon/umychart.NetworkFilterTest.js +63 -0
- package/src/jscommon/umychart.complier.js +44 -1
- package/src/jscommon/umychart.js +348 -0
- package/src/jscommon/umychart.report.js +8 -0
- package/src/jscommon/umychart.testdata.js +63 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +401 -2
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.NetworkFilterTest.vue.js +63 -0
- package/src/jscommon/umychart.vue/umychart.vue.js +401 -2
|
@@ -15611,6 +15611,14 @@ function ToFixed(number, precision)
|
|
|
15611
15611
|
return s;
|
|
15612
15612
|
}
|
|
15613
15613
|
|
|
15614
|
+
function IsRectOverlap(rt, rt2)
|
|
15615
|
+
{
|
|
15616
|
+
if (Math.max(rt.Left,rt2.Left)<Math.min(rt.Right,rt2.Right) && Math.max(rt.Top,rt2.Top)<Math.min(rt.Bottom, rt2.Bottom))
|
|
15617
|
+
return true;
|
|
15618
|
+
|
|
15619
|
+
return false;
|
|
15620
|
+
}
|
|
15621
|
+
|
|
15614
15622
|
Number.prototype.toFixed2=Number.prototype.toFixed; //备份下老的
|
|
15615
15623
|
Number.prototype.toFixed = function( precision )
|
|
15616
15624
|
{
|
|
@@ -38904,6 +38912,326 @@ function ChartScatterPlot()
|
|
|
38904
38912
|
|
|
38905
38913
|
}
|
|
38906
38914
|
|
|
38915
|
+
//散点图
|
|
38916
|
+
function ChartScatterPlotV2()
|
|
38917
|
+
{
|
|
38918
|
+
this.newMethod=IChartPainting; //派生
|
|
38919
|
+
this.newMethod();
|
|
38920
|
+
delete this.newMethod;
|
|
38921
|
+
|
|
38922
|
+
this.ClassName='ChartScatterPlotV2'; //类名
|
|
38923
|
+
|
|
38924
|
+
//默认点配置
|
|
38925
|
+
this.Color=g_JSChartResource.ChartScatterPlotV2.Color; //点颜色
|
|
38926
|
+
this.TextColor=g_JSChartResource.ChartScatterPlotV2.TextColor;
|
|
38927
|
+
this.Radius=g_JSChartResource.ChartScatterPlotV2.Radius;
|
|
38928
|
+
this.Font=g_JSChartResource.ChartScatterPlotV2.Font; //半径
|
|
38929
|
+
|
|
38930
|
+
this.TooltipData=[];
|
|
38931
|
+
this.MapCache=null; //key=date/date-time value={ Data:[] }
|
|
38932
|
+
this.AryPoint=[ ]; //[{ Value:, Radius:半径(可选), Color:颜色(可选),ColorBorder:边框颜色(可选),
|
|
38933
|
+
// Text:{ Text:显示文字, Color:"rgb(0,30,100)", BaseLine:1, YOffset:5, Align:2 }; }]
|
|
38934
|
+
// BaseLine: 0=圆点上面 1=圆点下面 Align: 2=居中 1=左 3=右
|
|
38935
|
+
|
|
38936
|
+
this.GetKValue=ChartData.GetKValue;
|
|
38937
|
+
this.TextHeight=10;
|
|
38938
|
+
this.AryDrawRect=[];
|
|
38939
|
+
|
|
38940
|
+
this.ReloadResource=function(resource)
|
|
38941
|
+
{
|
|
38942
|
+
this.Color=g_JSChartResource.ChartScatterPlotV2.Color; //点颜色
|
|
38943
|
+
this.TextColor=g_JSChartResource.ChartScatterPlotV2.TextColor;
|
|
38944
|
+
this.Radius=g_JSChartResource.ChartScatterPlotV2.Radius;
|
|
38945
|
+
this.Font=g_JSChartResource.ChartScatterPlotV2.Font;
|
|
38946
|
+
}
|
|
38947
|
+
|
|
38948
|
+
this.BuildCacheData=function()
|
|
38949
|
+
{
|
|
38950
|
+
var mapData=new Map();
|
|
38951
|
+
this.MapCache=mapData;
|
|
38952
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.AryPoint)) return;
|
|
38953
|
+
|
|
38954
|
+
for(var i=0;i<this.AryPoint.length;++i)
|
|
38955
|
+
{
|
|
38956
|
+
var item=this.AryPoint[i];
|
|
38957
|
+
var key=this.BuildKey(item);
|
|
38958
|
+
if (mapData.has(key))
|
|
38959
|
+
{
|
|
38960
|
+
var mapItem=mapData.get(key);
|
|
38961
|
+
mapItem.Data.push(item);
|
|
38962
|
+
}
|
|
38963
|
+
else
|
|
38964
|
+
{
|
|
38965
|
+
mapData.set(key,{ Data:[item] });
|
|
38966
|
+
}
|
|
38967
|
+
}
|
|
38968
|
+
}
|
|
38969
|
+
|
|
38970
|
+
this.Draw=function()
|
|
38971
|
+
{
|
|
38972
|
+
this.TooltipData=[];
|
|
38973
|
+
this.AryDrawRect=[];
|
|
38974
|
+
if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
|
|
38975
|
+
if (this.IsShowIndexTitleOnly()) return;
|
|
38976
|
+
if (this.IsHideScriptIndex()) return;
|
|
38977
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.AryPoint)) return;
|
|
38978
|
+
if (!this.MapCache || this.MapCache.size<=0) return;
|
|
38979
|
+
if(!this.Data || !IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return;
|
|
38980
|
+
|
|
38981
|
+
this.DrawScatterPlot();
|
|
38982
|
+
this.AryDrawRect=[];
|
|
38983
|
+
}
|
|
38984
|
+
|
|
38985
|
+
this.DrawScatterPlot=function()
|
|
38986
|
+
{
|
|
38987
|
+
var bHScreen=(this.ChartFrame.IsHScreen===true);
|
|
38988
|
+
var isMinute=this.IsMinuteFrame();
|
|
38989
|
+
var dataWidth=this.ChartFrame.DataWidth;
|
|
38990
|
+
var distanceWidth=this.ChartFrame.DistanceWidth;
|
|
38991
|
+
var xPointCount=this.ChartFrame.XPointCount;
|
|
38992
|
+
|
|
38993
|
+
if (bHScreen)
|
|
38994
|
+
{
|
|
38995
|
+
var border=this.ChartBorder.GetHScreenBorder();
|
|
38996
|
+
var chartright=border.BottomEx;
|
|
38997
|
+
var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
|
|
38998
|
+
}
|
|
38999
|
+
else
|
|
39000
|
+
{
|
|
39001
|
+
var border=this.ChartBorder.GetBorder();
|
|
39002
|
+
var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
|
|
39003
|
+
var chartright=border.RightEx;
|
|
39004
|
+
}
|
|
39005
|
+
|
|
39006
|
+
var lockRect=this.GetLockRect();
|
|
39007
|
+
if (lockRect)
|
|
39008
|
+
{
|
|
39009
|
+
if (bHScreen) chartright=lockRect.Top;
|
|
39010
|
+
else chartright=lockRect.Left;
|
|
39011
|
+
}
|
|
39012
|
+
|
|
39013
|
+
this.Canvas.save();
|
|
39014
|
+
this.ClipClient(bHScreen);
|
|
39015
|
+
|
|
39016
|
+
this.Canvas.font=this.Font;
|
|
39017
|
+
this.Canvas.textAlign = "left";
|
|
39018
|
+
this.Canvas.textBaseline = "bottom";
|
|
39019
|
+
this.TextHeight=this.GetFontHeight();
|
|
39020
|
+
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth))
|
|
39021
|
+
{
|
|
39022
|
+
var kItem=this.Data.Data[i];
|
|
39023
|
+
if (!kItem) continue;
|
|
39024
|
+
|
|
39025
|
+
var key=this.BuildKey(kItem);
|
|
39026
|
+
if (!this.MapCache.has(key)) continue;
|
|
39027
|
+
var mapItem=this.MapCache.get(key);
|
|
39028
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(mapItem.Data)) continue;
|
|
39029
|
+
|
|
39030
|
+
if (isMinute)
|
|
39031
|
+
{
|
|
39032
|
+
var x=this.ChartFrame.GetXFromIndex(j);
|
|
39033
|
+
}
|
|
39034
|
+
else
|
|
39035
|
+
{
|
|
39036
|
+
var left=xOffset;
|
|
39037
|
+
var right=xOffset+dataWidth;
|
|
39038
|
+
if (right>chartright) break;
|
|
39039
|
+
var x=left+(right-left)/2;
|
|
39040
|
+
}
|
|
39041
|
+
|
|
39042
|
+
if (x>chartright) break;
|
|
39043
|
+
|
|
39044
|
+
for(var k=0;k<mapItem.Data.length;++k)
|
|
39045
|
+
{
|
|
39046
|
+
var item=mapItem.Data[k];
|
|
39047
|
+
this.DrawItem(kItem, item, x);
|
|
39048
|
+
}
|
|
39049
|
+
}
|
|
39050
|
+
|
|
39051
|
+
this.Canvas.restore();
|
|
39052
|
+
}
|
|
39053
|
+
|
|
39054
|
+
this.DrawItem=function(kItem, item, x)
|
|
39055
|
+
{
|
|
39056
|
+
var dataWidth=this.ChartFrame.DataWidth;
|
|
39057
|
+
var maxRadius=dataWidth/2;
|
|
39058
|
+
if (!item) return;
|
|
39059
|
+
var price=item.Value;
|
|
39060
|
+
if (IFrameSplitOperator.IsString(item.Value)) price=this.GetKValue(kItem,item.Value);
|
|
39061
|
+
if (!IFrameSplitOperator.IsNumber(price)) return;
|
|
39062
|
+
|
|
39063
|
+
var y=this.GetYFromData(price,false);
|
|
39064
|
+
|
|
39065
|
+
var radius=this.Radius;
|
|
39066
|
+
if (item.Radius) radius=item.Radius;
|
|
39067
|
+
if (!IFrameSplitOperator.IsNumber(radius)) return;
|
|
39068
|
+
if (radius>maxRadius) radius=maxRadius;
|
|
39069
|
+
|
|
39070
|
+
this.Canvas.beginPath();
|
|
39071
|
+
this.Canvas.arc(x, y, radius, 0, 2 * Math.PI);
|
|
39072
|
+
|
|
39073
|
+
var color=this.Color;
|
|
39074
|
+
if (item.Color) color=item.Color;
|
|
39075
|
+
if (color)
|
|
39076
|
+
{
|
|
39077
|
+
this.Canvas.fillStyle=color;
|
|
39078
|
+
this.Canvas.fill();
|
|
39079
|
+
}
|
|
39080
|
+
|
|
39081
|
+
if (item.ColorBorder)
|
|
39082
|
+
{
|
|
39083
|
+
this.Canvas.strokeStyle=item.ColorBorder;
|
|
39084
|
+
this.Canvas.stroke()
|
|
39085
|
+
}
|
|
39086
|
+
|
|
39087
|
+
if (dataWidth>this.TextHeight)
|
|
39088
|
+
{
|
|
39089
|
+
this.DrawText(item.Text,x,y,radius);
|
|
39090
|
+
}
|
|
39091
|
+
|
|
39092
|
+
var itemTooltip={ X:x, Y:y, Radius:radius, Data:item };
|
|
39093
|
+
this.TooltipData.push(itemTooltip);
|
|
39094
|
+
}
|
|
39095
|
+
|
|
39096
|
+
this.DrawText=function(item, x, y, radius)
|
|
39097
|
+
{
|
|
39098
|
+
if (!item || !item.Text) return;
|
|
39099
|
+
|
|
39100
|
+
var bHScreen=(this.ChartFrame.IsHScreen===true);
|
|
39101
|
+
if (bHScreen) return;
|
|
39102
|
+
|
|
39103
|
+
var text=item.Text;
|
|
39104
|
+
var textWidth=this.Canvas.measureText(text).width;
|
|
39105
|
+
|
|
39106
|
+
var baseLine=1; //1=上 2=下
|
|
39107
|
+
var align=2;
|
|
39108
|
+
var yOffset=2;
|
|
39109
|
+
var xText=x;
|
|
39110
|
+
if (IFrameSplitOperator.IsNumber(item.YOffset)) yOffset=item.YOffset; //Y偏移
|
|
39111
|
+
if (IFrameSplitOperator.IsNumber(item.BaseLine)) baseLine=item.BaseLine;
|
|
39112
|
+
var yText=y-radius-yOffset;
|
|
39113
|
+
if (baseLine==2) yText=y+radius+this.TextHeight+yOffset; //下
|
|
39114
|
+
|
|
39115
|
+
if (IFrameSplitOperator.IsNumber(item.Align)) align=item.Align; //左中右
|
|
39116
|
+
if (align==1) xText=x-textWidth;
|
|
39117
|
+
else if (align==2) xText=x-textWidth/2;
|
|
39118
|
+
|
|
39119
|
+
var rtText=null;
|
|
39120
|
+
if (item.BG && item.BG.Color)
|
|
39121
|
+
{
|
|
39122
|
+
var bgItem=item.BG;
|
|
39123
|
+
var marginLeft=2, marginRight=2, yBGOffset=1, marginBottom=0, marginTop=0;
|
|
39124
|
+
if (IFrameSplitOperator.IsNumber(bgItem.MarginLeft)) marginLeft=bgItem.MarginLeft;
|
|
39125
|
+
if (IFrameSplitOperator.IsNumber(bgItem.MarginRight)) marginRight=bgItem.MarginRight;
|
|
39126
|
+
if (IFrameSplitOperator.IsNumber(bgItem.MarginBottom)) marginBottom=bgItem.MarginBottom;
|
|
39127
|
+
if (IFrameSplitOperator.IsNumber(bgItem.MarginTop)) marginTop=bgItem.MarginTop;
|
|
39128
|
+
if (IFrameSplitOperator.IsNumber(bgItem.YOffset)) yBGOffset=bgItem.YOffset;
|
|
39129
|
+
|
|
39130
|
+
var rtBG={ Left:xText-marginLeft, Bottom:yText+yBGOffset+marginBottom, Width:textWidth+marginLeft+marginRight, Height:this.TextHeight+marginBottom+marginTop };
|
|
39131
|
+
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
39132
|
+
rtBG.Top=rtBG.Bottom-rtBG.Height;
|
|
39133
|
+
|
|
39134
|
+
if (this.IsTextOverlap(rtBG)) return;
|
|
39135
|
+
|
|
39136
|
+
this.Canvas.fillStyle=bgItem.Color;
|
|
39137
|
+
this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
|
|
39138
|
+
|
|
39139
|
+
rtText=rtBG;
|
|
39140
|
+
}
|
|
39141
|
+
else
|
|
39142
|
+
{
|
|
39143
|
+
rtText={ Left:xText, Bottom:yText, Width:textWidth, Height:this.TextHeight };
|
|
39144
|
+
rtText.Right=rtText.Left+rtText.Width;
|
|
39145
|
+
rtText.Top=rtText.Bottom-rtText.Height;
|
|
39146
|
+
|
|
39147
|
+
if (this.IsTextOverlap(rtText)) return;
|
|
39148
|
+
}
|
|
39149
|
+
|
|
39150
|
+
if (item.Color) this.Canvas.fillStyle=item.Color;
|
|
39151
|
+
else this.Canvas.fillStyle=this.TextColor;
|
|
39152
|
+
this.Canvas.fillText(text, xText, yText);
|
|
39153
|
+
|
|
39154
|
+
this.AryDrawRect.push(rtText);
|
|
39155
|
+
}
|
|
39156
|
+
|
|
39157
|
+
this.IsTextOverlap=function(rtText)
|
|
39158
|
+
{
|
|
39159
|
+
for(var i=0; i<this.AryDrawRect.length; ++i)
|
|
39160
|
+
{
|
|
39161
|
+
var item=this.AryDrawRect[i];
|
|
39162
|
+
if (IsRectOverlap(rtText,item)) return true;
|
|
39163
|
+
}
|
|
39164
|
+
|
|
39165
|
+
return false;
|
|
39166
|
+
}
|
|
39167
|
+
|
|
39168
|
+
this.GetMaxMin=function()
|
|
39169
|
+
{
|
|
39170
|
+
var range={Min:null, Max:null };
|
|
39171
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.AryPoint)) return range;
|
|
39172
|
+
if (!this.MapCache || this.MapCache.size<=0) return range;
|
|
39173
|
+
if(!this.Data || !IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return range;
|
|
39174
|
+
|
|
39175
|
+
var xPointCount=this.ChartFrame.XPointCount;
|
|
39176
|
+
var start=this.Data.DataOffset;
|
|
39177
|
+
if (this.ChartFrame.GlobalOption && this.ChartFrame.GlobalOption.IsValueFullRange)
|
|
39178
|
+
{
|
|
39179
|
+
start=0;
|
|
39180
|
+
xPointCount=this.Data.Data.length;
|
|
39181
|
+
}
|
|
39182
|
+
|
|
39183
|
+
for(var i=start,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j)
|
|
39184
|
+
{
|
|
39185
|
+
var kItem=this.Data.Data[i];
|
|
39186
|
+
if (!kItem) continue;
|
|
39187
|
+
|
|
39188
|
+
var key=this.BuildKey(kItem);
|
|
39189
|
+
if (!this.MapCache.has(key)) continue;
|
|
39190
|
+
var mapItem=this.MapCache.get(key);
|
|
39191
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(mapItem.Data)) continue;
|
|
39192
|
+
|
|
39193
|
+
for(k=0;k<mapItem.Data.length;++k)
|
|
39194
|
+
{
|
|
39195
|
+
var item=mapItem.Data[k];
|
|
39196
|
+
var value=item.Value;
|
|
39197
|
+
if (IFrameSplitOperator.IsString(item.Value)) value=this.GetKValue(kItem,item.Value);
|
|
39198
|
+
if (!IFrameSplitOperator.IsNumber(value)) continue;
|
|
39199
|
+
|
|
39200
|
+
if (range.Max==null) range.Max=value;
|
|
39201
|
+
else if (range.Max<value) range.Max=value;
|
|
39202
|
+
if (range.Min==null) range.Min=value;
|
|
39203
|
+
else if (range.Min>value) range.Min=value;
|
|
39204
|
+
}
|
|
39205
|
+
}
|
|
39206
|
+
|
|
39207
|
+
return range;
|
|
39208
|
+
}
|
|
39209
|
+
|
|
39210
|
+
this.GetTooltipData=function(x,y,tooltip)
|
|
39211
|
+
{
|
|
39212
|
+
if (!this.IsShow) return false;
|
|
39213
|
+
|
|
39214
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.TooltipData)) return false;
|
|
39215
|
+
|
|
39216
|
+
for(var i=this.TooltipData.length-1; i>=0; --i)
|
|
39217
|
+
{
|
|
39218
|
+
var item=this.TooltipData[i];
|
|
39219
|
+
|
|
39220
|
+
this.Canvas.beginPath();
|
|
39221
|
+
this.Canvas.arc(item.X, item.Y, item.Radius, 0, 2 * Math.PI);
|
|
39222
|
+
if (this.Canvas.isPointInPath(x,y))
|
|
39223
|
+
{
|
|
39224
|
+
JSConsole.Chart.Log('[ChartScatterPlotV2::GetTooltipData] point', item);
|
|
39225
|
+
tooltip.Data=item;
|
|
39226
|
+
tooltip.ChartPaint=this;
|
|
39227
|
+
tooltip.Type=6; //散点图
|
|
39228
|
+
return true;
|
|
39229
|
+
}
|
|
39230
|
+
}
|
|
39231
|
+
}
|
|
39232
|
+
|
|
39233
|
+
}
|
|
39234
|
+
|
|
38907
39235
|
//子线段
|
|
38908
39236
|
function ChartSubLine()
|
|
38909
39237
|
{
|
|
@@ -77644,6 +77972,14 @@ function JSChartResource()
|
|
|
77644
77972
|
DiffValueBGColor:"rgb(251,140,1)"
|
|
77645
77973
|
}
|
|
77646
77974
|
|
|
77975
|
+
this.ChartScatterPlotV2=
|
|
77976
|
+
{
|
|
77977
|
+
Color:"rgb(0,0,255)",
|
|
77978
|
+
TextColor:"rgb(0,0,0)",
|
|
77979
|
+
Radius:3,
|
|
77980
|
+
Font:`${10*GetDevicePixelRatio()}px 微软雅黑`
|
|
77981
|
+
}
|
|
77982
|
+
|
|
77647
77983
|
//筹码分布图
|
|
77648
77984
|
this.StockChip=
|
|
77649
77985
|
{
|
|
@@ -79044,6 +79380,7 @@ function JSChartResource()
|
|
|
79044
79380
|
if (style.KLineToolbar) this.SetKLineToolbar(style.KLineToolbar);
|
|
79045
79381
|
|
|
79046
79382
|
if (style.IndexLock) this.SetIndexLock(style.IndexLock);
|
|
79383
|
+
if (style.ChartScatterPlotV2) this.SetChartScatterPlotV2(style.ChartScatterPlotV2);
|
|
79047
79384
|
}
|
|
79048
79385
|
|
|
79049
79386
|
|
|
@@ -79742,6 +80079,17 @@ function JSChartResource()
|
|
|
79742
80079
|
if (item.Title) dest.Title=item.Title;
|
|
79743
80080
|
}
|
|
79744
80081
|
|
|
80082
|
+
this.SetChartScatterPlotV2=function(style)
|
|
80083
|
+
{
|
|
80084
|
+
var item=style;
|
|
80085
|
+
var dest=this.ChartScatterPlotV2;
|
|
80086
|
+
|
|
80087
|
+
if (item.Color) dest.Color=item.Color;
|
|
80088
|
+
if (item.TextColor) dest.TextColor=item.TextColor;
|
|
80089
|
+
if (item.Font) dest.Font=item.Font;
|
|
80090
|
+
if (IFrameSplitOperator.IsNumber(item.Radius)) dest.Radius=item.Radius
|
|
80091
|
+
}
|
|
80092
|
+
|
|
79745
80093
|
}
|
|
79746
80094
|
|
|
79747
80095
|
var g_JSChartResource=new JSChartResource();
|
|
@@ -124181,7 +124529,9 @@ var SCRIPT_CHART_NAME=
|
|
|
124181
124529
|
{
|
|
124182
124530
|
OVERLAY_BARS:"OVERLAY_BARS", //叠加柱子图
|
|
124183
124531
|
KLINE_TABLE:"KLINE_TABLE",
|
|
124184
|
-
SCATTER_PLOT:"SCATTER_PLOT",
|
|
124532
|
+
SCATTER_PLOT:"SCATTER_PLOT", //散点图
|
|
124533
|
+
SCATTER_PLOT_V2:"SCATTER_PLOT_V2", //散点图V2
|
|
124534
|
+
|
|
124185
124535
|
|
|
124186
124536
|
CLIP_COLOR_STICK:"CLIP_COLOR_STICK", //上下柱子 裁剪
|
|
124187
124537
|
|
|
@@ -126188,6 +126538,34 @@ function ScriptIndex(name,script,args,option)
|
|
|
126188
126538
|
hqChart.ChartPaint.push(chart);
|
|
126189
126539
|
}
|
|
126190
126540
|
|
|
126541
|
+
this.CreateScatterPlotV2=function(hqChart,windowIndex,varItem,i)
|
|
126542
|
+
{
|
|
126543
|
+
var chart=new ChartScatterPlotV2();
|
|
126544
|
+
chart.Canvas=hqChart.Canvas;
|
|
126545
|
+
chart.Name=varItem.Name;
|
|
126546
|
+
chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
|
|
126547
|
+
chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
|
|
126548
|
+
chart.HQChart=hqChart;
|
|
126549
|
+
chart.Identify=this.Guid;
|
|
126550
|
+
|
|
126551
|
+
chart.Data=hqChart.GetKData(); //绑定K线
|
|
126552
|
+
chart.AryPoint=varItem.Draw.DrawData;
|
|
126553
|
+
|
|
126554
|
+
var config=varItem.Draw.Config;
|
|
126555
|
+
if (config)
|
|
126556
|
+
{
|
|
126557
|
+
if (config.Color) chart.Color=config.Color;
|
|
126558
|
+
if (IFrameSplitOperator.IsNumber(config.Radius)) chart.Radius=config.Radius;
|
|
126559
|
+
if (config.TextColor) chart.TextColor=config.TextColor;
|
|
126560
|
+
if (config.Font) chart.Font=config.Font;
|
|
126561
|
+
}
|
|
126562
|
+
|
|
126563
|
+
chart.BuildCacheData();
|
|
126564
|
+
|
|
126565
|
+
hqChart.ChartPaint.push(chart);
|
|
126566
|
+
}
|
|
126567
|
+
|
|
126568
|
+
|
|
126191
126569
|
this.CreateClipColorStick=function(hqChart,windowIndex,varItem,id)
|
|
126192
126570
|
{
|
|
126193
126571
|
var chart=new ChartClipColorStick();
|
|
@@ -126550,6 +126928,9 @@ function ScriptIndex(name,script,args,option)
|
|
|
126550
126928
|
case SCRIPT_CHART_NAME.SCATTER_PLOT:
|
|
126551
126929
|
this.CreateScatterPlot(hqChart,windowIndex,item,i);
|
|
126552
126930
|
break;
|
|
126931
|
+
case SCRIPT_CHART_NAME.SCATTER_PLOT_V2:
|
|
126932
|
+
this.CreateScatterPlotV2(hqChart,windowIndex,item,i);
|
|
126933
|
+
break;
|
|
126553
126934
|
case SCRIPT_CHART_NAME.CLIP_COLOR_STICK:
|
|
126554
126935
|
this.CreateClipColorStick(hqChart,windowIndex,item,i);
|
|
126555
126936
|
break;
|
|
@@ -129111,6 +129492,16 @@ function APIScriptIndex(name,script,args,option, isOverlay)
|
|
|
129111
129492
|
|
|
129112
129493
|
result.push(outVarItem);
|
|
129113
129494
|
}
|
|
129495
|
+
else if (draw.DrawType==SCRIPT_CHART_NAME.SCATTER_PLOT_V2)
|
|
129496
|
+
{
|
|
129497
|
+
drawItem.Name=draw.Name;
|
|
129498
|
+
drawItem.Type=draw.Type;
|
|
129499
|
+
drawItem.DrawType=draw.DrawType;
|
|
129500
|
+
drawItem.DrawData=draw.DrawData;
|
|
129501
|
+
drawItem.Config=draw.Config;
|
|
129502
|
+
outVarItem.Draw=drawItem;
|
|
129503
|
+
result.push(outVarItem);
|
|
129504
|
+
}
|
|
129114
129505
|
else if (draw.DrawType==SCRIPT_CHART_NAME.KLINE_TABLE)
|
|
129115
129506
|
{
|
|
129116
129507
|
drawItem.Name=draw.Name;
|
|
@@ -133206,6 +133597,14 @@ function JSReportChart(divElement)
|
|
|
133206
133597
|
if (IFrameSplitOperator.IsBool(option.EnableDragHeader)) chart.EnableDragHeader=option.EnableDragHeader;
|
|
133207
133598
|
if (IFrameSplitOperator.IsNumber(option.WheelPageType)) chart.WheelPageType=option.WheelPageType;
|
|
133208
133599
|
if (IFrameSplitOperator.IsBool(option.PageUpDownCycle)) chart.PageUpDownCycle=option.PageUpDownCycle;
|
|
133600
|
+
|
|
133601
|
+
//数据下载提示信息
|
|
133602
|
+
if (IFrameSplitOperator.IsObject(option.SplashTitle))
|
|
133603
|
+
{
|
|
133604
|
+
var item=option.SplashTitle;
|
|
133605
|
+
if (item) chart.SplashTitle.StockList=item.StockList;
|
|
133606
|
+
if (item) chart.SplashTitle.MemberList=item.MemberList;
|
|
133607
|
+
}
|
|
133209
133608
|
|
|
133210
133609
|
|
|
133211
133610
|
if (option.VScrollbar) chart.SetVScrollbar(option.VScrollbar);
|
|
@@ -146034,7 +146433,7 @@ function ScrollBarBGChart()
|
|
|
146034
146433
|
|
|
146035
146434
|
|
|
146036
146435
|
|
|
146037
|
-
var HQCHART_VERSION="1.1.
|
|
146436
|
+
var HQCHART_VERSION="1.1.14620";
|
|
146038
146437
|
|
|
146039
146438
|
function PrintHQChartVersion()
|
|
146040
146439
|
{
|
|
@@ -57545,6 +57545,8 @@ HQData.Report_APIIndex=function(data, callback)
|
|
|
57545
57545
|
HQData.APIIndex_DRAWKLINE(data, callback);
|
|
57546
57546
|
else if (request.Data.indexname=="API_TITLE")
|
|
57547
57547
|
HQData.APIIndex_TITLE(data, callback);
|
|
57548
|
+
else if (request.Data.indexname=="API_SCATTER_PLOT_V2")
|
|
57549
|
+
HQData.APIIndex_SCATTER_PLOT_V2(data, callback);
|
|
57548
57550
|
}
|
|
57549
57551
|
|
|
57550
57552
|
|
|
@@ -58545,6 +58547,67 @@ HQData.APIIndex_TITLE=function(data, callback)
|
|
|
58545
58547
|
callback(apiData);
|
|
58546
58548
|
}
|
|
58547
58549
|
|
|
58550
|
+
HQData.APIIndex_SCATTER_PLOT_V2=function(data, callback)
|
|
58551
|
+
{
|
|
58552
|
+
data.PreventDefault=true;
|
|
58553
|
+
var hqchart=data.HQChart;
|
|
58554
|
+
var kData=hqchart.GetKData();
|
|
58555
|
+
|
|
58556
|
+
var pointData=
|
|
58557
|
+
{
|
|
58558
|
+
name:"SCATTER_PLOT_V2", type:1,
|
|
58559
|
+
Draw:
|
|
58560
|
+
{
|
|
58561
|
+
Name:"SCATTER_PLOT_V2",
|
|
58562
|
+
DrawType:"SCATTER_PLOT_V2",
|
|
58563
|
+
DrawData:[],
|
|
58564
|
+
Config:{ Color:"rgb(100,100,0)", Radius:5 },
|
|
58565
|
+
},
|
|
58566
|
+
};
|
|
58567
|
+
|
|
58568
|
+
for(var i=0;i<kData.Data.length;++i)
|
|
58569
|
+
{
|
|
58570
|
+
var kItem=kData.Data[i];
|
|
58571
|
+
|
|
58572
|
+
var item={ Date:kItem.Date, Time:kItem.Time, Value:kItem.High, Color:"rgb(0,0,0)", IsEmpty:true };
|
|
58573
|
+
if (kItem.Close>kItem.Open)
|
|
58574
|
+
{
|
|
58575
|
+
item.ColorBorder="rgb(0,250,0)";
|
|
58576
|
+
item.Text={ Text:`${kItem.High.toFixed(2)}`, Color:"rgb(250,250,250)", BaseLine:1, YOffset:8, Align:2, BG:{ Color:"rgb(255,140,0)", MarginLeft:5, MarginRight:5, YOffset:5, MarginTop:8, MarginBottom:1 }};
|
|
58577
|
+
}
|
|
58578
|
+
else
|
|
58579
|
+
{
|
|
58580
|
+
item.ColorBorder="rgb(250,0,0)";
|
|
58581
|
+
item.Text=
|
|
58582
|
+
{
|
|
58583
|
+
Text:`${kItem.High.toFixed(2)}`, Color:"rgb(178,34,34)", BaseLine:2, YOffset:10, Align:2,
|
|
58584
|
+
//BG:{ Color:"rgb(255,255,0)" }
|
|
58585
|
+
};
|
|
58586
|
+
}
|
|
58587
|
+
|
|
58588
|
+
|
|
58589
|
+
item.Tooltip=
|
|
58590
|
+
[
|
|
58591
|
+
{Title:"日期", Text:`${kItem.Date}`},
|
|
58592
|
+
{Title:"最高", Text:`${kItem.High.toFixed(2)}`, TextColor:"rgb(250,0,0)"},
|
|
58593
|
+
{Title:"最低", Text:`${kItem.Low.toFixed(2)}`,TextColor:"rgb(0,255,0)" },
|
|
58594
|
+
]
|
|
58595
|
+
pointData.Draw.DrawData.push(item);
|
|
58596
|
+
}
|
|
58597
|
+
|
|
58598
|
+
var apiData=
|
|
58599
|
+
{
|
|
58600
|
+
code:0,
|
|
58601
|
+
stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
|
|
58602
|
+
outdata: { date:kData.GetDate(), time:kData.GetTime(), outvar:[ pointData] },
|
|
58603
|
+
|
|
58604
|
+
//error: { message:"无权限查看指标“测试指标1”" }
|
|
58605
|
+
};
|
|
58606
|
+
|
|
58607
|
+
console.log('[HQData.APIIndex_SCATTER_PLOT_V2] apiData ', apiData);
|
|
58608
|
+
callback(apiData);
|
|
58609
|
+
}
|
|
58610
|
+
|
|
58548
58611
|
|
|
58549
58612
|
HQData.RequestVolumeProfileData=function(data, callback)
|
|
58550
58613
|
{
|