Add a static value / row as a series next to other data series in an ASP.NET MVC diagram

I have an ASP.NET MVC Chart for Diet chart showing the history of weights for the user, but I want to add the optimal weight as the continued line in the diagram, the example below does not work because it gives only one value and does not show the previous series "By default ". Is there a way to show the optimal weight as a continuation and a static line in the Chart (above / except for a series of weights).

  @{
     ViewBag.Title = "Weight Chart";

    var dataSet = new DataSet();
    dataSet = FollowUpTBL.GetDS_FollowUpTBL(User.Identity.Name, 15);
    var dataView = new DataView(dataSet.Tables[0]);

    var myChart = new Chart(width: 600, height: 400)
        .AddTitle("My First Chart")

        .AddSeries("Default", chartType: "Line",
            xValue: dataView, xField: "FDate",
            yValues: dataView, yFields: "Weight")

        .AddSeries("default2", chartType: "Line",
             xValue: new[] { "optimal" },
            yValues: new[] { "85" }
            )

         .Write(); 
 }
+3
source share

All Articles