|
using System.Web.Mvc;
using MVCChart.Models;
using MVCChart.Utilities;
namespace MVCChart.Controllers
{
[HandleError]
public class HomeController : Controller
{
[HttpGet]
public ActionResult Index()
{
var chartData = BrowserShareRepository.GetBrowserShares();
return View(chartData);
}
[HttpGet]
public FileResult GetChart()
{
var chartData = BrowserShareRepository.GetBrowserShares();
return File(chartData.ChartImageStream().GetBuffer()
, @"image/png", "BrowserShareChart.png");
}
[HttpGet]
public FileResult GetPdf()
{
var chartData = BrowserShareRepository.GetBrowserShares();
var chartStream = chartData.ChartImageStream();
return File(PdfUtility.GetSimplePdf(chartStream).GetBuffer()
, @"application/pdf", "BrowserShareChart.pdf");
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I have been working in the IT industry for some time. It is still exciting and I am still learning. I am a happy and honest person, and I want to be your friend.