Based on this forum post: http://es.infragistics.com/community/forums/p/64311/478787.aspx#478787
Both the Tooltip and Legend text values are currently displaying "Series Title".
We are looking to get the Legend to display what each color represents or mapped to.
And when we hover over a Stack Fragment, in this sample, we want to display "Emission: <num value>".
How can we accomplish this?
Thanks,
Micjael
<Window.Resources> <local:TestEmissionsCollection x:Key="data" /> <ig:GroupBy x:Key="grouped" ItemsSource="{StaticResource data}" GroupMemberPath="Date" KeyMemberPath="Installation" ValueMemberPath="Emission" /> </Window.Resources> <Grid x:Name="LayoutRoot" Background="White"> <!-- Loaded="TheChart_OnLoaded" --> <igChart:XamDataChart x:Name="theChart" Legend="{Binding ElementName=xmLegend}" Title="{Binding ElementName=xmLegend, Path=ToolTip}"> <igChart:XamDataChart.Axes> <igChart:CategoryXAxis x:Name="xAxis" ItemsSource="{StaticResource grouped}" Label="{}{Key}" /> <igChart:NumericYAxis x:Name="yAxis" /> </igChart:XamDataChart.Axes>
<igChart:XamDataChart.Series> <igChart:StackedColumnSeries x:Name="stack" ItemsSource="{StaticResource grouped}" XAxis="{Binding ElementName=xAxis}" YAxis="{Binding ElementName=yAxis}" AutoGenerateSeries="True" ShowDefaultTooltip="True">
</igChart:StackedColumnSeries> </igChart:XamDataChart.Series> </igChart:XamDataChart> <ig:Legend x:Name="xmLegend" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="20,20,5,20"> </ig:Legend>
namespace WpfAppStackedColumnSerie{ using System; using System.Collections.ObjectModel; using System.Windows;
using Infragistics; using Infragistics.Controls.Charts;
/// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); }
}
/// <summary> /// The test emissions collection. /// </summary> public class TestEmissionsCollection : ObservableCollection<InstalationEmissionDateInformation> { public TestEmissionsCollection() { Add(new InstalationEmissionDateInformation("A", 5, "1/1/2012", 1)); Add(new InstalationEmissionDateInformation("B", 2, "1/1/2012", 1)); Add(new InstalationEmissionDateInformation("C", 7, "1/1/2012", 1)); Add(new InstalationEmissionDateInformation("A", 6, "1/2/2012", 1)); Add(new InstalationEmissionDateInformation("B", 3, "1/2/2012", 1)); Add(new InstalationEmissionDateInformation("C", 8, "1/2/2012", 1)); Add(new InstalationEmissionDateInformation("A", 6, "1/3/2012", 1)); Add(new InstalationEmissionDateInformation("B", 3, "1/3/2012", 1)); Add(new InstalationEmissionDateInformation("C", 6, "1/3/2012", 1)); Add(new InstalationEmissionDateInformation("A", 4, "1/4/2012", 1)); Add(new InstalationEmissionDateInformation("B", 3, "1/4/2012", 1)); Add(new InstalationEmissionDateInformation("C", 7, "1/4/2012", 1)); } }
/// <summary> /// The instalation emission date information. /// </summary> public class InstalationEmissionDateInformation { public string Installation { get; set; } public Decimal Emission { get; set; } public string Date { get; set; } public Decimal Assignation { get; set; }
public InstalationEmissionDateInformation( string installation, Decimal emission, string date, Decimal assignation) { Installation = installation; Emission = emission; Date = date; Assignation = assignation; } } }
namespace WpfAppStackedColumnSerie { using System; using System.Collections.ObjectModel; using System.Windows; using Infragistics; using Infragistics.Controls.Charts; ///
/// Interaction logic for MainWindow.xaml /// public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } } /// /// The test emissions collection. /// public class TestEmissionsCollection : ObservableCollection { public TestEmissionsCollection() { Add(new InstalationEmissionDateInformation("A", 5, "1/1/2012", 1)); Add(new InstalationEmissionDateInformation("B", 2, "1/1/2012", 1)); Add(new InstalationEmissionDateInformation("C", 7, "1/1/2012", 1)); Add(new InstalationEmissionDateInformation("A", 6, "1/2/2012", 1)); Add(new InstalationEmissionDateInformation("B", 3, "1/2/2012", 1)); Add(new InstalationEmissionDateInformation("C", 8, "1/2/2012", 1)); Add(new InstalationEmissionDateInformation("A", 6, "1/3/2012", 1)); Add(new InstalationEmissionDateInformation("B", 3, "1/3/2012", 1)); Add(new InstalationEmissionDateInformation("C", 6, "1/3/2012", 1)); Add(new InstalationEmissionDateInformation("A", 4, "1/4/2012", 1)); Add(new InstalationEmissionDateInformation("B", 3, "1/4/2012", 1)); Add(new InstalationEmissionDateInformation("C", 7, "1/4/2012", 1)); } } /// /// The instalation emission date information. /// public class InstalationEmissionDateInformation { public string Installation { get; set; } public Decimal Emission { get; set; } public string Date { get; set; } public Decimal Assignation { get; set; } public InstalationEmissionDateInformation( string installation, Decimal emission, string date, Decimal assignation) { Installation = installation; Emission = emission; Date = date; Assignation = assignation; } } }
http://es.infragistics.com/community/forums/t/64311.aspx
Covers how to properly format the legend.
We just require a sample of how to format the ToolTip.
Michael
This work, and based on other forum post.
<igChart:StackedColumnSeries.ToolTip> <TextBlock Text="{Binding Series.ValueMemberPath, Converter={StaticResource KeyConverter}, ConverterParameter='_Emission'}" /> </igChart:StackedColumnSeries.ToolTip>