hqchart 1.1.14121 → 1.1.14128
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 +70 -13
- package/package.json +1 -1
- package/src/jscommon/umychart.DialogTooltip.js +21 -2
- package/src/jscommon/umychart.complier.js +186 -0
- package/src/jscommon/umychart.js +139 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +326 -1
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +347 -3
|
@@ -11388,6 +11388,105 @@ function JSDraw(errorHandler,symbolData)
|
|
|
11388
11388
|
|
|
11389
11389
|
return result;
|
|
11390
11390
|
}
|
|
11391
|
+
|
|
11392
|
+
|
|
11393
|
+
///////////////////////////////////////////////////////////////////////////////////
|
|
11394
|
+
//DRAWLASTBARICON :在最后一根k线绘制图标。
|
|
11395
|
+
//用法:DRAWLASTBARICON(PRICE,ICON);
|
|
11396
|
+
//最后一根k线,在PRICE位置画图标ICON。
|
|
11397
|
+
//
|
|
11398
|
+
//注:
|
|
11399
|
+
//1、该函数可以指定位置PRICE标注图标ICON
|
|
11400
|
+
//2、ICON位置可以写成'ICON'的形式,也可以写为数字的形式,即DRAWLASTBARICON(PRICE,'ICO1');等价于DRAWLASTBARICON(PRICE,1);
|
|
11401
|
+
//3、不支持将该函数定义为变量,即不支持下面的写法:
|
|
11402
|
+
//A:DRAWLASTBARICON(PRICE,ICON);
|
|
11403
|
+
//4、该函数可以用ALIGN,VALIGN设置图标的对齐方式。
|
|
11404
|
+
//例1:
|
|
11405
|
+
//DRAWLASTBARICON(LOW,'ICO1');//在最后一根k线最低价上画出图标ICON1。
|
|
11406
|
+
//例2:
|
|
11407
|
+
//MA5:=MA(C,5);
|
|
11408
|
+
//DRAWLASTBARICON(MA5,2);//表示在最后一根k线对应的MA5数值位置上画出图标ICON2。
|
|
11409
|
+
|
|
11410
|
+
this.DRAWLASTBARICON=function(data, type)
|
|
11411
|
+
{
|
|
11412
|
+
if (IFrameSplitOperator.IsString(type)) //把ICO1=>1
|
|
11413
|
+
{
|
|
11414
|
+
var value=type.replace('ICO',"");
|
|
11415
|
+
type=parseInt(value);
|
|
11416
|
+
}
|
|
11417
|
+
|
|
11418
|
+
var icon=g_JSComplierResource.GetDrawIcon(type);
|
|
11419
|
+
if (!icon) g_JSComplierResource.GetDrawTextIcon(type);
|
|
11420
|
+
if (!icon) icon={ Symbol:'🚩'};
|
|
11421
|
+
|
|
11422
|
+
var drawItem={ Value:null, Icon:icon, IconType:type };
|
|
11423
|
+
if (IFrameSplitOperator.IsNonEmptyArray(data)) drawItem.Value=data[data.length-1];
|
|
11424
|
+
else drawItem.Value=data;
|
|
11425
|
+
|
|
11426
|
+
var result={ DrawData:drawItem, DrawType:'DRAWLASTBARICON' };
|
|
11427
|
+
|
|
11428
|
+
return result;
|
|
11429
|
+
}
|
|
11430
|
+
|
|
11431
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
11432
|
+
//DRAWLASTBARTEXT:显在最后一根k线显示文字。
|
|
11433
|
+
//用法:DRAWLASTBARTEXT(PRICE,TEXT);
|
|
11434
|
+
//最后一根k线,在PRICE位置书写文字TEXT。
|
|
11435
|
+
//注:
|
|
11436
|
+
//1、显示的汉字用单引号标注
|
|
11437
|
+
//2、可以设置文字显示的对齐方式,字体大小以及文字的颜色,即支持下面的写法:
|
|
11438
|
+
//DRAWLASTBARTEXT(PRICE,TEXT),COLOR,ALIGN,VALIGN;
|
|
11439
|
+
//例1:
|
|
11440
|
+
//DRAWLASTBARTEXT(LOW,'注');//
|
|
11441
|
+
//最后一根k线,在最低价上写"注"字。
|
|
11442
|
+
//例2:
|
|
11443
|
+
//DRAWLASTBARTEXT(LOW,'低'),ALIGN0,FONTSIZE16,COLORRED;//在最后一根k线,在最低价写"低"字,文字左对齐,字体大小为16,文字颜色为红色。
|
|
11444
|
+
|
|
11445
|
+
this.DRAWLASTBARTEXT=function(data, text)
|
|
11446
|
+
{
|
|
11447
|
+
var drawItem={ Value:null, Text:text };
|
|
11448
|
+
if (IFrameSplitOperator.IsNonEmptyArray(data)) drawItem.Value=data[data.length-1];
|
|
11449
|
+
else drawItem.Value=data;
|
|
11450
|
+
|
|
11451
|
+
var result={ DrawData:drawItem, DrawType:'DRAWLASTBARTEXT' };
|
|
11452
|
+
|
|
11453
|
+
return result;
|
|
11454
|
+
}
|
|
11455
|
+
|
|
11456
|
+
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
11457
|
+
//DRAWLASTBARNUMBER:在最后一根k线输出数值。
|
|
11458
|
+
//用法:DRAWLASTBARNUMBER(DATA,NUMBER,PRECISION,COLOR);
|
|
11459
|
+
//最后一根k线在DATA位置写数字NUMBER。PRECISION为精度(小数点后有几位数字)。COLOR为颜色。
|
|
11460
|
+
//注:
|
|
11461
|
+
//该函数支持在函数后设置文字的大小和文字对齐方式。即支持下面的写法:
|
|
11462
|
+
//DRAWLASTBARNUMBER(DATA,NUMBER,PRECISION,COLOR),ALIGN,VALIGN;
|
|
11463
|
+
//例1:
|
|
11464
|
+
//DRAWLASTBARNUMBER(HIGH,(CLOSE-OPEN)/OPEN*100,2,COLORRED);//最后一根k线在最高价位置红色显示涨幅数值(相对开盘价的百分比,精确2位小数)。
|
|
11465
|
+
//例2:
|
|
11466
|
+
//DRAWLASTBARNUMBER(L,REF(C,1),2,COLORRED),ALIGN0,VALIGN0;//表示最后一根k线的最低价处以红色显示昨收盘价数值(精确2位小数),标注文字居左,居上对齐。
|
|
11467
|
+
|
|
11468
|
+
this.DRAWLASTBARNUMBER=function(data,value,dec,color)
|
|
11469
|
+
{
|
|
11470
|
+
var drawItem={ Value:null, Text:null, Color:color };
|
|
11471
|
+
if (IFrameSplitOperator.IsNonEmptyArray(data)) drawItem.Value=data[data.length-1];
|
|
11472
|
+
else drawItem.Value=data;
|
|
11473
|
+
|
|
11474
|
+
var precision=2;
|
|
11475
|
+
if (IFrameSplitOperator.IsNumber(dec)) precision=parseInt(dec);
|
|
11476
|
+
if (IFrameSplitOperator.IsNumber(value))
|
|
11477
|
+
{
|
|
11478
|
+
drawItem.Text=value.toFixed(precision);
|
|
11479
|
+
}
|
|
11480
|
+
else if (IFrameSplitOperator.IsNonEmptyArray(value))
|
|
11481
|
+
{
|
|
11482
|
+
var lastValue=value[value.length-1];
|
|
11483
|
+
if (IFrameSplitOperator.IsNumber(lastValue)) drawItem.Text=lastValue.toFixed(precision);
|
|
11484
|
+
}
|
|
11485
|
+
|
|
11486
|
+
var result={ DrawData:drawItem, DrawType:'DRAWLASTBARNUMBER' };
|
|
11487
|
+
|
|
11488
|
+
return result;
|
|
11489
|
+
}
|
|
11391
11490
|
}
|
|
11392
11491
|
|
|
11393
11492
|
|
|
@@ -11442,6 +11541,7 @@ JSDraw.prototype.IsDrawFunction=function(name)
|
|
|
11442
11541
|
'DRAWOVERLAYLINE',"FILLRGN", "FILLRGN2","FILLTOPRGN", "FILLBOTTOMRGN", "FILLVERTICALRGN","FLOATRGN","DRAWSL", "DRAWGBK2","DRAWGBK_DIV",
|
|
11443
11542
|
"VERTLINE","HORLINE","TIPICON",
|
|
11444
11543
|
"BUY","SELL","SELLSHORT","BUYSHORT",
|
|
11544
|
+
"DRAWLASTBARICON","DRAWLASTBARNUMBER", "DRAWLASTBARTEXT",
|
|
11445
11545
|
]);
|
|
11446
11546
|
if (setFunctionName.has(name)) return true;
|
|
11447
11547
|
|
|
@@ -16724,6 +16824,7 @@ function JSExecute(ast,option)
|
|
|
16724
16824
|
["OFFERCANCELVOL", null], //累计总有效撤卖量,专业版等(资金流向功能)沪深京品种行情专用 累计总有效委卖量-累计总有效撤卖量=总卖+总成交量
|
|
16725
16825
|
["AVGOFFERPX", null], //专业版等(资金流向功能)沪深京品种行情专用:最新委卖均价
|
|
16726
16826
|
//["", null],
|
|
16827
|
+
|
|
16727
16828
|
]);
|
|
16728
16829
|
|
|
16729
16830
|
this.SymbolData=new JSSymbolData(this.AST,option,this);
|
|
@@ -18180,6 +18281,20 @@ function JSExecute(ast,option)
|
|
|
18180
18281
|
node.Draw=this.Draw.HORLINE(args[0],args[1],args[2],args[3]);
|
|
18181
18282
|
node.Out=node.Draw.DrawData.Data;
|
|
18182
18283
|
break;
|
|
18284
|
+
|
|
18285
|
+
case "DRAWLASTBARICON":
|
|
18286
|
+
node.Draw=this.Draw.DRAWLASTBARICON(args[0],args[1]);
|
|
18287
|
+
node.Out=[];
|
|
18288
|
+
break;
|
|
18289
|
+
case "DRAWLASTBARNUMBER":
|
|
18290
|
+
node.Draw=this.Draw.DRAWLASTBARNUMBER(args[0],args[1],args[2],args[3]);
|
|
18291
|
+
node.Out=[];
|
|
18292
|
+
break;
|
|
18293
|
+
case "DRAWLASTBARTEXT":
|
|
18294
|
+
node.Draw=this.Draw.DRAWLASTBARTEXT(args[0],args[1]);
|
|
18295
|
+
node.Out=[];
|
|
18296
|
+
break;
|
|
18297
|
+
|
|
18183
18298
|
case 'CODELIKE':
|
|
18184
18299
|
node.Out=this.SymbolData.CODELIKE(args[0]);
|
|
18185
18300
|
break;
|
|
@@ -18592,6 +18707,22 @@ function JSExplainer(ast,option)
|
|
|
18592
18707
|
["OFFERCANCELVOL", "累计总有效撤卖量"],
|
|
18593
18708
|
["AVGOFFERPX", "最新委卖均价"],
|
|
18594
18709
|
|
|
18710
|
+
['COLORBLACK','黑色'],
|
|
18711
|
+
['COLORBLUE','蓝色'],
|
|
18712
|
+
['COLORGREEN','绿色'],
|
|
18713
|
+
['COLORCYAN','青色'],
|
|
18714
|
+
['COLORRED','红色'],
|
|
18715
|
+
['COLORMAGENTA','洋红色'],
|
|
18716
|
+
['COLORBROWN','棕色'],
|
|
18717
|
+
['COLORLIGRAY','淡灰色'],
|
|
18718
|
+
['COLORGRAY','深灰色'],
|
|
18719
|
+
['COLORLIBLUE','淡蓝色'],
|
|
18720
|
+
['COLORLIGREEN','淡绿色'],
|
|
18721
|
+
['COLORLICYAN','淡青色'],
|
|
18722
|
+
['COLORLIRED','淡红色'],
|
|
18723
|
+
['COLORLIMAGENTA','淡洋红色'],
|
|
18724
|
+
['COLORWHITE','白色'],
|
|
18725
|
+
['COLORYELLOW','黄色']
|
|
18595
18726
|
]);
|
|
18596
18727
|
|
|
18597
18728
|
if (option)
|
|
@@ -19293,6 +19424,12 @@ function JSExplainer(ast,option)
|
|
|
19293
19424
|
case "BUYSHORT":
|
|
19294
19425
|
return "买入平仓";
|
|
19295
19426
|
|
|
19427
|
+
case "DRAWLASTBARNUMBER":
|
|
19428
|
+
return "在最后一根k线输出数值";
|
|
19429
|
+
case "DRAWLASTBARTEXT":
|
|
19430
|
+
return "在最后一根k线显示文字";
|
|
19431
|
+
case "DRAWLASTBARICON":
|
|
19432
|
+
return "在最后一根k线绘制图标";
|
|
19296
19433
|
case "YMOVE":
|
|
19297
19434
|
return;
|
|
19298
19435
|
case "BACKGROUND":
|
|
@@ -21464,6 +21601,49 @@ function ScriptIndex(name,script,args,option)
|
|
|
21464
21601
|
hqChart.ChartPaint.push(chart);
|
|
21465
21602
|
}
|
|
21466
21603
|
|
|
21604
|
+
this.CreateDrawLastBarText=function(hqChart,windowIndex,varItem,id)
|
|
21605
|
+
{
|
|
21606
|
+
var chart=new ChartDrawLastBarText();
|
|
21607
|
+
chart.Canvas=hqChart.Canvas;
|
|
21608
|
+
chart.Name=varItem.Name;
|
|
21609
|
+
chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
|
|
21610
|
+
chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
|
|
21611
|
+
|
|
21612
|
+
if (hqChart.ChartPaint[0].IsMinuteFrame())
|
|
21613
|
+
chart.Data=hqChart.SourceData;
|
|
21614
|
+
else
|
|
21615
|
+
chart.Data=hqChart.ChartPaint[0].Data;//绑定K线
|
|
21616
|
+
|
|
21617
|
+
var lastItem=varItem.Draw.DrawData;
|
|
21618
|
+
if (lastItem)
|
|
21619
|
+
{
|
|
21620
|
+
if (lastItem.Color) lastItem.Color=this.GetColor(lastItem.Color);
|
|
21621
|
+
else lastItem.Color=this.GetDefaultColor(id);
|
|
21622
|
+
if (varItem.Color) lastItem.Color=this.GetColor(varItem.Color);
|
|
21623
|
+
|
|
21624
|
+
if (varItem.DrawVAlign>=0)
|
|
21625
|
+
{
|
|
21626
|
+
if (varItem.DrawVAlign==0) lastItem.TextBaseline='top';
|
|
21627
|
+
else if (varItem.DrawVAlign==1) lastItem.TextBaseline='middle';
|
|
21628
|
+
else if (varItem.DrawVAlign==2) lastItem.TextBaseline='bottom';
|
|
21629
|
+
}
|
|
21630
|
+
|
|
21631
|
+
if (varItem.DrawAlign>=0)
|
|
21632
|
+
{
|
|
21633
|
+
if (varItem.DrawAlign==0) lastItem.TextAlign="left";
|
|
21634
|
+
else if (varItem.DrawAlign==1) lastItem.TextAlign="center";
|
|
21635
|
+
else if (varItem.DrawAlign==2) lastItem.TextAlign='right';
|
|
21636
|
+
}
|
|
21637
|
+
|
|
21638
|
+
if (IFrameSplitOperator.IsNumber(varItem.YOffset)) lastItem.YOffset=varItem.YOffset;
|
|
21639
|
+
if (IFrameSplitOperator.IsNumber(varItem.XOffset)) lastItem.XOffset=varItem.XOffset;
|
|
21640
|
+
if (varItem.DrawFontSize>0) lastItem.FontSize=varItem.DrawFontSize;
|
|
21641
|
+
}
|
|
21642
|
+
|
|
21643
|
+
chart.LastBarItem=lastItem;
|
|
21644
|
+
hqChart.ChartPaint.push(chart);
|
|
21645
|
+
}
|
|
21646
|
+
|
|
21467
21647
|
//创建通道
|
|
21468
21648
|
this.CreateChannel=function(hqChart,windowIndex,varItem,id)
|
|
21469
21649
|
{
|
|
@@ -22060,6 +22240,12 @@ function ScriptIndex(name,script,args,option)
|
|
|
22060
22240
|
this.CreateTradeIcon(hqChart,windowIndex,item,i);
|
|
22061
22241
|
break;
|
|
22062
22242
|
|
|
22243
|
+
case "DRAWLASTBARICON":
|
|
22244
|
+
case "DRAWLASTBARNUMBER":
|
|
22245
|
+
case "DRAWLASTBARTEXT":
|
|
22246
|
+
this.CreateDrawLastBarText(hqChart,windowIndex,item,i);
|
|
22247
|
+
break;
|
|
22248
|
+
|
|
22063
22249
|
case SCRIPT_CHART_NAME.OVERLAY_BARS:
|
|
22064
22250
|
this.CreateStackedBar(hqChart,windowIndex,item,i);
|
|
22065
22251
|
break;
|
package/src/jscommon/umychart.js
CHANGED
|
@@ -8890,6 +8890,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
8890
8890
|
if (IFrameSplitOperator.IsBool(option.IsShowXLine)) subFrame.Frame.IsShowXLine=option.IsShowXLine;
|
|
8891
8891
|
if (IFrameSplitOperator.IsBool(option.IsShowYLine)) subFrame.Frame.IsShowYLine=option.IsShowYLine;
|
|
8892
8892
|
if (IFrameSplitOperator.IsBool(option.IsShowIndexTitle)) subFrame.Frame.IsShowIndexTitle=option.IsShowIndexTitle;
|
|
8893
|
+
if (IFrameSplitOperator.IsNumber(option.Height)) subFrame.Height=option.Height; //高度
|
|
8893
8894
|
|
|
8894
8895
|
|
|
8895
8896
|
if (IFrameSplitOperator.IsBool(option.IsShowLeftText))
|
|
@@ -35416,6 +35417,136 @@ function ChartDrawNumber()
|
|
|
35416
35417
|
}
|
|
35417
35418
|
}
|
|
35418
35419
|
|
|
35420
|
+
function ChartDrawLastBarText()
|
|
35421
|
+
{
|
|
35422
|
+
this.newMethod=IChartPainting; //派生
|
|
35423
|
+
this.newMethod();
|
|
35424
|
+
delete this.newMethod;
|
|
35425
|
+
|
|
35426
|
+
this.ClassName='ChartDrawLastBarText'; //类名
|
|
35427
|
+
this.LastBarItem=null;
|
|
35428
|
+
|
|
35429
|
+
this.TextSize=
|
|
35430
|
+
{
|
|
35431
|
+
Max: g_JSChartResource.DRAWICON.Text.MaxSize, Min:g_JSChartResource.DRAWICON.Text.MinSize, //字体的最大最小值
|
|
35432
|
+
Zoom:{ Type:g_JSChartResource.DRAWICON.Text.Zoom.Type , Value:g_JSChartResource.DRAWICON.Text.Zoom.Value }, //放大倍数
|
|
35433
|
+
FontName:g_JSChartResource.DRAWICON.Text.FontName,
|
|
35434
|
+
YOffset:g_JSChartResource.DRAWICON.Text.YOffset
|
|
35435
|
+
}
|
|
35436
|
+
|
|
35437
|
+
this.IconSize=
|
|
35438
|
+
{
|
|
35439
|
+
Max: g_JSChartResource.DRAWICON.Icon.MaxSize, Min:g_JSChartResource.DRAWICON.Icon.MinSize, //图标的最大最小值
|
|
35440
|
+
Zoom:{ Type:g_JSChartResource.DRAWICON.Icon.Zoom.Type , Value:g_JSChartResource.DRAWICON.Icon.Zoom.Value }, //放大倍数
|
|
35441
|
+
YOffset:g_JSChartResource.DRAWICON.Icon.YOffset //Direction==2的向下偏移
|
|
35442
|
+
};
|
|
35443
|
+
|
|
35444
|
+
this.IconFamily=g_JSChartResource.DRAWLASTICON.Family;
|
|
35445
|
+
|
|
35446
|
+
this.ReloadResource=function(resource)
|
|
35447
|
+
{
|
|
35448
|
+
this.TextSize=
|
|
35449
|
+
{
|
|
35450
|
+
Max: g_JSChartResource.DRAWTEXT.MaxSize, Min:g_JSChartResource.DRAWTEXT.MinSize, //字体的最大最小值
|
|
35451
|
+
Zoom:{ Type:g_JSChartResource.DRAWTEXT.Zoom.Type , Value:g_JSChartResource.DRAWTEXT.Zoom.Value }, //放大倍数
|
|
35452
|
+
FontName:g_JSChartResource.DRAWTEXT.FontName,
|
|
35453
|
+
};
|
|
35454
|
+
|
|
35455
|
+
this.IconSize=
|
|
35456
|
+
{
|
|
35457
|
+
Max: g_JSChartResource.DRAWICON.Icon.MaxSize, Min:g_JSChartResource.DRAWICON.Icon.MinSize, //图标的最大最小值
|
|
35458
|
+
Zoom:{ Type:g_JSChartResource.DRAWICON.Icon.Zoom.Type , Value:g_JSChartResource.DRAWICON.Icon.Zoom.Value }, //放大倍数
|
|
35459
|
+
};
|
|
35460
|
+
|
|
35461
|
+
this.IconFamily=g_JSChartResource.DRAWLASTICON.Family;
|
|
35462
|
+
}
|
|
35463
|
+
|
|
35464
|
+
this.Draw=function()
|
|
35465
|
+
{
|
|
35466
|
+
if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
|
|
35467
|
+
if (this.IsShowIndexTitleOnly()) return;
|
|
35468
|
+
if (this.IsHideScriptIndex()) return;
|
|
35469
|
+
if (!this.LastBarItem) return;
|
|
35470
|
+
if (!this.Data || !IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return;
|
|
35471
|
+
|
|
35472
|
+
this.IsHScreen=(this.ChartFrame.IsHScreen===true);
|
|
35473
|
+
var xPointCount=this.ChartFrame.XPointCount;
|
|
35474
|
+
var offset=this.Data.DataOffset;
|
|
35475
|
+
var index=offset+xPointCount;
|
|
35476
|
+
if (index<this.Data.Data.length) return;
|
|
35477
|
+
var lastIndex=(this.Data.Data.length-1)-offset;
|
|
35478
|
+
var x=this.ChartFrame.GetXFromIndex(lastIndex);
|
|
35479
|
+
var item=this.LastBarItem;
|
|
35480
|
+
|
|
35481
|
+
if (item.Value=="Top") y=top;
|
|
35482
|
+
else if (item.Value=="Bottom") y=bottom;
|
|
35483
|
+
else y=this.ChartFrame.GetYFromData(item.Value, false);
|
|
35484
|
+
if (IFrameSplitOperator.IsNumber(item.YOffset)) y+=item.YOffset; //Y轴偏移
|
|
35485
|
+
if (IFrameSplitOperator.IsNumber(item.XOffset)) x+=item.XOffset;
|
|
35486
|
+
|
|
35487
|
+
this.Canvas.save();
|
|
35488
|
+
this.ClipClient(this.IsHScreen);
|
|
35489
|
+
|
|
35490
|
+
//文本
|
|
35491
|
+
if (item.Text) this.DrawLastText(item, x, y);
|
|
35492
|
+
else if (item.Icon) this.DrawLastIcon(item, x, y);
|
|
35493
|
+
|
|
35494
|
+
this.Canvas.restore();
|
|
35495
|
+
}
|
|
35496
|
+
|
|
35497
|
+
this.DrawLastText=function(item,x,y)
|
|
35498
|
+
{
|
|
35499
|
+
var dataWidth=this.ChartFrame.DataWidth;
|
|
35500
|
+
var distanceWidth=this.ChartFrame.DistanceWidth;
|
|
35501
|
+
var font=this.GetDynamicFont(dataWidth,distanceWidth,this.TextSize.Max,this.TextSize.Min,this.TextSize.Zoom,this.TextSize.FontName);
|
|
35502
|
+
|
|
35503
|
+
var textBaseline='bottom';
|
|
35504
|
+
if (item.TextBaseline) textBaseline=item.TextBaseline;
|
|
35505
|
+
var textAlign="center";
|
|
35506
|
+
if (item.TextAlign) textAlign=item.TextAlign;
|
|
35507
|
+
|
|
35508
|
+
this.Canvas.font=font;
|
|
35509
|
+
this.Canvas.textBaseline=textBaseline;
|
|
35510
|
+
this.Canvas.textAlign=textAlign;
|
|
35511
|
+
this.Canvas.fillStyle = item.Color;
|
|
35512
|
+
this.Canvas.fillText(item.Text, x, y);
|
|
35513
|
+
}
|
|
35514
|
+
|
|
35515
|
+
this.DrawLastIcon=function(item,x,y)
|
|
35516
|
+
{
|
|
35517
|
+
var dataWidth=this.ChartFrame.DataWidth;
|
|
35518
|
+
var distanceWidth=this.ChartFrame.DistanceWidth;
|
|
35519
|
+
var iconSize=this.GetDynamicIconSize(dataWidth,distanceWidth,this.IconSize.Max,this.IconSize.Min,this.IconSize.Zoom);
|
|
35520
|
+
var font=`${iconSize}px ${this.IconFamily}`;
|
|
35521
|
+
|
|
35522
|
+
var textBaseline='bottom';
|
|
35523
|
+
if (item.TextBaseline) textBaseline=item.TextBaseline;
|
|
35524
|
+
var textAlign="center";
|
|
35525
|
+
if (item.TextAlign) textAlign=item.TextAlign;
|
|
35526
|
+
|
|
35527
|
+
this.Canvas.font=font;
|
|
35528
|
+
this.Canvas.textBaseline=textBaseline;
|
|
35529
|
+
this.Canvas.textAlign=textAlign;
|
|
35530
|
+
this.Canvas.fillStyle = item.Color;
|
|
35531
|
+
this.Canvas.fillText(item.Icon.Symbol, x, y);
|
|
35532
|
+
}
|
|
35533
|
+
|
|
35534
|
+
this.GetMaxMin=function()
|
|
35535
|
+
{
|
|
35536
|
+
var range={ Min:null, Max:null };
|
|
35537
|
+
if (!this.Data || !IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return range;
|
|
35538
|
+
var xPointCount=this.ChartFrame.XPointCount;
|
|
35539
|
+
var offset=this.Data.DataOffset;
|
|
35540
|
+
var index=offset+xPointCount;
|
|
35541
|
+
if (index<this.Data.Data.length) return range;
|
|
35542
|
+
if (!this.LastBarItem) return range;
|
|
35543
|
+
|
|
35544
|
+
if (IFrameSplitOperator.IsNumber(this.LastBarItem.Value)) range.Max=range.Min=this.LastBarItem.Value;
|
|
35545
|
+
|
|
35546
|
+
return range;
|
|
35547
|
+
}
|
|
35548
|
+
}
|
|
35549
|
+
|
|
35419
35550
|
//直线 水平直线 只有1个数据
|
|
35420
35551
|
function ChartStraightLine()
|
|
35421
35552
|
{
|
|
@@ -69645,6 +69776,11 @@ function JSChartResource()
|
|
|
69645
69776
|
Color:"rgb(255,165,0)"
|
|
69646
69777
|
}
|
|
69647
69778
|
|
|
69779
|
+
this.DRAWLASTICON=
|
|
69780
|
+
{
|
|
69781
|
+
Family:'iconfont',
|
|
69782
|
+
}
|
|
69783
|
+
|
|
69648
69784
|
this.POINTDOT=
|
|
69649
69785
|
{
|
|
69650
69786
|
Radius:2*GetDevicePixelRatio()
|
|
@@ -73246,6 +73382,9 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
73246
73382
|
this.Canvas.rect(this.Frame.ChartBorder.GetLeft(),this.Frame.ChartBorder.GetTop(),this.Frame.ChartBorder.GetWidth(),this.Frame.ChartBorder.GetHeight());
|
|
73247
73383
|
isInClient=this.Canvas.isPointInPath(x,y);
|
|
73248
73384
|
|
|
73385
|
+
//PC触摸板双指缩放时deltaY数值在[-20,20]之间
|
|
73386
|
+
if (IFrameSplitOperator.IsNumber(e.deltaY) && Math.abs(e.deltaY)<90) return;
|
|
73387
|
+
|
|
73249
73388
|
var wheelValue=e.wheelDelta;
|
|
73250
73389
|
if (!IFrameSplitOperator.IsObjectExist(e.wheelDelta))
|
|
73251
73390
|
wheelValue=e.deltaY* -0.01;
|