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); } } }