How to draw vertical line on categoryaxis at a point for line chart in Razor

2 posts, 0 answers
  1. ramu
    ramu avatar
    1 posts
    Member since:
    Sep 2015

    Posted 23 Mar Link to this post

    I am trying to draw vertical line on category axis so that I can differentiate previous  values and future from that point. 


    Razor view:

    .Title("Scheduled Info")
    .Title(title => title.Font("24px Arial"))
    .Legend(legend => legend
    .HtmlAttributes(new {style = "border: 1px solid #1593cc;height: 400px;"})
    .Legend(legend => legend.Font("medium Arial"))

    .Series(series =>
    .Markers(x => x.Visible(false));
    .Markers(x => x.Visible(false));
    .CategoryAxis(axis => axis
    .Line(line => line.Visible(true))
    .MajorGridLines(lines => lines.Visible(true))
    .MajorTicks(lines => lines.Visible(false))
    .Labels(labels=> labels.Step(4)))
    .ValueAxis(axis => axis.Numeric()
    .Labels(labels => labels.Format("{0}%")))


    public class graphs

     public List<decimal> ScheduledA14 { get; set; }
     public List<decimal> ScheduledD0 { get; set; }
    public List<string> ScheduledPlotTime { get; set; }




  2. Daniel
    Daniel avatar
    2110 posts

    Posted 25 Mar Link to this post


    You can use the approach demonstrated in this example to draw the line.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET AJAX banner
Back to Top