ChartDirector 7.1 (.NET Edition)

3D Scatter Axis Types




This example demonstrates different axis scale types for the 3D scatter charts. It also demonstrates using different symbol shapes.

Like an XYChart, in a ThreeDScatterChart, the axis scale can represent numbers, date/time or labels. In this example, the x-axis uses a date/time scale, the y-axis uses a label based scale, and the z-axis uses a numeric scale.

Source Code Listing

[Windows Forms - C# version] NetWinCharts\CSharpWinCharts\threedscatteraxis.cs
using System; using ChartDirector; namespace CSharpChartExplorer { public class threedscatteraxis : DemoModule { //Name of demo module public string getName() { return "3D Scatter Axis Types"; } //Number of charts produced in this demo module public int getNoOfCharts() { return 1; } //Main code for creating chart. //Note: the argument chartIndex is unused because this demo only has 1 chart. public void createChart(WinChartViewer viewer, int chartIndex) { // The x coordinates for the 2 scatter groups DateTime[] dataX = {new DateTime(2011, 9, 1), new DateTime(2011, 9, 2), new DateTime( 2011, 9, 3), new DateTime(2011, 9, 4), new DateTime(2011, 9, 5), new DateTime(2011, 9, 6), new DateTime(2011, 9, 7), new DateTime(2011, 9, 8), new DateTime(2011, 9, 9), new DateTime(2011, 9, 10), new DateTime(2011, 9, 11)}; // The y and z coordinates for the first scatter group double[] dataY0 = {0.4, 0.2, 0.5, 0.4, 0.7, 1.3, 1.1, 1.0, 0.6, 0.4, 0.5}; double[] dataZ0 = {43, 38, 33, 23.4, 28, 36, 34, 47, 53, 45, 40}; // The y and z coordinates for the second scatter group double[] dataY1 = {1.4, 1.0, 1.8, 1.9, 1.5, 1.0, 0.6, 0.7, 1.2, 1.7, 1.5}; double[] dataZ1 = {46, 41, 33, 37, 28, 29, 34, 37, 41, 52, 50}; // Instead of displaying numeric values, labels are used for the y-axis string[] labelsY = {"Low", "Medium", "High"}; // Create a ThreeDScatterChart object of size 760 x 520 pixels ThreeDScatterChart c = new ThreeDScatterChart(760, 520); // Add a title to the chart using 18 points Arial font c.addTitle("3D Scatter Chart Axis Types", "Arial", 18); // Set the center of the plot region at (385, 270), and set width x depth x height to // 480 x 240 x 240 pixels c.setPlotRegion(385, 270, 480, 240, 240); // Set the elevation and rotation angles to 30 and -10 degrees c.setViewAngle(30, -10); // Add a legend box at (380, 40) with horizontal layout. Use 9pt Arial Bold font. LegendBox b = c.addLegend(380, 40, false, "Arial Bold", 9); b.setAlignment(Chart.TopCenter); b.setRoundedCorners(); // Add a scatter group to the chart using 13 pixels red (ff0000) glass sphere symbols, // with dotted drop lines ThreeDScatterGroup g0 = c.addScatterGroup(Chart.CTime(dataX), dataY0, dataZ0, "Alpha Series", Chart.GlassSphere2Shape, 13, 0xff0000); g0.setDropLine(c.dashLineColor(Chart.SameAsMainColor, Chart.DotLine)); // Add a scatter group to the chart using 13 pixels blue (00cc00) cross symbols, with // dotted drop lines ThreeDScatterGroup g1 = c.addScatterGroup(Chart.CTime(dataX), dataY1, dataZ1, "Beta Series", Chart.Cross2Shape(), 13, 0x00cc00); g1.setDropLine(c.dashLineColor(Chart.SameAsMainColor, Chart.DotLine)); // Set x-axis tick density to 50 pixels. ChartDirector auto-scaling will use this as the // guideline when putting ticks on the x-axis. c.xAxis().setTickDensity(50); // Set the y-axis labels c.yAxis().setLabels(labelsY); // Set label style to Arial bold for all axes c.xAxis().setLabelStyle("Arial Bold"); c.yAxis().setLabelStyle("Arial Bold"); c.zAxis().setLabelStyle("Arial Bold"); // Set the x, y and z axis titles using deep blue (000088) 15 points Arial font c.xAxis().setTitle("Date/Time Axis", "Arial Italic", 15, 0x000088); c.yAxis().setTitle("Label\nBased\nAxis", "Arial Italic", 15, 0x000088); c.zAxis().setTitle("Numeric Axis", "Arial Italic", 15, 0x000088); // Output the chart viewer.Chart = c; } } }

[Windows Forms - VB Version] NetWinCharts\VBNetWinCharts\threedscatteraxis.vb
Imports System Imports Microsoft.VisualBasic Imports ChartDirector Public Class threedscatteraxis Implements DemoModule 'Name of demo module Public Function getName() As String Implements DemoModule.getName Return "3D Scatter Axis Types" End Function 'Number of charts produced in this demo module Public Function getNoOfCharts() As Integer Implements DemoModule.getNoOfCharts Return 1 End Function 'Main code for creating chart. 'Note: the argument chartIndex is unused because this demo only has 1 chart. Public Sub createChart(viewer As WinChartViewer, chartIndex As Integer) _ Implements DemoModule.createChart ' The x coordinates for the 2 scatter groups Dim dataX() As Date = {DateSerial(2011, 9, 1), DateSerial(2011, 9, 2), DateSerial(2011, 9, _ 3), DateSerial(2011, 9, 4), DateSerial(2011, 9, 5), DateSerial(2011, 9, 6), _ DateSerial(2011, 9, 7), DateSerial(2011, 9, 8), DateSerial(2011, 9, 9), DateSerial( _ 2011, 9, 10), DateSerial(2011, 9, 11)} ' The y and z coordinates for the first scatter group Dim dataY0() As Double = {0.4, 0.2, 0.5, 0.4, 0.7, 1.3, 1.1, 1.0, 0.6, 0.4, 0.5} Dim dataZ0() As Double = {43, 38, 33, 23.4, 28, 36, 34, 47, 53, 45, 40} ' The y and z coordinates for the second scatter group Dim dataY1() As Double = {1.4, 1.0, 1.8, 1.9, 1.5, 1.0, 0.6, 0.7, 1.2, 1.7, 1.5} Dim dataZ1() As Double = {46, 41, 33, 37, 28, 29, 34, 37, 41, 52, 50} ' Instead of displaying numeric values, labels are used for the y-axis Dim labelsY() As String = {"Low", "Medium", "High"} ' Create a ThreeDScatterChart object of size 760 x 520 pixels Dim c As ThreeDScatterChart = New ThreeDScatterChart(760, 520) ' Add a title to the chart using 18 points Arial font c.addTitle("3D Scatter Chart Axis Types", "Arial", 18) ' Set the center of the plot region at (385, 270), and set width x depth x height to 480 x ' 240 x 240 pixels c.setPlotRegion(385, 270, 480, 240, 240) ' Set the elevation and rotation angles to 30 and -10 degrees c.setViewAngle(30, -10) ' Add a legend box at (380, 40) with horizontal layout. Use 9pt Arial Bold font. Dim b As LegendBox = c.addLegend(380, 40, False, "Arial Bold", 9) b.setAlignment(Chart.TopCenter) b.setRoundedCorners() ' Add a scatter group to the chart using 13 pixels red (ff0000) glass sphere symbols, with ' dotted drop lines Dim g0 As ThreeDScatterGroup = c.addScatterGroup(Chart.CTime(dataX), dataY0, dataZ0, _ "Alpha Series", Chart.GlassSphere2Shape, 13, &Hff0000) g0.setDropLine(c.dashLineColor(Chart.SameAsMainColor, Chart.DotLine)) ' Add a scatter group to the chart using 13 pixels blue (00cc00) cross symbols, with dotted ' drop lines Dim g1 As ThreeDScatterGroup = c.addScatterGroup(Chart.CTime(dataX), dataY1, dataZ1, _ "Beta Series", Chart.Cross2Shape(), 13, &H00cc00) g1.setDropLine(c.dashLineColor(Chart.SameAsMainColor, Chart.DotLine)) ' Set x-axis tick density to 50 pixels. ChartDirector auto-scaling will use this as the ' guideline when putting ticks on the x-axis. c.xAxis().setTickDensity(50) ' Set the y-axis labels c.yAxis().setLabels(labelsY) ' Set label style to Arial bold for all axes c.xAxis().setLabelStyle("Arial Bold") c.yAxis().setLabelStyle("Arial Bold") c.zAxis().setLabelStyle("Arial Bold") ' Set the x, y and z axis titles using deep blue (000088) 15 points Arial font c.xAxis().setTitle("Date/Time Axis", "Arial Italic", 15, &H000088) c.yAxis().setTitle("Label<*br*>Based<*br*>Axis", "Arial Italic", 15, &H000088) c.zAxis().setTitle("Numeric Axis", "Arial Italic", 15, &H000088) ' Output the chart viewer.Chart = c End Sub End Class

[WPF - C#] NetWPFCharts\CSharpWPFCharts\threedscatteraxis.cs
using System; using ChartDirector; namespace CSharpWPFCharts { public class threedscatteraxis : DemoModule { //Name of demo module public string getName() { return "3D Scatter Axis Types"; } //Number of charts produced in this demo module public int getNoOfCharts() { return 1; } //Main code for creating chart. //Note: the argument chartIndex is unused because this demo only has 1 chart. public void createChart(WPFChartViewer viewer, int chartIndex) { // The x coordinates for the 2 scatter groups DateTime[] dataX = {new DateTime(2011, 9, 1), new DateTime(2011, 9, 2), new DateTime( 2011, 9, 3), new DateTime(2011, 9, 4), new DateTime(2011, 9, 5), new DateTime(2011, 9, 6), new DateTime(2011, 9, 7), new DateTime(2011, 9, 8), new DateTime(2011, 9, 9), new DateTime(2011, 9, 10), new DateTime(2011, 9, 11)}; // The y and z coordinates for the first scatter group double[] dataY0 = {0.4, 0.2, 0.5, 0.4, 0.7, 1.3, 1.1, 1.0, 0.6, 0.4, 0.5}; double[] dataZ0 = {43, 38, 33, 23.4, 28, 36, 34, 47, 53, 45, 40}; // The y and z coordinates for the second scatter group double[] dataY1 = {1.4, 1.0, 1.8, 1.9, 1.5, 1.0, 0.6, 0.7, 1.2, 1.7, 1.5}; double[] dataZ1 = {46, 41, 33, 37, 28, 29, 34, 37, 41, 52, 50}; // Instead of displaying numeric values, labels are used for the y-axis string[] labelsY = {"Low", "Medium", "High"}; // Create a ThreeDScatterChart object of size 760 x 520 pixels ThreeDScatterChart c = new ThreeDScatterChart(760, 520); // Add a title to the chart using 18 points Arial font c.addTitle("3D Scatter Chart Axis Types", "Arial", 18); // Set the center of the plot region at (385, 270), and set width x depth x height to // 480 x 240 x 240 pixels c.setPlotRegion(385, 270, 480, 240, 240); // Set the elevation and rotation angles to 30 and -10 degrees c.setViewAngle(30, -10); // Add a legend box at (380, 40) with horizontal layout. Use 9pt Arial Bold font. LegendBox b = c.addLegend(380, 40, false, "Arial Bold", 9); b.setAlignment(Chart.TopCenter); b.setRoundedCorners(); // Add a scatter group to the chart using 13 pixels red (ff0000) glass sphere symbols, // with dotted drop lines ThreeDScatterGroup g0 = c.addScatterGroup(Chart.CTime(dataX), dataY0, dataZ0, "Alpha Series", Chart.GlassSphere2Shape, 13, 0xff0000); g0.setDropLine(c.dashLineColor(Chart.SameAsMainColor, Chart.DotLine)); // Add a scatter group to the chart using 13 pixels blue (00cc00) cross symbols, with // dotted drop lines ThreeDScatterGroup g1 = c.addScatterGroup(Chart.CTime(dataX), dataY1, dataZ1, "Beta Series", Chart.Cross2Shape(), 13, 0x00cc00); g1.setDropLine(c.dashLineColor(Chart.SameAsMainColor, Chart.DotLine)); // Set x-axis tick density to 50 pixels. ChartDirector auto-scaling will use this as the // guideline when putting ticks on the x-axis. c.xAxis().setTickDensity(50); // Set the y-axis labels c.yAxis().setLabels(labelsY); // Set label style to Arial bold for all axes c.xAxis().setLabelStyle("Arial Bold"); c.yAxis().setLabelStyle("Arial Bold"); c.zAxis().setLabelStyle("Arial Bold"); // Set the x, y and z axis titles using deep blue (000088) 15 points Arial font c.xAxis().setTitle("Date/Time Axis", "Arial Italic", 15, 0x000088); c.yAxis().setTitle("Label\nBased\nAxis", "Arial Italic", 15, 0x000088); c.zAxis().setTitle("Numeric Axis", "Arial Italic", 15, 0x000088); // Output the chart viewer.Chart = c; } } }

[ASP.NET Web Forms - C# version] NetWebCharts\CSharpASP\threedscatteraxis.aspx
(Click here on how to convert this code to code-behind style.)
<%@ Page Language="C#" Debug="true" %> <%@ Import Namespace="ChartDirector" %> <%@ Register TagPrefix="chart" Namespace="ChartDirector" Assembly="netchartdir" %> <!DOCTYPE html> <script runat="server"> // // Page Load event handler // protected void Page_Load(object sender, EventArgs e) { // The x coordinates for the 2 scatter groups DateTime[] dataX = {new DateTime(2011, 9, 1), new DateTime(2011, 9, 2), new DateTime(2011, 9, 3 ), new DateTime(2011, 9, 4), new DateTime(2011, 9, 5), new DateTime(2011, 9, 6), new DateTime(2011, 9, 7), new DateTime(2011, 9, 8), new DateTime(2011, 9, 9), new DateTime( 2011, 9, 10), new DateTime(2011, 9, 11)}; // The y and z coordinates for the first scatter group double[] dataY0 = {0.4, 0.2, 0.5, 0.4, 0.7, 1.3, 1.1, 1.0, 0.6, 0.4, 0.5}; double[] dataZ0 = {43, 38, 33, 23.4, 28, 36, 34, 47, 53, 45, 40}; // The y and z coordinates for the second scatter group double[] dataY1 = {1.4, 1.0, 1.8, 1.9, 1.5, 1.0, 0.6, 0.7, 1.2, 1.7, 1.5}; double[] dataZ1 = {46, 41, 33, 37, 28, 29, 34, 37, 41, 52, 50}; // Instead of displaying numeric values, labels are used for the y-axis string[] labelsY = {"Low", "Medium", "High"}; // Create a ThreeDScatterChart object of size 760 x 520 pixels ThreeDScatterChart c = new ThreeDScatterChart(760, 520); // Add a title to the chart using 18 points Arial font c.addTitle("3D Scatter Chart Axis Types", "Arial", 18); // Set the center of the plot region at (385, 270), and set width x depth x height to 480 x 240 // x 240 pixels c.setPlotRegion(385, 270, 480, 240, 240); // Set the elevation and rotation angles to 30 and -10 degrees c.setViewAngle(30, -10); // Add a legend box at (380, 40) with horizontal layout. Use 9pt Arial Bold font. LegendBox b = c.addLegend(380, 40, false, "Arial Bold", 9); b.setAlignment(Chart.TopCenter); b.setRoundedCorners(); // Add a scatter group to the chart using 13 pixels red (ff0000) glass sphere symbols, with // dotted drop lines ThreeDScatterGroup g0 = c.addScatterGroup(Chart.CTime(dataX), dataY0, dataZ0, "Alpha Series", Chart.GlassSphere2Shape, 13, 0xff0000); g0.setDropLine(c.dashLineColor(Chart.SameAsMainColor, Chart.DotLine)); // Add a scatter group to the chart using 13 pixels blue (00cc00) cross symbols, with dotted // drop lines ThreeDScatterGroup g1 = c.addScatterGroup(Chart.CTime(dataX), dataY1, dataZ1, "Beta Series", Chart.Cross2Shape(), 13, 0x00cc00); g1.setDropLine(c.dashLineColor(Chart.SameAsMainColor, Chart.DotLine)); // Set x-axis tick density to 50 pixels. ChartDirector auto-scaling will use this as the // guideline when putting ticks on the x-axis. c.xAxis().setTickDensity(50); // Set the y-axis labels c.yAxis().setLabels(labelsY); // Set label style to Arial bold for all axes c.xAxis().setLabelStyle("Arial Bold"); c.yAxis().setLabelStyle("Arial Bold"); c.zAxis().setLabelStyle("Arial Bold"); // Set the x, y and z axis titles using deep blue (000088) 15 points Arial font c.xAxis().setTitle("Date/Time Axis", "Arial Italic", 15, 0x000088); c.yAxis().setTitle("Label\nBased\nAxis", "Arial Italic", 15, 0x000088); c.zAxis().setTitle("Numeric Axis", "Arial Italic", 15, 0x000088); // Output the chart WebChartViewer1.Image = c.makeWebImage(Chart.SVG); } </script> <html> <head> <script type="text/javascript" src="cdjcv.js"></script> </head> <body> <chart:WebChartViewer id="WebChartViewer1" runat="server" /> </body> </html>

[ASP.NET Web Forms - VB Version] NetWebCharts\VBNetASP\threedscatteraxis.aspx
(Click here on how to convert this code to code-behind style.)
<%@ Page Language="VB" Debug="true" %> <%@ Import Namespace="ChartDirector" %> <%@ Register TagPrefix="chart" Namespace="ChartDirector" Assembly="netchartdir" %> <!DOCTYPE html> <script runat="server"> ' ' Page Load event handler ' Protected Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) ' The x coordinates for the 2 scatter groups Dim dataX() As Date = {DateSerial(2011, 9, 1), DateSerial(2011, 9, 2), DateSerial(2011, 9, 3), _ DateSerial(2011, 9, 4), DateSerial(2011, 9, 5), DateSerial(2011, 9, 6), DateSerial(2011, _ 9, 7), DateSerial(2011, 9, 8), DateSerial(2011, 9, 9), DateSerial(2011, 9, 10), _ DateSerial(2011, 9, 11)} ' The y and z coordinates for the first scatter group Dim dataY0() As Double = {0.4, 0.2, 0.5, 0.4, 0.7, 1.3, 1.1, 1.0, 0.6, 0.4, 0.5} Dim dataZ0() As Double = {43, 38, 33, 23.4, 28, 36, 34, 47, 53, 45, 40} ' The y and z coordinates for the second scatter group Dim dataY1() As Double = {1.4, 1.0, 1.8, 1.9, 1.5, 1.0, 0.6, 0.7, 1.2, 1.7, 1.5} Dim dataZ1() As Double = {46, 41, 33, 37, 28, 29, 34, 37, 41, 52, 50} ' Instead of displaying numeric values, labels are used for the y-axis Dim labelsY() As String = {"Low", "Medium", "High"} ' Create a ThreeDScatterChart object of size 760 x 520 pixels Dim c As ThreeDScatterChart = New ThreeDScatterChart(760, 520) ' Add a title to the chart using 18 points Arial font c.addTitle("3D Scatter Chart Axis Types", "Arial", 18) ' Set the center of the plot region at (385, 270), and set width x depth x height to 480 x 240 x ' 240 pixels c.setPlotRegion(385, 270, 480, 240, 240) ' Set the elevation and rotation angles to 30 and -10 degrees c.setViewAngle(30, -10) ' Add a legend box at (380, 40) with horizontal layout. Use 9pt Arial Bold font. Dim b As LegendBox = c.addLegend(380, 40, False, "Arial Bold", 9) b.setAlignment(Chart.TopCenter) b.setRoundedCorners() ' Add a scatter group to the chart using 13 pixels red (ff0000) glass sphere symbols, with ' dotted drop lines Dim g0 As ThreeDScatterGroup = c.addScatterGroup(Chart.CTime(dataX), dataY0, dataZ0, _ "Alpha Series", Chart.GlassSphere2Shape, 13, &Hff0000) g0.setDropLine(c.dashLineColor(Chart.SameAsMainColor, Chart.DotLine)) ' Add a scatter group to the chart using 13 pixels blue (00cc00) cross symbols, with dotted drop ' lines Dim g1 As ThreeDScatterGroup = c.addScatterGroup(Chart.CTime(dataX), dataY1, dataZ1, _ "Beta Series", Chart.Cross2Shape(), 13, &H00cc00) g1.setDropLine(c.dashLineColor(Chart.SameAsMainColor, Chart.DotLine)) ' Set x-axis tick density to 50 pixels. ChartDirector auto-scaling will use this as the ' guideline when putting ticks on the x-axis. c.xAxis().setTickDensity(50) ' Set the y-axis labels c.yAxis().setLabels(labelsY) ' Set label style to Arial bold for all axes c.xAxis().setLabelStyle("Arial Bold") c.yAxis().setLabelStyle("Arial Bold") c.zAxis().setLabelStyle("Arial Bold") ' Set the x, y and z axis titles using deep blue (000088) 15 points Arial font c.xAxis().setTitle("Date/Time Axis", "Arial Italic", 15, &H000088) c.yAxis().setTitle("Label<*br*>Based<*br*>Axis", "Arial Italic", 15, &H000088) c.zAxis().setTitle("Numeric Axis", "Arial Italic", 15, &H000088) ' Output the chart WebChartViewer1.Image = c.makeWebImage(Chart.SVG) End Sub </script> <html> <head> <script type="text/javascript" src="cdjcv.js"></script> </head> <body> <chart:WebChartViewer id="WebChartViewer1" runat="server" /> </body> </html>

[ASP.NET MVC - Controller] NetMvcCharts\Controllers\ThreedscatteraxisController.cs
using System; using System.Web.Mvc; using ChartDirector; namespace NetMvcCharts.Controllers { public class ThreedscatteraxisController : Controller { // // Default Action // public ActionResult Index() { ViewBag.Title = "3D Scatter Axis Types"; createChart(ViewBag.Viewer = new RazorChartViewer(HttpContext, "chart1")); return View("~/Views/Shared/ChartView.cshtml"); } // // Create chart // private void createChart(RazorChartViewer viewer) { // The x coordinates for the 2 scatter groups DateTime[] dataX = {new DateTime(2011, 9, 1), new DateTime(2011, 9, 2), new DateTime(2011, 9, 3), new DateTime(2011, 9, 4), new DateTime(2011, 9, 5), new DateTime(2011, 9, 6), new DateTime(2011, 9, 7), new DateTime(2011, 9, 8), new DateTime(2011, 9, 9), new DateTime(2011, 9, 10), new DateTime(2011, 9, 11)}; // The y and z coordinates for the first scatter group double[] dataY0 = {0.4, 0.2, 0.5, 0.4, 0.7, 1.3, 1.1, 1.0, 0.6, 0.4, 0.5}; double[] dataZ0 = {43, 38, 33, 23.4, 28, 36, 34, 47, 53, 45, 40}; // The y and z coordinates for the second scatter group double[] dataY1 = {1.4, 1.0, 1.8, 1.9, 1.5, 1.0, 0.6, 0.7, 1.2, 1.7, 1.5}; double[] dataZ1 = {46, 41, 33, 37, 28, 29, 34, 37, 41, 52, 50}; // Instead of displaying numeric values, labels are used for the y-axis string[] labelsY = {"Low", "Medium", "High"}; // Create a ThreeDScatterChart object of size 760 x 520 pixels ThreeDScatterChart c = new ThreeDScatterChart(760, 520); // Add a title to the chart using 18 points Arial font c.addTitle("3D Scatter Chart Axis Types", "Arial", 18); // Set the center of the plot region at (385, 270), and set width x depth x height to 480 x // 240 x 240 pixels c.setPlotRegion(385, 270, 480, 240, 240); // Set the elevation and rotation angles to 30 and -10 degrees c.setViewAngle(30, -10); // Add a legend box at (380, 40) with horizontal layout. Use 9pt Arial Bold font. LegendBox b = c.addLegend(380, 40, false, "Arial Bold", 9); b.setAlignment(Chart.TopCenter); b.setRoundedCorners(); // Add a scatter group to the chart using 13 pixels red (ff0000) glass sphere symbols, with // dotted drop lines ThreeDScatterGroup g0 = c.addScatterGroup(Chart.CTime(dataX), dataY0, dataZ0, "Alpha Series", Chart.GlassSphere2Shape, 13, 0xff0000); g0.setDropLine(c.dashLineColor(Chart.SameAsMainColor, Chart.DotLine)); // Add a scatter group to the chart using 13 pixels blue (00cc00) cross symbols, with dotted // drop lines ThreeDScatterGroup g1 = c.addScatterGroup(Chart.CTime(dataX), dataY1, dataZ1, "Beta Series", Chart.Cross2Shape(), 13, 0x00cc00); g1.setDropLine(c.dashLineColor(Chart.SameAsMainColor, Chart.DotLine)); // Set x-axis tick density to 50 pixels. ChartDirector auto-scaling will use this as the // guideline when putting ticks on the x-axis. c.xAxis().setTickDensity(50); // Set the y-axis labels c.yAxis().setLabels(labelsY); // Set label style to Arial bold for all axes c.xAxis().setLabelStyle("Arial Bold"); c.yAxis().setLabelStyle("Arial Bold"); c.zAxis().setLabelStyle("Arial Bold"); // Set the x, y and z axis titles using deep blue (000088) 15 points Arial font c.xAxis().setTitle("Date/Time Axis", "Arial Italic", 15, 0x000088); c.yAxis().setTitle("Label\nBased\nAxis", "Arial Italic", 15, 0x000088); c.zAxis().setTitle("Numeric Axis", "Arial Italic", 15, 0x000088); // Output the chart viewer.Image = c.makeWebImage(Chart.SVG); } } }

[ASP.NET MVC - View] NetMvcCharts\Views\Shared\ChartView.cshtml
@{ Layout = null; } <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <title>@ViewBag.Title</title> <style> @ViewBag.Style </style> @Scripts.Render("~/Scripts/cdjcv.js") </head> <body style="margin:5px 0px 0px 5px"> <div style="font:bold 18pt verdana;"> @ViewBag.Title </div> <hr style="border:solid 1px #000080; background:#000080" /> <div> @{ if (ViewBag.Viewer is Array) { // Display multiple charts for (int i = 0; i < ViewBag.Viewer.Length; ++i) { @:@Html.Raw(ViewBag.Viewer[i].RenderHTML()) } } else { // Display one chart only @:@Html.Raw(ViewBag.Viewer.RenderHTML()) } } </div> </body> </html>