none
c# MVC Chart - make x labels vertical RRS feed

  • Question

  • I am working on a MVC view where I want the chart having the X values vertical - because the values are quite long. The chart class is from the System.Web.Helpers.

    In my View i have the following Razor code:

    <img src="@Url.Action("MyChart", "Userchart", new { area = "" }, null)" alt="SimpleChart" />

    I have a a MVC controller showing the code for the chart:

    Chart chart = new Chart(width: 800, height: 200);
            chart.AddSeries(chartType: "line", 
              xValue: listx,
               yValues: listy);            
            chart.AddTitle("Temperatur oversigt for det sidste døgn");           
            chart.Write("png");

    Where the listx and the listy are List<> lists.

    you can see the chart on scalingthis.com.

    I hope someone can help me :-)

    • Moved by CoolDadTx Saturday, December 22, 2018 3:29 PM ASP.NET related
    Saturday, December 22, 2018 1:13 PM

All replies