SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

0
0

In your example “CustomTooltipsWithModifiers” you show how to apply custom styles and templates to XML generated RenderableSeries, like: (works fine)

<s:SciChartSurface.RenderableSeries> 
<s:FastLineRenderableSeries 
Stroke="#ff6495ed" 
StrokeThickness="2" 
s:VerticalSliceModifier.TooltipContainerStyle="{StaticResource TooltipStyle1}" 
s:VerticalSliceModifier.TooltipTemplate="{StaticResource VerticalSliceTooltipTemplate1}"/>

In your example “ChangeSeriesTypeInCode” you generate the RenderableSeries in code programmatically, like: (works fine)

var series = new StackedMountainRenderableSeries() 
{ 
Name = "any Name", 
IsVisible = "any visibility", 
StrokeThickness = "any int", 
Stroke = "any Color", 
Fill = "any Brush", 
DataSeries = "any dataSeries" 
}; 
Chart.RenderableSeries.Add(series);

My Question: How do I apply the Templates and Styles for Modifiers to the programmatically generated RenderableSeries?

Thanks for help.

Version
4.2.2
  • You must to post comments
2
0

UPDATE: Just found it out myself.

Adding after : Chart.RenderableSeries.Add(series);

VerticalSliceModifier.SetTooltipTemplate(series, (DataTemplate)this.FindResource(“Desired_XML_Resource_Template”));
VerticalSliceModifier.SetTooltipContainerStyle(series, (Style)this.FindResource(“Desired_XML_Resource_Style”));

Thanks…

  • Andrew
    That is exactly right :) — Andrew
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.