Alias axis label

Thread is closed for posting
2 posts, 0 answers
  1. Phil
    Phil avatar
    273 posts
    Member since:
    Jul 2008

    Posted 28 Oct 2011 Link to this post

    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
  2. Phil
    Phil avatar
    273 posts
    Member since:
    Jul 2008

    Posted 31 Oct 2011 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top