var dataTemplate = new DataTemplate();
var stackPanel = new FrameworkElementFactory(typeof(StackPanel));
var textBlock = new FrameworkElementFactory(typeof(TextBlock));
stackPanel.AppendChild(textBlock);
dataTemplate.VisualTree = stackPanel;
s.TrackBallInfoTemplate = dataTemplate;
s.ApplyTemplate();
textBlock.SetBinding(TextBlock.TextProperty, new Binding("DataPoint.Value") { StringFormat = LineName + " - {0:0}" });