Syncfusion® ASP.NET MVC Sparkline Charts control renders compact, lightweight inline charts designed to be embedded within table cells, dashboards, and text content for showing trends without taking up much space. It supports Line, Area, Column, WinLoss, and Pie sparkline types with features like markers, tooltips, data labels, range bands, and special point highlighting (high, low, first, last, negative). Ideal for KPI grids, financial reports, and data tables in ASP.NET MVC applications.
Install
No framework information available.
README
Syncfusion® ASP.NET MVC Sparkline Charts
The Syncfusion® ASP.NET MVC Sparkline Charts component renders compact, word-sized charts that are ideal for embedding data visualizations within tables, dashboards, and inline text.
Key Features
- Supports Line, Column, Area, WinLoss, and Pie sparkline types
- High, Low, Start, End, and Negative point markers with custom colors
- Tooltip for point-level data display
- Data labels for annotating values
- Range band support to highlight a target range
- Lightweight and ideal for grid cells and summary rows
Common Setup
These setup steps are required only once for your application, regardless of which Syncfusion components you use.
1. Install Base NuGet Package
Install-Package Syncfusion.AspNetMvc.Sparkline
2. Add Namespace Reference
Edit Web.config under the Views folder and add the Syncfusion.EJ2 namespace:
<namespaces>
<add namespace="Syncfusion.EJ2"/>
</namespaces>
3. Add Stylesheet & Script References
In your layout file (~/Views/Shared/_Layout.cshtml), add the following in the <head> section:
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewBag.Title - Syncfusion Application</title>
<!-- Syncfusion ASP.NET MVC controls styles -->
<link rel="stylesheet" href="https://cdn.syncfusion.com/ej2/34.2.3/fluent2.css" />
<!-- Syncfusion ASP.NET MVC controls scripts -->
<script src="https://cdn.syncfusion.com/ej2/34.2.3/dist/ej2.min.js"></script>
</head>
4. Register Script Manager
At the end of the <body> tag in your layout file (~/Views/Shared/_Layout.cshtml):
<body>
@RenderBody()
<!-- Syncfusion ASP.NET MVC Script Manager -->
@Html.EJS().ScriptManager()
</body>
Quick Start
Step 1: Add ASP.NET MVC Sparkline control
Add the Syncfusion® ASP.NET MVC Sparkline control in ~/Views/Home/Index.cshtml page.
@Html.EJS().Sparkline("spark").DataSource(Model).XName("xval").YName("yval").Height("100").Width("70").Render()
Step 2: Create controller ~/Controllers/HomeController.cs
public class HomeController : Controller
{
public ActionResult Index()
{
return View(DataSource.GetData());
}
}
public class DataSource
{
public int x;
public string xval;
public double yval;
public static List<DataSource> GetData()
{
List<DataSource> data1 = new List<DataSource>();
data1.Add(new DataSource() { x = 0, xval = "2005", yval = 20090440 });
data1.Add(new DataSource() { x = 1, xval = "2006", yval = 20264080 });
data1.Add(new DataSource() { x = 2, xval = "2007", yval = 20434180 });
data1.Add(new DataSource() { x = 3, xval = "2008", yval = 21007310 });
data1.Add(new DataSource() { x = 4, xval = "2009", yval = 21262640 });
data1.Add(new DataSource() { x = 5, xval = "2010", yval = 21515750 });
data1.Add(new DataSource() { x = 6, xval = "2011", yval = 21766710 });
data1.Add(new DataSource() { x = 7, xval = "2012", yval = 22015580 });
data1.Add(new DataSource() { x = 8, xval = "2013", yval = 22262500 });
data1.Add(new DataSource() { x = 9, xval = "2014", yval = 22507620 });
return data1;
}
}
Step 3: Run the Application
Press Ctrl+F5 to run the application in your browser.
Documentation
Support
License
This is a commercial product and requires a paid license for possession or use. Review the Syncfusion® EULA
About Syncfusion®
Syncfusion® provides 1600+ UI components and frameworks for web, mobile, and desktop development across multiple platforms:
Web: Blazor | ASP.NET MVC | ASP.NET MVC | JavaScript | Angular | React | Vue
Desktop: WinForms | WPF | WinUI
Learn more at www.syncfusion.com
[email protected] | Toll Free: 1-888-9-DOTNET
Changes from Previous Version
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.