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

Apply Quality Colors to the Bar Inside

1 Answer 40 Views
BulletGraph
This is a migrated thread and some comments may be shown as answers.
Corey
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));
bulletGraph.QualitativeRanges.Add(range1);
 
QualitativeRange range2 = new QualitativeRange();
range2.Value = viewCol.BGRange2;
range2.Brush = new SolidColorBrush(S.ColorFromInt(viewCol.BGRange2Color));
bulletGraph.QualitativeRanges.Add(range2);
 
QualitativeRange range3 = new QualitativeRange();
range3.Value = viewCol.BGRange3;
range3.Brush = new SolidColorBrush(S.ColorFromInt(viewCol.BGRange3Color));
bulletGraph.QualitativeRanges.Add(range3);

1 Answer, 1 is accepted

Sort by
0
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.

Regards,
Petar Kirov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
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 >>
Tags
BulletGraph
Asked by
Corey
Top achievements
Rank 2
Answers by
Petar Kirov
Telerik team
Share this question
or