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

Answered
0
0

Hi , I created multi charts by adding them to a collection and binding them to RenderableSeries in the xaml.

    <sci:SciChartSurface Grid.Row="1" 
                         YAxes="{sci:AxesBinding YAxes}"
                         XAxes="{sci:AxesBinding XAxes}"
                         RenderableSeries="{sci:SeriesBinding RenderableSeries}"
                         Background="{Binding ChartBackBrush}"
                         Foreground="{Binding ChartForeBrush}"
                         ViewportManager="{Binding ViewportManager}">
        <sci:SciChartSurface.ChartModifier>
            <sci:ModifierGroup>
                <sci:RubberBandXyZoomModifier ExecuteOn="MouseLeftButton"  RubberBandFill="#3380FF00" 
                                              RubberBandStroke="#AA0080FF"  RubberBandStrokeDashArray="2 2"/>
                <sci:ZoomPanModifier ExecuteOn="MouseRightButton" ClipModeX="None" />
                <sci:ZoomExtentsModifier/>
                <sci:MouseWheelZoomModifier/>
                <sci:RolloverModifier ExecuteOn="MouseMove" ShowTooltipOn="MouseHover"/>
                <sci:YAxisDragModifier IsEnabled="True" DragMode="Pan" />
                <sci:XAxisDragModifier IsEnabled="True" ClipModeX="None" DragMode="Pan"/>
            </sci:ModifierGroup>
        </sci:SciChartSurface.ChartModifier>
    </sci:SciChartSurface>

Then in the code – behind , I created the RenderableSeries.

          var lineSeries = new LineRenderableSeriesViewModel()
            {
                Stroke = (Color)ColorConverter.ConvertFromString(chartParameters.SeriesMetaData[column].LineBrush),
                StrokeThickness = 1,
                AntiAliasing = true,
                DataSeries = xyDataSeries,
                YAxisId = ConvertYAxisTitleToId(chartParameters.SeriesMetaData[column].YAxisId),
                XAxisId = AxisBase.DefaultAxisId,
                IsVisible = chartParameters.SeriesMetaData[column].Visibility
            };

            RenderableSeries.Add(lineSeries);

Now I got a reqirement to the background of the tooltip to transparent. I got some examples ,it seems I should change the s:RolloverModifier.TooltipContainerStyle. But I have no idea how to do it in the code-hebind.

Nearly all examples tell me sth like this, everything is done in the xaml.
<s:SciChartSurface.RenderableSeries>

</s:SciChartSurface.RenderableSeries>

Version
5.3.0.11954
  • Andrew Burnett-Thompson
    Hi zhiyu, could you activate your SciChart license so our system can mark you as priority support or not? Instructions here: http://www.scichart.com/licensing-scichart-wpf. Thank you!
  • zhiyu chen
    Thank you, Andrew. I work in a big company. Weeks ago, I asked to renew my sichart license, but you know, the large companies are usally low-efficient…
  • Andrew Burnett-Thompson
    Hi Zhiyu, if support is expired we can’t support you. Please let your company know and ask them to contact our sales team.
  • You must to post comments
Best Answer
0
1

Hi Zhiyu

There is an example in our WPF Chart Documentation showing how to bind tooltip templates or attached properties in MVVM

Let me know if this helps,

Best regards,
Andrew

  • You must to post comments
0
0
        <s:SciChartSurface.RenderableSeries>
            <s:FastLineRenderableSeries DataSeries="{Binding ChartData}"
                                        IsDigitalLine="{Binding IsDigitalLine,
                                                                Mode=TwoWay}"
                                        ResamplingMode="{Binding SeriesResamplingMode}"
                                        Style="{StaticResource LineSeriesStyle}"
                                        s:CursorModifier.SnapToSeries="True"
                                        s:RolloverModifier.TooltipContainerStyle="{StaticResource TooltipStyle}"
                                        s:RolloverModifier.TooltipTemplate="{StaticResource TooltipDataTemplate}" />
        </s:SciChartSurface.RenderableSeries>

Here is the example I got from the SDK, but there is no example about how to do it in a MVVM pattern project.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.