Hello,
I searched for sample projects but I can not adapt them to my graph. When I adapted them, just nothing happened. Here my xaml and code behind;
<ig:XamDataChart Name="xamDataChart1" HorizontalZoomable="True" HorizontalZoombarVisibility="Visible" VerticalZoomable="False" Margin="0,0,0,0" Legend="{Binding ElementName=xmLegend}"> <ig:SyncManager.SyncSettings> <ig:SyncSettings SyncChannel="Group1" SynchronizeHorizontally="True" SynchronizeVertically="False" /> </ig:SyncManager.SyncSettings> <ig:XamDataChart.Axes> <ig:CategoryDateTimeXAxis x:Name="xAxis" DateTimeMemberPath="TARIH" Interval="1"> <ig:CategoryDateTimeXAxis.LabelSettings> <ig:AxisLabelSettings Location="OutsideBottom" Extent="40" Angle="270" /> </ig:CategoryDateTimeXAxis.LabelSettings> <ig:CategoryDateTimeXAxis.Label> <DataTemplate> <TextBlock Text="{Binding Item.Date, StringFormat={}{0:d.MM} }" Margin="-25,0,0,0" FontSize="10" /> </DataTemplate> </ig:CategoryDateTimeXAxis.Label> <ig:CategoryDateTimeXAxis.Style> <Style TargetType="ig:Axis"> <Setter Property="MajorStrokeThickness" Value="0"/> </Style> </ig:CategoryDateTimeXAxis.Style> </ig:CategoryDateTimeXAxis> <ig:NumericYAxis x:Name="yAxis" Label="{}{0:P}"> <ig:NumericYAxis.LabelSettings> <ig:AxisLabelSettings Location="InsideLeft" /> </ig:NumericYAxis.LabelSettings> <ig:NumericYAxis.Style> <Style TargetType="ig:Axis"> <Setter Property="MajorStrokeThickness" Value="0"/> </Style> </ig:NumericYAxis.Style> </ig:NumericYAxis> <ig:NumericYAxis x:Name="yAxisVol"> <ig:NumericYAxis.LabelSettings> <ig:AxisLabelSettings Location="InsideRight" /> </ig:NumericYAxis.LabelSettings> <ig:NumericYAxis.Style> <Style TargetType="ig:Axis"> <Setter Property="MajorStrokeThickness" Value="0"/> </Style> </ig:NumericYAxis.Style> </ig:NumericYAxis> </ig:XamDataChart.Axes> </ig:XamDataChart>
HorizontalZoomable="True"
HorizontalZoombarVisibility="Visible"
VerticalZoomable="False"
Margin="0,0,0,0"
Legend="{Binding ElementName=xmLegend}">
<ig:SyncManager.SyncSettings>
<ig:SyncSettings SyncChannel="Group1"
SynchronizeHorizontally="True"
SynchronizeVertically="False" />
</ig:SyncManager.SyncSettings>
<ig:XamDataChart.Axes>
<ig:CategoryDateTimeXAxis x:Name="xAxis" DateTimeMemberPath="TARIH" Interval="1">
<ig:CategoryDateTimeXAxis.LabelSettings>
<ig:AxisLabelSettings Location="OutsideBottom" Extent="40" Angle="270" />
</ig:CategoryDateTimeXAxis.LabelSettings>
<ig:CategoryDateTimeXAxis.Label>
<DataTemplate>
<TextBlock Text="{Binding Item.Date, StringFormat={}{0:d.MM} }" Margin="-25,0,0,0" FontSize="10" />
</DataTemplate>
</ig:CategoryDateTimeXAxis.Label>
<ig:CategoryDateTimeXAxis.Style>
<Style TargetType="ig:Axis">
<Setter Property="MajorStrokeThickness" Value="0"/>
</Style>
</ig:CategoryDateTimeXAxis.Style>
</ig:CategoryDateTimeXAxis>
<ig:NumericYAxis x:Name="yAxis" Label="{}{0:P}">
<ig:NumericYAxis.LabelSettings>
<ig:AxisLabelSettings Location="InsideLeft" />
</ig:NumericYAxis.LabelSettings>
<ig:NumericYAxis.Style>
</ig:NumericYAxis.Style>
</ig:NumericYAxis>
<ig:NumericYAxis x:Name="yAxisVol">
<ig:AxisLabelSettings Location="InsideRight" />
</ig:XamDataChart.Axes>
</ig:XamDataChart>
LineSeries lineSeri = new LineSeries(); lineSeri.ItemsSource = each.DefaultView; lineSeri.ValueMemberPath = "CHANGE"; lineSeri.XAxis = xAxis; lineSeri.YAxis = yAxis; lineSeri.Title = each.Rows[0]["TEST"].ToString(); lineSeri.Thickness = 3.0; xamDataChart1.Series.Add(lineSeri);
LineSeries lineSeri = new LineSeries();
lineSeri.ItemsSource = each.DefaultView;
lineSeri.ValueMemberPath = "CHANGE";
lineSeri.XAxis = xAxis;
lineSeri.YAxis = yAxis;
lineSeri.Title = each.Rows[0]["TEST"].ToString();
lineSeri.Thickness = 3.0;
xamDataChart1.Series.Add(lineSeri);
So I am trying to add tooltip with adding the below code below to my xaml that I wrote above;
<ig:XamDataChart.Series> <ig:LineSeries Name="lineSeri" ItemsSource="{Binding}" ValueMemberPath="CHANGE" XAxis="{Binding ElementName=xAxis}" YAxis="{Binding ElementName=yAxis}"> <ig:LineSeries.ToolTip> <StackPanel> <TextBlock Text="sadsa" /> <Grid> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition /> <ColumnDefinition /> </Grid.ColumnDefinitions> <TextBlock Text="Date:" FontWeight="Bold" Grid.Row="0" Grid.Column="0" /> <TextBlock Text="sdfdsfd" Grid.Row="0" Grid.Column="1" /> <TextBlock Text="Sales:" FontWeight="Bold" Grid.Row="1" Grid.Column="0" /> <TextBlock Text="fgfdgfd" Grid.Row="1" Grid.Column="1" /> </Grid> </StackPanel> </ig:LineSeries.ToolTip> </ig:LineSeries> </ig:XamDataChart.Series>
<ig:XamDataChart.Series>
<ig:LineSeries Name="lineSeri"
ItemsSource="{Binding}"
ValueMemberPath="CHANGE"
XAxis="{Binding ElementName=xAxis}"
<ig:LineSeries.ToolTip>
<StackPanel>
<TextBlock Text="sadsa" />
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock Text="Date:" FontWeight="Bold" Grid.Row="0" Grid.Column="0" />
<TextBlock Text="sdfdsfd" Grid.Row="0" Grid.Column="1" />
<TextBlock Text="Sales:" FontWeight="Bold" Grid.Row="1" Grid.Column="0" />
<TextBlock Text="fgfdgfd" Grid.Row="1" Grid.Column="1" />
</Grid>
</StackPanel>
</ig:LineSeries.ToolTip>
</ig:LineSeries>
</ig:XamDataChart.Series>
But as I said nothing happens when mouse over on graph
I am waiting for your replies
Thanks
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
Hello Stefan,
Thanks for your reply. My problem is that I have multiple lineseries.
Below you can see the code behind.
In your sample you set ItemSource and valueMemberPath as Oil but I am not sure what to set as ItemSource and ValueMemberPath because I have multi lineseries that I am adding to xamDataChart like in the code below.
How you got an idea?
<ig:XamDataChart.Series> <ig:LineSeries Name="lineSeri" ItemsSource="{Binding}" ValueMemberPath="Oil" XAxis="{Binding ElementName=xAxis}" YAxis="{Binding ElementName=yAxis}">
ValueMemberPath="Oil"
YAxis="{Binding ElementName=yAxis}">
foreach (DataTable each in _vm.Stocks) { LineSeries lineSeri = new LineSeries(); lineSeri.ItemsSource = each.DefaultView; lineSeri.ValueMemberPath = _vm.ChartYAxisValueMemberPath; lineSeri.XAxis = xAxis; lineSeri.YAxis = yAxis; lineSeri.Title = each.Rows[0]["STOCK"].ToString(); lineSeri.Thickness = 3.0; xamDataChart1.Series.Add(lineSeri); }
foreach (DataTable each in _vm.Stocks)
{
lineSeri.ValueMemberPath = _vm.ChartYAxisValueMemberPath;
lineSeri.Title = each.Rows[0]["STOCK"].ToString();
}