Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
jazfunk
Frequent Visitor

Modify Axis Values for Letter Grade Category

I've modified the Microsoft Bullet Chart to have additional bars, and some other necessary customizations.  So far, I've been successful.  

 

The trouble I'm having now is attempting to display letter values on the axis.  I have only one record in my dataset which I'm attempting to convert numbers (1-10) to their letter grade equivalent (A+, A, A-, B+, B, B-, C+, C, C-, D).  

 

I've modified the visual to convert the numbers to the letters using a JSON object, and it shows in the "Value" in the tooltip, and below the category name where I've manually added the text.  However, the Axis still displays the numbers 1-10.  

 

Which approach should I take to get the axis to display letters as needed?  I've looked at creating an ordinal scale (couldn't get that to work), and now I'm looking into modifying the axis after the DOM is rendered (with no success, yet).

 

The visual has a level of complexity where it's not very intuitive to make this modification, at least at my current level of proficiency with D3.

 

Thanks for any input.

1 ACCEPTED SOLUTION
jazfunk
Frequent Visitor

@V-lianl-msft You're correct in that it was difficult, and took me quite a while to come up with a solution... but I did last night.

 

I was able to capture the axis right before it was drawn. 

 

This screenshot shows the area in the setUpBulletsHorizontally() method where I instantiated the existing scale, built a new axis, set the tickValues() and tickFormat() methods to the letter/number grade conversion values, then assigned it to the bar.xAxisProperties object if the existing current bar/bullet *resultValue in the loop was non-numeric.  

 
*Note:  The "resultValue" property is a custom property I added to the BulletChartModel BarData interface.
 
Worked like a charm!
 
jazfunk_0-1625145734250.png

 

View solution in original post

2 REPLIES 2
jazfunk
Frequent Visitor

@V-lianl-msft You're correct in that it was difficult, and took me quite a while to come up with a solution... but I did last night.

 

I was able to capture the axis right before it was drawn. 

 

This screenshot shows the area in the setUpBulletsHorizontally() method where I instantiated the existing scale, built a new axis, set the tickValues() and tickFormat() methods to the letter/number grade conversion values, then assigned it to the bar.xAxisProperties object if the existing current bar/bullet *resultValue in the loop was non-numeric.  

 
*Note:  The "resultValue" property is a custom property I added to the BulletChartModel BarData interface.
 
Worked like a charm!
 
jazfunk_0-1625145734250.png

 

V-lianl-msft
Community Support
Community Support

I think it will be very complicated to do so. It is difficult to define the length between letter grade and the number range of letter grade . We also need to consider the order of letter grade.

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.