Pie chart rendering with labels AND data values?

3,727 views
Skip to first unread message

Alexander Johannesen

unread,
Jul 27, 2011, 7:56:43 AM7/27/11
to jqplot...@googlegroups.com
Hi,

I'm trying to render a pie chart that displays both the label *and* the actual data value (not the calculated percentage) in each slice. I'm mucking around with options, and I've got ;

          dataLabels: 'label',
          dataLabelFormatString: '%s (%d)',

However, this only shows the label (and when dataLabels='label' it seems that %d lose functionality). Is there any way to get the data value in there as well (as well as a newLine :)?



Kind regards,

Alexander

Alexander Johannesen

unread,
Jul 28, 2011, 2:38:56 AM7/28/11
to jqplot...@googlegroups.com
Hiya,

Bump. Anyone know any answers to this one? And where could I find doco for what I can put in dataLabelFormatString: '%s (%d) %d%%' for pie charts? 


Regards,

Alex


wgpubs

unread,
Sep 16, 2011, 2:10:28 PM9/16/11
to jqplot-users
BUMPed again. How do you customize the labels?


On Jul 27, 11:38 pm, Alexander Johannesen

wgpubs

unread,
Sep 16, 2011, 2:20:33 PM9/16/11
to jqplot-users
BUMPed again. How do you customize the labels?


On Jul 27, 11:38 pm, Alexander Johannesen
<alexander.johanne...@gmail.com> wrote:

Bl4ckB1rd

unread,
Jan 13, 2012, 12:53:29 PM1/13/12
to jqplot...@googlegroups.com
Hi, i have the same problem... I hack very quickly the src, i add dataLabels: 'custom' and in dataLabelFormatString: ['%s', '%d', '%d%%'] or one or two of this options... is very quickly hack... and the view with 2 values if not very nice... But i attach the src if someone need this solution.
if not dataLabelFormatString for default show percent.

the hack start in line 477to 494

jqplot.pieRenderer.js

Bl4ckB1rd

unread,
Jan 13, 2012, 1:26:18 PM1/13/12
to jqplot...@googlegroups.com

Hi again i add know the %d to legends... and yesterday i touch with a very ugly hack the higligter plugin to support "bold" the legend...
in my blog add the description for the higlighter http://www.bl4ckb1rd.com.ar/blog/2012/01/11/jqplot-pie-chart-legend-hightlighter-bold-legend/

but you need the plugin src that i attach hear if you use the pie modification to show %d in legends.

thank.
jqplot.highlighter.js
jqplot.pieRenderer.js
Reply all
Reply to author
Forward
0 new messages