hqchart 1.1.14713 → 1.1.14722
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 +37 -60
- package/package.json +1 -1
- package/src/jscommon/umychart.js +195 -91
- package/src/jscommon/umychart.style.js +1 -1
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +197 -93
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +197 -93
package/src/jscommon/umychart.js
CHANGED
|
@@ -2773,6 +2773,8 @@ var JSCHART_EVENT_ID=
|
|
|
2773
2773
|
ON_TOUCH_FAST_SLIDE:169, //快速滑动
|
|
2774
2774
|
|
|
2775
2775
|
ON_CLICK_CROSSCURSOR_BOTTOM:170, //十字光标底部文字点击
|
|
2776
|
+
|
|
2777
|
+
ON_CLICK_CHART_CELL:171, //点击图形单元
|
|
2776
2778
|
}
|
|
2777
2779
|
|
|
2778
2780
|
var JSCHART_OPERATOR_ID=
|
|
@@ -3204,7 +3206,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3204
3206
|
this.EnableVerticalDrag=false;
|
|
3205
3207
|
|
|
3206
3208
|
//十字光标长留(手势才有)
|
|
3207
|
-
this.ClickModel={ IsShowCorssCursor:false, PreventHide:false }; //PreventHide 阻止隐藏十字光标
|
|
3209
|
+
this.ClickModel={ IsShowCorssCursor:false, PreventHide:false, IsClickButton:false }; //PreventHide 阻止隐藏十字光标
|
|
3208
3210
|
this.EnableClickModel=false;
|
|
3209
3211
|
|
|
3210
3212
|
//标题栏显示最新数据
|
|
@@ -3686,6 +3688,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3686
3688
|
if (this.IndexChartDrag) return;
|
|
3687
3689
|
if (this.CustomChartDrag) return;
|
|
3688
3690
|
//if (this.RectSelectDrag) return;
|
|
3691
|
+
if (this.EnableClickModel && this.ClickModel.IsClickButton) return;
|
|
3689
3692
|
|
|
3690
3693
|
/*
|
|
3691
3694
|
if (this.CurrentChartDrawPicture)
|
|
@@ -3902,7 +3905,11 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3902
3905
|
if (item.IsHideScriptIndex()) continue;
|
|
3903
3906
|
|
|
3904
3907
|
result=item.ClickCell(x,y,e);
|
|
3905
|
-
if (result)
|
|
3908
|
+
if (result)
|
|
3909
|
+
{
|
|
3910
|
+
result.Chart=item;
|
|
3911
|
+
return result;
|
|
3912
|
+
}
|
|
3906
3913
|
}
|
|
3907
3914
|
|
|
3908
3915
|
for(var i=0;i<this.OverlayChartPaint.length;++i)
|
|
@@ -3911,7 +3918,12 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3911
3918
|
if (!item.ClickCell) continue;
|
|
3912
3919
|
|
|
3913
3920
|
result=item.ClickCell(x,y,e);
|
|
3914
|
-
if (result)
|
|
3921
|
+
if (result)
|
|
3922
|
+
{
|
|
3923
|
+
result.Chart=item;
|
|
3924
|
+
result.IsOverlayChart=true;
|
|
3925
|
+
return result;
|
|
3926
|
+
}
|
|
3915
3927
|
}
|
|
3916
3928
|
|
|
3917
3929
|
for(var i=0,j=0,k=0;i<this.Frame.SubFrame.length;++i)
|
|
@@ -3932,7 +3944,12 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3932
3944
|
if (chart.ClickCell)
|
|
3933
3945
|
{
|
|
3934
3946
|
result=chart.ClickCell(x,y,e);
|
|
3935
|
-
if (result)
|
|
3947
|
+
if (result)
|
|
3948
|
+
{
|
|
3949
|
+
result.Chart=chart;
|
|
3950
|
+
result.IsOverlayIndex=true;
|
|
3951
|
+
return result;
|
|
3952
|
+
}
|
|
3936
3953
|
}
|
|
3937
3954
|
}
|
|
3938
3955
|
}
|
|
@@ -4256,6 +4273,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
4256
4273
|
|
|
4257
4274
|
if (clickCellData)
|
|
4258
4275
|
{
|
|
4276
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_CHART_CELL); //点击图形单个元素
|
|
4277
|
+
if (event && event.Callback)
|
|
4278
|
+
{
|
|
4279
|
+
var data={ Event:e, CellData:clickCellData };
|
|
4280
|
+
event.Callback(event,data,this);
|
|
4281
|
+
}
|
|
4282
|
+
|
|
4259
4283
|
if (clickCellData.Redraw===true) bRedraw=true;
|
|
4260
4284
|
}
|
|
4261
4285
|
else
|
|
@@ -4953,6 +4977,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
4953
4977
|
this.UIOnMounseOut=function(e)
|
|
4954
4978
|
{
|
|
4955
4979
|
JSConsole.Chart.Log('[KLineChartContainer::UIOnMounseOut]',e);
|
|
4980
|
+
if (this.EnableClickModel && this.ClickModel.IsShowCorssCursor==true) return; //点击模式 十字光标显示下 不需要处理
|
|
4981
|
+
|
|
4956
4982
|
if (!this.IsLockCorssCursor()) this.UIOnMouseMove(e); //锁十字光标时, 始终显示十字光标
|
|
4957
4983
|
}
|
|
4958
4984
|
|
|
@@ -5372,7 +5398,10 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
5372
5398
|
this.TouchDrawCount=0;
|
|
5373
5399
|
this.PhonePinch=null;
|
|
5374
5400
|
this.TouchDrag=null;
|
|
5375
|
-
|
|
5401
|
+
this.ClickModel.IsClickButton=false;
|
|
5402
|
+
this.ClickModel.PreventHide=false;
|
|
5403
|
+
|
|
5404
|
+
|
|
5376
5405
|
this.StopDragTimer();
|
|
5377
5406
|
|
|
5378
5407
|
var isSingleTouch=this.IsSingleTouch(e);
|
|
@@ -5388,8 +5417,11 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
5388
5417
|
var pt=this.PointAbsoluteToRelative(touches[0].clientX, touches[0].clientY, true);
|
|
5389
5418
|
|
|
5390
5419
|
if (this.TryPhoneClickButton(pt.X, pt.Y, e))
|
|
5420
|
+
{
|
|
5421
|
+
this.ClickModel.IsClickButton=true;
|
|
5391
5422
|
return;
|
|
5392
|
-
|
|
5423
|
+
}
|
|
5424
|
+
|
|
5393
5425
|
if (this.EnableVerticalDrag )
|
|
5394
5426
|
{
|
|
5395
5427
|
this.VerticalDrag={ IsDrag:false };
|
|
@@ -5574,6 +5606,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
5574
5606
|
if (this.ChartSplashPaint && this.ChartSplashPaint.IsEnableSplash == true) return;
|
|
5575
5607
|
|
|
5576
5608
|
var touches=this.GetToucheData(e,this.IsForceLandscape);
|
|
5609
|
+
this.ClickModel.IsClickButton=false;
|
|
5577
5610
|
|
|
5578
5611
|
if (this.IsPhoneDragging(e))
|
|
5579
5612
|
{
|
|
@@ -55866,7 +55899,7 @@ function ChartCorssCursor()
|
|
|
55866
55899
|
Enable:false, Rect:null,
|
|
55867
55900
|
BGColor:g_JSChartResource.CorssCursor.RightButton.BGColor ,
|
|
55868
55901
|
PenColor:g_JSChartResource.CorssCursor.RightButton.PenColor,
|
|
55869
|
-
Icon:g_JSChartResource.CorssCursor.RightButton.Icon
|
|
55902
|
+
Icon:CloneData(g_JSChartResource.CorssCursor.RightButton.Icon)
|
|
55870
55903
|
};
|
|
55871
55904
|
|
|
55872
55905
|
//底部按钮
|
|
@@ -55875,9 +55908,11 @@ function ChartCorssCursor()
|
|
|
55875
55908
|
Enable:false, Rect:null,
|
|
55876
55909
|
}
|
|
55877
55910
|
|
|
55878
|
-
this.
|
|
55879
|
-
this.
|
|
55880
|
-
this.
|
|
55911
|
+
this.BottomConfig=CloneData(g_JSChartResource.CorssCursor.BottomText); //底部输出配置
|
|
55912
|
+
this.LeftConfig=CloneData(g_JSChartResource.CorssCursor.LeftText); //左侧输出配置
|
|
55913
|
+
this.RightConfig=CloneData(g_JSChartResource.CorssCursor.RightText); //右侧输出配置
|
|
55914
|
+
this.RightOverlayConfig=CloneData(g_JSChartResource.CorssCursor.RightOverlayText); //右侧叠加指标输出配置
|
|
55915
|
+
|
|
55881
55916
|
|
|
55882
55917
|
//内部使用
|
|
55883
55918
|
this.Close=null; //收盘价格
|
|
@@ -55895,6 +55930,10 @@ function ChartCorssCursor()
|
|
|
55895
55930
|
this.XRangeBGColor=g_JSChartResource.CorssCursorXRangeBGColor;
|
|
55896
55931
|
this.LineDash=g_JSChartResource.CorssCursorLineDash.slice(); //虚线
|
|
55897
55932
|
|
|
55933
|
+
this.RightButton.BGColor=g_JSChartResource.CorssCursor.RightButton.BGColor;
|
|
55934
|
+
this.RightButton.PenColor=g_JSChartResource.CorssCursor.RightButton.PenColor;
|
|
55935
|
+
this.RightButton.Icon=CloneData(g_JSChartResource.CorssCursor.RightButton.Icon);
|
|
55936
|
+
this.RightOverlayConfig=CloneData(g_JSChartResource.CorssCursor.RightOverlayText);
|
|
55898
55937
|
|
|
55899
55938
|
this.CorssPointConfig.Center=CloneData(g_JSChartResource.CorssCursor.CorssPoint.Center);
|
|
55900
55939
|
this.CorssPointConfig.Border=CloneData(g_JSChartResource.CorssCursor.CorssPoint.Border);
|
|
@@ -56300,7 +56339,7 @@ function ChartCorssCursor()
|
|
|
56300
56339
|
{
|
|
56301
56340
|
ShowType:0, //0=单行(默认) 1=多行
|
|
56302
56341
|
Font:this.Font, Color:this.TextColor,
|
|
56303
|
-
Text:[ { Text:text, Margin:this.
|
|
56342
|
+
Text:[ { Text:text, Margin:this.RightConfig.Margin, TextOffset:this.RightConfig.TextOffset } ],
|
|
56304
56343
|
};
|
|
56305
56344
|
|
|
56306
56345
|
var yTop=y-this.TextHeight/2;
|
|
@@ -56359,74 +56398,73 @@ function ChartCorssCursor()
|
|
|
56359
56398
|
//叠加坐标
|
|
56360
56399
|
if (isOverlayIndex && textSize.Width>overlayIndexInterval && overlayIndexInterval>0) //大于子坐标宽度
|
|
56361
56400
|
{
|
|
56401
|
+
var rtBG={ Right:right+overlayIndexInterval, Width:textSize.Width, YCenter:y, Height:textSize.Height };
|
|
56402
|
+
rtBG.Left=rtBG.Right-rtBG.Width;
|
|
56403
|
+
if (complexText.ShowType==1)
|
|
56404
|
+
{
|
|
56405
|
+
rtBG.Top=rtBG.YCenter-this.TextHeight/2;
|
|
56406
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
56407
|
+
}
|
|
56408
|
+
else
|
|
56409
|
+
{
|
|
56410
|
+
rtBG.Top=rtBG.YCenter-rtBG.Height/2;
|
|
56411
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
56412
|
+
}
|
|
56413
|
+
|
|
56414
|
+
if (rtBG.Right>chartRight)
|
|
56415
|
+
{
|
|
56416
|
+
rtBG.Right=chartRight;
|
|
56417
|
+
rtBG.Left=rtBG.Right-rtBG.Width;
|
|
56418
|
+
}
|
|
56419
|
+
|
|
56362
56420
|
var drawRight=right+overlayIndexInterval;
|
|
56363
56421
|
if (drawRight>chartRight) drawRight=chartRight;
|
|
56364
56422
|
|
|
56365
|
-
|
|
56366
|
-
this.
|
|
56367
|
-
this.DrawComplexTextV2(itemLeft, yTop, complexText, textSize);
|
|
56423
|
+
this.DrawTextBGRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
|
|
56424
|
+
this.DrawComplexRightText(rtBG,complexText,textSize);
|
|
56368
56425
|
|
|
56369
|
-
if (this.RightButton.Enable) this.
|
|
56370
|
-
}
|
|
56371
|
-
else if (rightWidth<textSize.Width) //右边空白显示不下,
|
|
56372
|
-
{
|
|
56373
|
-
var itemLeft=chartRight-2-textSize.Width;
|
|
56374
|
-
this.DrawTextBGRect(itemLeft,yTop,textSize.Width,textSize.Height);
|
|
56375
|
-
this.DrawComplexTextV2(itemLeft, yTop ,complexText, textSize);
|
|
56376
|
-
|
|
56377
|
-
if (this.RightButton.Enable) this.DrawRightButton(yTop, chartRight-2-textSize.Width,this.TextHeight,this.TextHeight,buttonData);
|
|
56426
|
+
if (this.RightButton.Enable) this.DrawRightButtonV2(rtBG, complexText, textSize, buttonData);
|
|
56378
56427
|
}
|
|
56379
56428
|
else
|
|
56380
56429
|
{
|
|
56381
|
-
var
|
|
56382
|
-
|
|
56383
|
-
|
|
56384
|
-
|
|
56385
|
-
if (this.RightButton.Enable) this.DrawRightButton(yTop, right+2,this.TextHeight,this.TextHeight,buttonData);
|
|
56386
|
-
}
|
|
56387
|
-
|
|
56388
|
-
/*
|
|
56389
|
-
if (this.StringFormatY.RExtendText && this.StringFormatY.RExtendText.length>0)
|
|
56390
|
-
{
|
|
56391
|
-
var yOffset=0;
|
|
56392
|
-
for(var i in this.StringFormatY.RExtendText)
|
|
56430
|
+
var rtBG={ Left:right+1, Width:textSize.Width, YCenter:y, Height:textSize.Height };
|
|
56431
|
+
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
56432
|
+
if (complexText.ShowType==1)
|
|
56393
56433
|
{
|
|
56394
|
-
|
|
56395
|
-
|
|
56396
|
-
if (item.YText) rText=item.YText;
|
|
56397
|
-
else if (IFrameSplitOperator.IsNumber(item.Y)) rText=item.Y.toFixed(0);
|
|
56398
|
-
var rTextWidth=this.Canvas.measureText(rText).width+4; //前后各空2个像素
|
|
56399
|
-
|
|
56400
|
-
if (rightWidth<rTextWidth)
|
|
56401
|
-
{
|
|
56402
|
-
this.DrawTextBGRect(chartRight-2-rTextWidth,y+yOffset+this.TextHeight/2,rTextWidth,this.TextHeight);
|
|
56403
|
-
this.Canvas.textAlign="right";
|
|
56404
|
-
this.Canvas.textBaseline="middle";
|
|
56405
|
-
this.Canvas.fillStyle=item.TextColor;
|
|
56406
|
-
this.Canvas.fillText(rText,chartRight-4,y+yOffset+this.TextHeight,rTextWidth);
|
|
56407
|
-
}
|
|
56408
|
-
else
|
|
56409
|
-
{
|
|
56410
|
-
this.DrawTextBGRect(right+2,y+yOffset+this.TextHeight/2,rTextWidth,this.TextHeight);
|
|
56411
|
-
this.Canvas.textAlign="left";
|
|
56412
|
-
this.Canvas.textBaseline="middle";
|
|
56413
|
-
this.Canvas.fillStyle=item.TextColor;
|
|
56414
|
-
this.Canvas.fillText(rText,right+4,y+yOffset+this.TextHeight,rTextWidth);
|
|
56415
|
-
}
|
|
56416
|
-
|
|
56417
|
-
yOffset+=this.TextHeight;
|
|
56434
|
+
rtBG.Top=rtBG.YCenter-this.TextHeight/2;
|
|
56435
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
56418
56436
|
}
|
|
56437
|
+
else
|
|
56438
|
+
{
|
|
56439
|
+
rtBG.Top=rtBG.YCenter-rtBG.Height/2;
|
|
56440
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
56441
|
+
}
|
|
56442
|
+
|
|
56443
|
+
if (rtBG.Right>chartRight)
|
|
56444
|
+
{
|
|
56445
|
+
rtBG.Right=chartRight;
|
|
56446
|
+
rtBG.Left=rtBG.Right-rtBG.Width;
|
|
56447
|
+
}
|
|
56448
|
+
|
|
56449
|
+
this.DrawTextBGRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
|
|
56450
|
+
this.DrawComplexRightText(rtBG,complexText,textSize);
|
|
56451
|
+
|
|
56452
|
+
if (this.RightButton.Enable) this.DrawRightButtonV2(rtBG, complexText, textSize, buttonData);
|
|
56419
56453
|
}
|
|
56420
|
-
*/
|
|
56421
56454
|
}
|
|
56422
|
-
else if (this.ShowTextMode.Right==2)
|
|
56455
|
+
else if (this.ShowTextMode.Right==2) //框架内侧显示
|
|
56423
56456
|
{
|
|
56457
|
+
var rtBG={ Right:right, Width:textSize.Width, YCenter:y, Height:textSize.Height };
|
|
56458
|
+
rtBG.Left=rtBG.Right-rtBG.Width;
|
|
56459
|
+
rtBG.Top=rtBG.YCenter-rtBG.Height/2;
|
|
56460
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
56461
|
+
|
|
56424
56462
|
this.Canvas.fillStyle=this.TextBGColor;
|
|
56425
56463
|
var showLeft=right-textSize.Width;
|
|
56426
|
-
this.DrawTextBGRect(
|
|
56427
|
-
this.
|
|
56464
|
+
this.DrawTextBGRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
|
|
56465
|
+
this.DrawComplexRightText(rtBG,complexText,textSize);
|
|
56428
56466
|
|
|
56429
|
-
if (this.RightButton.Enable) this.
|
|
56467
|
+
if (this.RightButton.Enable) this.DrawRightButtonV2(rtBG, complexText, textSize, buttonData);
|
|
56430
56468
|
}
|
|
56431
56469
|
}
|
|
56432
56470
|
|
|
@@ -56509,8 +56547,19 @@ function ChartCorssCursor()
|
|
|
56509
56547
|
//if (overlayLeft+30>chartRight) break;
|
|
56510
56548
|
var yValue=item.Frame.GetYData(y);
|
|
56511
56549
|
var text=IFrameSplitOperator.FormatValueString(yValue,2);
|
|
56512
|
-
var textWidth=this.Canvas.measureText(text).width
|
|
56550
|
+
var textWidth=this.Canvas.measureText(text).width; //前后各空2个像素
|
|
56551
|
+
|
|
56552
|
+
|
|
56553
|
+
var margin=this.RightOverlayConfig.Margin;
|
|
56554
|
+
var textOffset=this.RightOverlayConfig.TextOffset;
|
|
56555
|
+
|
|
56556
|
+
var rtBG={ Left:overlayLeft+1, Width:textWidth+margin.Left+margin.Right, YCenter:y, Height:textHeight+margin.Top+margin.Bottom };
|
|
56557
|
+
rtBG.Right=rtBG.Left-rtBG.Width;
|
|
56558
|
+
rtBG.Top=rtBG.YCenter-rtBG.Height/2;
|
|
56559
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
56513
56560
|
|
|
56561
|
+
this.DrawTextBGRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
|
|
56562
|
+
|
|
56514
56563
|
/*
|
|
56515
56564
|
for(var j=2;j>=0;--j)
|
|
56516
56565
|
{
|
|
@@ -56520,19 +56569,17 @@ function ChartCorssCursor()
|
|
|
56520
56569
|
}
|
|
56521
56570
|
*/
|
|
56522
56571
|
|
|
56523
|
-
this.Canvas.fillStyle=this.TextBGColor;
|
|
56524
|
-
this.Canvas.fillRect(overlayLeft+1,y-this.TextHeight/2,textWidth,this.TextHeight);
|
|
56525
56572
|
this.Canvas.textAlign="left";
|
|
56526
|
-
this.Canvas.textBaseline="
|
|
56573
|
+
this.Canvas.textBaseline="bottom";
|
|
56527
56574
|
this.Canvas.fillStyle=this.TextColor;
|
|
56528
|
-
this.Canvas.fillText(text,
|
|
56575
|
+
this.Canvas.fillText(text,rtBG.Left+textOffset.X, rtBG.Bottom+textOffset.Y);
|
|
56529
56576
|
}
|
|
56530
56577
|
}
|
|
56531
56578
|
|
|
56532
56579
|
this.Status=1;
|
|
56533
56580
|
}
|
|
56534
56581
|
|
|
56535
|
-
this.
|
|
56582
|
+
this.DrawComplexRightText=function(rtBG, complexText, size)
|
|
56536
56583
|
{
|
|
56537
56584
|
this.Canvas.textAlign="left";
|
|
56538
56585
|
this.Canvas.textBaseline="bottom";
|
|
@@ -56540,8 +56587,8 @@ function ChartCorssCursor()
|
|
|
56540
56587
|
if (complexText.ShowType==1) showType=complexText.ShowType;
|
|
56541
56588
|
if (showType==1) //多行
|
|
56542
56589
|
{
|
|
56543
|
-
var xLeft=
|
|
56544
|
-
var
|
|
56590
|
+
var xLeft=rtBG.Left;
|
|
56591
|
+
var yTop=rtBG.Top; //顶
|
|
56545
56592
|
for(var i=0; i<complexText.Text.length; ++i)
|
|
56546
56593
|
{
|
|
56547
56594
|
var item=complexText.Text[i];
|
|
@@ -56553,24 +56600,25 @@ function ChartCorssCursor()
|
|
|
56553
56600
|
if (item.Color) this.Canvas.fillStyle=item.Color;
|
|
56554
56601
|
else this.Canvas.fillStyle=complexText.Color;
|
|
56555
56602
|
|
|
56556
|
-
var y=
|
|
56603
|
+
var y=yTop+itemSize.Height;
|
|
56557
56604
|
var x=xLeft;
|
|
56558
|
-
|
|
56605
|
+
|
|
56606
|
+
if (item.TextOffset)
|
|
56559
56607
|
{
|
|
56560
|
-
var
|
|
56561
|
-
if (IFrameSplitOperator.IsNumber(
|
|
56562
|
-
if (IFrameSplitOperator.IsNumber(
|
|
56608
|
+
var textOffset=item.TextOffset;
|
|
56609
|
+
if (IFrameSplitOperator.IsNumber(textOffset.X)) x+=textOffset.X;
|
|
56610
|
+
if (IFrameSplitOperator.IsNumber(textOffset.Y)) y+=textOffset.Y;
|
|
56563
56611
|
}
|
|
56564
56612
|
|
|
56565
56613
|
this.Canvas.fillText(item.Text,x,y,itemSize.Width);
|
|
56566
56614
|
|
|
56567
|
-
|
|
56615
|
+
yTop+=itemSize.Height;
|
|
56568
56616
|
}
|
|
56569
56617
|
}
|
|
56570
56618
|
else //水平 单行
|
|
56571
56619
|
{
|
|
56572
|
-
var xText=
|
|
56573
|
-
var yBottom=
|
|
56620
|
+
var xText=rtBG.Left;
|
|
56621
|
+
var yBottom=rtBG.Bottom;
|
|
56574
56622
|
for(var i=0; i<complexText.Text.length; ++i)
|
|
56575
56623
|
{
|
|
56576
56624
|
var item=complexText.Text[i];
|
|
@@ -56582,15 +56630,16 @@ function ChartCorssCursor()
|
|
|
56582
56630
|
if (item.Color) this.Canvas.fillStyle=item.Color;
|
|
56583
56631
|
else this.Canvas.fillStyle=complexText.Color;
|
|
56584
56632
|
|
|
56585
|
-
var y=yBottom;
|
|
56586
56633
|
var x=xText;
|
|
56587
|
-
|
|
56634
|
+
var y=yBottom;
|
|
56635
|
+
|
|
56636
|
+
if (item.TextOffset)
|
|
56588
56637
|
{
|
|
56589
|
-
var
|
|
56590
|
-
if (IFrameSplitOperator.IsNumber(
|
|
56591
|
-
if (IFrameSplitOperator.IsNumber(
|
|
56638
|
+
var textOffset=item.TextOffset;
|
|
56639
|
+
if (IFrameSplitOperator.IsNumber(textOffset.X)) x+=textOffset.X;
|
|
56640
|
+
if (IFrameSplitOperator.IsNumber(textOffset.Y)) y+=textOffset.Y;
|
|
56592
56641
|
}
|
|
56593
|
-
|
|
56642
|
+
|
|
56594
56643
|
this.Canvas.fillText(item.Text,x,y,itemSize.Width);
|
|
56595
56644
|
|
|
56596
56645
|
xText+=itemSize.Width;
|
|
@@ -56613,7 +56662,7 @@ function ChartCorssCursor()
|
|
|
56613
56662
|
if (item.Font) this.Canvas.font=item.Font;
|
|
56614
56663
|
else this.Canvas.font=complexText.Font;
|
|
56615
56664
|
var itemWidth=this.Canvas.measureText(item.Text).width; //前后各空2个像素
|
|
56616
|
-
var itemHeight=this.
|
|
56665
|
+
var itemHeight=this.GetFontHeight();
|
|
56617
56666
|
if (item.Margin)
|
|
56618
56667
|
{
|
|
56619
56668
|
var margin=item.Margin;
|
|
@@ -56634,7 +56683,7 @@ function ChartCorssCursor()
|
|
|
56634
56683
|
}
|
|
56635
56684
|
else //水平 单行
|
|
56636
56685
|
{
|
|
56637
|
-
var textWidth=0, textHeight=
|
|
56686
|
+
var textWidth=0, textHeight=this.GetFontHeight();
|
|
56638
56687
|
for(var i=0; i<complexText.Text.length; ++i)
|
|
56639
56688
|
{
|
|
56640
56689
|
var item=complexText.Text[i];
|
|
@@ -56663,6 +56712,61 @@ function ChartCorssCursor()
|
|
|
56663
56712
|
}
|
|
56664
56713
|
}
|
|
56665
56714
|
|
|
56715
|
+
|
|
56716
|
+
this.DrawRightButtonV2=function(rtTextBG, complexText, textSize, data)
|
|
56717
|
+
{
|
|
56718
|
+
this.Canvas.fillStyle=this.RightButton.BGColor;
|
|
56719
|
+
var drawHeight=rtTextBG.Height;
|
|
56720
|
+
var drawWidth=rtTextBG.Height;
|
|
56721
|
+
|
|
56722
|
+
if (complexText.ShowType==1) //多行 取第1行高度
|
|
56723
|
+
{
|
|
56724
|
+
var itemSize=textSize.Text[0];
|
|
56725
|
+
drawHeight=itemSize.Height;
|
|
56726
|
+
drawWidth=itemSize.Height;
|
|
56727
|
+
}
|
|
56728
|
+
|
|
56729
|
+
var rtButton={Left:rtTextBG.Left-drawHeight, Top:rtTextBG.Top, Width:drawWidth, Height:drawHeight };
|
|
56730
|
+
rtButton.Right=rtButton.Left+rtButton.Width;
|
|
56731
|
+
rtButton.Bottom=rtButton.Top+rtButton.Height;
|
|
56732
|
+
this.RightButton.Rect=rtButton;
|
|
56733
|
+
this.RightButton.Data=data;
|
|
56734
|
+
this.Canvas.fillRect(ToFixedPoint(rtButton.Left+1),ToFixedPoint(rtButton.Top),ToFixedRect(rtButton.Width),ToFixedRect(rtButton.Height));
|
|
56735
|
+
|
|
56736
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
56737
|
+
var spaceWidth=3;
|
|
56738
|
+
var yCenter=(rtButton.Top+spaceWidth)+(rtButton.Height-spaceWidth*2)/2;
|
|
56739
|
+
var xCenter=(rtButton.Left+spaceWidth)+(rtButton.Width-spaceWidth*2)/2;
|
|
56740
|
+
|
|
56741
|
+
if (this.RightButton.Icon)
|
|
56742
|
+
{
|
|
56743
|
+
var icon=this.RightButton.Icon;
|
|
56744
|
+
this.Canvas.font=`${icon.Size*pixelRatio}px ${icon.Family}`;
|
|
56745
|
+
this.Canvas.textAlign="center";
|
|
56746
|
+
this.Canvas.textBaseline="middle";
|
|
56747
|
+
this.Canvas.fillStyle=icon.Color;
|
|
56748
|
+
this.Canvas.fillText("\ue6a3",xCenter,yCenter);
|
|
56749
|
+
}
|
|
56750
|
+
else
|
|
56751
|
+
{
|
|
56752
|
+
//画加号
|
|
56753
|
+
this.Canvas.strokeStyle=this.RightButton.PenColor;
|
|
56754
|
+
var x=rtButtom.Left+spaceWidth;
|
|
56755
|
+
var y=rtButtom.Top+spaceWidth;
|
|
56756
|
+
this.Canvas.save();
|
|
56757
|
+
this.Canvas.linewidth=1*pixelRatio;
|
|
56758
|
+
this.Canvas.beginPath();
|
|
56759
|
+
this.Canvas.moveTo(ToFixedPoint(x), ToFixedPoint(yCenter));
|
|
56760
|
+
this.Canvas.lineTo(ToFixedPoint(x+rtButton.Width-spaceWidth*2), ToFixedPoint(yCenter));
|
|
56761
|
+
|
|
56762
|
+
this.Canvas.moveTo(ToFixedPoint(xCenter),ToFixedPoint(y));
|
|
56763
|
+
this.Canvas.lineTo(ToFixedPoint(xCenter), ToFixedPoint(y+rtButton.Height-spaceWidth*2));
|
|
56764
|
+
|
|
56765
|
+
this.Canvas.stroke();
|
|
56766
|
+
this.Canvas.restore();
|
|
56767
|
+
}
|
|
56768
|
+
}
|
|
56769
|
+
|
|
56666
56770
|
this.DrawRightButton=function(drawTop, drawRight, drawWidth, drawHeight, data)
|
|
56667
56771
|
{
|
|
56668
56772
|
this.Canvas.fillStyle=this.RightButton.BGColor;
|
|
@@ -74151,13 +74255,13 @@ function JSChartResource()
|
|
|
74151
74255
|
{
|
|
74152
74256
|
BGColor:'rgb(43,54,69)',
|
|
74153
74257
|
PenColor:'rgb(255,255,255)',
|
|
74154
|
-
Icon: { Text:'\ue6a3', Color:'rgb(255,255,255)', Family:"iconfont", Size:
|
|
74258
|
+
Icon: { Text:'\ue6a3', Color:'rgb(255,255,255)', Family:"iconfont", Size:14 }
|
|
74155
74259
|
},
|
|
74156
74260
|
|
|
74157
|
-
RightMargin: { Left:2, Right:2, Top:5, Bottom:3 },
|
|
74158
|
-
|
|
74159
74261
|
BottomText:{ Margin: { Left:4, Right:4, Top:0, Bottom:0 }, TextOffset:{X:4, Y:-1 } },
|
|
74160
74262
|
LeftText:{ Margin: { Left:4, Right:4, Top:0, Bottom:0 }, TextOffset:{X:4, Y:-1 } },
|
|
74263
|
+
RightText:{ Margin: { Left:4, Right:4, Top:0, Bottom:0 }, TextOffset:{X:4, Y:-1 } },
|
|
74264
|
+
RightOverlayText:{ Margin: { Left:2, Right:2, Top:0, Bottom:0 }, TextOffset:{X:2, Y:-1 } }, //右侧叠加坐标
|
|
74161
74265
|
|
|
74162
74266
|
CorssPoint:{ Center:{ Radius:5*GetDevicePixelRatio(), Color:"rgb(50,171,205)"}, Border:{ Color:'rgb(255,255,255)', Width:1*GetDevicePixelRatio() } }
|
|
74163
74267
|
};
|
|
@@ -205,7 +205,7 @@ function GetBlackStyle()
|
|
|
205
205
|
{
|
|
206
206
|
BGColor:'rgb(43,54,69)',
|
|
207
207
|
PenColor:'rgb(255,255,255)',
|
|
208
|
-
Icon: { Text:'\ue6a3', Color:'rgb(255,255,255)', Family:"iconfont", Size:
|
|
208
|
+
Icon: { Text:'\ue6a3', Color:'rgb(255,255,255)', Family:"iconfont", Size:12 }
|
|
209
209
|
},
|
|
210
210
|
|
|
211
211
|
CorssPoint:{ Center:{ Color:"rgb(50,171,205)" }, Border:{ Color:'rgba(0,0,0,0.8)', Width:1*GetDevicePixelRatio() } }
|