Chartbuilder icon indicating copy to clipboard operation
Chartbuilder copied to clipboard

Add Arbitrary text to chart area either as an annotation or a subtitle

Open johnschoen opened this issue 10 years ago • 8 comments

Terrific tool - simple, powerful, nice clean design. Some charts need a little explaining - is here any way top drop a caption field? Thanks!

johnschoen avatar Sep 18 '13 20:09 johnschoen

Could you explain a little more? You want something other than the title, credit or source?

yanofsky avatar Sep 18 '13 20:09 yanofsky

for, say, a chart on unemployment, something like:

Weak Job Growth

Despite record low interest rates and other government efforts, employers are not hiring fast enough to get the economy growing.

<<<<CHART HERE>>>>

SOURCE: BLS

johnschoen avatar Sep 18 '13 20:09 johnschoen

SVG is really terrible at wrapping text, so this is more difficult than it sounds since most captions would be longer than one line.

I'm also hesitant to allow for more and more text to be obscured to people who are using screen readers (since this text will just be pixels in an image). At the organizations I've worked at captions like that are preferred to fall outside of the chart area and rendered in HTML text.

yanofsky avatar Sep 24 '13 02:09 yanofsky

Adding these as HTML drops it below the chart in our CMSs which is not optimal. Can you send a link to an example of this? The other workaround is to cut and paste in an image editor but that sort of defeats the one-stop shop model. This is for CNBC.com and NBCNews.com. On Sep 23, 2013 10:33 PM, "yanofsky" [email protected] wrote:

SVG is really terrible at wrapping text, so this is more difficult than it sounds since most captions would be longer than one line.

I'm also hesitant to allow for more and more text to be obscured to people who are using screen readers (since this text will just be pixels in an image). At the organizations I've worked at captions like that are preferred to fall outside of the chart area and rendered in HTML text.

— Reply to this email directly or view it on GitHubhttps://github.com/Quartz/Chartbuilder/issues/88#issuecomment-24970936 .

johnschoen avatar Sep 24 '13 17:09 johnschoen

Got it...will probably add when we tackle annotations

yanofsky avatar Sep 26 '13 01:09 yanofsky

Thanks. Its nice piece of code.

Sent from my iPhone

On Sep 25, 2013, at 9:45 PM, yanofsky [email protected] wrote:

Got it...will probably add when we tackle annotations

— Reply to this email directly or view it on GitHub.

johnschoen avatar Sep 26 '13 01:09 johnschoen

this will be helpful: http://bl.ocks.org/mbostock/7555321

yanofsky avatar Nov 20 '13 16:11 yanofsky

This is basically all it takes to implement, https://github.com/Quartz/Chartbuilder/commit/3846844529f13dfe496a214dd9abc6152b86b20b

but the calculations for padding need to be adjusted anywhere afterTitle is used to include a condition for afterSubtitle

yanofsky avatar Sep 17 '15 15:09 yanofsky