I want to add a non-draggable vertical color line to my scrollable chart.
This works, however when scrolling the chart, the color line is still visible outside of the actual chart area, which means that it could for example mess up the readability of the chart legend.
I noticed that when I make the color line draggable (as it is by default), the color line disappears when it is outside of the actual chart area, as it should.
To illustrate the issue, I created following code sample. The resulting chart images before and after scrolling are attached.
Code: Select all
private void InitializeChart()
{
Steema.TeeChart.Styles.Line line = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line.Add(0);
line.Add(1);
line.Add(2);
line.Add(3);
line.Add(4);
Steema.TeeChart.Tools.ColorLine colorLine = new Steema.TeeChart.Tools.ColorLine();
colorLine.Axis = tChart1.Chart.Axes.Bottom;
colorLine.AllowDrag = false; // !!! Comment this line and the issue disappears !!!
colorLine.Value = 3;
tChart1.Tools.Add(colorLine);
}
Thanks,
Steven