M# Tutorials

Learn to build .NET applications with M#. Our step-by-step tutorials will get you up-to-speed rapidly.
If you already know ASP.NET and C#, you can master M# in a week or two.

M# Charting

Charts are used to display statistical information and have high importance in data driven applications. This tutorial explains how you can use the chart module and how M# generates charts. Charting in M# is provided as a separate section in List modules only, because charts are always based on collection or series of data (please read chapter “List Modules” for more information).

In order to create a chart you specify a chart name and hit “Enter” on keyboard. M# displays a chart with default attributes.

M# uses “System.Web.UI.DataVisualization.Charting” namespace and generates ASP.NET chart web control in the “List module” markup. The charts are converted into images and are placed in the “@TempImageFiles”

Series

Series section in the screenshot shown above represents data series, which holds data points, that are plotted on the chart or used in calculation to generate chart points. You may add multiple series or change to a different chart type, some chart types do not allow multiple series e.g. pie Chart. A good example of multiple series could be a “Line Chart” where you can render different chart series for a particular data point.

DataSource

This is the data source of a series. By default M# accesses the “List Module” data source by calling “GetDataSource” method but you can specify custom data source as well. Each element in the provided data source sequence is accessible using “item” keyword to specify the chart axis text and point value expression.

Value Expression

This value provided in this attribute is plotted on the chart. The expression is calculated by accessing each “item” of the provided data source.

Chart Types

You can change the type of a chart by selecting the “Chart Type” attribute of a series.

Axis Text Expression

“Axis text expression” is used to display text on the axis for each data point representation.

Titles

Titles section is used to display any number of titles for a chart. Each “Title” has an attribute “Markup Attributes”, which is used to customise the title position or docking.