ComponentOne
Web API Explorer ASP.NET Web API Explorer

MVCFlexChart

Header and Footer

This sample demonstrates how to export a MVC FlexChart with header and footer to image file.

Features

Resources.MVCFlexChart.HeaderFooter_HeaderResources.MVCFlexChart.HeaderFooter_FooterSalesMar 2Mar 16Mar 30Apr 13Apr 27May 11May 25150200

Settings

Export
Export Format : Height :
Width :
Export Name :

Description

This sample demonstrates how to export a MVC FlexChart with header and footer to image file.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WebApiExplorer.Models;
 
namespace WebApiExplorer.Controllers
{
    public partial class MVCFlexChartController : Controller
    {
        public ActionResult HeaderFooter()
        {
            ViewBag.Options = _flexChartModel;
            return View(new Fruit().Sales);
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
@model IEnumerable<FruitSale>
@{
    ViewBag.DemoSettings = true;
    ImageExportOptions optionsModel = ViewBag.Options;
}
 
@(Html.C1().FlexChart().Bind("Date", Model).Id(optionsModel.ControlId)
.ChartType(C1.Web.Mvc.Chart.ChartType.LineSymbols)
.Series(sers =>
{
    sers.Add("Sales").Binding("SalesInChina");
})
.Header("Resources.MVCFlexChart.HeaderFooter_Header").Footer("Resources.MVCFlexChart.HeaderFooter_Footer").FooterStyle(hs => hs.Halign("right")))
 
@section Settings{
    @Html.Partial("_ImageExportOptions", optionsModel)
}
 
@section Description{
    @Html.Raw(Resources.MVCFlexChart.HeaderFooter_Text0)
}