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

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

2 votes
95 views

Hi ,

I am currently using the DataPointSelectionModifier for StackedColumnRenderableSeriesViewModel and I am having an issue trying to have a single selection that is togglable.

I am currently not AllowingMultiSelection so the default value is SelectionMode.Replace, which, in case you click on the same column, it will deselect that column and then select it again. Is there a way around this?

Best Regards.

0 votes
889 views

When I select a series/plot, I would like to identify where it came with more than just the Name member. How can I do that?

Background:
I have a list of unsigned integer values taken from a data logger. I bundle the values up in a class with some other information, such as the name of the sample and an ID string.

Since I can’t data bind to the logged samples as-is, I convert them to a SciChart friendly “LineRenderableSeriesViewModel” and add them to a list of “ObservableCollection” that I data bind to a SciChart.

ViewModel.cs:

// Where "loggedSamples" is a SamplesContainer 
//class SamplesContainer
//{
//    public string Name;
//    public string ID;  **<=== I want to get this somehow when I select something**
//    public Uint16 data {get;set;}
//}

// Convert Samples => XyDataSeries => LineRenderableSeriesViewModel

SamplesContainer loggedSamples = GetLoggedSample();
XyDataSeries<double, double> xySeries = ConvertSamplesToXyDataSeries(loggedSamples);
xySeries.SeriesName = loggedSamples.Name;

LineRenderableSeriesViewModel lineSeries = new LineRenderableSeriesViewModel() {
    DataSeries = xySeries, StyleKey = "LineStyle", Stroke = Colors.Blue };

RenderableSeriesViewModelForChannels.Add(lineSeries);

MainWindow.xaml:

   <s:SciChartSurface Name="sciChartItemView" Grid.Column="2"
    AllowDrop="True"
    DragDrop.Drop="sciChartItemView_Drop"
    DragDrop.DragEnter="sciChartItemView_DragEnter"
    MinHeight="80"
    s:ThemeManager.Theme="BrightSpark"  
    RenderableSeries="{s:SeriesBinding RenderableSeriesViewModelForChannels}"
    ViewportManager="{Binding SampleSetViewMod.ViewportManager}"                                                                           
    DebugWhyDoesntSciChartRender="True"
    s:SciChartGroup.VerticalChartGroup="sharedYAxisWidth"
    >

    <s:SciChartSurface.XAxis>
        <s:NumericAxis   
        DrawMajorGridLines="True"
        DrawMinorGridLines="False"
        DrawMajorBands="False"  
        VisibleRange="{Binding SampleSetViewMod.SharedXVisibleRange, Mode=TwoWay}"
        Visibility="Hidden" 
        TextFormatting="0.######"/>
    </s:SciChartSurface.XAxis>

    <s:SciChartSurface.YAxis>
        <s:NumericAxis AxisAlignment="Left"
        DrawMajorGridLines="False"
        DrawMinorGridLines="False"
        DrawMajorBands="False"
        Visibility="Visible">
            <s:NumericAxis.GrowBy>
                <s:DoubleRange Min="0.1" Max="0.1" />
            </s:NumericAxis.GrowBy>
        </s:NumericAxis>

    </s:SciChartSurface.YAxis>

    <s:SciChartSurface.ChartModifier>
        <s:ModifierGroup>
            <s:ZoomExtentsModifier XyDirection="YDirection"/>

            <s:ZoomPanModifier ExecuteOn="MouseMiddleButton" XyDirection="XYDirection" ClipModeX="ClipAtExtents" />

            <local:ExtendedMouseWheelZoomModifier />

            <s:RubberBandXyZoomModifier IsEnabled="True"
                IsXAxisOnly="False"
                ReceiveHandledEvents="True" />
            <s:LegendModifier ShowLegend="True" Orientation="Vertical" Margin="10"
                GetLegendDataFor="AllSeries"
                ShowVisibilityCheckboxes="False" 
                HorizontalAlignment="Right"
                LegendPlacement="Inside"
                Background="White"
                />

            <local:ExtendedSeriesSelectionModifier SelectionChanged="SeriesSelectionModifier_OnSelectionChanged">
                <local:ExtendedSeriesSelectionModifier.SelectedSeriesStyle>
                    <Style TargetType="s:FastLineRenderableSeriesForMvvm">
                        <Setter Property="StrokeDashArray" Value="10,5"/>
                    </Style>
                </local:ExtendedSeriesSelectionModifier.SelectedSeriesStyle>
            </local:ExtendedSeriesSelectionModifier>


            <!--<s:CursorModifier x:Name="cursorModifier" IsEnabled="True" />
        <s:RolloverModifier x:Name="rolloverModifier" IsEnabled="True"/>-->
        </s:ModifierGroup>
    </s:SciChartSurface.ChartModifier>
</s:SciChartSurface>
2 votes
1k views

Hi,
I am currently trying the iOS Charting Library and want to implement a Column series with the drill-down functionality (when touching one of column points by end user). Does the charting component supports the hit-testing or selection feature to determine which point has been clicked at runtime?
Thanks!
Liza

  • liza yudup asked 2 years ago
  • last active 2 years ago
0 votes
1k views

Hello,

Is there a mechanism for binding, in a two way fashion, the collection of Selected points when using the IPointmetadata mechnism?

Basically, I have a view which contains a table (DevExpress Datagrid) and a SciChart plot, where all of the rows are plotted on a line series. When the user highlights a row or rows in the table, the appropriate points should be selected on the graph. Also, if the user selects the points on the graph, the rows should be selected in the table. Ideally, I would like to bind each view’s SelectedRows (or SelectedPoints) to a common ObservableCollection.

The trouble I am seeing is that the two views use different paradigms to represent Selected-ness. The point is only selectable if it is given an object that implements IPointMetadata, and its selection state is represented by the BizObjectViewModel’s IsSelected property. The selection state in the table is represented by its presence in the SelectedRows collection.

No opinions as to which is better, I am simply trying to get the two to work together nicely. OnCollectionChanged of the bound SelectedRows is a great place for me to set/unset IsSelected for the affected object, and the chart reacts:

switch (e.Action)
        {
            case System.Collections.Specialized.NotifyCollectionChangedAction.Add:
                foreach (var p in e.NewItems.Cast<SolverDetailRow>())
                {
                    p.IsSelected = true;
                }
                break;
            case System.Collections.Specialized.NotifyCollectionChangedAction.Remove:
                foreach (var p in e.OldItems.Cast<SolverDetailRow>())
                {
                    p.IsSelected = false;
                }
                break;
            case System.Collections.Specialized.NotifyCollectionChangedAction.Replace:
                break;
            case System.Collections.Specialized.NotifyCollectionChangedAction.Move:
                break;
            case System.Collections.Specialized.NotifyCollectionChangedAction.Reset:
                foreach (var row in SolverRows)
                {
                    foreach (var detRow in row.Observations)
                    {
                        detRow.IsSelected = false;
                    }
                }
                break;
            default:
                break;
        }

However, I can’t find the best place to update the collection when the chart updates the IsSelected property itself. The BizObjectViewModel won’t (and shouldn’t) know about the collection he is in. Right now I am using a Messenger model from DevExpress to notify anyone who cares that the IsSelected property has changed:

private bool _isSelected;
    public virtual bool IsSelected
    {
        get { return _isSelected; }
        set
        {
            if (value != _isSelected)
            {
                _isSelected = value;
                RaisePropertyChanged("IsSelected");
                Messenger.Default.Send(new PointSelectionChangedMessage() { Object = this });
                Messenger.Default.Send(new ChartRefreshRequestedMessage());
            }
            _isSelected = value;
        }
    }

This at least decouples the view model from knowing about the collection, but it kind of muddies the Viewmodel with piping that seems superfluous. It would be nice if I could bind the DataPointSelectionModifier’s SelectedPoints to the same collection that the table is bound to, but it appears that this is Readonly.

Am I missing something? I suppose I can extend the DataPointSelectionModifier to provide something, but I am hoping I am overlooking a feature…

Thanks for your time,
Mike.

1 vote
921 views

Hello,

I have the need to be able to select a single column or a set of columns from either a FastColumnRenderableSeries or a StackedColumnRenderableSeries.

Is there an out-of-the-box way to do this?

If negative, could you provide me some guidance as to what I could do?

Thank you.

Kind regards,
Sebastian

1 vote
2k views

Hi,

I would like to ask if there is any easy way to select distict time intervals.
I have thought of creating vertical slices on mouse down and up events,
and highlighting the surface between the slices. Is there an easier way
to do this?

Thanks,
Chris

1 vote
4k views

I want to highlight a single bar in a plot with multiple StackedColumnRenderableSeries (or FastColumnRenderableSeries). I want to do this when the user clicks a bar. I’ve created a “ClickSelectionModifier” that is able to detect what series + data series index the user clicks, but I have not been able to highlight the clicked bar. A few nudges in the right direction would be appreciated 🙂

Example of single highlighted bar

1 vote
5k views

Hi there,

I am currently evaluating SciChart for use within a new piece of software we are developing. One important feature that we need to provide is to be able to draw a polygon and determine which points are contained within it. Then the colour, visibility, etc of these points can be changed. I can see from your documentation that this could be achieved by creating a custom chart modifier to draw lines that make up the shape and then implement my own algorithm to determine which points are contained within it. Before I embark on this route, could you tell me if I have missed any implementation that already exists? Will the drawn polygon zoom and pan with the graph, therefore enclosing the same points?

Kind Regards,

Kathryn

Showing 8 results
This template supports the sidebar's widgets. Add one or use Full Width layout.