CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2018
    Posts
    7

    [RESOLVED] MSChart need to remove the Y Axis Tick Marks

    I have a MSChart Control that displays as follows:

    MSChart.jpg
    Code:
    chartMRBDaily.ChartAreas[0].AxisY.MajorGrid.Enabled = false;
    chartMRBDaily.ChartAreas[0].AxisY.MajorTickMark.Enabled = false;
    chartMRBDaily.ChartAreas[0].AxisY.MinorGrid.Enabled = false;
    chartMRBDaily.ChartAreas[0].AxisY.MinorTickMark.Enabled = false;
    As you can see from the code above. I have have tried setting the AxisY MajorGrid and MinorGrids AND MajorTickMark and MinorTickMark to Enabled = false, but that seems to have no affect on the grid mess you see along the Y Axis. Is there some other variables that need to be set to remove all Grids from the Y Axis?
    Last edited by tim8w123; February 13th, 2025 at 04:41 PM.

  2. #2
    Join Date
    Jan 2018
    Posts
    7

    Cool Re: MSChart need to remove the Y Axis Tick Marks

    Figured it out. I also needed to include disabling the AxisY LabelStyle as follows:

    Code:
    chartMRBDaily.ChartAreas[0].AxisY.LabelStyle.Enabled = false;

  3. #3
    Join Date
    Feb 2025
    Posts
    2

    Re: [RESOLVED] MSChart need to remove the Y Axis Tick Marks

    Try setting the Interval of AxisY.MajorTickMark and AxisY.MinorTickMark to 0 to completely remove the tick marks. Also, disable LineWidth for AxisY to ensure no extra lines appear. Use the following code:

    chartMRBDaily.ChartAreas[0].AxisY.MajorTickMark.Interval = 0;
    chartMRBDaily.ChartAreas[0].AxisY.MinorTickMark.Interval = 0;
    chartMRBDaily.ChartAreas[0].AxisY.LineWidth = 0;

    This should remove all tick marks and any extra lines on the Y-axis.

  4. #4
    Join Date
    Feb 2025
    Posts
    2

    Re: [RESOLVED] MSChart need to remove the Y Axis Tick Marks

    Quote Originally Posted by mohrceleste219 View Post
    Try setting the Interval of AxisY.MajorTickMark and AxisY.MinorTickMark to 0 to completely remove the tick marks. Also, disable LineWidth for AxisY to ensure no extra lines appear. Use the following code:

    chartMRBDaily.ChartAreas[0].AxisY.MajorTickMark.Interval = 0;
    chartMRBDaily.ChartAreas[0].AxisY.MinorTickMark.Interval = 0;
    chartMRBDaily.ChartAreas[0].AxisY.LineWidth = 0;

    This should remove all tick marks and any extra lines on the Y-axis.
    Have you tried this solution?

    **Links removed by Site Administrator so it doesn't look like you're spamming us. Please don't post them again.**

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured