We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How can I show a tooltip on the ChartAdornmentInfo symbol?

Hi,
 
I have a series line chart, and I want to display a small ellipse at each data point and have a tooltip display the value when the mouse hovers over it.
 
So I thought the obvious solution was to add a ChartAdornmentInfo and configure this to do what I want. However, there is no tooltip option that I can see for a ChartAdornmentInfo, and I can't see a way to hide the text except to set my own empty DataTemplate for the LabelTemplate.  I tried setting my own DataTemplate for the SymbolTemplate to draw my own symbol and add a ToolTip, but the DataContext is not set for this template, so I can't access the data needed for the tooltip! :(
 
Currently I am setting a transparent LabelTemplate in order to add the tooltip, and a SymbolTemplate to draw the symbol, but this has the problem that when a data point is at the edge of the chart area the LabelTemplate gets repositioned inside the chart, so it no longer overlaps the point (which just gets clipped as expected), so you don't get the tooltip when you're over the point in this case, but instead it appears when you're near it! :(
 
This does not seem like an unreasonable thing to want to do, but I can't see any easy way to do it! :(  Am I missing something?  Can anyone tell me the correct way to do this please?
 
Thanks,
 
Brian

3 Replies

SS Sheik Syed Abthaheer M Syncfusion Team June 10, 2013 11:45 AM UTC

Hi Brian,

Thanks for using Syncfusion products.

We have analyzed your query. Your requirement for “ToolTip support for ChartAdornment” in Chart Area mouse over event can be achieved and we have prepared the sample based on your requirement. Please download the sample from following location.  

Please let us know if you have any queries.

Regards,

M. Sheik



ChartAdormentToolTip_91e2b9db.zip


SH Shwetha H S September 29, 2015 10:15 AM UTC

Hi ,
I  have seen this sample when googling .
but i come to know my requirement is different i want to show 4 ractangle and based on property of Item shource i want to change color of those ractancle .
one more point property that we need to bind is differnt from that of Y axis and X axis.
i am sending to xaml and screen shot of that binding.


 

<Rectangle Width="7" Height="10" >

                                                <Rectangle.Style>

                                                    <Style TargetType="Rectangle">

                                                        <Style.Triggers>

 

                                                            <DataTrigger  Binding="{Binding Record.Data.RegulationMode, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Value="0" >

                                                                <Setter  Property="Fill" Value="Black"/>

                                                            </DataTrigger>

 

                                                            <DataTrigger  Binding="{Binding Record.Data.RegulationMode, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Value="1" >

                                                                <Setter  Property="Fill" Value="Red"/>

                                                            </DataTrigger>

                                                        </Style.Triggers>

                                                    </Style>

                                                </Rectangle.Style>

                                            </Rectangle>

                                            <Rectangle Width="7" Height="10" >

                                                <Rectangle.Style>

                                                    <Style TargetType="Rectangle">

                                                        <Style.Triggers>

 

                                                            <DataTrigger  Binding="{Binding Record.Data.RegulationMode, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Value="0" >

                                                                <Setter  Property="Fill" Value="Black"/>

                                                            </DataTrigger>

 

                                                            <DataTrigger  Binding="{Binding Record.Data.RegulationMode, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Value="1" >

                                                                <Setter  Property="Fill" Value="Green"/>

                                                            </DataTrigger>

                                                        </Style.Triggers>

                                                    </Style>

                                                </Rectangle.Style>

                                            </Rectangle>

                                            <Rectangle Width="7" Height="10" >

                                                <Rectangle.Style>

                                                    <Style TargetType="Rectangle">

                                                        <Style.Triggers>

 

                                                            <DataTrigger  Binding="{Binding Record.Data.RegulationMode, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Value="0" >

                                                                <Setter  Property="Fill" Value="Black"/>

                                                            </DataTrigger>

 

                                                            <DataTrigger  Binding="{Binding Record.Data.RegulationMode, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Value="1" >

                                                                <Setter  Property="Fill" Value="Orange"/>

                                                            </DataTrigger>

                                                        </Style.Triggers>

                                                    </Style>

                                                </Rectangle.Style>

                                            </Rectangle>

                                            <Rectangle Width="7" Height="10" >

                                                <Rectangle.Style>

                                                    <Style TargetType="Rectangle">

                                                        <Style.Triggers>

 

                                                            <DataTrigger  Binding="{Binding Record.Data.RegulationMode, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Value="0" >

                                                                <Setter  Property="Fill" Value="Black"/>

                                                            </DataTrigger>

 

                                                            <DataTrigger  Binding="{Binding Record.Data.RegulationMode, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Value="1" >

                                                                <Setter  Property="Fill" Value="Blue"/>

                                                            </DataTrigger>

                                                        </Style.Triggers>

                                                    </Style>

                                                </Rectangle.Style>

                                            </Rectangle>




where item shource collection (ObservableCollection) of this class


 public class HistoGramSBPWBP : IDisposable, ICloneable
    {
        public HistoGramSBPWBP();

        public string Comment { get; set; }
        public byte[] CurrentCurve { get; set; }
        public string Date { get; set; }
        public float Energy { get; set; }
        public byte[] ForceCurve { get; set; }
        public decimal FQF { get; set; }
        public string GhostRunMode { get; set; }
        public string GunName { get; set; }
        public long ItemCount { get; set; }
        public uint Length { get; set; }
        public uint LogNo { get; set; }
        public decimal MeanCurrent { get; set; }
        public decimal MeanForce { get; set; }
        public decimal MeanPulse { get; set; }
        public uint MeanResistance { get; set; }
        public uint MeanVoltage { get; set; }
        public int PSF { get; set; }
        public byte[] PulseCurve { get; set; }
        public int RegulationMode { get; set; }
        public uint SequenceBlock_Id { get; set; }
        public uint SequenceBlockNo { get; set; }
        public int SpatterTime { get; set; }
        public string SpotName { get; set; }
        public uint SpotNo { get; set; }
        public string STCReferenceSelection { get; set; }
        public string STCTeachName { get; set; }
        public string TimerName { get; set; }
        public uint TipDressCount { get; set; }
        public uint TipWearCount { get; set; }
        public int UIP { get; set; }
        public bool UirModeOff { get; set; }
        public long UnixEpochDate { get; set; }
        public byte[] VoltageCurve { get; set; }
        public string WeldError { get; set; }
        public string WeldJobName { get; set; }
        public uint WeldJobVersion { get; set; }
        public string WeldProtocolMonitorErrorCode { get; set; }

        public object Clone();
        public void Dispose();
        protected virtual void Dispose(bool disposing);
    }



Attachment: Graphs_314ccef8.7z


RA Rachel A Syncfusion Team September 30, 2015 12:31 PM UTC

Hi Shwetha,

Thanks for contacting Syncfusion Support.

We can achieve your requirement using CustomTemplate in ColumnSeries.We have prepared the sample for your reference and please download the sample from the following location.

Sample: CustomTemplate

Regards,
Rachel. A

Loader.
Live Chat Icon For mobile
Up arrow icon