hqchart 1.1.13364 → 1.1.13375
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 +39 -48
- package/package.json +1 -1
- package/src/jscommon/umychart.DialogDrawTool.js +29 -5
- package/src/jscommon/umychart.js +363 -65
- package/src/jscommon/umychart.resource/css/tools.css +21 -0
- package/src/jscommon/umychart.resource/font/drawtool/demo_index.html +26 -3
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.css +7 -3
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.js +1 -1
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.json +7 -0
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.ttf +0 -0
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.woff +0 -0
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.woff2 +0 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +364 -66
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +393 -71
|
@@ -15731,6 +15731,8 @@ function AverageWidthFrame()
|
|
|
15731
15731
|
|
|
15732
15732
|
this.Canvas.font=this.DrawPicture.Font;
|
|
15733
15733
|
var fontHeight=this.GetFontHeight();
|
|
15734
|
+
this.Canvas.textAlign="left";
|
|
15735
|
+
this.Canvas.textBaseline = "bottom";
|
|
15734
15736
|
|
|
15735
15737
|
if (range.X)
|
|
15736
15738
|
{
|
|
@@ -19143,6 +19145,7 @@ function KLineFrame()
|
|
|
19143
19145
|
if (this.BeforeDrawXYCallback) this.BeforeDrawXYCallback(this);
|
|
19144
19146
|
|
|
19145
19147
|
this.DrawTitleBG();
|
|
19148
|
+
this.DrawCustomHorizontalArea(); //Y轴背景区域 在刻度前面绘制
|
|
19146
19149
|
this.DrawHorizontal();
|
|
19147
19150
|
this.DrawVertical();
|
|
19148
19151
|
}
|
|
@@ -19935,13 +19938,24 @@ function KLineFrame()
|
|
|
19935
19938
|
case 4: //叠加K线涨幅刻度
|
|
19936
19939
|
this.DrawCustomItem(item, mapTextRect);
|
|
19937
19940
|
break;
|
|
19938
|
-
case 5:
|
|
19939
|
-
this.DrawCustomAreaItem(item);
|
|
19940
|
-
break;
|
|
19941
19941
|
}
|
|
19942
19942
|
}
|
|
19943
19943
|
}
|
|
19944
19944
|
|
|
19945
|
+
//Y轴面积背景
|
|
19946
|
+
this.DrawCustomHorizontalArea=function()
|
|
19947
|
+
{
|
|
19948
|
+
if (this.IsMinSize) return;
|
|
19949
|
+
if (this.ChartBorder.IsShowTitleOnly) return;
|
|
19950
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.CustomHorizontalInfo)) return;
|
|
19951
|
+
|
|
19952
|
+
for(var i=0;i<this.CustomHorizontalInfo.length;++i)
|
|
19953
|
+
{
|
|
19954
|
+
var item=this.CustomHorizontalInfo[i];
|
|
19955
|
+
if (item.Type==5) this.DrawCustomAreaItem(item);
|
|
19956
|
+
}
|
|
19957
|
+
}
|
|
19958
|
+
|
|
19945
19959
|
this.DrawCustomVerticalItem=function(item)
|
|
19946
19960
|
{
|
|
19947
19961
|
this.Canvas.save();
|
|
@@ -22568,7 +22582,14 @@ function HQTradeFrame()
|
|
|
22568
22582
|
if (!drawPicture.GetXYCoordinate) return false;
|
|
22569
22583
|
|
|
22570
22584
|
var range=drawPicture.GetXYCoordinate();
|
|
22571
|
-
|
|
22585
|
+
if (range && range.IsShowYCoordinate===false) //隐藏Y轴刻度信息
|
|
22586
|
+
{
|
|
22587
|
+
|
|
22588
|
+
}
|
|
22589
|
+
else
|
|
22590
|
+
{
|
|
22591
|
+
drawPicture.Frame.DrawPictureYCoordinate(drawPicture, range, option);
|
|
22592
|
+
}
|
|
22572
22593
|
|
|
22573
22594
|
for(var i=0;i<this.SubFrame.length;++i)
|
|
22574
22595
|
{
|
|
@@ -59643,6 +59664,7 @@ IChartDrawPicture.ArrayDrawPricture=
|
|
|
59643
59664
|
{ Name:"射线", ClassName:'ChartDrawPictureHaflLine', Create:function() { return new ChartDrawPictureHaflLine(); } },
|
|
59644
59665
|
{ Name:"箭头", ClassName:"ChartDrawArrowLine", Create:function() { return new ChartDrawArrowLine(); } },
|
|
59645
59666
|
{ Name:"水平线", ClassName:'ChartDrawPictureHorizontalLine', Create:function() { return new ChartDrawPictureHorizontalLine(); }},
|
|
59667
|
+
{ Name:"水平射线", ClassName:"ChartDrawPictureHorizontalRay", Create:function() { return new ChartDrawPictureHorizontalRay(); }},
|
|
59646
59668
|
{ Name:"趋势线", ClassName:'ChartDrawPictureTrendLine', Create:function() { return new ChartDrawPictureTrendLine(); }},
|
|
59647
59669
|
{ Name:"矩形", ClassName:'ChartDrawPictureRect', Create:function() { return new ChartDrawPictureRect(); }},
|
|
59648
59670
|
{ Name:"圆弧线", ClassName:'ChartDrawPictureArc', Create:function() { return new ChartDrawPictureArc(); }},
|
|
@@ -60319,17 +60341,67 @@ function ChartDrawPictureHorizontalLine()
|
|
|
60319
60341
|
this.newMethod();
|
|
60320
60342
|
delete this.newMethod;
|
|
60321
60343
|
|
|
60344
|
+
this.ClassName='ChartDrawPictureHorizontalLine';
|
|
60345
|
+
this.PointCount=1;
|
|
60346
|
+
this.IsPointIn=this.IsPointIn_XYValue_Line;
|
|
60347
|
+
this.IsDrawFirst=true;
|
|
60348
|
+
this.LineWidth=1;
|
|
60322
60349
|
this.Super_SetOption=this.SetOption; //父类函数
|
|
60323
60350
|
this.Super_ExportStorageData=this.ExportStorageData;
|
|
60324
60351
|
|
|
60325
|
-
this.
|
|
60352
|
+
this.LabelConfig=
|
|
60353
|
+
{
|
|
60354
|
+
Left:{ IsShow:true, Margin:{ Left:5, Top:4, Bottom:2, Right:5 } },
|
|
60355
|
+
Right:{ IsShow:true, Margin:{ Left:5, Top:4, Bottom:2, Right:5 } },
|
|
60356
|
+
Font:`${12*GetDevicePixelRatio()}px 微软雅黑`, TextColor:"rgb(255,255,255)"
|
|
60357
|
+
};
|
|
60358
|
+
|
|
60359
|
+
this.InsideLabelConfig=
|
|
60360
|
+
{
|
|
60361
|
+
Position:0, //0=左, 1=右
|
|
60362
|
+
Font:`${14*GetDevicePixelRatio()}px 微软雅黑`,
|
|
60363
|
+
Margin:{ Left:5, Top:4, Bottom:2, Right:5 },
|
|
60364
|
+
TextColor:"rgb(255,255,255)",
|
|
60365
|
+
BGAlpha:0.8, //背景色透明度
|
|
60366
|
+
}
|
|
60367
|
+
|
|
60368
|
+
this.LabelTitle;
|
|
60326
60369
|
|
|
60327
60370
|
this.SetOption=function(option)
|
|
60328
60371
|
{
|
|
60329
60372
|
if (this.Super_SetOption) this.Super_SetOption(option);
|
|
60330
60373
|
if (option)
|
|
60331
60374
|
{
|
|
60332
|
-
if (option.
|
|
60375
|
+
if (option.LabelTitle) this.LabelTitle=option.LabelTitle;
|
|
60376
|
+
|
|
60377
|
+
if (option.Label)
|
|
60378
|
+
{
|
|
60379
|
+
var item=option.Label;
|
|
60380
|
+
if (item.Left)
|
|
60381
|
+
{
|
|
60382
|
+
var subItem=item.Left;
|
|
60383
|
+
if (IFrameSplitOperator.IsBool(subItem.IsShow)) this.LabelConfig.Left.IsShow=subItem.IsShow;
|
|
60384
|
+
}
|
|
60385
|
+
|
|
60386
|
+
|
|
60387
|
+
if (item.Right)
|
|
60388
|
+
{
|
|
60389
|
+
var subItem=item.Right;
|
|
60390
|
+
if (IFrameSplitOperator.IsBool(subItem.IsShow)) this.LabelConfig.Right.IsShow=subItem.IsShow;
|
|
60391
|
+
}
|
|
60392
|
+
|
|
60393
|
+
if (item.Font) this.LabelConfig.Font=item.Font;
|
|
60394
|
+
if (item.TextColor) this.LabelConfig.FoTextColornt=item.TextColor;
|
|
60395
|
+
}
|
|
60396
|
+
|
|
60397
|
+
if (option.InsideLabel)
|
|
60398
|
+
{
|
|
60399
|
+
var item=option.InsideLabel;
|
|
60400
|
+
if (item.Font) this.InsideLabelConfig.Font=item.Font;
|
|
60401
|
+
if (item.TextColor) this.InsideLabelConfig.TextColor=item.TextColor;
|
|
60402
|
+
if (IFrameSplitOperator.IsNumber(item.Position)) this.InsideLabelConfig.Position=item.Position;
|
|
60403
|
+
if (IFrameSplitOperator.IsNumber(item.BGAlpha)) this.InsideLabelConfig.BGAlpha=item.BGAlpha;
|
|
60404
|
+
}
|
|
60333
60405
|
}
|
|
60334
60406
|
}
|
|
60335
60407
|
|
|
@@ -60339,17 +60411,13 @@ function ChartDrawPictureHorizontalLine()
|
|
|
60339
60411
|
if (this.Super_ExportStorageData)
|
|
60340
60412
|
{
|
|
60341
60413
|
storageData=this.Super_ExportStorageData();
|
|
60342
|
-
if (this.
|
|
60414
|
+
if (this.LabelTitle) storageData.LabelTitle=this.LabelTitle;
|
|
60343
60415
|
}
|
|
60344
60416
|
|
|
60345
60417
|
return storageData;
|
|
60346
60418
|
}
|
|
60347
60419
|
|
|
60348
|
-
|
|
60349
|
-
this.ClassName='ChartDrawPictureHorizontalLine';
|
|
60350
|
-
this.IsPointIn=this.IsPointIn_XYValue_Line;
|
|
60351
|
-
this.Font=16*GetDevicePixelRatio() +"px 微软雅黑";
|
|
60352
|
-
|
|
60420
|
+
/*
|
|
60353
60421
|
this.GetXYCoordinate=function()
|
|
60354
60422
|
{
|
|
60355
60423
|
if (this.IsFrameMinSize()) return null;
|
|
@@ -60357,6 +60425,7 @@ function ChartDrawPictureHorizontalLine()
|
|
|
60357
60425
|
|
|
60358
60426
|
return this.PointRange(drawPoint);
|
|
60359
60427
|
}
|
|
60428
|
+
*/
|
|
60360
60429
|
|
|
60361
60430
|
this.Draw=function()
|
|
60362
60431
|
{
|
|
@@ -60390,8 +60459,9 @@ function ChartDrawPictureHorizontalLine()
|
|
|
60390
60459
|
}
|
|
60391
60460
|
else
|
|
60392
60461
|
{
|
|
60393
|
-
this.
|
|
60394
|
-
this.Canvas.
|
|
60462
|
+
var yFixed=ToFixedPoint2(this.LineWidth,drawPoint[0].Y);
|
|
60463
|
+
this.Canvas.moveTo(left,yFixed);
|
|
60464
|
+
this.Canvas.lineTo(right,yFixed);
|
|
60395
60465
|
}
|
|
60396
60466
|
this.Canvas.stroke();
|
|
60397
60467
|
this.RestoreLineWidth();
|
|
@@ -60417,89 +60487,317 @@ function ChartDrawPictureHorizontalLine()
|
|
|
60417
60487
|
this.DrawPoint(drawPoint);
|
|
60418
60488
|
|
|
60419
60489
|
//显示价格
|
|
60420
|
-
this.
|
|
60421
|
-
|
|
60422
|
-
this.Canvas.
|
|
60423
|
-
|
|
60424
|
-
|
|
60490
|
+
this.DrawInsideLabel(drawPoint[0])
|
|
60491
|
+
|
|
60492
|
+
this.Canvas.restore();
|
|
60493
|
+
|
|
60494
|
+
this.DrawValueLabel(drawPoint[0]);
|
|
60495
|
+
}
|
|
60496
|
+
|
|
60497
|
+
this.DrawValueLabel=function(point)
|
|
60498
|
+
{
|
|
60499
|
+
if (!point) return;
|
|
60500
|
+
if (this.Frame.IsHScreen) return; //不支持横屏
|
|
60501
|
+
|
|
60502
|
+
var y=point.Y;
|
|
60503
|
+
var yValue=this.Frame.GetYData(y);
|
|
60504
|
+
var text=yValue.toFixed(2);
|
|
60505
|
+
|
|
60506
|
+
var border=this.Frame.GetBorder();
|
|
60507
|
+
var config=this.LabelConfig;
|
|
60508
|
+
|
|
60509
|
+
this.Canvas.font=config.Font;
|
|
60510
|
+
var textHeight=this.Canvas.measureText("擎").width;
|
|
60511
|
+
var textWidth=this.Canvas.measureText(text).width;
|
|
60512
|
+
|
|
60513
|
+
if (config.Left.IsShow && this.Frame.ChartBorder.Left>5)
|
|
60425
60514
|
{
|
|
60515
|
+
var margin=config.Left.Margin;
|
|
60516
|
+
var rtBG={ Right:border.Left-1, Height:textHeight+margin.Top+margin.Bottom, Width:textWidth+margin.Left+margin.Right };
|
|
60517
|
+
rtBG.Top=y-textHeight/2-margin.Top;
|
|
60518
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
60519
|
+
rtBG.Left=rtBG.Right-rtBG.Width;
|
|
60520
|
+
|
|
60521
|
+
this.Canvas.fillStyle=this.LineColor;
|
|
60522
|
+
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
60523
|
+
|
|
60426
60524
|
this.Canvas.textAlign="left";
|
|
60427
|
-
this.Canvas.textBaseline="
|
|
60428
|
-
var xText=
|
|
60429
|
-
var yText=
|
|
60430
|
-
this.Canvas.
|
|
60431
|
-
this.Canvas.
|
|
60432
|
-
var yValue=this.Frame.GetYData(drawPoint[0].X);
|
|
60433
|
-
var text=yValue.toFixed(2);
|
|
60434
|
-
if (this.Label)
|
|
60435
|
-
{
|
|
60436
|
-
if (this.Label.Position==0) text=this.Label.Text+yValue.toFixed(2);
|
|
60437
|
-
else if (this.Label.Position==1) text=yValue.toFixed(2)+this.Label.Text;
|
|
60438
|
-
}
|
|
60439
|
-
this.Canvas.fillText(text,0,0);
|
|
60525
|
+
this.Canvas.textBaseline = "top";
|
|
60526
|
+
var xText=rtBG.Left+margin.Left;
|
|
60527
|
+
var yText=rtBG.Top+margin.Top;
|
|
60528
|
+
this.Canvas.fillStyle=config.TextColor;
|
|
60529
|
+
this.Canvas.fillText(text,xText,yText);
|
|
60440
60530
|
}
|
|
60441
|
-
|
|
60531
|
+
|
|
60532
|
+
if (config.Right.IsShow && this.Frame.ChartBorder.Right>5)
|
|
60442
60533
|
{
|
|
60534
|
+
var margin=config.Right.Margin;
|
|
60535
|
+
var rtBG={ Left:border.Right+1, Height:textHeight+margin.Top+margin.Bottom, Width:textWidth+margin.Left+margin.Right };
|
|
60536
|
+
rtBG.Top=y-textHeight/2-margin.Top;
|
|
60537
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
60538
|
+
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
60539
|
+
this.Canvas.fillStyle=this.LineColor;
|
|
60540
|
+
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
60541
|
+
|
|
60443
60542
|
this.Canvas.textAlign="left";
|
|
60444
|
-
this.Canvas.textBaseline="
|
|
60445
|
-
var
|
|
60446
|
-
var
|
|
60447
|
-
|
|
60448
|
-
|
|
60449
|
-
if (this.Label.Position==0) text=this.Label.Text+yValue.toFixed(2);
|
|
60450
|
-
else if (this.Label.Position==1) text=yValue.toFixed(2)+this.Label.Text;
|
|
60451
|
-
}
|
|
60452
|
-
this.Canvas.fillText(text,left,drawPoint[0].Y);
|
|
60543
|
+
this.Canvas.textBaseline = "top";
|
|
60544
|
+
var xText=rtBG.Left+margin.Left;
|
|
60545
|
+
var yText=rtBG.Top+margin.Top;
|
|
60546
|
+
this.Canvas.fillStyle=config.TextColor;
|
|
60547
|
+
this.Canvas.fillText(text,xText,yText);
|
|
60453
60548
|
}
|
|
60454
|
-
*/
|
|
60455
|
-
|
|
60456
|
-
this.Canvas.restore();
|
|
60457
60549
|
}
|
|
60458
60550
|
|
|
60459
|
-
this.
|
|
60551
|
+
this.DrawInsideLabel=function(point)
|
|
60460
60552
|
{
|
|
60461
60553
|
if (!point) return;
|
|
60462
60554
|
|
|
60463
60555
|
var isHScreen=this.Frame.IsHScreen;
|
|
60464
|
-
var
|
|
60556
|
+
var config=this.InsideLabelConfig;
|
|
60557
|
+
if (config.Position!=0 && config.Position!=1) return;
|
|
60558
|
+
var margin=config.Margin;
|
|
60465
60559
|
|
|
60466
60560
|
this.Canvas.fillStyle=this.LineColor;
|
|
60467
|
-
this.Canvas.font=
|
|
60561
|
+
this.Canvas.font=config.Font;
|
|
60562
|
+
var textHeight=this.Canvas.measureText("擎").width;
|
|
60563
|
+
var border=this.Frame.GetBorder();
|
|
60468
60564
|
|
|
60469
60565
|
if (isHScreen)
|
|
60470
60566
|
{
|
|
60471
|
-
left=this.Frame.ChartBorder.GetTop();
|
|
60472
|
-
this.Canvas.textAlign="left";
|
|
60473
|
-
this.Canvas.textBaseline="bottom";
|
|
60474
|
-
var xText=point.X;
|
|
60475
|
-
var yText=left;
|
|
60476
|
-
this.Canvas.translate(xText, yText);
|
|
60477
|
-
this.Canvas.rotate(90 * Math.PI / 180); //数据和框子旋转180度
|
|
60478
60567
|
var yValue=this.Frame.GetYData(point.X);
|
|
60479
60568
|
var text=yValue.toFixed(2);
|
|
60480
|
-
if (this.
|
|
60569
|
+
if (this.LabelTitle) text=this.LabelTitle+text;
|
|
60570
|
+
var textWidth=this.Canvas.measureText(text).width;
|
|
60571
|
+
|
|
60572
|
+
var rtBG=null;
|
|
60573
|
+
if (config.Position==0) //左
|
|
60574
|
+
{
|
|
60575
|
+
var rtBG={ Top:border.Top+1, Width:textHeight+margin.Top+margin.Bottom, Height:textWidth+margin.Left+margin.Right, Left:point.X };
|
|
60576
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
60577
|
+
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
60578
|
+
}
|
|
60579
|
+
else if (config.Position==1) //右
|
|
60481
60580
|
{
|
|
60482
|
-
|
|
60483
|
-
|
|
60581
|
+
var rtBG={ Bottom:border.Bottom-1, Width:textHeight+margin.Top+margin.Bottom, Height:textWidth+margin.Left+margin.Right, Left:point.X };
|
|
60582
|
+
rtBG.Top=rtBG.Bottom-rtBG.Height;
|
|
60583
|
+
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
60484
60584
|
}
|
|
60485
|
-
|
|
60585
|
+
|
|
60586
|
+
var bgColor=this.LineColor;
|
|
60587
|
+
if (config.BGAlpha<1) bgColor=IChartDrawPicture.ColorToRGBA(this.LineColor, config.BGAlpha);
|
|
60588
|
+
this.Canvas.fillStyle=bgColor;
|
|
60589
|
+
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
60590
|
+
|
|
60591
|
+
var xText=rtBG.Right-margin.Top;
|
|
60592
|
+
var yText=rtBG.Top+margin.Left;
|
|
60593
|
+
this.Canvas.translate(xText, yText);
|
|
60594
|
+
this.Canvas.rotate(90 * Math.PI / 180); //数据和框子旋转180度
|
|
60595
|
+
|
|
60596
|
+
this.Canvas.textAlign="left";
|
|
60597
|
+
this.Canvas.textBaseline="top";
|
|
60598
|
+
this.Canvas.fillStyle=config.TextColor;
|
|
60599
|
+
this.Canvas.fillText(text,0,0);
|
|
60486
60600
|
}
|
|
60487
60601
|
else
|
|
60488
60602
|
{
|
|
60489
|
-
this.Canvas.textAlign="left";
|
|
60490
|
-
this.Canvas.textBaseline="bottom";
|
|
60491
60603
|
var yValue=this.Frame.GetYData(point.Y);
|
|
60492
60604
|
var text=yValue.toFixed(2);
|
|
60493
|
-
if (this.
|
|
60605
|
+
if (this.LabelTitle) text=this.LabelTitle+text;
|
|
60606
|
+
var textWidth=this.Canvas.measureText(text).width;
|
|
60607
|
+
|
|
60608
|
+
var rtBG=null;
|
|
60609
|
+
if (config.Position==0) //左
|
|
60494
60610
|
{
|
|
60495
|
-
|
|
60496
|
-
|
|
60611
|
+
var rtBG={ Left:border.Left+1, Height:textHeight+margin.Top+margin.Bottom, Width:textWidth+margin.Left+margin.Right, Bottom:point.Y };
|
|
60612
|
+
rtBG.Top=rtBG.Bottom-rtBG.Height;
|
|
60613
|
+
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
60497
60614
|
}
|
|
60498
|
-
|
|
60615
|
+
else if (config.Position==1) //右
|
|
60616
|
+
{
|
|
60617
|
+
var rtBG={ Right:border.Right-1, Height:textHeight+margin.Top+margin.Bottom, Width:textWidth+margin.Left+margin.Right, Bottom:point.Y };
|
|
60618
|
+
rtBG.Top=rtBG.Bottom-rtBG.Height;
|
|
60619
|
+
rtBG.Left=rtBG.Right-rtBG.Width;
|
|
60620
|
+
}
|
|
60621
|
+
|
|
60622
|
+
var bgColor=this.LineColor;
|
|
60623
|
+
if (config.BGAlpha<1) bgColor=IChartDrawPicture.ColorToRGBA(this.LineColor, config.BGAlpha);
|
|
60624
|
+
this.Canvas.fillStyle=bgColor;
|
|
60625
|
+
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
60626
|
+
|
|
60627
|
+
var xText=rtBG.Left+margin.Left;
|
|
60628
|
+
var yText=rtBG.Top+margin.Top;
|
|
60629
|
+
this.Canvas.textAlign="left";
|
|
60630
|
+
this.Canvas.textBaseline = "top";
|
|
60631
|
+
this.Canvas.fillStyle=config.TextColor;
|
|
60632
|
+
this.Canvas.fillText(text,xText,yText);
|
|
60499
60633
|
}
|
|
60500
60634
|
}
|
|
60501
60635
|
}
|
|
60502
60636
|
|
|
60637
|
+
// 画图工具-水平射线线 支持横屏
|
|
60638
|
+
function ChartDrawPictureHorizontalRay()
|
|
60639
|
+
{
|
|
60640
|
+
this.newMethod=IChartDrawPicture; //派生
|
|
60641
|
+
this.newMethod();
|
|
60642
|
+
delete this.newMethod;
|
|
60643
|
+
|
|
60644
|
+
this.ClassName='ChartDrawPictureHorizontalRay';
|
|
60645
|
+
this.PointCount=1;
|
|
60646
|
+
this.IsPointIn=this.IsPointIn_XYValue_Line;
|
|
60647
|
+
this.IsDrawFirst=true;
|
|
60648
|
+
this.LineWidth=1;
|
|
60649
|
+
this.Super_SetOption=this.SetOption; //父类函数
|
|
60650
|
+
this.Super_ExportStorageData=this.ExportStorageData;
|
|
60651
|
+
|
|
60652
|
+
this.LabelConfig=
|
|
60653
|
+
{
|
|
60654
|
+
Right:{ IsShow:true, Margin:{ Left:5, Top:4, Bottom:2, Right:5 } },
|
|
60655
|
+
Font:`${12*GetDevicePixelRatio()}px 微软雅黑`, TextColor:"rgb(255,255,255)"
|
|
60656
|
+
};
|
|
60657
|
+
|
|
60658
|
+
this.SetOption=function(option)
|
|
60659
|
+
{
|
|
60660
|
+
if (this.Super_SetOption) this.Super_SetOption(option);
|
|
60661
|
+
if (option)
|
|
60662
|
+
{
|
|
60663
|
+
if (option.LabelTitle) this.LabelTitle=option.LabelTitle;
|
|
60664
|
+
|
|
60665
|
+
if (option.Label)
|
|
60666
|
+
{
|
|
60667
|
+
var item=option.Label;
|
|
60668
|
+
if (item.Right)
|
|
60669
|
+
{
|
|
60670
|
+
var subItem=item.Right;
|
|
60671
|
+
if (IFrameSplitOperator.IsBool(subItem.IsShow)) this.LabelConfig.Right.IsShow=subItem.IsShow;
|
|
60672
|
+
}
|
|
60673
|
+
|
|
60674
|
+
if (item.Font) this.LabelConfig.Font=item.Font;
|
|
60675
|
+
if (item.TextColor) this.LabelConfig.FoTextColornt=item.TextColor;
|
|
60676
|
+
}
|
|
60677
|
+
}
|
|
60678
|
+
}
|
|
60679
|
+
|
|
60680
|
+
this.ExportStorageData=function()
|
|
60681
|
+
{
|
|
60682
|
+
var storageData;
|
|
60683
|
+
if (this.Super_ExportStorageData)
|
|
60684
|
+
{
|
|
60685
|
+
storageData=this.Super_ExportStorageData();
|
|
60686
|
+
}
|
|
60687
|
+
return storageData;
|
|
60688
|
+
}
|
|
60689
|
+
|
|
60690
|
+
this.GetXYCoordinate=function()
|
|
60691
|
+
{
|
|
60692
|
+
if (this.IsFrameMinSize()) return null;
|
|
60693
|
+
var drawPoint=this.CalculateDrawPoint();
|
|
60694
|
+
|
|
60695
|
+
var data=this.PointRange(drawPoint);
|
|
60696
|
+
if (data) data.IsShowYCoordinate=false;
|
|
60697
|
+
return data;
|
|
60698
|
+
}
|
|
60699
|
+
|
|
60700
|
+
this.Draw=function()
|
|
60701
|
+
{
|
|
60702
|
+
this.LinePoint=[];
|
|
60703
|
+
if (this.IsFrameMinSize()) return;
|
|
60704
|
+
if (!this.IsShow) return;
|
|
60705
|
+
|
|
60706
|
+
var drawPoint=this.CalculateDrawPoint();
|
|
60707
|
+
if (!drawPoint || drawPoint.length!=1) return;
|
|
60708
|
+
if (!this.Frame) return;
|
|
60709
|
+
if (this.Value.length!=1) return;
|
|
60710
|
+
if (!this.IsYValueInFrame(this.Value[0].YValue)) return null;
|
|
60711
|
+
|
|
60712
|
+
var isHScreen=this.Frame.IsHScreen;
|
|
60713
|
+
var left=this.Frame.ChartBorder.GetLeft();
|
|
60714
|
+
var right=this.Frame.ChartBorder.GetRight();
|
|
60715
|
+
if (isHScreen)
|
|
60716
|
+
{
|
|
60717
|
+
left=this.Frame.ChartBorder.GetTop();
|
|
60718
|
+
right=this.Frame.ChartBorder.GetBottom();
|
|
60719
|
+
}
|
|
60720
|
+
this.ClipFrame();
|
|
60721
|
+
|
|
60722
|
+
this.Canvas.strokeStyle=this.LineColor;
|
|
60723
|
+
this.SetLineWidth();
|
|
60724
|
+
this.Canvas.beginPath();
|
|
60725
|
+
if (isHScreen)
|
|
60726
|
+
{
|
|
60727
|
+
this.Canvas.moveTo(drawPoint[0].X,drawPoint[0].Y);
|
|
60728
|
+
this.Canvas.lineTo(drawPoint[0].X,right);
|
|
60729
|
+
}
|
|
60730
|
+
else
|
|
60731
|
+
{
|
|
60732
|
+
var yFixed=ToFixedPoint2(this.LineWidth,drawPoint[0].Y);
|
|
60733
|
+
this.Canvas.moveTo(drawPoint[0].X,yFixed);
|
|
60734
|
+
this.Canvas.lineTo(right,yFixed);
|
|
60735
|
+
}
|
|
60736
|
+
this.Canvas.stroke();
|
|
60737
|
+
this.RestoreLineWidth();
|
|
60738
|
+
|
|
60739
|
+
var line={Start:new Point(), End:new Point()};
|
|
60740
|
+
if (isHScreen)
|
|
60741
|
+
{
|
|
60742
|
+
line.Start.X=drawPoint[0].X;
|
|
60743
|
+
line.Start.Y=drawPoint[0].Y;
|
|
60744
|
+
line.End.X=drawPoint[0].X;
|
|
60745
|
+
line.End.Y=right;
|
|
60746
|
+
}
|
|
60747
|
+
else
|
|
60748
|
+
{
|
|
60749
|
+
line.Start.X=drawPoint[0].X;
|
|
60750
|
+
line.Start.Y=drawPoint[0].Y;
|
|
60751
|
+
line.End.X=right;
|
|
60752
|
+
line.End.Y=drawPoint[0].Y;
|
|
60753
|
+
}
|
|
60754
|
+
this.LinePoint.push(line);
|
|
60755
|
+
|
|
60756
|
+
//画点
|
|
60757
|
+
this.DrawPoint(drawPoint);
|
|
60758
|
+
|
|
60759
|
+
this.Canvas.restore();
|
|
60760
|
+
|
|
60761
|
+
this.DrawValueLabel(drawPoint[0]);
|
|
60762
|
+
}
|
|
60763
|
+
|
|
60764
|
+
this.DrawValueLabel=function(point)
|
|
60765
|
+
{
|
|
60766
|
+
if (!point) return;
|
|
60767
|
+
if (this.Frame.IsHScreen) return; //不支持横屏
|
|
60768
|
+
|
|
60769
|
+
var y=point.Y;
|
|
60770
|
+
var yValue=this.Frame.GetYData(y);
|
|
60771
|
+
var text=yValue.toFixed(2);
|
|
60772
|
+
|
|
60773
|
+
var border=this.Frame.GetBorder();
|
|
60774
|
+
var config=this.LabelConfig;
|
|
60775
|
+
|
|
60776
|
+
this.Canvas.font=config.Font;
|
|
60777
|
+
var textHeight=this.Canvas.measureText("擎").width;
|
|
60778
|
+
var textWidth=this.Canvas.measureText(text).width;
|
|
60779
|
+
|
|
60780
|
+
if (config.Right.IsShow && this.Frame.ChartBorder.Right>5)
|
|
60781
|
+
{
|
|
60782
|
+
var margin=config.Right.Margin;
|
|
60783
|
+
var rtBG={ Left:border.Right+1, Height:textHeight+margin.Top+margin.Bottom, Width:textWidth+margin.Left+margin.Right };
|
|
60784
|
+
rtBG.Top=y-textHeight/2-margin.Top;
|
|
60785
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
60786
|
+
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
60787
|
+
this.Canvas.fillStyle=this.LineColor;
|
|
60788
|
+
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
60789
|
+
|
|
60790
|
+
this.Canvas.textAlign="left";
|
|
60791
|
+
this.Canvas.textBaseline = "top";
|
|
60792
|
+
var xText=rtBG.Left+margin.Left;
|
|
60793
|
+
var yText=rtBG.Top+margin.Top;
|
|
60794
|
+
this.Canvas.fillStyle=config.TextColor;
|
|
60795
|
+
this.Canvas.fillText(text,xText,yText);
|
|
60796
|
+
}
|
|
60797
|
+
}
|
|
60798
|
+
}
|
|
60799
|
+
|
|
60800
|
+
|
|
60503
60801
|
//水平线2
|
|
60504
60802
|
function ChartDrawHLine()
|
|
60505
60803
|
{
|
|
@@ -136133,6 +136431,7 @@ function JSDialogDrawTool()
|
|
|
136133
136431
|
{ Title: '箭头', ClassName: 'hqchart_drawtool icon-draw_rays', Type:0, Data:{ ID:"箭头" } },
|
|
136134
136432
|
{ Title: '趋势线', ClassName: 'hqchart_drawtool icon-draw_trendline', Type:0, Data:{ ID:"趋势线" } },
|
|
136135
136433
|
{ Title: '水平线', ClassName: 'hqchart_drawtool icon-draw_hline', Type:0, Data:{ ID:"水平线" } },
|
|
136434
|
+
{ Title: '水平射线', ClassName: 'hqchart_drawtool icon-tubiao_shuipingshexian', Type:0, Data:{ ID:"水平射线" } },
|
|
136136
136435
|
{ Title: '涂鸦线段', ClassName: 'hqchart_drawtool icon-draw_line', Type:0, Data:{ ID:"涂鸦线段" } },
|
|
136137
136436
|
{ Title: '阻速线', ClassName: 'hqchart_drawtool icon-draw_resline', Type:0, Data:{ ID:"阻速线" } },
|
|
136138
136437
|
{ Title: '江恩角度线', ClassName: 'hqchart_drawtool icon-jiangenjiaoduxian', Type:0, Data:{ ID:"江恩角度线" } },
|
|
@@ -136713,7 +137012,7 @@ function JSDialogModifyDraw()
|
|
|
136713
137012
|
{ Title:"点击线段颜色", ClassName: 'hqchart_drawtool icon-huabi', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID }},
|
|
136714
137013
|
{ Title:"点击字体颜色", ClassName: 'hqchart_drawtool icon-zitiyanse', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_FONT_COLOR_ID }},
|
|
136715
137014
|
{ Title:"点击背景色", ClassName: 'hqchart_drawtool icon-zitibeijingse', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BG_COLOR_ID }},
|
|
136716
|
-
{ Title:"
|
|
137015
|
+
{ Title:"删除图形", ClassName: 'hqchart_drawtool icon-recycle_bin', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_DELETE_DRAW_CHART_ID }}
|
|
136717
137016
|
];
|
|
136718
137017
|
|
|
136719
137018
|
this.Inital=function(hqchart)
|
|
@@ -136761,14 +137060,25 @@ function JSDialogModifyDraw()
|
|
|
136761
137060
|
{
|
|
136762
137061
|
var divItem=document.createElement("div");
|
|
136763
137062
|
divItem.className="UMyChart_Draw_Modify_Dialog_Button_Div";
|
|
137063
|
+
|
|
137064
|
+
var spanTooltip=document.createElement("span");
|
|
137065
|
+
spanTooltip.className="UMyChart_Draw_Modify_Tooltip";
|
|
137066
|
+
spanTooltip.innerText=item.Title;
|
|
137067
|
+
divItem.appendChild(spanTooltip);
|
|
137068
|
+
|
|
137069
|
+
|
|
136764
137070
|
var spanDom=document.createElement("span");
|
|
136765
137071
|
spanDom.className=item.ClassName;
|
|
136766
137072
|
spanDom.classList.add("UMyChart_DrawTool_Span");
|
|
136767
137073
|
divItem.appendChild(spanDom);
|
|
137074
|
+
|
|
136768
137075
|
|
|
136769
|
-
var data={ Div:divItem, Span:spanDom, Parent:parentDivDom, Item:item };
|
|
137076
|
+
var data={ Div:divItem, Span:spanDom, Parent:parentDivDom, Item:item, Tooltip:spanTooltip };
|
|
136770
137077
|
divItem.onmousedown=(e)=> { this.OnClickButton(e, data); }; //点击
|
|
136771
137078
|
|
|
137079
|
+
divItem.onmouseover=(e)=> { this.OnHoverButton(e, data); }
|
|
137080
|
+
divItem.onmouseout=(e)=>{ this.OnLeaveButton(e, data); }
|
|
137081
|
+
|
|
136772
137082
|
switch(item.Data.ID)
|
|
136773
137083
|
{
|
|
136774
137084
|
case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID:
|
|
@@ -136810,6 +137120,18 @@ function JSDialogModifyDraw()
|
|
|
136810
137120
|
}
|
|
136811
137121
|
}
|
|
136812
137122
|
|
|
137123
|
+
this.OnHoverButton=function(e, data)
|
|
137124
|
+
{
|
|
137125
|
+
//var x=e.clientX;
|
|
137126
|
+
//data.Tooltip.style.left=x+"px";
|
|
137127
|
+
data.Tooltip.style.display="inline";
|
|
137128
|
+
}
|
|
137129
|
+
|
|
137130
|
+
this.OnLeaveButton=function(e, data)
|
|
137131
|
+
{
|
|
137132
|
+
data.Tooltip.style.display="none";
|
|
137133
|
+
}
|
|
137134
|
+
|
|
136813
137135
|
this.Close=function(e)
|
|
136814
137136
|
{
|
|
136815
137137
|
if (!this.DivDialog) return;
|
|
@@ -136953,7 +137275,7 @@ function JSDialogModifyDraw()
|
|
|
136953
137275
|
if (this.ColorButton)
|
|
136954
137276
|
{
|
|
136955
137277
|
var item=this.ColorButton;
|
|
136956
|
-
this.ShowButton(item.Div, bShowLineColor?"
|
|
137278
|
+
this.ShowButton(item.Div, bShowLineColor?"inline":"none");
|
|
136957
137279
|
if (bShowLineColor)
|
|
136958
137280
|
{
|
|
136959
137281
|
item.Span.style['color']=chart.LineColor;
|
|
@@ -136963,7 +137285,7 @@ function JSDialogModifyDraw()
|
|
|
136963
137285
|
if (this.BGColorButton)
|
|
136964
137286
|
{
|
|
136965
137287
|
var item=this.BGColorButton;
|
|
136966
|
-
this.ShowButton(item.Div, bShowBGColor?"
|
|
137288
|
+
this.ShowButton(item.Div, bShowBGColor?"inline":"none");
|
|
136967
137289
|
if (bShowBGColor)
|
|
136968
137290
|
{
|
|
136969
137291
|
item.Span.style['color']=bgColor;
|
|
@@ -136973,7 +137295,7 @@ function JSDialogModifyDraw()
|
|
|
136973
137295
|
if (this.FontColorButton)
|
|
136974
137296
|
{
|
|
136975
137297
|
var item=this.FontColorButton;
|
|
136976
|
-
this.ShowButton(item.Div, bShowFontColor?"
|
|
137298
|
+
this.ShowButton(item.Div, bShowFontColor?"inline":"none");
|
|
136977
137299
|
if (bShowFontColor)
|
|
136978
137300
|
{
|
|
136979
137301
|
item.Span.style['color']=fontColor;
|
|
@@ -137148,7 +137470,7 @@ function HQChartScriptWorker()
|
|
|
137148
137470
|
|
|
137149
137471
|
|
|
137150
137472
|
|
|
137151
|
-
var HQCHART_VERSION="1.1.
|
|
137473
|
+
var HQCHART_VERSION="1.1.13374";
|
|
137152
137474
|
|
|
137153
137475
|
function PrintHQChartVersion()
|
|
137154
137476
|
{
|