This is a migrated thread and some comments may be shown as answers.

Alias axis label

1 Answer 68 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Phil
Top achievements
Rank 2
Phil asked on 29 Oct 2011, 01:21 AM
Hi:
I have a chart with one of the axis is a numeric month, i.e. Jan 2009 = 2009*12+1, but I also have a column with a string alias (MonthName).  I would like to display the string, instead of the number.
Thanks,
Phil

1 Answer, 1 is accepted

Sort by
0
Phil
Top achievements
Rank 2
answered on 31 Oct 2011, 09:37 PM
Hi:
I had to get a solution, so I solved it.  I constructed a column via linq:
  rowIndex = DateTime.Parse(_m.PeriodYear.ToString + "-" + _m.PeriodMonth.ToString + "-15").ToOADate()
so the above would be 2009-12-15 (mid-month, not the 1st of the month)
I do another linq query to group on true and get the min and max values for all columns that could be on a chart.
Then I set:
RadChart1.PlotArea.XAxis.Appearance.ValueFormat = Styles.ChartValueFormat.ShortDate;
RadChart1.PlotArea.XAxis.Appearance.CustomFormat = "yyyy-MMM";
RadChart1.PlotArea.XAxis.MinValue = mimIndex;
RadChart1.PlotArea.XAxis.MaxValue = maxIndex;
RadChart1.PlotArea.XAxis.Step = 30.34;  // # of days in a month


Phil
Tags
Chart (Obsolete)
Asked by
Phil
Top achievements
Rank 2
Answers by
Phil
Top achievements
Rank 2
Share this question
or