This is a migrated thread and some comments may be shown as answers.
Apply Quality Colors to the Bar Inside
1 Answer 8 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 2
Corey asked on 05 Sep 2013, 07:42 PM
I'm working with a RadHorizontalBulletGraph in Silverlight.  Currently the control appears as in the picture below.  What I'm hoping to do, however, is to take those qualitative range brushes and actually apply them to the bar itself.  That way, one would see the bar as green for most of the way, then become yellow as it neared the maximum, and then red once it hit the max.  Ultimately, the bar itself would display the quality colors instead of seeing a black bar climbing through colored backgrounds.

Is this possible with the bullet graph?  The example here displays almost what I want.  Once the bar passes the 50 mark, it changes colors to become a lighter grey.  All I want is to figure out how this was done and apply it to my situation.  I've included the picture from the example.

Also, here is my code creating the bullet graph (please note I'm doing this programmatically, so please respond with a solution that can be done in the code if possible):

RadHorizontalBulletGraph bulletGraph = new RadHorizontalBulletGraph();
bulletGraph.Height = 20;
bulletGraph.Margin = new Thickness(10,5,10,5);
if (viewCol.Width > 0)
  bulletGraph.Width = viewCol.Width;
bulletGraph.Minimum = viewCol.BGMinValue;
bulletGraph.Maximum = viewCol.BGMaxValue;
string displayValue = GetDisplayVal(dataItem);
bulletGraph.FeaturedMeasure = S.ToDouble(displayValue);
bulletGraph.QuantitativeScaleVisibility = viewCol.BGShowLabels ? Visibility.Visible : Visibility.Collapsed;
QualitativeRange range1 = new QualitativeRange();
range1.Value = viewCol.BGRange1;
range1.Brush = new SolidColorBrush(S.ColorFromInt(viewCol.BGRange1Color));
QualitativeRange range2 = new QualitativeRange();
range2.Value = viewCol.BGRange2;
range2.Brush = new SolidColorBrush(S.ColorFromInt(viewCol.BGRange2Color));
QualitativeRange range3 = new QualitativeRange();
range3.Value = viewCol.BGRange3;
range3.Brush = new SolidColorBrush(S.ColorFromInt(viewCol.BGRange3Color));

1 Answer, 1 is accepted

Sort by
Petar Kirov
Telerik team
answered on 10 Sep 2013, 04:18 PM
Hi Corey,

The BulletGraph control was designed to represent a specific kind of visualization and it does not support customization in the way you require.

That is why believe that our linear gauge control would be more suitable for your scenario. It allows extensive customization on virtually any of its visual elements. Here you can find its online demos and here its documentation.

I hope this helps.

Petar Kirov
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Asked by
Top achievements
Rank 2
Answers by
Petar Kirov
Telerik team
Share this question