You can create an instance of the DataTemplate class and add the elements you want inside of it, but this approach
is deprecated and it is not recommended. If you want to define a DataTemplate in code-behind I suggest you to use a string or a stream containing the template and load it with the XamlReader.Load()
Basically you can use something like the following:
var labelTemplate = XamlReader.Load(templateString)
chart.TooltipTemplate = labelTemplate;
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos
and start improving your app based on facts, not hunches.