I\'m using to Oxyplot for my Xamarin.iOS project for plotting a bar chart..
This is what my graph currently looks likes currently
here\'s instead of
To show the label on the axis you have to specify the property MajorStep
, Oxyplot will paint only the labels matching the major step.
model.Axes.Add(new LinearAxis()
{
MajorStep = 10,
Position = AxisPosition.Left,
...
});
And to modify the labels with the day name, you can use a DateTimeAxis
instead of LinearAxis
:
model.Axes.Add(new DateTimeAxis()
{
StringFormat = "ffffd",
Position = AxisPosition.Bottom,
...
});
If you want something more customized you will have to use the LabelFormatter
attribute.
EDIT:
Labels in CategoryAxis:
var categoryAxis = new CategoryAxis()
{
Position = AxisPosition.Bottom,
...
};
categoryAxis.ActualLabels.Add("Mon");
categoryAxis.ActualLabels.Add("Tue");
categoryAxis.ActualLabels.Add("Wed");
categoryAxis.ActualLabels.Add("Thu");
categoryAxis.ActualLabels.Add("Fri");
categoryAxis.ActualLabels.Add("Sat");
categoryAxis.ActualLabels.Add("Sun");
Model.Axes.Add(categoryAxis);
CategoryAxis.ActualLabels
is readOnly, so you will have to Add the items one by one.