Code: Select all
public double Min
{
get
{
m_Min = m_Axis.Minimum;
return m_Min;
}
set
{
m_Min = value;
m_Axis.AutomaticMinimum = false;
int WidthBefore = m_Axis.Labels.Width;
m_Axis.FixedLabelSize = false;
m_Axis.Minimum = value;
Helper.RecaclulateAxisIncrement(CAxesHolder.GetAxesIncrement(), m_Axis);
FitAxes(WidthBefore);
}
}
private void FitAxes(int WidthBefore)
{
m_TChart.Refresh();
int delta = m_Axis.Labels.Width - WidthBefore;
ResetPosition(delta);
m_TChart.Refresh();
m_Axis.FixedLabelSize = true;
}
public double Max
{
get
{
m_Max = m_Axis.Maximum;
return m_Max;
}
set
{
m_Max = value;
m_Axis.AutomaticMaximum = false;
int WidthBefore = m_Axis.Labels.Size.Width;
m_Axis.FixedLabelSize = false;
m_Axis.Maximum = value;
Helper.RecaclulateAxisIncrement(CAxesHolder.GetAxesIncrement(), m_Axis);
FitAxes(WidthBefore);
}
}
private void ResetPosition(double delta)
{
m_TChart.Panel.MarginLeft += delta;
int index = m_TChart.Axes.Custom.IndexOf(m_Axis);
for (int i = index + 1; i < m_TChart.Axes.Custom.Count; ++i)
m_TChart.Axes.Custom[i].RelativePosition -= delta;
}