Elements / Axes / Draw Gridlines on Chart
Draw Gridlines on Chart

FlexChart provides you the option to draw gridlines in front of or behind the chart data. For this, the control provides AxesOnTop property of FlexChart class to control the appearance of gridlines.

A moving image which shows gridlines on chart data.

Here, in the above use-case, we have used a button event to draw gridlines on chart at runtime.

private void button1_Click(object sender, EventArgs e)
{
  
    // for Odd clicks, ie., if the user clicks for the first time, the third time and so on.
    if (myVar % 2 == 0)
    {
        flexChart1.AxesOnTop = true;
    }
    // for Even clicks, if the user clicks for the second time, the fourth time and so on.
    else
    {
        flexChart1.AxesOnTop = false;
    }
    // Increment myVar.  
    myVar = myVar + 1;
}