Search code examples
c#winformsmschart

Is it possible to change color text or background of label Y-Axis of Range bar chart


If so please help me how to change that color enter image description here


Solution

  • To change the color of the X-Axis Label:

    chart2.ChartAreas[0].AxisX.LabelStyle.ForeColor = Color.Yellow;
    

    To change the color of the Y-Axis Label:

     chart2.ChartAreas[0].AxisY.LabelStyle.ForeColor = Color.Blue;
    

    Default:

    Color Change

    Hope it helps. Happy coding.