I’m trying to switch RolloverMarker template at runtime from code behind, with no luck.
I have ControlTemplate definitions in XAML.
I create FastLineRenderableSeries objects and assign RolloverTemplates to them dymanically in code behind.
I add the series into sciChartSurface.RenderableSeries.
All this works.
When user clicks a series, a selectionChanged eventHandler method tries to switch the RolloverMarkerTemplate of the selected series
ControlTemplate ylbl = (ControlTemplate)Application.Current.Resources["RolloverLabelTopTemplate"];
flrseries.RolloverMarkerTemplate = ylbl;
The template object is created from Resources and assigned to the series, but the visible presentation is not changed.
Is there a better ( = working) way to do this or is it even possible ?
- Kari Kivento asked 7 years ago
- last active 7 years ago
Hi,
I have a chart where the Axis Title is truncated because the title is too long. Is there a way to wrap or put an ellipsis in the Axis Title? The height of my chart should be fix, so I have to do something about the title instead.
Thanks,
Ira
- Irene Aquino asked 8 years ago
- last active 8 years ago
FAQ: How to create a custom legend with TextFormatting for the FastHeatmapRenderableSeries? The provided legend in SciChart v3.4 does not allow text formatting.
- Andrew Burnett-Thompson asked 9 years ago
- last active 8 years ago
Hi,
I have a SciChartGroup with 2 SciChartSurfaces…
It seems the SciChartGroup is adding the surface Title on its own somewhere.
What do I have to do to not display the 2nd surfaces title in white in the top-left corner?
Thanks!
Here is a screenshot of what I’d like to remove:
(I’d attach the project, but the buttons on the ask page aren’t attaching anything – in chrome anyway…)
Here is the codebehind:
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Windows;
using System.Windows.Input;
using Abt.Controls.SciChart;
namespace nameOn2ndSurface
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
public class datamodel : INotifyPropertyChanged
{
#region PropertyChanged
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged(PropertyChangedEventArgs e)
{
if (PropertyChanged != null)
PropertyChanged(this, e);
}
protected void notifyPropertyChanged(string propertyName)
{
PropertyChangedEventArgs e = new PropertyChangedEventArgs(propertyName);
OnPropertyChanged(e);
}
#endregion
ObservableCollection<DataModelGraph> graphs;
public datamodel()
{
graphs = new ObservableCollection<DataModelGraph>();
graphs.Add(new DataModelGraph() { Title = "graph1" });
graphs.Add(new DataModelGraph() { Title = "graph2" });
}
public ObservableCollection<DataModelGraph> Graphs
{
get
{
return graphs;
}
}
}
public class DataModelGraph : IChildPane, INotifyPropertyChanged
{
#region PropertyChanged
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged(PropertyChangedEventArgs e)
{
if (PropertyChanged != null)
PropertyChanged(this, e);
}
protected void notifyPropertyChanged(string propertyName)
{
PropertyChangedEventArgs e = new PropertyChangedEventArgs(propertyName);
OnPropertyChanged(e);
}
#endregion
string title;
public DataModelGraph()
{
title = "graph";
}
public string Title
{
get
{
return title;
}
set
{
if (title != value)
{
title = value;
notifyPropertyChanged("Title");
}
}
}
public ICommand ClosePaneCommand { get; set; }
public void ZoomExtents()
{
}
}
}
Here is the xaml:
<Window x:Class="nameOn2ndSurface.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="http://schemas.abtsoftware.co.uk/scichart"
xmlns:local="clr-namespace:nameOn2ndSurface"
Title="MainWindow" Height="350" Width="525">
<Window.Resources>
<local:datamodel x:Key="data" />
<Style TargetType="s:SciChartSurface">
<Setter Property="Foreground" Value="Red"/>
<Setter Property="ChartTitle" Value="{Binding Title}"/>
</Style>
</Window.Resources>
<Grid DataContext="{DynamicResource data}">
<s:SciChartGroup x:Name="group"
ItemsSource="{Binding Graphs}"
>
<s:SciChartGroup.ItemTemplate>
<DataTemplate>
<s:SciChartSurface />
</DataTemplate>
</s:SciChartGroup.ItemTemplate>
</s:SciChartGroup>
</Grid>
- dwoerner asked 9 years ago
- last active 9 years ago
On priority support tickets, a user just asked us how to show and hide the AxisTitle TextBlock without changing the AxisTitle.Text to string.Empty.
The solution uses attached properties and a small custom style, so we thought we’d post it below
- Andrew Burnett-Thompson asked 9 years ago
- last active 9 years ago
How can i wrap legend? if legend width is out of window.
- Raghupathy asked 9 years ago
- last active 9 years ago
Hi,
I have graph with Verctically Stacked Axes. Each of series have different scale. This means that Grid that holds yAxis ticks and labels has different width for each series.
As Axis Container is StackPanel it leads to problem, how to align AxisTitles ?
What I Would like is to set AxisContainer to Grid with two columns.
The first column for AxisTitle, second column for labels and ticks, with shared size group.
Is it possible?
UPDATE I have added a picture. Fig. 1. shows current state, Fig. 2. shows what i would like to achieve.
Thanks
Jan
- Jan Kaiser asked 9 years ago
- last active 9 years ago
how can i apply styling for legend in legend modifier? i want to apply the following style
<Style x:Key="LegendStyle" TargetType="s:LegendModifier">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<s:SciChartLegend x:Name="legendControl" Margin="2,2" Orientation="Horizontal" Background="Transparent" BorderThickness="0" ScrollViewer.VerticalScrollBarVisibility="Auto"
Visibility="{Binding IsLegendVisible,Converter={StaticResource BoolToVisibilityConverter}}"
LegendData="{Binding LegendData, ElementName=legendModifier,Mode=OneWay}">
<s:SciChartLegend.Resources>
<SciChart:ColorToBrushConverter x:Key="ColorToBrushConverter"/>
</s:SciChartLegend.Resources>
<s:SciChartLegend.ItemTemplate>
<DataTemplate DataType="SciChart:XyzSeriesInfo">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Rectangle Grid.Column="0"
VerticalAlignment="Center"
Stretch="Fill"
Width="10"
StrokeThickness="10"
Stroke="{Binding SeriesColor,
Converter={StaticResource ColorToBrushConverter}}" />
<TextBlock Grid.Column="1" Foreground="Black"
Margin="2,0,15,0"
HorizontalAlignment="Center"
Text="{Binding SeriesName}" FontWeight="Normal"/>
</Grid>
</DataTemplate>
</s:SciChartLegend.ItemTemplate>
</s:SciChartLegend>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
- Raghupathy asked 9 years ago
- last active 9 years ago
Hi!
Our Designer wants the LineGraphs to continue under the axis and the gridlines area not to have a border, to accomplish some kind of “open” look&feel.
To get this working, i think i need to template the scichartsurface and put the axis over the gridlinesarea.
I did not find any hints on templating the surface itself, only other parts.
In the example styles you only change colors and borders, but not the template itself.
Can you give me some advice? Am i even on the right track?
Thanks,
Claudius
- Claudius Hagen asked 9 years ago
- last active 1 year ago
I have a case where there can be hundreds or even thousands of potential series on the surface.
When I use the LegendModifier, I only see the first 20 or so series.
What would it take to display a scrollbar so that the user can see all available series?
Thanks!
- dwoerner asked 9 years ago
- last active 9 years ago
Hi all,
Sorry for yet another overview question!
We are trying to modify the colours of the Overview. The various properties on the SciChartOverview itself provide all-but-one element that needs to change colour.
The one remaining element is the SciChartSurface.GridLinesPanelStyle underneath the Overview.
See the screenshot for what I’m interested in changing the colour of 🙂
Thanks!
Miles
- bstapylton asked 11 years ago
- last active 9 years ago