Chart for WinRT > Concepts and Main Properties |
In order to create and format charts using the C1Chart control, it is useful to understand how the main properties map into chart elements. The diagram below illustrates this:
The steps involved in creating a typical chart are:
The XAML markup below was used to create the chart in the image:
XAML |
Copy Code
|
---|---|
<Chart:C1Chart x:Name="c1Chart1" Height="450" Width="550" ChartType="Column" Palette="Solstice" > <!--Populate the chart with three series--> <Chart:C1Chart.Data> <Chart:ChartData > <Chart:ChartData.Children> <Chart:DataSeries Label="Revenue" Values="1200, 1205, 400, 1410" ></Chart:DataSeries> <Chart:DataSeries Label="Expense" Values="400, 300, 300, 210" ></Chart:DataSeries> <Chart:DataSeries Label="Profit" Values="790, 990, 175, 1205" ></Chart:DataSeries> </Chart:ChartData.Children> </Chart:ChartData> </Chart:C1Chart.Data> <!--Configure axes--> <Chart:C1Chart.View> <Chart:ChartView> <Chart:ChartView.AxisX> <Chart:Axis Title="Region" Height="35" /> </Chart:ChartView.AxisX> <Chart:ChartView.AxisY> <Chart:Axis MinorGridStroke="Black" MinorGridStrokeDashes="9,9" Title="Amount($1000)" /> </Chart:ChartView.AxisY> </Chart:ChartView> </Chart:C1Chart.View> <Chart:C1ChartLegend Visibility="Visible" Position="Right" /> </Chart:C1Chart> |