Charting: How To Show Scroll Lines on Form Load
The following sample graphic form and script below shows how you can show the scroll lines be default when the form loads.
The script uses reflection to show the scroll lines, as this is private functionality that not made public yet via script.
The script first checks the scroll lines button on the toolbar and then shows the scroll lines as below:
// check the scroll lines ToolStripButton
FieldInfo dynField = typeof(ChartBase).GetField("_scrollLineTBtn", BindingFlags.NonPublic | BindingFlags.Instance);
ToolStripButton scrollLineTBtn = dynField.GetValue(lineChart) as ToolStripButton;
scrollLineTBtn.Checked = true;
// show the scroll lines
MethodInfo dynMethod = typeof(ChartBase).GetMethod("ShowScrollLine", BindingFlags.NonPublic | BindingFlags.Instance);
dynMethod.Invoke(lineChart, new object[] { true });
Add the script above to the main method of your graphic form script. Below is a sample graphic form showing how to use this script.
ScrollLineAutoShow.viz (29.3 KB)