This is a migrated thread and some comments may be shown as answers.

Templating the TrackBallInfo popup

3 Answers 236 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Jesper
Top achievements
Rank 1
Jesper asked on 06 Jul 2012, 10:47 AM
Hi again,

I have now managed to get the TrackBallInfo popup window to look almost as I want it but one thing remains: I would like to have the header present the datapoint's current Category. 

Having examined all the demos I've seen that I can in fact have the first series also present such a header for me but that won't work if the user opts that data series out of the presentation. I could have a "special" series with null values just to achieve this but that would be very a very clunky solution.

I have also seen that I can use one of the indicators but they all seem to end up at the bottom of the info window.

Could you please direct me to whatever documentation that explains how to template the info window while using the current datapoints?

Thanks

3 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 11 Jul 2012, 07:37 AM
Hello Jesper,

You can change the display header of the trackball easily like this:

private void ChartTrackBallBehavior_TrackInfoUpdated(object sender, TrackBallInfoEventArgs e)
{
    foreach (DataPointInfo info in e.Context.DataPointInfos)
    {
        info.DisplayHeader = "Custom data point header";
    }
 
    e.Header = "Sample header";
}

Here is the result:


You can find more information on styling the trackball in this topic in our online help system. 

All the best,
Yavor
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Peter
Top achievements
Rank 1
answered on 15 Aug 2012, 11:13 AM
Hey,

I have used this technique in Q1 2012. In addition to the custom header I used a custom template for TrackBallInfoControl. In the version before I could easily display the value of header by using "{Binding Header}". Now it seems that you changed the DataContext of this template to the Context of the RadChart control. Previously it has been the current datapoint or the trackball itself. I have found no way to access the text I wrote to header. Perhaps you could tell me what I have to insert in this example:

<Style x:Key="trackballInfoControl" TargetType="telerik:TrackBallInfoControl">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="telerik:TrackBallInfoControl">
                <StackPanel>
                    <TextBlock Text="{ ??? }" />
                    <StackPanel x:Name="panel" />
                </StackPanel>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

Thanks in advance,
Peter Schmidt
0
Yavor
Telerik team
answered on 20 Aug 2012, 09:02 AM
Hi Peter,

Indeed, there is a bug in our latest binaries that prevents this approach for setting the header. I have logged this issue in our PITS system here. We will make sure that it is resolved as soon as possible, so a fix will be available in one of the upcoming LIB that is released every Monday. Also, your telerik points have been updated!

All the best,
Yavor
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
ChartView
Asked by
Jesper
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Peter
Top achievements
Rank 1
Share this question
or