如何在MVC ASP.NET中将辅助轴添加到图形中

时间:2015-08-13 15:35:00

标签: c# asp.net asp.net-mvc visual-studio-2013

我试图在一个图表中显示两个系列的数据。我能够这样做,但我需要在右边第二个Y轴。有没有办法在不使用其他工具和扩展的情况下添加第二个Y轴?

我的控制器看起来像这样:

public ActionResult PerformanceChart(){
xVals = {...}
yVals = {...}
var myChart = new Chart(width: 1000, height: 500, theme:ChartTheme.Green)
                .AddTitle("FSA Monthly Report").AddLegend(title: "% Backup vs Day", name: "File Server Backup Chart")
            .AddSeries(
            chartType:"Line", 
                name: "Total Success",
                xValue: xVals.ToList(),
                yValues: yVals.ToList());

            myChart.AddSeries(chartType: "StackedArea",
                name: "Daily Archiving", 
                xValue: xVals.ToList(),
                yValues: dailyArchive).Write();

            myChart.Save("~/Content/PerformanceChart", "jpeg");
            // Return the contents of the Stream to the client
            return base.File("~/Content/PerformanceChart", "jpeg");}

我的cshtml看起来像这样:

<div style="margin-left:5%; margin-top:1em; float: left; width: 90%; height:auto;">
    <div style="height:inherit; width:inherit;">
        <p><img style="height:90%; width:96%;" src="@Url.Action("PerformanceChart")" alt="Cricketers" /> </p>
    </div>

0 个答案:

没有答案