// --------------------------------------------------------------------------------------------------------------------
//
// Copyright (c) 2014 OxyPlot contributors
//
//
// The axis base.
//
// --------------------------------------------------------------------------------------------------------------------
using Avalonia;
namespace OxyPlot.Avalonia
{
using global::Avalonia.Controls;
using global::Avalonia.Media;
using System;
///
/// The axis base.
///
public abstract class Axis : Control
{
///
/// Identifies the dependency property.
///
public static readonly StyledProperty AbsoluteMaximumProperty = AvaloniaProperty.Register(nameof(AbsoluteMaximum), double.MaxValue);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty AbsoluteMinimumProperty = AvaloniaProperty.Register(nameof(AbsoluteMinimum), double.MinValue);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty AngleProperty = AvaloniaProperty.Register(nameof(Angle), 0.0);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty AxisTickToLabelDistanceProperty = AvaloniaProperty.Register(nameof(AxisTickToLabelDistance), 4.0);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty AxisTitleDistanceProperty = AvaloniaProperty.Register(nameof(AxisTitleDistance), 4.0);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty AxisDistanceProperty = AvaloniaProperty.Register(nameof(AxisDistance), 0.0);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty AxislineColorProperty = AvaloniaProperty.Register(nameof(AxislineColor), Colors.Black);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty AxislineStyleProperty = AvaloniaProperty.Register(nameof(AxislineStyle), LineStyle.None);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty AxislineThicknessProperty = AvaloniaProperty.Register(nameof(AxislineThickness), 1.0);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty ClipTitleProperty = AvaloniaProperty.Register(nameof(ClipTitle), true);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty EndPositionProperty = AvaloniaProperty.Register(nameof(EndPosition), 1.0);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty ExtraGridlineColorProperty = AvaloniaProperty.Register(nameof(ExtraGridlineColor), Colors.Black);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty ExtraGridlineStyleProperty = AvaloniaProperty.Register(nameof(ExtraGridlineStyle), LineStyle.Solid);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty ExtraGridlineThicknessProperty = AvaloniaProperty.Register(nameof(ExtraGridlineThickness), 1.0);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty ExtraGridlinesProperty = AvaloniaProperty.Register("ExtraGridLines", null);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty> FilterFunctionProperty = AvaloniaProperty.Register>(nameof(FilterFunction), null);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty FilterMaxValueProperty = AvaloniaProperty.Register(nameof(FilterMaxValue), double.MaxValue);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty FilterMinValueProperty = AvaloniaProperty.Register(nameof(FilterMinValue), double.MinValue);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty FontProperty = AvaloniaProperty.Register(nameof(Font), null);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty FontSizeProperty = AvaloniaProperty.Register(nameof(FontSize), double.NaN);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty FontWeightProperty = AvaloniaProperty.Register(nameof(FontWeight), FontWeight.Normal);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty IntervalLengthProperty = AvaloniaProperty.Register(nameof(IntervalLength), 60.0);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty IsAxisVisibleProperty = AvaloniaProperty.Register(nameof(IsAxisVisible), true);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty IsPanEnabledProperty = AvaloniaProperty.Register(nameof(IsPanEnabled), true);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty IsZoomEnabledProperty = AvaloniaProperty.Register(nameof(IsZoomEnabled), true);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty KeyProperty = AvaloniaProperty.Register(nameof(Key), null);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty> LabelFormatterProperty = AvaloniaProperty.Register>(nameof(LabelFormatter), null);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty LayerProperty = AvaloniaProperty.Register(nameof(Layer), Axes.AxisLayer.BelowSeries);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty MajorGridlineColorProperty = AvaloniaProperty.Register(nameof(MajorGridlineColor), Color.FromArgb(0x40, 0, 0, 0));
///
/// Identifies the dependency property.
///
public static readonly StyledProperty MajorGridlineStyleProperty = AvaloniaProperty.Register(nameof(MajorGridlineStyle), LineStyle.None);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty MajorGridlineThicknessProperty = AvaloniaProperty.Register(nameof(MajorGridlineThickness), 1.0);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty MajorStepProperty = AvaloniaProperty.Register(nameof(MajorStep), double.NaN);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty MajorTickSizeProperty = AvaloniaProperty.Register(nameof(MajorTickSize), 7.0);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty MaximumPaddingProperty = AvaloniaProperty.Register(nameof(MaximumPadding), 0.01);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty MaximumMarginProperty = AvaloniaProperty.Register(nameof(MaximumMargin), 0.0);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty MaximumDataMarginProperty = AvaloniaProperty.Register(nameof(MaximumDataMargin), 0.0);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty MaximumProperty = AvaloniaProperty.Register(nameof(Maximum), double.NaN);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty MaximumRangeProperty = AvaloniaProperty.Register(nameof(MaximumRange), double.PositiveInfinity);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty MinimumPaddingProperty = AvaloniaProperty.Register(nameof(MinimumPadding), 0.01);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty MinimumMarginProperty = AvaloniaProperty.Register(nameof(MinimumMargin), 0.0);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty MinimumDataMarginProperty = AvaloniaProperty.Register(nameof(MinimumDataMargin), 0.0);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty MinimumProperty = AvaloniaProperty.Register(nameof(Minimum), double.NaN);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty MinimumRangeProperty = AvaloniaProperty.Register(nameof(MinimumRange), 0.0);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty MinorGridlineColorProperty = AvaloniaProperty.Register(nameof(MinorGridlineColor), Color.FromArgb(0x20, 0, 0, 0));
///
/// Identifies the dependency property.
///
public static readonly StyledProperty MinorGridlineStyleProperty = AvaloniaProperty.Register(nameof(MinorGridlineStyle), LineStyle.None);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty MinorGridlineThicknessProperty = AvaloniaProperty.Register(nameof(MinorGridlineThickness), 1.0);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty MinorStepProperty = AvaloniaProperty.Register(nameof(MinorStep), double.NaN);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty MinorTickSizeProperty = AvaloniaProperty.Register(nameof(MinorTickSize), 4.0);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty PositionAtZeroCrossingProperty = AvaloniaProperty.Register(nameof(PositionAtZeroCrossing), false);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty PositionProperty = AvaloniaProperty.Register(nameof(Position), Axes.AxisPosition.Left);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty PositionTierProperty = AvaloniaProperty.Register(nameof(PositionTier), 0);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty StartPositionProperty = AvaloniaProperty.Register(nameof(StartPosition), 0.0);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty StringFormatProperty = AvaloniaProperty.Register(nameof(StringFormat), null);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty TextColorProperty = AvaloniaProperty.Register(nameof(TextColor), MoreColors.Automatic);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty TickStyleProperty = AvaloniaProperty.Register(nameof(TickStyle), Axes.TickStyle.Outside);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty TicklineColorProperty = AvaloniaProperty.Register(nameof(TicklineColor), Colors.Black);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty TitleClippingLengthProperty = AvaloniaProperty.Register(nameof(TitleClippingLength), 0.9);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty TitleColorProperty = AvaloniaProperty.Register(nameof(TitleColor), OxyColors.Automatic.ToColor());
///
/// Identifies the dependency property.
///
public static readonly StyledProperty TitleFontProperty = AvaloniaProperty.Register(nameof(TitleFont), null);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty TitleFontSizeProperty = AvaloniaProperty.Register(nameof(TitleFontSize), double.NaN);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty TitleFontWeightProperty = AvaloniaProperty.Register(nameof(TitleFontWeight), FontWeight.Normal);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty TitleFormatStringProperty = AvaloniaProperty.Register(nameof(TitleFormatString), "{0} [{1}]");
///
/// Identifies the dependency property.
///
public static readonly StyledProperty TitlePositionProperty = AvaloniaProperty.Register(nameof(TitlePosition), 0.5);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty TitleProperty = AvaloniaProperty.Register(nameof(Title), null);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty UnitProperty = AvaloniaProperty.Register(nameof(Unit), null);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty UseSuperExponentialFormatProperty = AvaloniaProperty.Register(nameof(UseSuperExponentialFormat), false);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty EdgeRenderingModeProperty = AvaloniaProperty.Register(nameof(EdgeRenderingMode), EdgeRenderingMode.Automatic);
///
/// Gets or sets the internal axis.
///
public Axes.Axis InternalAxis { get; protected set; }
///
/// Gets or sets the absolute maximum. This is only used for the UI control. It will not be possible to zoom/pan beyond this limit.
///
public double AbsoluteMaximum
{
get
{
return GetValue(AbsoluteMaximumProperty);
}
set
{
SetValue(AbsoluteMaximumProperty, value);
}
}
///
/// Gets or sets the absolute minimum. This is only used for the UI control. It will not be possible to zoom/pan beyond this limit.
///
public double AbsoluteMinimum
{
get
{
return GetValue(AbsoluteMinimumProperty);
}
set
{
SetValue(AbsoluteMinimumProperty, value);
}
}
///
/// Gets or sets Angle.
///
public double Angle
{
get
{
return GetValue(AngleProperty);
}
set
{
SetValue(AngleProperty, value);
}
}
///
/// Gets or sets AxisDistance.
///
public double AxisDistance
{
get
{
return GetValue(AxisDistanceProperty);
}
set
{
SetValue(AxisDistanceProperty, value);
}
}
///
/// Gets or sets AxisTickToLabelDistance.
///
public double AxisTickToLabelDistance
{
get
{
return GetValue(AxisTickToLabelDistanceProperty);
}
set
{
SetValue(AxisTickToLabelDistanceProperty, value);
}
}
///
/// Gets or sets AxisTitleDistance.
///
public double AxisTitleDistance
{
get
{
return GetValue(AxisTitleDistanceProperty);
}
set
{
SetValue(AxisTitleDistanceProperty, value);
}
}
///
/// Gets or sets the color of the axis line.
///
/// The color of the axis line.
public Color AxislineColor
{
get
{
return GetValue(AxislineColorProperty);
}
set
{
SetValue(AxislineColorProperty, value);
}
}
///
/// Gets or sets the axis line style.
///
/// The axis line style.
public LineStyle AxislineStyle
{
get
{
return GetValue(AxislineStyleProperty);
}
set
{
SetValue(AxislineStyleProperty, value);
}
}
///
/// Gets or sets the axis line thickness.
///
/// The axis line thickness.
public double AxislineThickness
{
get
{
return GetValue(AxislineThicknessProperty);
}
set
{
SetValue(AxislineThicknessProperty, value);
}
}
///
/// Gets or sets a value indicating whether [clip title].
///
/// true if [clip title]; otherwise, false .
public bool ClipTitle
{
get
{
return GetValue(ClipTitleProperty);
}
set
{
SetValue(ClipTitleProperty, value);
}
}
///
/// Gets or sets EndPosition.
///
public double EndPosition
{
get
{
return GetValue(EndPositionProperty);
}
set
{
SetValue(EndPositionProperty, value);
}
}
///
/// Gets or sets ExtraGridlineColor.
///
public Color ExtraGridlineColor
{
get
{
return GetValue(ExtraGridlineColorProperty);
}
set
{
SetValue(ExtraGridlineColorProperty, value);
}
}
///
/// Gets or sets ExtraGridlineStyle.
///
public LineStyle ExtraGridlineStyle
{
get
{
return GetValue(ExtraGridlineStyleProperty);
}
set
{
SetValue(ExtraGridlineStyleProperty, value);
}
}
///
/// Gets or sets ExtraGridlineThickness.
///
public double ExtraGridlineThickness
{
get
{
return GetValue(ExtraGridlineThicknessProperty);
}
set
{
SetValue(ExtraGridlineThicknessProperty, value);
}
}
///
/// Gets or sets ExtraGridLines.
///
public double[] ExtraGridlines
{
get
{
return GetValue(ExtraGridlinesProperty);
}
set
{
SetValue(ExtraGridlinesProperty, value);
}
}
///
/// Gets or sets the filter function.
///
/// The filter function.
public Func FilterFunction
{
get
{
return GetValue(FilterFunctionProperty);
}
set
{
SetValue(FilterFunctionProperty, value);
}
}
///
/// Gets or sets FilterMaxValue.
///
public double FilterMaxValue
{
get
{
return GetValue(FilterMaxValueProperty);
}
set
{
SetValue(FilterMaxValueProperty, value);
}
}
///
/// Gets or sets FilterMinValue.
///
public double FilterMinValue
{
get
{
return GetValue(FilterMinValueProperty);
}
set
{
SetValue(FilterMinValueProperty, value);
}
}
///
/// Gets or sets Font.
///
public string Font
{
get
{
return GetValue(FontProperty);
}
set
{
SetValue(FontProperty, value);
}
}
///
/// Gets or sets FontSize.
///
public double FontSize
{
get
{
return GetValue(FontSizeProperty);
}
set
{
SetValue(FontSizeProperty, value);
}
}
///
/// Gets or sets the font weight.
///
public FontWeight FontWeight
{
get
{
return GetValue(FontWeightProperty);
}
set
{
SetValue(FontWeightProperty, value);
}
}
///
/// Gets or sets the interval length.
///
public double IntervalLength
{
get
{
return GetValue(IntervalLengthProperty);
}
set
{
SetValue(IntervalLengthProperty, value);
}
}
///
/// Gets or sets a value indicating whether the axis is visible.
///
public bool IsAxisVisible
{
get
{
return GetValue(IsAxisVisibleProperty);
}
set
{
SetValue(IsAxisVisibleProperty, value);
}
}
///
/// Gets or sets a value indicating whether pan is enabled.
///
public bool IsPanEnabled
{
get
{
return GetValue(IsPanEnabledProperty);
}
set
{
SetValue(IsPanEnabledProperty, value);
}
}
///
/// Gets or sets a value indicating whether zoom is enabled.
///
public bool IsZoomEnabled
{
get
{
return GetValue(IsZoomEnabledProperty);
}
set
{
SetValue(IsZoomEnabledProperty, value);
}
}
///
/// Gets or sets the axis key.
///
public string Key
{
get
{
return GetValue(KeyProperty);
}
set
{
SetValue(KeyProperty, value);
}
}
///
/// Gets or sets the label formatter.
///
public Func LabelFormatter
{
get
{
return GetValue(LabelFormatterProperty);
}
set
{
SetValue(LabelFormatterProperty, value);
}
}
///
/// Gets or sets the layer.
///
public Axes.AxisLayer Layer
{
get
{
return GetValue(LayerProperty);
}
set
{
SetValue(LayerProperty, value);
}
}
///
/// Gets or sets the color of the major gridlines.
///
public Color MajorGridlineColor
{
get
{
return GetValue(MajorGridlineColorProperty);
}
set
{
SetValue(MajorGridlineColorProperty, value);
}
}
///
/// Gets or sets the line style of the major gridlines.
///
public LineStyle MajorGridlineStyle
{
get
{
return GetValue(MajorGridlineStyleProperty);
}
set
{
SetValue(MajorGridlineStyleProperty, value);
}
}
///
/// Gets or sets MajorGridlineThickness.
///
public double MajorGridlineThickness
{
get
{
return GetValue(MajorGridlineThicknessProperty);
}
set
{
SetValue(MajorGridlineThicknessProperty, value);
}
}
///
/// Gets or sets MajorStep.
///
public double MajorStep
{
get
{
return GetValue(MajorStepProperty);
}
set
{
SetValue(MajorStepProperty, value);
}
}
///
/// Gets or sets MajorTickSize.
///
public double MajorTickSize
{
get
{
return GetValue(MajorTickSizeProperty);
}
set
{
SetValue(MajorTickSizeProperty, value);
}
}
///
/// Gets or sets Maximum.
///
public double Maximum
{
get
{
return GetValue(MaximumProperty);
}
set
{
SetValue(MaximumProperty, value);
}
}
///
/// Gets or sets MaximumPadding.
///
public double MaximumPadding
{
get
{
return GetValue(MaximumPaddingProperty);
}
set
{
SetValue(MaximumPaddingProperty, value);
}
}
///
/// Gets or sets Margin.
///
public double MaximumMargin
{
get
{
return GetValue(MaximumMarginProperty);
}
set
{
SetValue(MaximumMarginProperty, value);
}
}
///
/// Gets or sets DataMargin.
///
public double MaximumDataMargin
{
get
{
return GetValue(MaximumDataMarginProperty);
}
set
{
SetValue(MaximumDataMarginProperty, value);
}
}
///
/// Gets or sets MaximumRange.
///
public double MaximumRange
{
get
{
return GetValue(MaximumRangeProperty);
}
set
{
SetValue(MaximumRangeProperty, value);
}
}
///
/// Gets or sets Minimum.
///
public double Minimum
{
get
{
return GetValue(MinimumProperty);
}
set
{
SetValue(MinimumProperty, value);
}
}
///
/// Gets or sets MinimumPadding.
///
public double MinimumPadding
{
get
{
return GetValue(MinimumPaddingProperty);
}
set
{
SetValue(MinimumPaddingProperty, value);
}
}
///
/// Gets or sets Margin.
///
public double MinimumMargin
{
get
{
return GetValue(MinimumMarginProperty);
}
set
{
SetValue(MinimumMarginProperty, value);
}
}
///
/// Gets or sets DataMargin.
///
public double MinimumDataMargin
{
get
{
return GetValue(MinimumDataMarginProperty);
}
set
{
SetValue(MinimumDataMarginProperty, value);
}
}
///
/// Gets or sets MinimumRange.
///
public double MinimumRange
{
get
{
return GetValue(MinimumRangeProperty);
}
set
{
SetValue(MinimumRangeProperty, value);
}
}
///
/// Gets or sets MinorGridlineColor.
///
public Color MinorGridlineColor
{
get
{
return GetValue(MinorGridlineColorProperty);
}
set
{
SetValue(MinorGridlineColorProperty, value);
}
}
///
/// Gets or sets MinorGridlineStyle.
///
public LineStyle MinorGridlineStyle
{
get
{
return GetValue(MinorGridlineStyleProperty);
}
set
{
SetValue(MinorGridlineStyleProperty, value);
}
}
///
/// Gets or sets MinorGridlineThickness.
///
public double MinorGridlineThickness
{
get
{
return GetValue(MinorGridlineThicknessProperty);
}
set
{
SetValue(MinorGridlineThicknessProperty, value);
}
}
///
/// Gets or sets MinorStep.
///
public double MinorStep
{
get
{
return GetValue(MinorStepProperty);
}
set
{
SetValue(MinorStepProperty, value);
}
}
///
/// Gets or sets MinorTickSize.
///
public double MinorTickSize
{
get
{
return GetValue(MinorTickSizeProperty);
}
set
{
SetValue(MinorTickSizeProperty, value);
}
}
///
/// Gets or sets Position.
///
public Axes.AxisPosition Position
{
get
{
return GetValue(PositionProperty);
}
set
{
SetValue(PositionProperty, value);
}
}
///
/// Gets or sets a value indicating whether PositionAtZeroCrossing.
///
public bool PositionAtZeroCrossing
{
get
{
return GetValue(PositionAtZeroCrossingProperty);
}
set
{
SetValue(PositionAtZeroCrossingProperty, value);
}
}
///
/// Gets or sets the position tier which defines in which tier the axis is displayed.
///
/// The bigger the value the further afar is the axis from the graph.
public int PositionTier
{
get
{
return GetValue(PositionTierProperty);
}
set
{
SetValue(PositionTierProperty, value);
}
}
///
/// Gets or sets the start position.
///
public double StartPosition
{
get
{
return GetValue(StartPositionProperty);
}
set
{
SetValue(StartPositionProperty, value);
}
}
///
/// Gets or sets the string format.
///
public string StringFormat
{
get
{
return GetValue(StringFormatProperty);
}
set
{
SetValue(StringFormatProperty, value);
}
}
///
/// Gets or sets the text color
///
public Color TextColor
{
get
{
return GetValue(TextColorProperty);
}
set
{
SetValue(TextColorProperty, value);
}
}
///
/// Gets or sets the tick style.
///
public Axes.TickStyle TickStyle
{
get
{
return GetValue(TickStyleProperty);
}
set
{
SetValue(TickStyleProperty, value);
}
}
///
/// Gets or sets the tick line color.
///
public Color TicklineColor
{
get
{
return GetValue(TicklineColorProperty);
}
set
{
SetValue(TicklineColorProperty, value);
}
}
///
/// Gets or sets the title.
///
public string Title
{
get
{
return GetValue(TitleProperty);
}
set
{
SetValue(TitleProperty, value);
}
}
///
/// Gets or sets the length of the title clipping.
///
/// The length of the title clipping.
public double TitleClippingLength
{
get
{
return GetValue(TitleClippingLengthProperty);
}
set
{
SetValue(TitleClippingLengthProperty, value);
}
}
///
/// Gets or sets the color of the title.
///
/// The color of the title.
public Color TitleColor
{
get
{
return GetValue(TitleColorProperty);
}
set
{
SetValue(TitleColorProperty, value);
}
}
///
/// Gets or sets the title font.
///
/// The title font.
public string TitleFont
{
get
{
return GetValue(TitleFontProperty);
}
set
{
SetValue(TitleFontProperty, value);
}
}
///
/// Gets or sets the size of the title font.
///
/// The size of the title font.
public double TitleFontSize
{
get
{
return GetValue(TitleFontSizeProperty);
}
set
{
SetValue(TitleFontSizeProperty, value);
}
}
///
/// Gets or sets the title font weight.
///
/// The title font weight.
public FontWeight TitleFontWeight
{
get
{
return GetValue(TitleFontWeightProperty);
}
set
{
SetValue(TitleFontWeightProperty, value);
}
}
///
/// Gets or sets TitleFormatString.
///
public string TitleFormatString
{
get
{
return GetValue(TitleFormatStringProperty);
}
set
{
SetValue(TitleFormatStringProperty, value);
}
}
///
/// Gets or sets TitlePosition.
///
public double TitlePosition
{
get
{
return GetValue(TitlePositionProperty);
}
set
{
SetValue(TitlePositionProperty, value);
}
}
///
/// Gets or sets Unit.
///
public string Unit
{
get
{
return GetValue(UnitProperty);
}
set
{
SetValue(UnitProperty, value);
}
}
///
/// Gets or sets a value indicating whether UseSuperExponentialFormat.
///
public bool UseSuperExponentialFormat
{
get
{
return GetValue(UseSuperExponentialFormatProperty);
}
set
{
SetValue(UseSuperExponentialFormatProperty, value);
}
}
///
/// Gets or sets the for the axis.
///
public EdgeRenderingMode EdgeRenderingMode
{
get
{
return GetValue(EdgeRenderingModeProperty);
}
set
{
SetValue(EdgeRenderingModeProperty, value);
}
}
///
/// Creates the model.
///
/// An axis object.
public abstract Axes.Axis CreateModel();
///
/// The visual appearance changed.
///
/// The sender.
/// The event args.
protected static void AppearanceChanged(AvaloniaObject d, AvaloniaPropertyChangedEventArgs e)
{
((Axis)d).OnVisualChanged();
}
///
/// The on visual changed handler.
///
protected void OnVisualChanged()
{
(this.Parent as IPlot)?.ElementAppearanceChanged(this);
}
///
/// The data changed.
///
/// The sender.
/// The event args.
protected static void DataChanged(AvaloniaObject d, AvaloniaPropertyChangedEventArgs e)
{
((Axis)d).OnDataChanged();
}
///
/// The on data changed handler.
///
protected void OnDataChanged()
{
(this.Parent as IPlot)?.ElementDataChanged(this);
}
///
/// The on property changed handler.
///
/// The event args.
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs e)
{
base.OnPropertyChanged(e);
if (e.Property.OwnerType == GetType() && Parent is IPlotView plot)
{
plot.InvalidatePlot();
}
}
///
/// Synchronizes the properties.
///
protected virtual void SynchronizeProperties()
{
var a = InternalAxis;
a.AbsoluteMaximum = AbsoluteMaximum;
a.AbsoluteMinimum = AbsoluteMinimum;
a.Angle = Angle;
a.AxisDistance = AxisDistance;
a.AxislineColor = AxislineColor.ToOxyColor();
a.AxislineStyle = AxislineStyle;
a.AxislineThickness = AxislineThickness;
a.AxisTitleDistance = AxisTitleDistance;
a.AxisTickToLabelDistance = AxisTickToLabelDistance;
a.ClipTitle = ClipTitle;
a.EndPosition = EndPosition;
a.ExtraGridlineColor = ExtraGridlineColor.ToOxyColor();
a.ExtraGridlineStyle = ExtraGridlineStyle;
a.ExtraGridlineThickness = ExtraGridlineThickness;
a.ExtraGridlines = ExtraGridlines;
a.FilterFunction = FilterFunction;
a.FilterMaxValue = FilterMaxValue;
a.FilterMinValue = FilterMinValue;
a.Font = Font;
a.FontSize = FontSize;
a.FontWeight = (int)FontWeight;
a.IntervalLength = IntervalLength;
a.IsPanEnabled = IsPanEnabled;
a.IsAxisVisible = IsAxisVisible;
a.IsZoomEnabled = IsZoomEnabled;
a.Key = Key;
a.Layer = Layer;
a.MajorGridlineColor = MajorGridlineColor.ToOxyColor();
a.MinorGridlineColor = MinorGridlineColor.ToOxyColor();
a.MajorGridlineStyle = MajorGridlineStyle;
a.MinorGridlineStyle = MinorGridlineStyle;
a.MajorGridlineThickness = MajorGridlineThickness;
a.MinorGridlineThickness = MinorGridlineThickness;
a.MajorStep = MajorStep;
a.MajorTickSize = MajorTickSize;
a.MinorStep = MinorStep;
a.MinorTickSize = MinorTickSize;
a.Minimum = Minimum;
a.Maximum = Maximum;
a.MinimumRange = MinimumRange;
a.MaximumRange = MaximumRange;
a.MinimumPadding = MinimumPadding;
a.MaximumPadding = MaximumPadding;
a.MinimumMargin = MinimumMargin;
a.MaximumMargin = MinimumMargin;
a.MinimumDataMargin = MinimumDataMargin;
a.MaximumDataMargin = MaximumDataMargin;
a.Position = Position;
a.PositionTier = PositionTier;
a.PositionAtZeroCrossing = PositionAtZeroCrossing;
a.StartPosition = StartPosition;
a.StringFormat = StringFormat;
a.TextColor = TextColor.ToOxyColor();
a.TicklineColor = TicklineColor.ToOxyColor();
a.TitleClippingLength = TitleClippingLength;
a.TitleColor = TitleColor.ToOxyColor();
a.TitleFont = TitleFont;
a.TitleFontSize = TitleFontSize;
a.TitleFontWeight = (int)TitleFontWeight;
a.TitleFormatString = TitleFormatString;
a.Title = Title;
a.ToolTip = (ToolTip.GetTip(this)?.ToString());
a.TickStyle = TickStyle;
a.TitlePosition = TitlePosition;
a.Unit = Unit;
a.UseSuperExponentialFormat = UseSuperExponentialFormat;
a.LabelFormatter = LabelFormatter;
a.EdgeRenderingMode = EdgeRenderingMode;
}
static Axis()
{
AbsoluteMaximumProperty.Changed.AddClassHandler(AppearanceChanged);
AbsoluteMinimumProperty.Changed.AddClassHandler(AppearanceChanged);
AngleProperty.Changed.AddClassHandler(AppearanceChanged);
AxisTickToLabelDistanceProperty.Changed.AddClassHandler(AppearanceChanged);
AxisTitleDistanceProperty.Changed.AddClassHandler(AppearanceChanged);
AxisDistanceProperty.Changed.AddClassHandler(AppearanceChanged);
AxislineColorProperty.Changed.AddClassHandler(AppearanceChanged);
AxislineStyleProperty.Changed.AddClassHandler(AppearanceChanged);
AxislineThicknessProperty.Changed.AddClassHandler(AppearanceChanged);
ClipTitleProperty.Changed.AddClassHandler(AppearanceChanged);
EndPositionProperty.Changed.AddClassHandler(AppearanceChanged);
ExtraGridlineColorProperty.Changed.AddClassHandler(AppearanceChanged);
ExtraGridlineStyleProperty.Changed.AddClassHandler(AppearanceChanged);
ExtraGridlineThicknessProperty.Changed.AddClassHandler(AppearanceChanged);
ExtraGridlinesProperty.Changed.AddClassHandler(DataChanged);
FilterFunctionProperty.Changed.AddClassHandler(AppearanceChanged);
FilterMaxValueProperty.Changed.AddClassHandler(DataChanged);
FilterMinValueProperty.Changed.AddClassHandler(DataChanged);
FontProperty.Changed.AddClassHandler(AppearanceChanged);
FontSizeProperty.Changed.AddClassHandler(AppearanceChanged);
FontWeightProperty.Changed.AddClassHandler(AppearanceChanged);
IntervalLengthProperty.Changed.AddClassHandler(AppearanceChanged);
IsAxisVisibleProperty.Changed.AddClassHandler(AppearanceChanged);
KeyProperty.Changed.AddClassHandler(DataChanged);
LabelFormatterProperty.Changed.AddClassHandler(AppearanceChanged);
LayerProperty.Changed.AddClassHandler(AppearanceChanged);
MajorGridlineColorProperty.Changed.AddClassHandler(AppearanceChanged);
MajorGridlineStyleProperty.Changed.AddClassHandler(AppearanceChanged);
MajorGridlineThicknessProperty.Changed.AddClassHandler(AppearanceChanged);
MajorStepProperty.Changed.AddClassHandler(AppearanceChanged);
MajorTickSizeProperty.Changed.AddClassHandler(AppearanceChanged);
MaximumPaddingProperty.Changed.AddClassHandler(AppearanceChanged);
MaximumMarginProperty.Changed.AddClassHandler(AppearanceChanged);
MaximumDataMarginProperty.Changed.AddClassHandler(AppearanceChanged);
MaximumProperty.Changed.AddClassHandler(AppearanceChanged);
MaximumRangeProperty.Changed.AddClassHandler(AppearanceChanged);
MinimumPaddingProperty.Changed.AddClassHandler(AppearanceChanged);
MinimumMarginProperty.Changed.AddClassHandler(AppearanceChanged);
MinimumDataMarginProperty.Changed.AddClassHandler(AppearanceChanged);
MinimumProperty.Changed.AddClassHandler(AppearanceChanged);
MinimumRangeProperty.Changed.AddClassHandler(AppearanceChanged);
MinorGridlineColorProperty.Changed.AddClassHandler(AppearanceChanged);
MinorGridlineStyleProperty.Changed.AddClassHandler(AppearanceChanged);
MinorGridlineThicknessProperty.Changed.AddClassHandler(AppearanceChanged);
MinorStepProperty.Changed.AddClassHandler(AppearanceChanged);
MinorTickSizeProperty.Changed.AddClassHandler(AppearanceChanged);
PositionAtZeroCrossingProperty.Changed.AddClassHandler(AppearanceChanged);
PositionProperty.Changed.AddClassHandler(AppearanceChanged);
PositionTierProperty.Changed.AddClassHandler(AppearanceChanged);
StartPositionProperty.Changed.AddClassHandler(AppearanceChanged);
StringFormatProperty.Changed.AddClassHandler(AppearanceChanged);
TextColorProperty.Changed.AddClassHandler(AppearanceChanged);
TickStyleProperty.Changed.AddClassHandler(AppearanceChanged);
TicklineColorProperty.Changed.AddClassHandler(AppearanceChanged);
TitleClippingLengthProperty.Changed.AddClassHandler(AppearanceChanged);
TitleColorProperty.Changed.AddClassHandler(AppearanceChanged);
TitleFontProperty.Changed.AddClassHandler(AppearanceChanged);
TitleFontSizeProperty.Changed.AddClassHandler(AppearanceChanged);
TitleFontWeightProperty.Changed.AddClassHandler(AppearanceChanged);
TitleFormatStringProperty.Changed.AddClassHandler(AppearanceChanged);
TitlePositionProperty.Changed.AddClassHandler(AppearanceChanged);
TitleProperty.Changed.AddClassHandler(AppearanceChanged);
UnitProperty.Changed.AddClassHandler(AppearanceChanged);
UseSuperExponentialFormatProperty.Changed.AddClassHandler(AppearanceChanged);
EdgeRenderingModeProperty.Changed.AddClassHandler(AppearanceChanged);
}
}
}