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

Is this possible?

2 Answers 59 Views
BulletGraph
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Fredrik
Top achievements
Rank 1
Fredrik asked on 27 Sep 2011, 01:35 PM
Hi !!!

Another great component from telerik ...tumbs up.

I´m looking to incorporate this component into my project and have some suggestions (maybe some of this could be done already).

1. Is it possible to have some kind of label text next to the labelsteps values ? (For example my BulletGraph is showing a timescale and I would like to have 1h, 2h etc as labels under the graph)

2. Is it possible to get rid of the comperativemeasure. Setting it to negative value perhaps ?

Regards

Fredrik

2 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 06 Oct 2011, 04:30 PM
Hello Fredrik,

 Thank you for the questions. Please excuse us for the very delayed response, we had a technical issue (now resolved) that caused us to miss your post in our support system.

You can easily specify custom text in the bullet graph scale labels by providing your own data template and a custom value converter that will convert the actual value of the label to your desired text. This data template should be set to the bullet graph's LabelTemplate property and the value converter should used inside this template. For example:

<telerikDataVisualization:RadBulletGraph>
    <telerikDataVisualization:RadBulletGraph.LabelTemplate>
        <DataTemplate>
            <TextBlock Text="{Binding Converter={StaticResource converter}}"/>
        </DataTemplate>
    </telerikDataVisualization:RadBulletGraph.LabelTemplate>
</telerikDataVisualization:RadBulletGraph>

Here are the converter declaration and implementation:
<UserControl.Resources>
    <local:MyValueConverter x:Key="converter"/>
</UserControl.Resources>

public class MyValueConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        return String.Format("{0}h", value);
    }
 
    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        return null;
    }
}

In order to hide the comparative measure you can simply set the comparative measure's template to a data template that contains an empty UI element. For example:
<telerikDataVisualization:RadBulletGraph>
    <telerikDataVisualization:RadBulletGraph.ComparativeMeasureTemplate>
        <DataTemplate>
            <TextBlock/>
        </DataTemplate>
    </telerikDataVisualization:RadBulletGraph.ComparativeMeasureTemplate>
</telerikDataVisualization:RadBulletGraph>

Please write again if you have other questions.

All the best,
Victor
the Telerik team

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

0
esteban
Top achievements
Rank 1
answered on 01 Aug 2013, 11:55 PM
Oh great!! Thanks Admind, excellent information, thx for sharing! :D
__________________
[url=https://valordelaplata.wordpress.com]Valor de la plata[/url]
Tags
BulletGraph
Asked by
Fredrik
Top achievements
Rank 1
Answers by
Victor
Telerik team
esteban
Top achievements
Rank 1
Share this question
or