Hello,
I have a BlazorWASM app. I am wondering how to sync the x values of different renderable series that have different number of data points.
In a simple form, I am passing in the data for a moving average to be rendered on the chart that has already been populated with data. The moving average data has already been calculated and has the correct date timestamps. But when I add this series to the chart it is starting at index 0 of where the the price data started instead of where the xAxis date of this renderable series has.
I prefer not to use the filters api to regenerate this data as some will be complex and have already been calculated by study or pulled from a database. I have seen the article to offset a series but this seems unnecessary since I already have the x axis coordinate that I want each point of the new line series to be rendered.
Is there somewhere in the docs that I missed how to get these renderable series to line up properly to their own x data points?
Thank you
- Leland asked 10 months ago
- last active 10 months ago
- Jeremy Klas asked 1 year ago
- last active 1 year ago
Hi
I am creating an real-time application that handles multiple series in one surface. The series number is variant from 2 to 10. I use “RenderableSeries” then bind it to ObservableCollection. But I can not update DataSeries during run time and it throw an error? is it possible at all?
Thanks
- neda asked 3 years ago
- last active 3 years ago
I need z data in DataSeries using LineAnnotation.
Note:
Z data of blue areas 0
Z data of green areas 50
Any help? Thank you.
- rasit kozan asked 3 years ago
- last active 3 years ago
In my SciChart InteractionToolbar, I have a slider that changes the stroke thickness of the selected series.
<TextBlock Text="Line Thickness:"/>
<wpfTool:IntegerUpDown Foreground="White"
x:Name="Thickness"
Minimum="1"
Maximum="10"
Value="{Binding SelectedSpectrum.StrokeThickness, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ValueChanged="Thickness_ValueChanged">
</wpfTool:IntegerUpDown>
This works correctly until a new series is selected. When a new series is selected, the previously selected series thickness returns to its default of “1”. Is there a way I can persist my StrokeThickness value even when the series is no longer selected?
private void Thickness_ValueChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
{
if ((sciChartSurface.RenderableSeries != null) && (e.NewValue != null))
{
var selectedSeries = sciChartSurface.RenderableSeries.Where(s => s.IsSelected == true).FirstOrDefault();
if (selectedSeries != null)
{
selectedSeries.StrokeThickness = (int)e.NewValue;
}
}
}
- Kyle Williamson asked 3 years ago
- last active 3 years ago
Hello
I’m working on a WPF app. Everything is OK except that I don’t understand how to render the series above the annotations.
The XAML code is the following:
<s:SciChartSurface Name="sciChartSurface"
s:ThemeManager.Theme="SciChartv4Dark"
Annotations="{Binding Path=Annotations}"
ChartTitle="{Binding Path=GraphTitle}"
DataContext="{Binding Path=ChartViewModel,
RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type charts:ChartView}}}"
FocusVisualStyle="{x:Null}"
Focusable="True"
SeriesSource="{Binding Path=Series}"
Padding="0 5 8 0">
<s:SciChartSurface.RenderSurface>
<s:HighQualityRenderSurface/>
</s:SciChartSurface.RenderSurface>
<s:SciChartSurface.ChartModifier>
<s:ModifierGroup>
[...]
</s:ModifierGroup>
</s:SciChartSurface.ChartModifier>
<!-- Create an X Axis -->
<s:SciChartSurface.XAxis>
<s:NumericAxis AutoRange="{Binding Path=XAxis.AutoScaling,
Converter={StaticResource BooleanToAutoRangeConverter}}"
AxisTitle="{Binding Path=XAxis.AxisTitle}"
DrawMajorGridLines="{Binding Path=XAxis.ShowGridLines}"
DrawMinorGridLines="False"
DrawMinorTicks="True"
GrowBy="0, 0.1"
AxisBandsFill="#1c1c1e"
VisibleRange="{Binding Path=XAxis.AxisRange,
Mode=TwoWay}"
MajorDelta="{Binding XAxis.MajorDelta, Mode=TwoWay}"
MinorDelta="{Binding XAxis.MinorDelta, Mode=TwoWay}"
AutoTicks="{Binding XAxis.AutoTicks}"
/>
</s:SciChartSurface.XAxis>
<!-- Create a Y Axis -->
<s:SciChartSurface.YAxis>
<s:NumericAxis AutoRange="{Binding Path=YAxis.AutoScaling,
Converter={StaticResource BooleanToAutoRangeConverter}}"
AxisAlignment="Left"
AxisTitle="{Binding Path=YAxis.AxisTitle}"
DrawMajorGridLines="{Binding Path=YAxis.ShowGridLines}"
DrawMinorGridLines="False"
DrawMinorTicks="True"
GrowBy="0.1, 0.1"
IsPrimaryAxis="True"
AxisBandsFill="#1c1c1e"
VisibleRange="{Binding Path=YAxis.AxisRange,
Mode=TwoWay}"
MajorDelta="{Binding YAxis.MajorDelta, Mode=TwoWay}"
MinorDelta="{Binding YAxis.MinorDelta, Mode=TwoWay}"
AutoTicks="{Binding YAxis.AutoTicks}"
/>
</s:SciChartSurface.YAxis>
</s:SciChartSurface>
Edit: this is the code that creates the horizontal annotation:
/// <summary>
/// Creates a chart annotation
/// </summary>
/// <param name="a"></param>
/// <returns></returns>
private AnnotationBase CreateChartAnnotation(Annotation a)
{
HorizontalLineAnnotation annotation;
//not used??
//ColorToBrushConverter brushConverter = new ColorToBrushConverter();
annotation = new HorizontalLineAnnotation() { Y1 = a.ThresholdValue.Value };
annotation.Stroke = new SolidColorBrush((Color)ColorConverter.ConvertFromString(a.Stroke));
annotation.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
annotation.IsEditable = false;
annotation.LabelTextFormatting = string.Format("{0} 0.0", a.Label);
annotation.StrokeThickness = 2;
annotation.LabelPlacement = LabelPlacement.Axis;
annotation.ShowLabel = a.ShowLabel;
if (a.DashArray != null)
{
annotation.StrokeDashArray = new DoubleCollection(a.DashArray);
}
return annotation;
}
I tried to set AnnotationCanvas.BelowChart but the behaviour is very strange: the horizontal annotation line is no more continuous
I attached two jpegs
Regards
Gianpaolo
- gianpaolo filippa asked 5 years ago
- last active 5 years ago
I think this is a pretty simple question but i am not sure what i am missing.I have a toggle button on my legend that is intended to allow the users to select all the series or deselect all the series.
the button essentially goes through the Renderable series view models and set the IsSelected to either true or false, this approach however, doesn’t work. I looked at the SelectionModifier and i can see that has a protected DeselectAll method and i am thinking to leverage that to solve this use case.
what is the best solution to accomplish this? isn’t this functionality something that perhaps be standard and could just be turned on?
- Joseph McClean asked 5 years ago
- last active 5 years ago
I am binding my chart to an ObservableCollection that consists of many XYDataSeries. When I create and add the XyDataSeries, I set the SeriesName and Stroke properties. The data shows on the chart. I have the following Legend Template:
<DataTemplate x:Key="LegendItemTemplate" DataType="s:SeriesInfo">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<CheckBox Grid.Column="0"
Margin="5,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Foreground="{StaticResource BlackBrush}"
Content="{Binding SeriesName}"
IsChecked="{Binding RenderableSeries.IsVisible, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Visibility="{Binding LegendData.ShowVisibilityCheckboxes, RelativeSource={RelativeSource AncestorType=s:SciChartLegend}, Converter={StaticResource VisibleWhenTrueConverter}}" />
<xctk:ColorPicker Grid.Column="2" x:Name="cpPalette"
ColorMode="ColorPalette" VerticalAlignment="Center"
SelectedColor="{Binding RenderableSeries.Stroke, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Height="25" Width="40" />
</Grid>
</DataTemplate>
However, when I change the colour using the Colorpicker, my charts series are not updated (ie, changing colour)
- Craig Muckleston asked 5 years ago
- last active 5 years ago
Hi, we are updating our scichart component to version 5. Now we had to change our Series Binding which is obsolete now to RenderableSeries binding.
In the most graphs it works fine but I have also graphs that uses ElementName with paths for the binding and that does not work.
I tried the following versions which all did not work, is there a different way to do it?
<!-- old scichart version which is not allowed anymore-->
<s:SciChartSurface Style="{StaticResource SciChartSurfaceStyle}"
SeriesSource ="{Binding ElementName=GraphRoot, Path=Series}"
BorderThickness="1 0 0 0"
Background="Transparent">
<!-- First try with new version which is not working because we don't use seriesBinding-->
<s:SciChartSurface Style="{StaticResource SciChartSurfaceStyle}"
RenderableSeries ="{Binding ElementName=GraphRoot, Path=Series}"
BorderThickness="1 0 0 0"
Background="Transparent">
<!-- Second try with new version which is also not working -->
<s:SciChartSurface Style="{StaticResource SciChartSurfaceStyle}"
RenderableSeries ="{s:SeriesBinding ElementName=GraphRoot, Path=Series}"
BorderThickness="1 0 0 0"
Background="Transparent">
<!-- Last try with new version which is also not working becaus without ElementName he cannot find the Series-->
<s:SciChartSurface Style="{StaticResource SciChartSurfaceStyle}"
RenderableSeries ="{s:SeriesBinding Series}"
BorderThickness="1 0 0 0"
Background="Transparent">
Please is there any idea how to solve this?
- Damian Janiga asked 5 years ago
Hello,
This is my data structure which needs to be plotted using XyScatterRenderableSeries:
public class Measurement
{
public Color Color { get; set; }
public double X { get; set; }
public double Y { get; set; }
}
I need to plot a list of measurements. It can be done in one series but each point color needs to be read from measurement data. To achieve that I’ve used a custom PaletteProvider and the result is satisfactory:
It looks good but there is a huge problem with a performance. If I try to pan, zoom etc. the application horribly slows down.
Also I’ve tried to group measurements by Color and then plot a couple of series with specified color but the result is the same.
I am attaching a simple application which shows the problem.
Hope anyone can help me.
Best regards,
Darek
- Darek Marek asked 5 years ago
- last active 5 years ago
I have 2 series of data in my chart like this:
<s3D:SciChart3DSurface.RenderableSeries>
</s3D:SciChart3DSurface.RenderableSeries>
My question is, how can I bind multiple series to the RenderableSeries of the SciChartSurface instead, because that requires an ObservableCollection , which is not the same as the XyzDataSeries3D the series are being bound to.
- Craig Muckleston asked 6 years ago
- last active 6 years ago
I try to add data series and have them rendered on a chart surface. The surface and entire chart library is wrapped in an mvvm-based api. The sci chart control and wrapping library are rendered on a document panel. I add new data series via the viewmodel and here is where I have some unexpected behavior:
a) When being on a different document panel, meaning the chart control is NOT visible, and when I add a new data series via view model and then view the document panel that hosts the sci chart control, no chart series are rendered on the chart but I do see the correct legend data (such as chart series name, color, stroke thickness). Please see below screen shot “Capture1.jpg” .
b) When I make the sci chart control visible by viewing the document panel that hosts the sci chart control and then via a button and command add the very same data series via my chart control’s view model the charts are correctly rendered. Please see “Capture2.jpg”.
My question is why is that the case? I basically expose a method in my chart library view model that lets me add data and if I invoke that methods while being on a document panel that does not host the chart control the added data series is not rendered on the chart. But strangely the correct chart legend data are displayed and also the chart control itself is correctly rendered. No problems when the hosting document panel is active and the very same method is invoked.
Basically what I currently observe is that the data series are not rendered at all as long as the chart control is not “in view” or the hosting document panel is not selected. I am sure programmatically all references and bindings are correct.
I have spend many hours debugging this issue and do not seem to find an answer. Any pointers?
Thanks a lot,
Matt
Edit:
Here is how I bind the content control to the view model of my sci chart charting library (user control)
<ContentControl Grid.Row="1" Content="{Binding ChartControl, Mode=OneWay}" />
…and the view model is instantiated in the hosting view model constructor:
public MainWindowViewModel()
{
ChartControl = new SciChartControlViewModel();
ExitApplicationCommand = new RelayCommand(OnExitApplicationCommand);
LoadDataSeriesFromFilesCommand = new RelayCommand(OnLoadDataSeriesFromFilesCommand);
RefreshDataSeriesFromFilesCommand = new RelayCommand(OnRefreshDataSeriesFromFilesCommand);
Test();
}
…Test() performs the following action:
private void Test()
{
var quotes = new List<Quote>();
List<DateTime> timeStamps = new List<DateTime>();
List<double> values = new List<double>();
List<SciChartAnnotation> annotations = new List<SciChartAnnotation>();
Random rand = new Random((int)DateTime.Now.Ticks);
DateTime currentDt = DateTime.Now;
double currentValue = 0;
for (int index = 0; index <= 50000; index++)
{
var randomValue = rand.NextDouble();
currentDt = currentDt + TimeSpan.FromSeconds(randomValue);
currentValue = currentValue + randomValue - 0.5;
if (index % 1000 == 0)
{
var buySell = rand.NextDouble() > 0.5 ? SciChartAnnotationDirection.Buy : SciChartAnnotationDirection.Sell;
annotations.Add(new SciChartAnnotation(buySell, currentDt, currentValue, "Index:" + index));
}
timeStamps.Add(currentDt);
values.Add(currentValue);
quotes.Add(new Quote(){DataProviderId = "Provider1", SymbolId = "Symbol1", QuoteType = QuoteType.BidAsk, CompressionType = TimeCompressionType.NoCompression, CompressionUnits = 0, TimeStamp = currentDt, Bid = currentValue, Ask= currentValue + 0.05, });
}
ChartControl.AddDataSet("Pane1", "0.00000", quotes, annotations);
//ChartControl.AddDataSet("MattSeries", ChartType.Scatter, 1, "0.00000", timeStamps, values);
}
…it basically tries to render chart series and annotations.
Strangely, as mentioned before, the series legends render correctly and the annotations also all render correctly but the chart series do not! Could this be a bug?
- bbmat asked 6 years ago
- last active 6 years ago
Hello,
Out team have several question about the framework:
Is there a way to make SCIChartSurfaceView background transparent so that the user could see underlying views? We tried using background brush of clear color on SCIChartSurface and making SCIChartSurfaceView backgroundColor transparent but no avail.
Is it possible to add translate/rotate/scale animation to markers/annotations from code?
When using gradient brush with mountain renderable series we found a strange visual artifact (“Gradient artifact” image). Is there a way to fix it?
Best regards,
Vasiliy
- Vasiliy Dumanov asked 6 years ago
- last active 6 years ago
Hello,
I wonder what the most efficient way is to completely reset (clean up) a SciChartGroup? I add all kinds of panes, add data series, add renderable series on different panes. Now, with a single call I like to reset the SciChartSurface to its original state (empty). I want to have all panes removed, as well as references the sciChartGroup may hold to panes, and references the panes hold to different renderable series and data series. I tried to clear ChartPaneViewModels, an observable collection that holds objects of type BaseChartPaneViewModel (which in turn implements IChildPane and ViewModelBase) but that did not have any effect. My SciChartGroup binds via ItemsSource to ChartPaneViewModels
What is your recommendation how to best reset the whole sciChartGroup?
Thanks,
Matt
- bbmat asked 8 years ago
- last active 8 years ago
Hi,
I have a chart showing data sets composed of multiple renderable series. Each data set is displayed using one FastLineRenderableSeries and three XyScatterRenderableSeries. All four series show in the legend for each data set, but I would only like to show the FastLineRenderableSeries in the legend for each data set. How can I do this?
I’ve seen the legendModifier.GetLegendDataFor property, but that can only be set to show options from this enum
public enum SourceMode
{
AllSeries = 0,
AllVisibleSeries = 1,
SelectedSeries = 2,
UnselectedSeries = 3,
}
which aren’t what I need. Some kind of flag on the renderable series saying whether they should be shown in the legend, or some way to specify the items source for the legend would be good.
Thanks!
- Robert Evans asked 8 years ago
- last active 6 years ago
How can I only show Legends when the corresponding RenederableSeries is visible.
If the corresponding RenderableSeries is not visible then that Legend shouldn’t be shown.
Keep in mind my users will be able to hide and show RenderableSeries during runtime.
My xaml code is:
<s:LegendModifier x:Name="legendModifier" ShowVisibilityCheckboxes="False" Orientation="Vertical" ShowLegend="{Binding ParentViewModel.ShowLegends, Mode=TwoWay}" Margin="10" />
<s:SeriesSelectionModifier>
<s:SeriesSelectionModifier.SelectedSeriesStyle>
<Style TargetType="s:BaseRenderableSeries">
<Setter Property="StrokeThickness" Value="3"/>
</Style>
</s:SeriesSelectionModifier.SelectedSeriesStyle>
</s:SeriesSelectionModifier>
- David Mecteaux asked 8 years ago
- last active 8 years ago
In the chart, I may need programmally add one RenderableSeries, and add data into its dataseries. But how to fire the ‘OnPropertyChangeEvent’ programmaly for the lively added RenderableSeries?
In the example, a binding between dataseries in the view and a property in the model is created manually. Then we change the data and fire the ‘OnPropertyChangeEvent’ event in the model. How to achieve this affect programmally?
best regards
Chunxi
- chunxi asked 8 years ago
- last active 8 years ago