Open fizzikzz opened 3 years ago
I can't reproduce a black screen using an empty override like you describe, though OxyPlot.LinearAxis
doesn't exist; you need either OxyPlot.Axes.LinearAxis
or OxyPlot.Avalonia.LinearAxis
: the former is the normal linear-axis model, the latter you can use in XAML bindings and all that.
For example, here you could add an instance of CustomLinearAxis
to PlotModel.Axes
, or include a CustomAxis
in Plot.Axes
(e.g. in XAML):
public class CustomAxis : OxyPlot.Avalonia.LinearAxis
{
public CustomAxis()
{
InternalAxis = new CustomLinearAxis();
}
}
public class CustomLinearAxis : LinearAxis
{
public override void GetTickValues(out IList<double> majorLabelValues, out IList<double> majorTickValues, out IList<double> minorTickValues)
{
base.GetTickValues(out majorLabelValues, out majorTickValues, out minorTickValues);
minorTickValues.Clear();
}
}
If I make a custom axis using an OxyPlot.LinearAxis as the base class like:
public class CustomLinearAxis : LinearAxis { }
The background on my usercontrol hosting the PlotView that uses the custom axis turns black. It seems like it doesn't style properly.
Is there a way to add custom axes in OxyPlot-Avalonia properly?