markus / ConvertService / ServiceBase / Markus.Service.StationController / Controls / RightAlignedLabelStrategy.cs @ 80391351
이력 | 보기 | 이력해설 | 다운로드 (1.3 KB)
1 | 80391351 | semi | using GemBox.Spreadsheet.Charts; |
---|---|---|---|
2 | using System; |
||
3 | using System.Collections.Generic; |
||
4 | using System.Linq; |
||
5 | using System.Text; |
||
6 | using System.Threading.Tasks; |
||
7 | using System.Windows; |
||
8 | using Telerik.Charting; |
||
9 | using Telerik.Windows.Controls; |
||
10 | using Telerik.Windows.Controls.ChartView; |
||
11 | using ChartSeries = Telerik.Windows.Controls.ChartView.ChartSeries; |
||
12 | |||
13 | namespace Markus.Service.StationController.Controls |
||
14 | { |
||
15 | public class RightAlignedLabelStrategy : Telerik.Windows.Controls.ChartView.ChartSeriesLabelStrategy |
||
16 | { |
||
17 | public double Offset { get; set; } |
||
18 | |||
19 | public override Telerik.Windows.Controls.ChartView.LabelStrategyOptions Options |
||
20 | { |
||
21 | get { return Telerik.Windows.Controls.ChartView.LabelStrategyOptions.Arrange; } |
||
22 | } |
||
23 | |||
24 | public override Telerik.Charting.RadRect GetLabelLayoutSlot(Telerik.Charting.DataPoint point, System.Windows.FrameworkElement visual, int labelIndex) |
||
25 | { |
||
26 | Size size = visual.DesiredSize; |
||
27 | |||
28 | var series = (ChartSeries)point.Presenter; |
||
29 | double top = point.LayoutSlot.Center.Y - (size.Height / 2); |
||
30 | double left = series.Chart.PlotAreaClip.Right - size.Width + this.Offset; |
||
31 | |||
32 | return new RadRect(left, top, size.Width, size.Height); |
||
33 | } |
||
34 | |||
35 | } |
||
36 | } |