Code: Select all
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
Axis axis = new Axis(false, false, chart.Chart);
axis.MinimumOffset = axis.MaximumOffset = 5;
chart.Axes.Custom.Add(axis);
chart.Series.Add(new Steema.TeeChart.WPF.Styles.Line());
chart.Series[0].FillSampleValues();
ColorLine cursor = new ColorLine();
cursor.Value = 5;
cursor.Axis = chart.Axes.Bottom;
chart.Tools.Add(cursor);
chart.MouseDoubleClick += DoubleClick;
}
void DoubleClick(object sender, MouseEventArgs e)
{
chart.Axes.Custom.Clear();
chart.Series.Clear();
chart.Tools.Clear();
Axis axis = new Axis(false, false, chart.Chart);
axis.MinimumOffset = axis.MaximumOffset = 5;
chart.Axes.Custom.Add(axis);
chart.Series.Add(new Steema.TeeChart.WPF.Styles.Line());
chart.Series[0].FillSampleValues();
}
}
We've found that the ColorLines remain drawn through Chart.Invalidate() and other methods that we would normally expect to force a redraw. However, resizing the window seems to do the trick of removing them. That seems like a rather poor way of getting rid of them though. Are we doing something wrong in the reset code or is this a bug that will be fixed soon?