Line Chart
Line chart is used to show trends and performance over a period of time. Line graphs are probably the most widely used graph for showing trend. This is useful in showing a spike in the traffic, prices, etc.

The chart from the image above is created with the following code:
<shield:ShieldChart ID="ShieldChart1" Width="580px" Height="400px" runat="server"
OnTakeDataSource="ShieldChart1_TakeDataSource"
CssClass="chart">
<PrimaryHeader Text="Electricity prices"></PrimaryHeader>
<ExportOptions AllowExportToImage="false" AllowPrint="false" />
<Axes>
<shield:ChartAxisX
CategoricalValues="2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012"></shield:ChartAxisX>
<shield:ChartAxisY>
<Title Text="Price (EUR per kWh)"></Title>
</shield:ChartAxisY>
</Axes>
<DataSeries>
<shield:ChartLineSeries DataFieldY="Households" CollectionAlias="Households">
<Settings EnablePointSelection="true">
<PointMark>
<ActiveSettings>
<PointSelectedState DrawWidth="4" DrawRadius="4" />
</ActiveSettings>
</PointMark>
</Settings>
</shield:ChartLineSeries>
<shield:ChartLineSeries DataFieldY="Industry" CollectionAlias="Industry">
<Settings EnablePointSelection="true">
<PointMark>
<ActiveSettings>
<PointSelectedState DrawWidth="4" DrawRadius="4" />
</ActiveSettings>
</PointMark>
</Settings>
</shield:ChartLineSeries>
</DataSeries>
</shield:ShieldChart>
protected void ShieldChart1_TakeDataSource(object sender, Shield.Web.UI.ChartTakeDataSourceEventArgs e)
{
List datasource = new List()
{
new Prices() { Households = 0.164, Industry= 0.103 },
new Prices() { Households = 0.173, Industry= 0.105 },
new Prices() { Households = 0.184, Industry= 0.112 },
new Prices() { Households = 0.167, Industry= 0.111 },
new Prices() { Households = 0.177, Industry= 0.102 },
new Prices() { Households = 0.189, Industry= 0.099 },
new Prices() { Households = 0.180, Industry= 0.110 },
new Prices() { Households = 0.183, Industry= 0.113 },
new Prices() { Households = 0.188, Industry= 0.117 },
new Prices() { Households = 0.160, Industry= 0.119 },
new Prices() { Households = 0.176, Industry= 0.123 },
new Prices() { Households = 0.178, Industry= 0.117 }
};
ShieldChart1.DataSource = datasource;
}
private class Prices
{
public double Households { get; set; }
public double Industry { get; set; }
}
- When the chart is bound to collection of objects the X values are got by the field which name is set into the
DataFieldXproperty of theChartLineSeries. The Y values are got by the field which name is set into theDataFieldYproperty. - The name that is shown in the legend is chosen via the
CollectionAliasproperty of theChartLineSeries. - By default all X values are sorted in order line chart to be shown appropriately, however this behavior is controlled by the
EnableValueXSortingproperty of theChartLineSeries. - The type of the
ChartLineSeriescan be changed by theSettings.SeriesDashStyleproperty and it can be set as:Solid,ShortDash,ShortDot,ShortDashDot,Dot, etc. DataStartandDataStepproperties control the start value of the x axis and explicit value for the interval between a data series member values.- All points from the
ChartLineSeriesare represented withChartSeriesItemwhich belongs to theChartLineSeries.Itemscollection.- The
ChartLineSeries.Itemscan be added declarative without data binding. - The data binding and declarative approach can be mixed. However in order declarative items to be appended to the items created from the datasource the
ShieldChart.AppendDataBoundItemsproperty need to be set to"true".
- The
- All setting related to
ChartLineSeriesare contained into theChartLineSeries.Settingsobject.- The series color can be set via
Colorproperty. - If the
AddToLegendis set to false the series is not added into the legend. - The animation of the series can be controlled by
ChartLineSeries.Settings.EnableAnimationandChartLineSeries.Settings.AnimationDurationproperties. - If some values are missing (i.e. they are null/Nothing) from the series data you can have the chart work around this by setting the
DrawNullValuesproperty. - If the chart has more than one line series they can be ordered by the index set in
ChartLineSeries.OrderIndexproperty. - Each point from the series can be selected if the
EnablePointSelectionproperty is set to true. - All selected points can be customized by
Settings.PointMark.ActiveSettings.PointSelectedStateobject properties. - From the
Settings.PointMark.ActiveSettings.PointHoveredStateobject properties you can change the appearance of each line when the user hovers it. - Each series has related tooltip which can be customized via the
Settings.Tooltipobject. - Each point from the series can have related text, which appearance is controlled by
Settings.DataPointTextproperty. You can changeBackgroundColor,BorderColor,Color,Padding, andTextAngleof the corresponding data point text.
- The series color can be set via
