Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1655
xamchart tooltip
posted

Hi,

 

I have a xamchart. I am binding data to the xamcahrt's datapoints dynamically.

For each datapoint, i want to display some text  as tooltip.  my code looks like this.

 

 

 

 

 

 

 

<igCA:XamChart Grid.Column="0" Grid.ColumnSpan="11" Grid.Row="0" Name="TrendsChart"

 

 

Theme="Default" Background="Transparent"

 

 

xmlns:igCA="http://infragistics.com/Chart" Height="130" DrawException="True"

 

 

EndPaletteBrush="#FFAD9BC3" StartPaletteBrush="#FFAD9BC3" FontSize="12" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="20,5,0,0" HorizontalContentAlignment

="Center">

 

 

<igCA:XamChart.Scene>

 

 

<igCA:Scene>

 

 

<igCA:Scene.GridArea>

 

 

<igCA:GridArea MarginType="Percent" Margin="8,8,0,5" />

 

 

</igCA:Scene.GridArea>

 

 

</igCA:Scene>

 

 

</igCA:XamChart.Scene>

 

 

<igCA:XamChart.Series>

 

 

<igCA:Series

 

Label="Production"

 

ChartType="column"

 

UseDataTemplate="True"

 

DataPointColor="Different">

 

 

<igCA:Series.DataPoints>

 

 

<igCA:DataPoint

 

Value="2"

 

Label="2002"

 

Fill="#FFD70005"

 

ToolTip="Image1"/>

 

 

<igCA:DataPoint

 

Value="4"

 

Label="2003"

 

Fill="#FF6CA224"

 

ToolTip=" Image2"/>

 

 

<igCA:DataPoint

 

Value="8"

 

Label="2004"

 

Fill="#FF076CB0"

 

ToolTip=" Image3"/>

 

 

<igCA:DataPoint

 

Value="5"

 

Label="2005"

 

Fill="#FFE6BE02"

 

ToolTip=" Image4"/>

 

 

<igCA:DataPoint

 

Value="6"

 

Label="2006"

 

Fill="#FF543792"

 

ToolTip="image5">

 

 

</igCA:DataPoint>

 

 

</igCA:Series.DataPoints>

 

 

</igCA:Series>

 

 

</igCA:XamChart.Series>

 

 

</igCA:XamChart>

Am I doing any thing wrong. It is not displaying any tooltip.

Actually i want to display a chart as tooltip, not simple text. Please provide me with solution.

Regards

Ritesh

Parents
  • 9836
    posted

    Hello Ritesh,

    The tooltips are not getting displayed because you are setting the UseDataTemplate property to true. In this case the chart will not use the default template and will search for a custom DataTemplate defined in the resources.

    You can resolve the issue by setting UseDataTemplate to false or keep the value to true but provide a custom template for the points. You can copy and paste the default template from the DefaultStyles\Chart\XamChartDefault.xaml file and set the tooltips to any visual element in the template  - the main grid or some of the borders e.g.

    <DataTemplate DataType="{x:Type igCA:ColumnChartTemplate}">
         <DataTemplate.Resources ..>
               <Grid x:Name="LegendControl">
                   <Grid ToolTip="{Binding ToolTip}">
       ...
    </DataTemplate>

    There is an example in our Feature Browser that shows setting an Image or XamChart control to the DataPoint's Tooltip. You can check it out under the XamChart-->DataBinding and Interaction-->Tooltips sample.

    Let me know if you have any questions.

Reply Children