We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Syncfusion Feedback

Trusted by the world’s leading companies

Syncfusion Trusted Companies

Overview

ASP.NET MVC Sparkline Charts is a replacement for normal charts to display trends in a very small area. Customize sparklines completely by changing the series or axis type and by adding markers, data labels, range bands, and more.


Sparkline types

ASP.NET MVC Sparkline Charts support five types of sparklines (line, column, area, win-loss, and pie) to show data trends.

ASP.NET MVC sparkline chart rendered in line type.

Line sparkline

Use a line sparkline to represent patterns and trends in data, such as seasonal effects, large changes, and turning points over a period of time.

ASP.NET MVC sparkline chart rendered in area type.

Area sparkline

An area sparkline is a line sparkline with the area between its points colored. Use this when the magnitude of the trend is to be communicated rather than individual data values.

ASP.NET MVC sparkline chart rendered in column type.

Column sparkline

A column sparkline is designed to show different values of two or more subjects.Use vertical bars to represent the different values.

ASP.NET MVC sparkline chart rendered in win-loss type.

Win-loss sparkline

Use a win-loss sparkline to show if each value is positive, negative, or zero to visualize win/loss scenarios such as results in games.

ASP.NET MVC sparkline chart rendered in pie type.

Pie sparkline

A pie sparkline is a circular graph that is divided into slices to illustrate numeric proportions.


Axis value types

ASP.NET MVC Sparkline Charts control offers different axes types like numeric, category, and date-time to plot any type of data in the sparkline.


Axis customization

Configure and customize axis in the sparkline graphs to show the origin and range of the data points.

ASP.NET MVC sparkline chart rendered with customized axis.


Special points customization

Some data points in the sparklines are special. Denote the data usage by highlighting and customizing the special data points, such as first, last, high, low, and negative points.

ASP.NET MVC sparkline chart rendered with customized special points.


Markers

The markers highlights data points in the line and area sparklines and makes these sparklines more readable.

ASP.NET MVC sparkline chart rendered with markers.


Data label

Improve readability by using data labels in the sparkline to display the values of data points.

Sparkline with Data labels.


Tooltip

The interactive ASP.NET MVC Sparkline Charts provide options to display details about data point values through a tooltip when hovering the mouse over a data point.

Displays a tooltip on moving mouse over the data points in ASP.NET MVC sparkline charts.


Track line

The track line tracks the data points that are closer to the mouse position or touch contact.

Displays a track line on moving mouse over the data points in ASP.NET MVC sparkline charts.


Range band

Highlight a particular region in a ASP.NET MVC sparkline charts using a range band to show the range of safe values. By setting the minimum and maximum for a range band, the outliers can be easily identified.

ASP.NET MVC sparkline chart rendered with a range band.


Touch and browser support

The interactive Sparkline Chart control also supports touch interactions.

Touch illustration

Touch support

All the sparkline features will work on touch devices with zero configuration. Use touch features such as tooltip and track line without any customization.

Responsive illustration

Responsive

You can view the Sparkline Charts control on various devices. Also hide specific elements in the sparkline for particular screen sizes by making a very minimal change in the events.

Cross-browser illustration

Cross-browser support

You can render the Sparkline Charts component in all modern browsers.


ASP.NET MVC Sparkline Code Example

Easily get started with the ASP.NET MVC Sparkline using a few simple lines of C# code as demonstrated below. Also explore our ASP.NET MVC Sparkline Example that shows you how to render and configure the Range Selector in ASP.NET MVC.

@Html.EJS().Sparkline("spark").DataSource(Model).XName("xval").YName("yval").Height("100").Width("70").Render()
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;
    }
}

Other supported frameworks

The Sparkline Charts component is also available in Blazor, React, Angular, JavaScript and Vue frameworks. Check out the different Sparkline Charts platforms from the links below,


85+ ASP.NET MVC UI CONTROLS

Our Customers Love Us

Having an excellent set of tools and a great support team, Syncfusion reduces customers’ development time.
Here are some of their experiences.

Rated by users across the globe

Transform your applications today by downloading our free evaluation version
Download Free Trial No credit card required.

Awards

Greatness—it’s one thing to say you have it, but it means more when others recognize it. Syncfusion is proud to hold the following industry awards.

Up arrow icon