Exemple #1
0
        public ActionResult Index()
        {
            RazorChartViewer viewer = ViewBag.Viewer = new RazorChartViewer(HttpContext, "chart1");

            DrawChart(viewer);

            if (RazorChartViewer.IsStreamRequest(Request))
            {
                return(File(viewer.StreamChart(), Response.ContentType));
            }

            return(View());
        }
        public ActionResult Index()
        {
            RazorChartViewer viewer = ViewBag.Viewer = new RazorChartViewer(HttpContext, "chart1");

            // Draw chart using the most update data
            drawChart(viewer);

            // If is streaming request, output the chart only
            if (RazorChartViewer.IsStreamRequest(Request))
            {
                return(File(viewer.StreamChart(), Response.ContentType));
            }

            return(View());
        }
Exemple #3
0
        public ActionResult Index()
        {
            RazorChartViewer viewer = ViewBag.Viewer = new RazorChartViewer(HttpContext, "chart1");

            // Draw chart using the most update data
            drawChart(viewer);

            // If is download request, output the chart as an attachment
            if (!string.IsNullOrEmpty(Request["download"]))
            {
                return(File(viewer.StreamChart(), Response.ContentType, "demo_" + DateTime.Now.ToString(
                                "yyyyMMddHHmmss") + "." + Request["download"]));
            }

            // If is streaming request, output the chart only
            if (RazorChartViewer.IsStreamRequest(Request))
            {
                return(File(viewer.StreamChart(), Response.ContentType));
            }

            return(View());
        }