01-14-2014 07:19 AM
I need to increase number of major divisions to at least 10, but such that min and max will still be dynamic, e.g. grid would move along with the plot.
If I force <ni:RangeLabeledDivisions TickVisibility="Hidden" Mode="Count: 11">, then number of cells is the same, but plot is not moved independent of the grid, and grid labels show non-pretty numbers.
If I don't force mode, then grid behaves very well, but it uses about 3.5 divisions
Solved! Go to Solution.
01-14-2014 10:57 AM
Major tick values are controlled by the GetDivisions method on RangeDivisionsMode, which receives an estimate of the number of divisions that will fit on screen. A simple workaround to increase the number of auto-generated divisions would be to pass a different estimate to the Auto implementation:
public sealed class CustomDivisionsMode : RangeDivisionsMode {
public override string Name {
get { return "Custom"; }
}
public override bool RequiresDivisionsEstimate {
get { return Auto.RequiresDivisionsEstimate; }
}
public override IList<TData> GetDivisions<TData>( IRangeDataMapper<TData> mapper, int divisionsEstimate ) {
return Auto.GetDivisions<TData>( mapper, divisionsEstimate * 2 );
}
public override IList<TData> GetSubdivisions<TData>( IRangeDataMapper<TData> mapper, IList<TData> dependentDivisions ) {
return Auto.GetSubdivisions<TData>( mapper, dependentDivisions );
}
}