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>
- Chris Chen asked 4 years ago
-
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!
-
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…
-
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 login to post comments
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
- Andrew Burnett-Thompson answered 4 years ago
-
Thanks, really help.
- You must login to post comments
<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.
- Chris Chen answered 4 years ago
- You must login to post comments
Please login first to submit.