jqplot and legend

77 views
Skip to first unread message

hariis

unread,
Nov 13, 2010, 12:12:58 PM11/13/10
to jqplot-users
I have the following in my code. Having the option legend:
{show:true} messes up the chart badly. The legend section is so long
and there is no chart.
I have pasted the image here of how the chart looks :
http://tinypic.com/view.php?pic=2eqgbgy&s=7

In Chrome I see the following exception
Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1


<script type="text/javascript">

line2 = [['Living Expenses',1000], ['Loans',2000], ['Credit
Card',500]];


$j(document).ready(function() {

$j.jqplot.config.enablePlugins = true;


$j.jqplot('piechartdiv', [line2], {
title: 'Where is my money going?',
seriesDefaults:{renderer:$j.jqplot.PieRenderer,
rendererOptions:{sliceMargin:8}},
legend:{show:true}
});

});
</script>

<div style="width: 450px;margin: 0px auto;">
<div id='piechartdiv'></div>
</div>



Any help appreciated.

solid

unread,
Nov 16, 2010, 12:14:11 AM11/16/10
to jqplot-users
I had the same problem initially. In my case, it stemmed from having
a global style reset. I fixed it by simply adding a chart_wrapper
class to the outer div and adding the following styles to my app:


div.chart_wrapper
{
margin: 0px;
padding: 0px;
}

div.chart_wrapper > div
{
margin: 5px;
}

div.chart_wrapper div
{
margin: 0px;
padding: 0px;
}

div.chart_wrapper *
{
width: auto;

Adam

unread,
Nov 23, 2010, 6:33:54 AM11/23/10
to jqplot-users
Hi,

I'm having this same problem, but unfortunately I'm quite new to web
programming. Would you be able to do into a little more detail about
what the issue was and what the fix actually does, as at the moment I
don't quite understand what it is you're doing with the styles?

Thanks very much,
Adam.
Reply all
Reply to author
Forward
0 new messages