08-07-2016 05:45 AM
I replace ni WIN graph in WPF graph.
I use in LogarithmBase10 in some graphs (you can see it in the example project).
When the range start from 0 it's OK, but if I change the range to another number (70
for example) the divisions are not displayed properly [The divisions are overcrowded].
You can change the range and sometimes it's overcrowded and sometimes it's OK (depending on the start number).
I must say: in WIN graph it does not happen.
Solved! Go to Solution.
08-08-2016 11:04 AM
First, just to clarify: by "WIN" you are referring to "Windows Forms"?
I was able to reproduce the issue using your example. This appears to be a problem with how we generate auto divisions for logarithmic ranges. As a workaround, you can set the Mode
on the MinorDivisions
to the custom implementation below:
public class CustomLogarithmicRangeDivisionsMode : RangeDivisionsMode {
protected override IList<TData> GetDivisionsCore<TData>( IRangeDataMapper<TData> dataMapper, int divisionsEstimate ) {
return Auto.GetDivisions( dataMapper, divisionsEstimate );
}
protected override IList<TData> GetSubdivisionsCore<TData>( IRangeDataMapper<TData> dataMapper, IList<TData> dependentDivisions ) {
// (Note: this example assumes you supply the graph with "double" values)
const int LogarithmBase = 10;
double firstDivision = (double)(object)dependentDivisions[0];
double lastDivision = (double)(object)dependentDivisions[dependentDivisions.Count - 1];
double previousPower = Math.Pow( LogarithmBase, Math.Floor( Math.Log( firstDivision, LogarithmBase ) ) );
var subdivisions = new List<TData>();
double division = previousPower;
while( division < lastDivision ) {
for( int i = 1; i < LogarithmBase; ++i ) {
double subdivision = i * division;
subdivisions.Add( (TData)(object)subdivision );
}
division *= LogarithmBase;
}
return subdivisions;
}
}
05-14-2019 11:05 AM
Hi all,
This issue is fixed in Measurement Studio 2019.
Cheers,
Ryan Curtis
Product Support Engineer
Automated Test Software R&D