Chart for LightSwitch allows you create a customizable chart based on an existing Data Source.
To add a data source to bind to C1Chart, follow these steps:
- Right-click the Data Sources folder in the Solution Explorer, and choose Add Data Source. The Attach Data Source Wizard will open.
- Choose a data source type. Options are Database, SharePoint, and WCF RIA Service.
- Click Next and work through the Wizard to complete the data binding.
Once you have specified a data source, Chart for LightSwitch includes several screen layout controls that are used to build the chart:
- C1Chart. This is a collection control that is the main control representing the chart in the screen.
- C1ChartData. A group control representing the chart data. The only valid parent for C1ChartData is a C1Chart. Only one C1ChartData may be defined within a C1Chart.
- C1ChartDataSeries. A value control representing a single data series in a chart. The only valid parent for a C1ChartDataSeries is a C1ChartData. Multiple C1ChartDataSeries may be defined within a C1ChartData.
- C1ChartDataItemName. A value control representing data item names. The only valid parent for a C1ChartDataItemName is a C1ChartData. Only one C1ChartDataItemName may be used by the chart so if there are several visible C1ChartDataItemName controls within a C1ChartData, the first one is used and others are ignored as if they were hidden.