Hi Graham,
Is it possible to put xamDataChart in ToolTip of another component? I try to place it in tooltips of textblock and it doesn't work. But if I use xamDataChart as usual it works fine.
You run into some Namescope issues when trying to use elementname bindings in a tooltip, here's an alternate way to bind the series to the axes:
XAxis="{Binding RelativeSource={RelativeSource AncestorType=ig:XamDataChart, Mode=FindAncestor}, Path=Axes[(system:Int32)1]}" YAxis="{Binding RelativeSource={RelativeSource AncestorType=ig:XamDataChart, Mode=FindAncestor}, Path=Axes[(system:Int32)0]}"
This relies on this namespace being added to the root node:
xmlns:system="clr-namespace:System;assembly=mscorlib"
Hope this helps!
-Graham
<
TextBlock Text="Text" Margin="0,0,0,0" >
<TextBlock.ToolTip>
<ig:XamDataChart Name="xamChartOI" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="400" Height="200"HorizontalZoomable="True" VerticalZoomable="True">
ig:XamDataChart.PlotAreaBackground>
<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="#FF334F79" Offset="0"/>
<GradientStop Color="#FF2EA5E4" Offset="1"/>
</LinearGradientBrush>
</ig:XamDataChart.PlotAreaBackground>
<ig:XamDataChart.Axes>
<ig:NumericYAxis x:Name="yAxisChartOI" MajorStrokeDashArray="5" MajorStrokeThickness="1" MajorStroke="White" Opacity="0.3">
<ig:NumericYAxis.LabelSettings>
<ig:AxisLabelSettings Foreground="Black" Location="OutsideLeft" ></ig:AxisLabelSettings>
</ig:NumericYAxis.LabelSettings>
</ig:NumericYAxis>
<ig:CategoryXAxis
x:Name="xAxisChartOI" MajorStrokeDashArray="5" MajorStrokeThickness="1" MajorStroke="White" ItemsSource="{Binding}" Label="{}{Label}" Opacity="0.3" >
<ig:CategoryXAxis.LabelSettings>
<ig:AxisLabelSettings Foreground="Black" Extent="55" ></ig:AxisLabelSettings>
</ig:CategoryXAxis.LabelSettings>
</ig:CategoryXAxis>
</ig:XamDataChart.Axes>
<ig:XamDataChart.Series>
<ig:ColumnSeries x:Name="SeriesTest1"
ItemsSource="{Binding}" XAxis="{Binding ElementName=xAxisChartOI}"
YAxis="{Binding ElementName=yAxisChartOI}"
ValueMemberPath="ValueCallOI" RadiusX="0" RadiusY="0" Thickness="0" Opacity="0.8">
</ig:ColumnSeries>
<ig:ColumnSeries x:Name="SeriesTest2"
ValueMemberPath="ValuePutOI" Visibility="Visible" RadiusX="0" RadiusY="0" Thickness="0" Opacity="0.6">
</ig:XamDataChart.Series>
</ig:XamDataChart>
</TextBlock.ToolTip>
</TextBlock>
As a result I see only labels on xAxis. No series, no yAxis. When I put the same xamChart on main form I see nice chart as expected.
Hi,
It should be possible. Could you share how you are trying to do it? I should be able to point out whats going wrong.