Add a chart in Project Siena

 

In Project Siena, you can display data graphically in a column, line, or pie chart. For a general overview of Project Siena and links to resources such as sample apps, video tutorials, and forums, see Project Siena.

You can also find a short demonstration of chart features in this video on the Channel 9 page.

Prerequisites

Create a simple chart

  1. Import data or create a collection that contains a column of labels and a column of data.

    In a column or line chart, the labels will appear on the x-axis, and the data will determine the height of the line or column on the y-axis. In a pie chart, the labels will identify each pie piece, and the data will determine their relative sizes. In this collection, named Revenue2012, the Product column shows the labels, and the Revenue column shows the data.

    Product

    Revenue

    Violins

    $21,000

    Trombones

    $15,000

    Bongos

    $14,000

  2. Add a chart, and set its data source.

    Setting the data source of a chart

  3. With the chart selected, click Design, and then click Chart.

  4. In the dialog box that appears, click MIN, and then set the minimum value to 0.

    A column chart and a pie chart showing data

Create a chart with multiple columns of data

  1. Import data or create a collection that contains a column of labels and multiple columns of data.

    In a column or line chart, the labels will appear on the x-axis, each data series will determine the height of a line or column on the y-axis, and the legend wil identify each data series by color. In a pie chart, the labels will identify each pie piece, and you'll specify which data series to show. In this collection, named RevenueByYear, the Product column shows the labels, and the other columns show the data.

    Product

    2012

    2013

    2014

    Violins

    $21,000

    $26,000

    $28,000

    Trombones

    $15,000

    $17,000

    $21,000

    Bongos

    $14,000

    $19,000

    $23,000

  2. Add a chart, and set its data source.

  3. If you added a line or column chart, click it, click Design, click Chart, and then set the number of series to 3, and set the minimum value to 0.

    Chart with three years of data for three products

  4. If you added a pie chart and you want to change the series that it shows, perform these steps:

    1. Click the chart, and then click Express View in the lower-right corner.

    2. Under Data, open the Series list, and click the column of data you want the chart to show.

      Setting the data for a pie chart

Create a chart that filters the data

If your data source is structured so that the labels are contained in multiple columns, you can show a specific series by filtering the rows. For example, this data source is named RevenueLedger:

Product

YearID

Revenue

Violins

2012

$21,000

Violins

2013

$26,000

Violins

2014

$28,000

Trombones

2012

$15,000

Trombones

2013

$17,000

Trombones

2014

$21,000

Bongos

2012

$14,000

Bongos

2013

$19,000

Bongos

2014

$23,000

If you add a chart, set its data source to RevenueLedger, and set the minimum value of the y-axis to 0, that chart will look like this illustration because the labels are taken from only the first column:

A chart based on labels in multiple columns

However, you can get a clearer and more useful chart by adding a list by which you can filter the data by either year or product.

Two charts filtered by year or product

  1. Import data or create a collection that follows the structure of the data earlier in this section.

  2. Add a dropdown list, a listbox, or a radio-button control, and name it FilterCriteria.

  3. Set the data source for FilterCriteria to a function that follows this syntax:

    Distinct(DataSource,ColumnName)

    For example, use Distinct(RevenueLedger, Product) if you want to show all data for a specific product or Distinct(RevenueLedger, YearID) if you want to show all data for a specific year.

  4. Add a column or line chart, and set its data source to a function that follows this syntax:

    Filter(DataSource,ColumnName=FilterCriteria!Selected!Result)

    For example, use Filter(RevenueLedger, Product = FilterCriteria!Selected!Result if you want to show all data for a specific product or Filter(RevenueLedger, YearID = FilterCriteria!Selected!Result if you want to show all data for a specific year.

  5. With the chart selected, click Design, and then click Chart.

  6. In the dialog box that appears, click MIN, and then set the minimum value to 0.

  7. In the lower-right corner, click Express View, open the Labels list under Data, and then click the name of the column from which you want to take the labels.

    For example, click YearID if you're showing all data for a specific product, or click Product if you're showing all data for a specific year.

  8. Click a list option or a radio button to display the data you specified.