Quartz / Chartbuilder

A front-end charting application that facilitates easy creation of simple beautiful charts
http://quartz.github.io/Chartbuilder
MIT License
2.1k stars 354 forks source link

Chart grid chart does not respond to presence of a suffix like the XY Chart does #168

Open chrislkeller opened 9 years ago

chrislkeller commented 9 years ago

XY Chart

image

Chart grid chart

la_county_voter_turnout_ 1962-2014 _midterm_primary_turnout_midterm_general_turnout_chartbuilder

Have been exploring where the difference might be but thought you might have a better idea on where to look to address?

nsonnad commented 9 years ago

Hey @chrislkeller, this is a known issue and is related to the fact that, in our version of Chartbuilder we use a customized version of D3 that positions the labels. That said it's definitely possible to get where we want without doing that. This is the code that positions the XY labels correctly, and something very close to that should work for the grid.

chrislkeller commented 9 years ago

Thanks @nsonnad. The example is helpful, but also above my immediate comprehension. I'll spend some time with it and try to understand how things are moving since to my eyes the XY rendering code is much more extensive than the chart grid code.

coagmano commented 8 years ago

Similar issue on a chart with horizontal bars: The % suffix is only added to the top bar :disappointed: chartbuilder_2_0

nsonnad commented 8 years ago

I have done a bit of work investigating @chrislkeller's issue (nothing to show for it yet, apologies). However @coagmano the suffix on the top bar only is intentional so as to not to be redundant, this gets especially unwieldy if you lave a long suffix like GDP (PPP adjusted) or somesuch.

yanofsky commented 8 years ago

@coagmano like @nsonnad the logic that only puts the units on the first line is intentional, but you can modify that logic here https://github.com/Quartz/Chartbuilder/blob/e22a5457c8b0f51d7303f3aa26cf40853d8c3593/src/js/components/chart-grid/ChartGridBars.jsx#L286-L290

changing it, however will mean you'll have to change the logic here too https://github.com/Quartz/Chartbuilder/blob/e22a5457c8b0f51d7303f3aa26cf40853d8c3593/src/js/components/chart-grid/ChartGridBars.jsx#L144