3

This is my first attempt at trying to use .net Chart Control and I am trying to achieve some specific Axis label format pattern.

I have a two Line series that have common X-Primary axis and it is of DateTime data type.

I am tyring to

  1. Show days of Month on Minor Tick and Month of year on Major Tick mark labels.

  2. Problem is I am unable to use mychart.ChartAreas[0].AxisX.LabelStyle.Format;
    to get desired Minor Tick mark label formatting as it applies to both Major and minor Grids/Ticks. Basically, what I am trying to know is how to apply different label format for each major and Minor Grid lines/ Tick labels on Axis. some snippets of my code - not exclusive

    mychart.ChartAreas[0].AxisX.Interval = 1;
    mychart.ChartAreas[0].AxisX.Interval = 1;
    mychart.ChartAreas[0].AxisX.LabelStyle.Format = "{MMM}";
    mychart.ChartAreas[0].AxisX.LabelStyle.Interval = 1;
    mychart.ChartAreas[0].AxisX.LabelStyle.IntervalType = DateTimeIntervalType.Months;
    mychart.ChartAreas[0].AxisX.MajorTickMark.Enabled = true;
    mychart.ChartAreas[0].AxisX.MinorTickMark.Enabled = true;
    mychart.ChartAreas[0].AxisX.MajorGrid.Interval = 1;
    mychart.ChartAreas[0].AxisX.MajorTickMark.Interval = 1;
    mychart.ChartAreas[0].AxisX.MajorGrid.IntervalType = DateTimeIntervalType.Months;
    mychart.ChartAreas[0].AxisX.MajorTickMark.IntervalType = DateTimeIntervalType.Months;
    mychart.ChartAreas[0].AxisX.MinorTickMark.IntervalType = DateTimeIntervalType.Days;
    

Any suggestion how to go about accomplishing this is much appreciated.

ocuenca
  • 38,548
  • 11
  • 89
  • 102
blowingwind
  • 31
  • 1
  • 5

0 Answers0