yangyin
2024-08-21 04e1d0a290ff76bf623bd9de075b350b8b77ba25
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
using DevExpress.Charts.Native;
using DevExpress.XtraCharts;
using DevExpress.XtraCharts.Localization;
 
namespace Yw.WinFrmUI.Phart.Core
{
    internal class Title
    {
        class TxtFont
        {
            public string Name { get; set; }
 
            public int Size { get; set; }
        }
 
        public enum AxisTitlePosition
        { 
            Outside, 
            Inside
        }
        
        public enum StringAlignment
        {
            //
            // 摘要:
            //     Specifies the text be aligned near the layout. In a left-to-right layout, the
            //     near position is left. In a right-to-left layout, the near position is right.
            Near = 0, 
            Center = 1, 
            Far = 2
        }
 
        TxtFont Font { get; set; }
        StringAlignment Alignment { get; set; }
        AxisTitlePosition Position { get; set; }
        bool Visible { get; set; }
        bool WordWrap { get; set; }//字体折行
 
    }
 
    internal class Axis
    {
        public enum AxisAlignment
        {
            //
            // 摘要:
            //     An axis is displayed at the left or bottom side of the diagram, depending on
            //     its type and orientation.
            Near,
            //
            // 摘要:
            //     An axis is displayed at the right or top side of the diagram, depending on its
            //     type and orientation.
            Far,
            //
            // 摘要:
            //     An axis intercepts another primary axis at the zero level.
            //
            //     This alignment type is applicable to primary axes only.
            //
            //     In this mode, an axis title and labels are shown within the pane.
            //
            //     For an axis of (Y) values, the zero level is its zero line.
            //
            //     For an axis of (X) arguments, the zero level depends upon a series’ SeriesBase.ScaleType
            //     property value:
            //
            //     - for the ScaleType.Qualitative scale, the zero level is specified by the first
            //     point’s argument,
            //
            //     - for the ScaleType.Numerical scale, the zero level equals the zero value,
            //
            //     - for the ScaleType.DateTime scale, the zero level is equal to the earliest date.
            Zero,
            //
            // 摘要:
            //     The axis is positioned in the center of chart plot area.
            //
            //     This alignment type is applicable to primary axes only.
            //
            //     In this mode, an axis title and labels are shown within the pane.
            Center
        }
        public enum AxisLabelAlignment
        {
            //
            // 摘要:
            //     The label alignment depends on the Axis2D.Alignment property value.
            Auto = -1,
            //
            // 摘要:
            //     Axis labels are centered with major tickmarks.
            Center = 0,
            //
            // 摘要:
            //     Axis labels are displayed at the major tickmark right or top side in depending
            //     on axis type and orientation.
            Far = 2,
            //
            // 摘要:
            //     Axis labels are displayed at the major tickmark left or bottom side in depending
            //     on axis type and orientation.
            Near = 1
        }
 
        string Name { get; set; }
        AxisAlignment DefaultAlignment => AxisAlignment.Near;
        AxisLabelAlignment DefaultLabelAlignment => AxisLabelAlignment.Center;
 
    }
 
    public class AxisX : AxisXBase
    {
        private static readonly string defaultName = ChartLocalizer.GetString(ChartStringId.PrimaryAxisXName);
 
        protected override AxisAlignment DefaultAlignment => AxisAlignment.Near;
 
        protected override ChartElementVisibilityPriority Priority => ChartElementVisibilityPriority.AxisX;
 
        protected override AxisLabelAlignment DefaultLabelAlignment
        {
            get
            {
                if (!base.PositionInsideDiagram && !base.LabelInOutsidePosition && IsVertical)
                {
                    return AxisLabelAlignment.Far;
                }
 
                return AxisLabelAlignment.Center;
            }
        }
 
        protected internal override AxisGroup AxisGroup => AxisGroup.ArgumentX;
 
        //
      
 
        internal AxisX(XYDiagram diagram)
            : base(defaultName, diagram)
        {
        }
 
        protected override ChartElement CreateObjectForClone()
        {
            return new AxisX(null);
        }
 
        protected override GridLines CreateGridLines()
        {
            return new GridLinesX(this);
        }
    }
 
}