0

In Google Sheets it is possible for data labels in a chart to reflect the number formats for individual scale points? Even if its only possible via the Google Sheets REST API that would be fine.

Currently it is possible in a chart to set the number format for data labels to "From source data", and data labels in the chart do successfully reflect that format.

But my problem is that the chart reads the custom number format only from the first cell in the source data, and then applies it to every data label in the series. Example

enter image description here

In the image below, the chart successfully reads the custom number format from the first value...

But what I want to get is like the mockedup image below:

enter image description here

1 Answer 1

2

You can work around the number format limitation with a helper column and some string manipulation. Enter the formula =text(C4,"0%") in D4 and copy it down the column for each value in column C. In D8 replace the formula with =char(9650)&" "&text(C8,"0%") and in D11 replace the formula with =char(9660)&" "&text(C11,"0%").

Finally, in the chart options, change the source range to include column D, then under 'Series' click the three dots next to 'Qty', then on 'Add labels' and finally select the D4:D15 range.

Sign up to request clarification or add additional context in comments.

2 Comments

This is awesome. And while creating the column D works as desired, it turns out it's not actually necessary. I can just use the original formatted data column C3:C12 twice -- both as the data source for the series and the data source for the series labels. The data series then include the formatted text as the labels, and the unformatted number as the value.
Oh, that's interesting (albeit slightly confusing)... I guess I've learned something here too!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.