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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.