• Demos
    • JavaScript Charts
    • JavaScript StockCharts
  • Download/NPM
    • Download CanvasJS
    • Install via NPM
  • Integrations
    Front End Technology Samples
    • React Charts
    • Angular Charts
    • Vue.js Charts New!
    • jQuery Charts
    • Dashboards
    Server Side Technology Samples
    • PHP Charts
    • Python Charts New!
    • ASP.NET MVC Charts
    • Spring MVC Charts
    • JSP Charts
  • License
  • Blog
  • Docs
    • Chart Documentation
    • StockChart Documentation
  • Support Forum
    • Chart Support
    • StockChart Support
  • My Account
My Account
  • KEY FEATURES
    • Chart with Zooming / Panning
    • Chart using JSON Data
    • Chart with Animation
    • Multi Series Chart
    • Chart with Multiple Axes
    • Chart with Crosshair
    • Chart with Scale Breaks
    • Chart with Logarithmic Axis
    • Performance with 50,000 Data Points
    • Responsive Charts
    • Chart with Drilldown
  • LINE CHARTS
    • Line Chart
    • Spline Chart
    • Step Line Chart
  • AREA CHARTS
    • Area Chart
    • Multi Series Area Chart with Date Time Axis
    • Spline Area Chart
    • Multi Series Spline Area
    • Step Area Chart
    • Range Area Chart
    • Range Spline Area Chart
    • Stacked Area Chart
    • Stacked Area 100% Chart
  • COLUMN & BAR CHARTS
    • Column Chart
    • Bar Chart
    • Range Column Chart
    • Stacked Column Chart
    • Stacked Column 100% Chart
    • Range Bar Chart
    • Stacked Bar Chart
    • Stacked Bar 100% Chart
    • Waterfall Chart
  • PIE & FUNNEL CHARTS
    • Pie Chart
    • Pie Chart with Index Labels Placed Inside
    • Doughnut Chart
    • Funnel Chart
    • Funnel Chart with Custom Neck
    • Pyramid Chart
  • FINANCIAL CHARTS
    • Candlestick Chart
    • Candlestick Chart from JSON
    • OHLC Chart
  • SCATTER & BUBBLE CHARTS
    • Scatter Chart
    • Scatter Chart with Custom Markers
    • Bubble Chart
  • BOX & WHISKER CHARTS
    • Box and Whisker Chart
    • Box and Whisker Chart with Customization
  • COMBINATION CHARTS
    • Error chart
    • Error Line Chart
    • Combination of Column, Line and Area Chart
  • DYNAMIC CHARTS
    • Dynamic Line Chart
    • Dynamic Column Chart
    • Dynamic Multi Series Chart
  • DATA BINDING
    • Chart from CSV
    • Chart from XML
    • Chart Data from Database
  • REACT, ANGULAR, VUE.JS, JQUERY
    • React Charts
    • Angular Charts
    • Vue.js Charts
    • jQuery Charts
    • JavaScript Charts
  • SERVER SIDE TECHNOLOGIES
    • PHP Charts
    • Python Charts
    • JSP Charts
    • Spring MVC Charts

ASP.NET MVC Charts & Graphs with Multiple Axes

Download ASP.NET Chart Samples
  • ASP.NET Chart Samples
  • JavaScript Chart Samples
  • React Chart Samples
  • Angular Chart Samples
  • Vue.js Chart Samples
  • jQuery Chart Samples
  • PHP Chart Samples
  • Python Django Chart Samples
  • JSP Chart Samples
  • Spring MVC Chart Samples
  • Dashboard Samples
  • JavaScript StockChart Samples

CanvasJS ASP.NET MVC Charts support multiple axes. Given example shows Range Spline Area & Spline Chart with multiple axes along with ASP.NET MVC source code that you can try running locally.

  • View
  • Controller
  • Model
@{
	Layout = null;
}

<!DOCTYPE HTML>
<html>
<head>
<script>
window.onload = function () {

var chart = new CanvasJS.Chart("chartContainer", {
	theme: "light1",
	animationEnabled: true,
	title: {
		text: "Blood Pressure & Body Temperature Readings over a Day"
	},
	axisY: {
		title: "Pressure (in mmHg)",
		maximum: 190,
		includeZero: true,
		gridThickness: 0
	},
	axisY2: {
		title: "Body Temperature (in °C)",
		suffix: " °C",
		gridThickness: 0
	},
	toolTip: {
		shared: true
	},
	data: [{
		type: "rangeSplineArea",
		xValueFormatString: "hh:MM TT",
		yValueFormatString: "# mmHg",
		toolTipContent: "{x}<br><b>Systolic:</b> {y[0]}<br><b>Diastolic:</b> {y[1]}",
		xValueType: "dateTime",
		dataPoints:  @Html.Raw(ViewBag.DataPoints1)
	}, {
		type: "spline",
		axisYType: "secondary",
		name: "Body Temperature",
		yValueFormatString: "#.0 °C",
		toolTipContent: "<b>{name}:</b> {y}",
		xValueType: "dateTime",
		dataPoints:  @Html.Raw(ViewBag.DataPoints2)
	}]
});
chart.render();

}
</script>
</head>
<body>
<div id="chartContainer" style="height: 370px; width: 100%;"></div>
<script src="https://cdn.canvasjs.com/canvasjs.min.js"></script>
</body>
</html>                              
using ASPNET_MVC_ChartsDemo.Models;
using Newtonsoft.Json;
using System.Collections.Generic;
using System.Web.Mvc;

namespace ASPNET_MVC_ChartsDemo.Controllers
{
	public class HomeController : Controller
	{
		// GET: Home
		public ActionResult Index()
		{
			List<DataPoint> dataPoints = new List<DataPoint>();

			dataPoints.Add(new DataPoint(1512441720000, new double[] { 120, 78 }));
			dataPoints.Add(new DataPoint(1512447240000, new double[] { 139, 89 }));
			dataPoints.Add(new DataPoint(1512453960000, new double[] { 139, 85 }));
			dataPoints.Add(new DataPoint(1512461700000, new double[] { 150, 95 }));
			dataPoints.Add(new DataPoint(1512466320000, new double[] { 130, 84 }));
			dataPoints.Add(new DataPoint(1512472020000, new double[] { 138, 87 }));
			dataPoints.Add(new DataPoint(1512475440000, new double[] { 127, 78 }));
			dataPoints.Add(new DataPoint(1512477540000, new double[] { 119, 76 }));
			dataPoints.Add(new DataPoint(1512482280000, new double[] { 135, 82 }));
			dataPoints.Add(new DataPoint(1512486900000, new double[] { 122, 78 }));
			dataPoints.Add(new DataPoint(1512490800000, new double[] { 115, 72 }));
			dataPoints.Add(new DataPoint(1512494160000, new double[] { 122, 75 }));

			ViewBag.DataPoints1 = JsonConvert.SerializeObject(dataPoints);

			dataPoints = new List<DataPoint>();
			dataPoints.Add(new DataPoint(1512441720000, 36.2));
			dataPoints.Add(new DataPoint(1512447240000, 36.5));
			dataPoints.Add(new DataPoint(1512453960000, 36.5));
			dataPoints.Add(new DataPoint(1512461700000, 36.4));
			dataPoints.Add(new DataPoint(1512466320000, 36.7));
			dataPoints.Add(new DataPoint(1512472020000, 36.8));
			dataPoints.Add(new DataPoint(1512475440000, 36.7));
			dataPoints.Add(new DataPoint(1512477540000, 36.9));
			dataPoints.Add(new DataPoint(1512482280000, 37.1));
			dataPoints.Add(new DataPoint(1512486900000, 37.2));
			dataPoints.Add(new DataPoint(1512490800000, 37.2));
			dataPoints.Add(new DataPoint(1512494160000, 37));

			ViewBag.DataPoints2 = JsonConvert.SerializeObject(dataPoints);

			return View();
		}
	}
}                        
using System;
using System.Runtime.Serialization;

namespace ASPNET_MVC_ChartsDemo.Models
{
	//DataContract for Serializing Data - required to serve in JSON format
	[DataContract]
	public class DataPoint
	{
		public DataPoint(double x, dynamic y)
		{
			this.X = x;
			this.Y = y;
		}

		//Explicitly setting the name to be used while serializing to JSON.
		[DataMember(Name = "x")]
		public Nullable<double> X = null;

		//Explicitly setting the name to be used while serializing to JSON.
		[DataMember(Name = "y")]
		public dynamic Y = null;
	}
}                        

Chart Customizations

axisXType / axisYType can be used to change the axis used for plotting a data-series. Some other commonly used customization options include axisXIndex, axisYIndex, showInLegend, etc.

Note   For step by step instructions, follow our ASP.NET MVC Integration Tutorial

Quick Links

  • Chart Docs
  • StockChart Docs
  • About Us
  • FAQs

Server Side Technologies

  • ASP.NET MVC Charts
  • PHP Charts
  • JSP Charts
  • Spring MVC Charts

Front Side Technologies

  • JavaScript Charts
  • jQuery Charts
  • React Charts
  • Angular Charts
  • JavaScript StockCharts

Contact

  • Fenopix, Inc.
  • 2093 Philadelphia Pike,
  • #5678, Claymont,
  • Delaware 19703
  • United States Of America

©2025 Fenopix Privacy Policy Cookies Policy Careers