SharePoint Dragons

Nikander & Margriet on SharePoint

Category Archives: SharePoint

ECB action depending on column value

You’ve probably been in a situation where you wanted to display a custom action based on a specific field value? If you’re in luck, you can keep things simple by creating a dedicated content type: http://www.csharpest.net/?p=95. Otherwise, you can go for an approach where you’re leveraging the client object model and jQuery: http://pholpar.wordpress.com/2011/07/24/hiding-ecb-custom-actions-based-on-specific-list-properties-using-the-client-object-model/. The latest solution being the best solution as we’re concerned.

Free eBook about Office 365

Another one for the free eBook collection: http://blogs.msdn.com/b/microsoft_press/archive/2011/08/17/free-ebook-microsoft-office-365-connect-and-collaborate-virtually-anywhere-anytime.aspx

Microsoft Office 365: Connect and Collaborate Virtually Anywhere, Anytime is all about cloud solutions for small businesses, focusing on the core software services (Microsoft Exchange Online, Microsoft SharePoint Online, Office Web Apps, and Microsoft Lync), and demonstrating ways you can create, manage, and lead teams effectively using the communications and collaborative online tools.

You’ll find helpful ideas and solutions in Office 365 if you

IntelliSense for CAML

Wow, we tried to do something similar for SharePoint features, which only partially succeeded. But this sounds like the real deal:

The CAML.NET IntelliSense extensions for Visual Studio 2010 is simply a must-have for SharePoint developers. It can help you tame that sometimes finicky, but ever-so-essential CAML language we all know and love.

You probably already know how to add the out-of-the-box SharePoint schemas to Visual Studio so you get IntelliSense when editing your CAML files.

This is a good first step, but CAML.NET Intellisense takes it even further by adding the following enhancements:

  • Extends the default schema files with detailed annotations imported directly from the SharePoint SDK documentation.
  • Adds a custom WPF IntelliSense Presenter to the Visual Studio environment for a greatly enhanced developer experience.
  • Automatically detects and downloads schema updates so you are always working with the most current information available.
  • Links directly to the online SDK documentation for the currently visible element, so you can “drill down” into the documentation with a single click.

Let’s face it – even with an up to date set of bookmarks, who wants to go searching all over the place for that missing tidbit that tells you just what that obscure attribute is for when you’re right in the middle of building the CAML for your spiffy new feature?

http://visualstudiogallery.msdn.microsoft.com/15055544-fda0-42db-a603-6dc32ed26fde/

Whitepaper about hybrid env’s with Office 365

Hybrid SharePoint environments combine on-premises Microsoft SharePoint Server 2010 with Office 365 — Microsoft SharePoint Online.

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=27580

White paper about large scale SharePoint content databases

This white paper provides details about a test lab that was run at Microsoft to show large scale SharePoint Server 2010 content databases:

http://www.microsoft.com/download/en/details.aspx?id=27573

Free SharePoint E-books

Upgrading and migrating SharePoint 2010

Nice article to check if you’re going to do an upgrade or migration traject:

http://blogs.technet.com/b/pfelatam/archive/2011/10/20/sharepoint-2010-upgrade-and-migration-summary.aspx

SharePoint 2010 PowerShell Command Builder

Hmm, a visual tool for building SharePoint command tools. We’re not convinced, but we’re giving it a test spin:

http://blogs.technet.com/b/steve_chen/archive/2011/10/20/3460400.aspx

SharePoint Online

Nice starting point for developers beginning SharePoint Online:

 

http://msdn.microsoft.com/en-us/library/gg317460.aspx

About the chart controls in the SilverLight 5 Toolkit

As a follow up of blog post https://sharepointdragons.com/2011/12/08/building-a-silverlight-chart-web-part-for-sharepoint-2010/, we’ll provide code examples of the various chart controls that can be found in the SilverLight 5 Toolkit. Repeat the same steps as described in the aforementioned blog post, but change this:

Building a Scatter chart

In MainPage.xaml, add a chart:

<toolkit:Chart HorizontalAlignment=”Left” Margin=”8,30,-295,0″ Title=”Chart Title” Name=”chart1″ VerticalAlignment=”Top” Height=”270″ Width=”687″>
</toolkit:Chart>

What makes this type of chart different from the regular chart is that you don’t create one or more ColumnSeries, instead you’re adding ScatterSeries:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.DataVisualization.Charting;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SilverRadar
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();

List<DayDto> days = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 10 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 8 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 3 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 7 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 4 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 3 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 1 },
};

List<DayDto> days2 = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 12 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 5 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 4 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 6 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 5 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 2 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 0 },
};

chart1.Title = “Visitors/days of week in Scatters”;
chart1.BorderThickness = new Thickness(10);

var b1 = new ScatterSeries();
b1.Name = “days”;
b1.Title = “Visitors of web site 1/Days of the Week”;
b1.IsSelectionEnabled = true;
b1.ItemsSource = days;
b1.IndependentValueBinding = new Binding(“Day”);
b1.DependentValueBinding = new Binding(“NumberOfVisitors”);

chart1.Series.Add(b1);

var b2 = new ScatterSeries();
b2.Name = “days2”;
b2.Title = “Visitors of web site 2/Days of the Week”;
b2.IsSelectionEnabled = true;
b2.ItemsSource = days2;
b2.IndependentValueBinding = new Binding(“Day”);
b2.DependentValueBinding = new Binding(“NumberOfVisitors”);

chart1.Series.Add(b2);
}
}

public class DayDto
{
public string Day { get; set; }
public int NumberOfVisitors { get; set; }
}
}

The end result:

image

Building a Line chart

In MainPage.xaml, add a chart:

<toolkit:Chart HorizontalAlignment=”Left” Margin=”8,30,-295,0″ Title=”Chart Title” Name=”chart1″ VerticalAlignment=”Top” Height=”270″ Width=”687″>
</toolkit:Chart>

What makes this type of chart different from the regular chart is that you don’t create one or more ColumnSeries, instead you’re adding LineSeries:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.DataVisualization.Charting;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SilverRadar
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();

List<DayDto> days = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 10 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 8 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 3 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 7 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 4 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 3 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 1 },
};

List<DayDto> days2 = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 12 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 5 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 4 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 6 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 5 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 2 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 0 },
};

chart1.Title = “Visitors/days of week in Lines”;
chart1.BorderThickness = new Thickness(10);

var b1 = new LineSeries();
b1.Name = “days”;
b1.Title = “Visitors of web site 1/Days of the Week”;
b1.IsSelectionEnabled = true;
b1.ItemsSource = days;
b1.IndependentValueBinding = new Binding(“Day”);
b1.DependentValueBinding = new Binding(“NumberOfVisitors”);

chart1.Series.Add(b1);

var b2 = new LineSeries();
b2.Name = “days2”;
b2.Title = “Visitors of web site 2/Days of the Week”;
b2.IsSelectionEnabled = true;
b2.ItemsSource = days2;
b2.IndependentValueBinding = new Binding(“Day”);
b2.DependentValueBinding = new Binding(“NumberOfVisitors”);

chart1.Series.Add(b2);
}
}

public class DayDto
{
public string Day { get; set; }
public int NumberOfVisitors { get; set; }
}
}

The end result:

image

Building a Column chart

In MainPage.xaml, add a chart:

<toolkit:Chart HorizontalAlignment=”Left” Margin=”8,30,-295,0″ Title=”Chart Title” Name=”chart1″ VerticalAlignment=”Top” Height=”270″ Width=”687″>
</toolkit:Chart>

The regular chart: you have to create one or more ColumnSeries:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.DataVisualization.Charting;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SilverRadar
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();

List<DayDto> days = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 10 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 8 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 3 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 7 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 4 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 3 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 1 },
};

List<DayDto> days2 = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 12 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 5 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 4 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 6 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 5 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 2 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 0 },
};

chart1.Title = “Visitors/days of week in Columns”;
chart1.BorderThickness = new Thickness(10);

var b1 = new ColumnSeries();
b1.Name = “days”;
b1.Title = “Visitors of web site 1/Days of the Week”;
b1.IsSelectionEnabled = true;
b1.ItemsSource = days;
b1.IndependentValueBinding = new Binding(“Day”);
b1.DependentValueBinding = new Binding(“NumberOfVisitors”);

chart1.Series.Add(b1);

var b2 = new ColumnSeries();
b2.Name = “days2”;
b2.Title = “Visitors of web site 2/Days of the Week”;
b2.IsSelectionEnabled = true;
b2.ItemsSource = days2;
b2.IndependentValueBinding = new Binding(“Day”);
b2.DependentValueBinding = new Binding(“NumberOfVisitors”);

chart1.Series.Add(b2);
}
}

public class DayDto
{
public string Day { get; set; }
public int NumberOfVisitors { get; set; }
}
}

The end result:

image

Building a Bar chart

In MainPage.xaml, add a chart:

<toolkit:Chart HorizontalAlignment=”Left” Margin=”8,30,-295,0″ Title=”Chart Title” Name=”chart1″ VerticalAlignment=”Top” Height=”270″ Width=”687″>
</toolkit:Chart>

What makes this type of chart different from the regular chart is that you don’t create one or more ColumnSeries, instead you’re adding BarSeries:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.DataVisualization.Charting;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SilverRadar
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();

List<DayDto> days = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 10 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 8 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 3 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 7 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 4 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 3 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 1 },
};

List<DayDto> days2 = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 12 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 5 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 4 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 6 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 5 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 2 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 0 },
};

chart1.Title = “Visitors/days of week in Bars”;
chart1.BorderThickness = new Thickness(10);

var b1 = new BarSeries();
b1.Name = “days”;
b1.Title = “Visitors of web site 1/Days of the Week”;
b1.IsSelectionEnabled = true;
b1.ItemsSource = days;
b1.IndependentValueBinding = new Binding(“Day”);
b1.DependentValueBinding = new Binding(“NumberOfVisitors”);

chart1.Series.Add(b1);

var b2 = new BarSeries();
b2.Name = “days2”;
b2.Title = “Visitors of web site 2/Days of the Week”;
b2.IsSelectionEnabled = true;
b2.ItemsSource = days2;
b2.IndependentValueBinding = new Binding(“Day”);
b2.DependentValueBinding = new Binding(“NumberOfVisitors”);

chart1.Series.Add(b2);
}
}

public class DayDto
{
public string Day { get; set; }
public int NumberOfVisitors { get; set; }
}
}

The end result:

image

Building a Area chart

In MainPage.xaml, add a chart:

<toolkit:Chart HorizontalAlignment=”Left” Margin=”8,30,-295,0″ Title=”Chart Title” Name=”chart1″ VerticalAlignment=”Top” Height=”270″ Width=”687″>
</toolkit:Chart>

What makes this type of chart different from the regular chart is that you don’t create one or more ColumnSeries, instead you’re adding AreaSeries:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.DataVisualization.Charting;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SilverRadar
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();

List<DayDto> days = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 10 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 8 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 3 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 7 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 4 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 3 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 1 },
};

List<DayDto> days2 = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 12 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 5 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 4 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 6 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 5 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 2 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 0 },
};

chart1.Title = “Visitors/days of week in Areas”;
chart1.BorderThickness = new Thickness(10);

var b1 = new AreaSeries();
b1.Name = “days”;
b1.Title = “Visitors of web site 1/Days of the Week”;
b1.IsSelectionEnabled = true;
b1.ItemsSource = days;
b1.IndependentValueBinding = new Binding(“Day”);
b1.DependentValueBinding = new Binding(“NumberOfVisitors”);

chart1.Series.Add(b1);

var b2 = new AreaSeries();
b2.Name = “days2”;
b2.Title = “Visitors of web site 2/Days of the Week”;
b2.IsSelectionEnabled = true;
b2.ItemsSource = days2;
b2.IndependentValueBinding = new Binding(“Day”);
b2.DependentValueBinding = new Binding(“NumberOfVisitors”);

chart1.Series.Add(b2);
}
}

public class DayDto
{
public string Day { get; set; }
public int NumberOfVisitors { get; set; }
}
}

The end result:

image

Building a Pie chart

In MainPage.xaml, add a chart:

<toolkit:Chart HorizontalAlignment=”Left” Margin=”8,30,-295,0″ Title=”Chart Title” Name=”chart1″ VerticalAlignment=”Top” Height=”270″ Width=”687″>
</toolkit:Chart>

What makes this type of chart different from the regular chart is that you don’t create one or more ColumnSeries, instead you’re adding PieSeries:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.DataVisualization.Charting;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SilverRadar
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();

List<DayDto> days = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 10 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 8 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 3 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 7 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 4 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 3 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 1 },
};

chart1.Title = “Visitors/days of week in Pies”;
chart1.BorderThickness = new Thickness(10);

var b1 = new PieSeries();
b1.Name = “days”;
b1.Title = “Visitors of web site 1/Days of the Week”;
b1.IsSelectionEnabled = true;
b1.ItemsSource = days;
b1.IndependentValueBinding = new Binding(“Day”);
b1.DependentValueBinding = new Binding(“NumberOfVisitors”);

chart1.Series.Add(b1);

}
}

public class DayDto
{
public string Day { get; set; }
public int NumberOfVisitors { get; set; }
}
}

The end result:

image

Building a Stacked Line chart

In MainPage.xaml, add a chart:

<toolkit:Chart HorizontalAlignment=”Left” Margin=”8,30,-295,0″ Title=”Chart Title” Name=”chart1″ VerticalAlignment=”Top” Height=”270″ Width=”687″>
</toolkit:Chart>

What makes this type of chart different from the regular chart is that you don’t create one or more ColumnSeries, instead you’re adding SeriesDefinitions:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.DataVisualization.Charting;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SilverRadar
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();

List<DayDto> days = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 10 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 8 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 3 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 7 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 4 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 3 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 1 },
};

List<DayDto> days2 = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 12 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 5 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 4 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 6 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 5 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 2 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 0 },
};

chart1.Title = “Visitors/days of week in Stacked Lines”;

var b1 = new StackedLineSeries();
b1.Name = “days”;
var s1 = new SeriesDefinition();
b1.SeriesDefinitions.Add(s1);
s1.Title = “Visitors of web site 1/Days of the Week”;
s1.ItemsSource = days;
s1.IndependentValueBinding = new Binding(“Day”);
s1.DependentValueBinding = new Binding(“NumberOfVisitors”);

var s2 = new SeriesDefinition();
b1.SeriesDefinitions.Add(s2);
s2.Title = “Visitors of web site 2/Days of the Week”;
s2.ItemsSource = days2;
s2.IndependentValueBinding = new Binding(“Day”);
s2.DependentValueBinding = new Binding(“NumberOfVisitors”);

chart1.Series.Add(b1);
}
}

public class DayDto
{
public string Day { get; set; }
public int NumberOfVisitors { get; set; }
}
}

The end result:

image

Building a Stacked Column chart

In MainPage.xaml, add a chart:

<toolkit:Chart HorizontalAlignment=”Left” Margin=”8,30,-295,0″ Title=”Chart Title” Name=”chart1″ VerticalAlignment=”Top” Height=”270″ Width=”687″>
</toolkit:Chart>

What makes this type of chart different from the regular chart is that you don’t create one or more ColumnSeries, instead you’re adding SeriesDefinitions:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.DataVisualization.Charting;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SilverRadar
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();

List<DayDto> days = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 10 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 8 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 3 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 7 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 4 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 3 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 1 },
};

List<DayDto> days2 = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 12 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 5 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 4 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 6 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 5 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 2 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 0 },
};

chart1.Title = “Visitors/days of week in Stacked Columns”;

var b1 = new StackedColumnSeries();
b1.Name = “days”;
var s1 = new SeriesDefinition();
b1.SeriesDefinitions.Add(s1);
s1.Title = “Visitors of web site 1/Days of the Week”;
s1.ItemsSource = days;
s1.IndependentValueBinding = new Binding(“Day”);
s1.DependentValueBinding = new Binding(“NumberOfVisitors”);

var s2 = new SeriesDefinition();
b1.SeriesDefinitions.Add(s2);
s2.Title = “Visitors of web site 2/Days of the Week”;
s2.ItemsSource = days2;
s2.IndependentValueBinding = new Binding(“Day”);
s2.DependentValueBinding = new Binding(“NumberOfVisitors”);

chart1.Series.Add(b1);
}
}

public class DayDto
{
public string Day { get; set; }
public int NumberOfVisitors { get; set; }
}
}

The end result:

image

Building a Stacked Area chart

In MainPage.xaml, add a chart:

<toolkit:Chart HorizontalAlignment=”Left” Margin=”8,30,-295,0″ Title=”Chart Title” Name=”chart1″ VerticalAlignment=”Top” Height=”270″ Width=”687″>
</toolkit:Chart>

What makes this type of chart different from the regular chart is that you don’t create one or more ColumnSeries, instead you’re adding SeriesDefinitions:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.DataVisualization.Charting;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SilverRadar
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();

List<DayDto> days = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 10 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 8 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 3 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 7 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 4 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 3 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 1 },
};

List<DayDto> days2 = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 12 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 5 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 4 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 6 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 5 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 2 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 0 },
};

chart1.Title = “Visitors/days of week in Stacked Areas”;

var b1 = new StackedAreaSeries();
b1.Name = “days”;
var s1 = new SeriesDefinition();
b1.SeriesDefinitions.Add(s1);
s1.Title = “Visitors of web site 1/Days of the Week”;
s1.ItemsSource = days;
s1.IndependentValueBinding = new Binding(“Day”);
s1.DependentValueBinding = new Binding(“NumberOfVisitors”);

var s2 = new SeriesDefinition();
b1.SeriesDefinitions.Add(s2);
s2.Title = “Visitors of web site 2/Days of the Week”;
s2.ItemsSource = days2;
s2.IndependentValueBinding = new Binding(“Day”);
s2.DependentValueBinding = new Binding(“NumberOfVisitors”);

chart1.Series.Add(b1);
}
}

public class DayDto
{
public string Day { get; set; }
public int NumberOfVisitors { get; set; }
}
}

The end result:

image

Building a Stacked Bar chart

In MainPage.xaml, add a chart:

<toolkit:Chart HorizontalAlignment=”Left” Margin=”8,30,-295,0″ Title=”Chart Title” Name=”chart1″ VerticalAlignment=”Top” Height=”270″ Width=”687″>
</toolkit:Chart>

What makes this type of chart different from the regular chart is that you don’t create one or more ColumnSeries, instead you’re adding SeriesDefinitions:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.DataVisualization.Charting;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SilverRadar
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();

List<DayDto> days = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 10 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 8 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 3 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 7 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 4 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 3 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 1 },
};

List<DayDto> days2 = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 12 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 5 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 4 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 6 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 5 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 2 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 0 },
};

chart1.Title = “Visitors/days of week in Stacked Bars”;

var b1 = new StackedBarSeries();
b1.Name = “days”;
var s1 = new SeriesDefinition();
b1.SeriesDefinitions.Add(s1);
s1.Title = “Visitors of web site 1/Days of the Week”;
s1.ItemsSource = days;
s1.IndependentValueBinding = new Binding(“Day”);
s1.DependentValueBinding = new Binding(“NumberOfVisitors”);

var s2 = new SeriesDefinition();
b1.SeriesDefinitions.Add(s2);
s2.Title = “Visitors of web site 2/Days of the Week”;
s2.ItemsSource = days2;
s2.IndependentValueBinding = new Binding(“Day”);
s2.DependentValueBinding = new Binding(“NumberOfVisitors”);

chart1.Series.Add(b1);
}
}

public class DayDto
{
public string Day { get; set; }
public int NumberOfVisitors { get; set; }
}
}

The end result:

image

Building a Line chart with custom linear axis

In MainPage.xaml, add a chart:

<toolkit:Chart HorizontalAlignment=”Left” Margin=”8,30,-295,0″ Title=”Chart Title” Name=”chart1″ VerticalAlignment=”Top” Height=”270″ Width=”687″>
</toolkit:Chart>

What makes this type of chart different from the regular chart is that you’re adding a LinearAxis:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.DataVisualization.Charting;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SilverRadar
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();

List<DayDto> days = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 10 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 8 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 3 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 7 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 4 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 3 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 1 },
};

chart1.Title = “Visitors/days of week in Linear Axis”;

var b1 = new LineSeries();
b1.Name = “days”;
b1.Title = “Visitors of web site 1/Days of the Week”;
b1.ItemsSource = days;
b1.IndependentValueBinding = new Binding(“Day”);
b1.DependentValueBinding = new Binding(“NumberOfVisitors”);

chart1.Series.Add(b1);

var la1 = new LinearAxis();
la1.Orientation = AxisOrientation.Y;
la1.Minimum = 0;
la1.Maximum = 20;
la1.Interval = 2;

chart1.Axes.Add(la1);
}
}

public class DayDto
{
public string Day { get; set; }
public int NumberOfVisitors { get; set; }
}
}

The end result:

image

Building a Line chart with custom datetime axis

In MainPage.xaml, add a chart:

<toolkit:Chart HorizontalAlignment=”Left” Margin=”8,30,-295,0″ Title=”Chart Title” Name=”chart1″ VerticalAlignment=”Top” Height=”270″ Width=”687″>
</toolkit:Chart>

What makes this type of chart different from the regular chart is that you’re adding a DateTimeAxis:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.DataVisualization.Charting;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SilverRadar
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();

List<DayDto> days3 = new List<DayDto>()
{
new DayDto() { Date = DateTime.Now.AddDays(-10), NumberOfVisitors = 12 },
new DayDto() { Date = DateTime.Now.AddDays(-15), NumberOfVisitors = 5 },
new DayDto() { Date = DateTime.Now.AddDays(-5), NumberOfVisitors = 4 },
new DayDto() { Date = DateTime.Now.AddDays(-7), NumberOfVisitors = 6 },
new DayDto() { Date = DateTime.Now.AddDays(-9), NumberOfVisitors = 5 },
new DayDto() { Date = DateTime.Now.AddDays(-20), NumberOfVisitors = 2 },
new DayDto() { Date = DateTime.Now, NumberOfVisitors = 0 },
};

chart1.Title = “Visitors/dates in Linear Axis with DateTime Axis”;

var b1 = new LineSeries();
b1.Name = “days”;
b1.Title = “Visitors of web site 1/Date of the Week”;
b1.ItemsSource = days3;
b1.IndependentValueBinding = new Binding(“Date”);
b1.DependentValueBinding = new Binding(“NumberOfVisitors”);

chart1.Series.Add(b1);

var la1 = new DateTimeAxis();
la1.Orientation = AxisOrientation.X;
la1.Minimum = DateTime.Now.AddDays(-25);
la1.Maximum = DateTime.Now.AddDays(1);

chart1.Axes.Add(la1);
}
}

public class DayDto
{
public string Day { get; set; }
public int NumberOfVisitors { get; set; }
public DateTime Date { get; set; }
}
}

The end result:

image

Building a Line chart with custom category axis

In MainPage.xaml, add a chart:

<toolkit:Chart HorizontalAlignment=”Left” Margin=”8,30,-295,0″ Title=”Chart Title” Name=”chart1″ VerticalAlignment=”Top” Height=”270″ Width=”687″>
</toolkit:Chart>

What makes this type of chart different from the regular chart is that you’re adding  a CategoryAxis:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.DataVisualization.Charting;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SilverRadar
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();

List<DayDto> days = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 10 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 8 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 3 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 7 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 4 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 3 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 1 },
};

chart1.Title = “Visitors/days in Linear chart with Category Axis”;

var labelStyle = new Style(typeof(AxisLabel));
labelStyle.Setters.Add(new Setter(AxisLabel.StringFormatProperty, “Category {0}”));

var b1 = new LineSeries();
b1.Name = “days”;
b1.Title = “Visitors of web site 1/Days of the Week”;
b1.ItemsSource = days;
b1.IndependentValueBinding = new Binding(“Day”);
b1.DependentValueBinding = new Binding(“NumberOfVisitors”);
b1.IndependentAxis = new CategoryAxis
{
Orientation = AxisOrientation.X,
AxisLabelStyle = labelStyle
};

chart1.Series.Add(b1);
}
}

public class DayDto
{
public string Day { get; set; }
public int NumberOfVisitors { get; set; }
public DateTime Date { get; set; }
}
}

The end result:

image

Building a Stacked 100% Area chart

In MainPage.xaml, add a chart:

<toolkit:Chart HorizontalAlignment=”Left” Margin=”8,30,-295,0″ Title=”Chart Title” Name=”chart1″ VerticalAlignment=”Top” Height=”270″ Width=”687″>
</toolkit:Chart>

What makes this type of chart different from the regular chart is that you don’t create one or more ColumnSeries, instead you’re adding SeriesDefinitions:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.DataVisualization.Charting;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SilverRadar
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();

List<DayDto> days = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 10 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 8 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 3 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 7 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 4 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 3 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 1 },
};

List<DayDto> days2 = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 12 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 5 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 4 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 6 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 5 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 2 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 0 },
};

chart1.Title = “Visitors/days of week in Stacked 100% Areas”;

var b1 = new Stacked100AreaSeries();
b1.Name = “days”;
var s1 = new SeriesDefinition();
b1.SeriesDefinitions.Add(s1);
s1.Title = “Visitors of web site 1/Days of the Week”;
s1.ItemsSource = days;
s1.IndependentValuePath = “Day”;
s1.DependentValuePath = “NumberOfVisitors”;

var s2 = new SeriesDefinition();
b1.SeriesDefinitions.Add(s2);
s2.Title = “Visitors of web site 2/Days of the Week”;
s2.ItemsSource = days2;
s2.IndependentValuePath = “Day”;
s2.DependentValuePath = “NumberOfVisitors”;

chart1.Series.Add(b1);
}
}

public class DayDto
{
public string Day { get; set; }
public int NumberOfVisitors { get; set; }
}
}

The end result:

image

Building a Stacked 100% Bar chart

In MainPage.xaml, add a chart:

<toolkit:Chart HorizontalAlignment=”Left” Margin=”8,30,-295,0″ Title=”Chart Title” Name=”chart1″ VerticalAlignment=”Top” Height=”270″ Width=”687″>
</toolkit:Chart>

What makes this type of chart different from the regular chart is that you don’t create one or more ColumnSeries, instead you’re adding SeriesDefinitions:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.DataVisualization.Charting;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SilverRadar
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();

List<DayDto> days = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 10 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 8 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 3 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 7 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 4 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 3 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 1 },
};

List<DayDto> days2 = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 12 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 5 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 4 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 6 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 5 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 2 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 0 },
};

chart1.Title = “Visitors/days of week in Stacked 100% Bars”;

var b1 = new Stacked100BarSeries();
b1.Name = “days”;
var s1 = new SeriesDefinition();
b1.SeriesDefinitions.Add(s1);
s1.Title = “Visitors of web site 1/Days of the Week”;
s1.ItemsSource = days;
s1.IndependentValuePath = “Day”;
s1.DependentValuePath = “NumberOfVisitors”;

var s2 = new SeriesDefinition();
b1.SeriesDefinitions.Add(s2);
s2.Title = “Visitors of web site 2/Days of the Week”;
s2.ItemsSource = days2;
s2.IndependentValuePath = “Day”;
s2.DependentValuePath = “NumberOfVisitors”;

chart1.Series.Add(b1);
}
}

public class DayDto
{
public string Day { get; set; }
public int NumberOfVisitors { get; set; }
}
}

The end result:

image

Building a Stacked 100% Column chart

In MainPage.xaml, add a chart:

<toolkit:Chart HorizontalAlignment=”Left” Margin=”8,30,-295,0″ Title=”Chart Title” Name=”chart1″ VerticalAlignment=”Top” Height=”270″ Width=”687″>
</toolkit:Chart>

What makes this type of chart different from the regular chart is that you don’t create one or more ColumnSeries, instead you’re adding SeriesDefinitions:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.DataVisualization.Charting;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SilverRadar
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();

List<DayDto> days = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 10 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 8 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 3 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 7 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 4 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 3 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 1 },
};

List<DayDto> days2 = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 12 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 5 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 4 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 6 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 5 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 2 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 0 },
};

chart1.Title = “Visitors/days of week in Stacked 100% Columns”;

var b1 = new Stacked100ColumnSeries();
b1.Name = “days”;
var s1 = new SeriesDefinition();
b1.SeriesDefinitions.Add(s1);
s1.Title = “Visitors of web site 1/Days of the Week”;
s1.ItemsSource = days;
s1.IndependentValuePath = “Day”;
s1.DependentValuePath = “NumberOfVisitors”;

var s2 = new SeriesDefinition();
b1.SeriesDefinitions.Add(s2);
s2.Title = “Visitors of web site 2/Days of the Week”;
s2.ItemsSource = days2;
s2.IndependentValuePath = “Day”;
s2.DependentValuePath = “NumberOfVisitors”;

chart1.Series.Add(b1);
}
}

public class DayDto
{
public string Day { get; set; }
public int NumberOfVisitors { get; set; }
}
}

The end result:

image

Building a Stacked 100% Line chart

In MainPage.xaml, add a chart:

<toolkit:Chart HorizontalAlignment=”Left” Margin=”8,30,-295,0″ Title=”Chart Title” Name=”chart1″ VerticalAlignment=”Top” Height=”270″ Width=”687″>
</toolkit:Chart>

What makes this type of chart different from the regular chart is that you don’t create one or more ColumnSeries, instead you’re adding SeriesDefinitions:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.DataVisualization.Charting;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SilverRadar
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();

List<DayDto> days = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 10 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 8 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 3 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 7 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 4 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 3 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 1 },
};

List<DayDto> days2 = new List<DayDto>()
{
new DayDto() { Day = “Mon”, NumberOfVisitors = 12 },
new DayDto() { Day = “Tue”, NumberOfVisitors = 5 },
new DayDto() { Day = “Wed”, NumberOfVisitors = 4 },
new DayDto() { Day = “Thu”, NumberOfVisitors = 6 },
new DayDto() { Day = “Fri”, NumberOfVisitors = 5 },
new DayDto() { Day = “Sat”, NumberOfVisitors = 2 },
new DayDto() { Day = “Sun”, NumberOfVisitors = 0 },
};

chart1.Title = “Visitors/days of week in Stacked 100% Lines”;

var b1 = new Stacked100LineSeries();
b1.Name = “days”;
var s1 = new SeriesDefinition();
b1.SeriesDefinitions.Add(s1);
s1.Title = “Visitors of web site 1/Days of the Week”;
s1.ItemsSource = days;
s1.IndependentValuePath = “Day”;
s1.DependentValuePath = “NumberOfVisitors”;

var s2 = new SeriesDefinition();
b1.SeriesDefinitions.Add(s2);
s2.Title = “Visitors of web site 2/Days of the Week”;
s2.ItemsSource = days2;
s2.IndependentValuePath = “Day”;
s2.DependentValuePath = “NumberOfVisitors”;

chart1.Series.Add(b1);
}
}

public class DayDto
{
public string Day { get; set; }
public int NumberOfVisitors { get; set; }
}
}

The end result:

image