Hi ,
I am defining the vertical axis' set of axis labels by defining min max and major step . Even though i set it , it takes some non relevant values like 100,200....1128.5 etc before starting from 0,60,120... Code attached:
rangeBarSeries.VerticalAxis.LabelFormatProvider = new MyFormatProvider();
LinearAxis verticalAxis = chart.View.Axes.Get<LinearAxis>(1);
verticalAxis.Minimum = 0; //Minutes 0:00
verticalAxis.Maximum = 1380; //Minutes 23:00
verticalAxis.MajorStep = 60; //60 minutes in an hour
public class MyFormatProvider : IFormatProvider, ICustomFormatter
{
public object GetFormat(Type formatType)
{
return this;
}
public string Format(string format, object arg, IFormatProvider formatProvider)
{
int totalminutes = Convert.ToInt32(arg);
TimeSpan timeSpan = TimeSpan.FromMinutes(totalminutes);
return timeSpan.ToString(@"hh\:mm");
}
}