Code: Select all
// Ensure regular gridlines are visible
TeeChart.Axes.Bottom.Grid.Visible = true;
TeeChart.Axes.Left.Grid.Visible = true;
//Adding grid line every 5 numbers shown on axis
TeeChart.Axes.Bottom.Grid.DrawEvery = 5;
TeeChart.Axes.Left.Grid.DrawEvery = 5;
// Define dash style for the X-axis (Bottom axis)
System.Windows.Media.DoubleCollection dashArrayX = new System.Windows.Media.DoubleCollection();
dashArrayX.Add(5); // Length of dash at y-coordinate 0
dashArrayX.Add(25); // Length of gap between y-coordinate 0 and 25
// Set the dash style for the bottom axis (X-axis)
TeeChart.Axes.Bottom.Grid.Style = new System.Windows.Media.DashStyle(dashArrayX, 0);
// Define dash style for the Y-axis (Left axis)
System.Windows.Media.DoubleCollection dashArrayY = new System.Windows.Media.DoubleCollection();
dashArrayY.Add(5); // Length of dash
dashArrayY.Add(25); // Length of gap
// Set the dash style for the left axis (Y-axis)
TeeChart.Axes.Left.Grid.Style = new System.Windows.Media.DashStyle(dashArrayY, 0);