private void UpdateAxes(bool recalculateAll)
{
int position = 0;
// if we're not recalculating axes using all iplots then set
// position to last one in list.
if (!recalculateAll)
{
position = m_drawables.Count - 1;
if (position < 0) position = 0;
}
if (recalculateAll)
{
m_xAxis1 = null;
m_yAxis1 = null;
m_xAxis2 = null;
m_yAxis2 = null;
}
for (int i = position; i < m_drawables.Count; ++i)
{
// only update axes if this drawable is an IPlot.
if (!(m_drawables[i] is IPlot))
continue;
IPlot p = (IPlot)m_drawables[i];
if (m_xAxis1 == null)
{
m_xAxis1 = p.SuggestXAxis();
if (m_xAxis1 != null)
{
m_xAxis1.TicksAngle = -(float)Math.PI / 2.0f;
}
}
else
{
m_xAxis1.LUB(p.SuggestXAxis());
}
if (m_xAxis1 != null)
{
m_xAxis1.MinPhysicalLargeTickStep = 50;
if (AutoScaleAutoGeneratedAxes)
{
m_xAxis1.AutoScaleText = true;
m_xAxis1.AutoScaleTicks = true;
m_xAxis1.TicksIndependentOfPhysicalExtent = true;
}
else
{
m_xAxis1.AutoScaleText = false;
m_xAxis1.AutoScaleTicks = false;
m_xAxis1.TicksIndependentOfPhysicalExtent = false;
}
}
if (m_yAxis1 == null)
{
m_yAxis1 = p.SuggestYAxis();
if (m_yAxis1 != null)
{
m_yAxis1.TicksAngle = (float)Math.PI / 2.0f;
}
}
else
{
m_yAxis1.LUB(p.SuggestYAxis());
}
if (m_yAxis1 != null)
{
if (AutoScaleAutoGeneratedAxes)
{
m_yAxis1.AutoScaleText = true;
m_yAxis1.AutoScaleTicks = true;
m_yAxis1.TicksIndependentOfPhysicalExtent = true;
}
else
{
m_yAxis1.AutoScaleText = false;
m_yAxis1.AutoScaleTicks = false;
m_yAxis1.TicksIndependentOfPhysicalExtent = false;
}
}
}
}