on 08-16-2011 8:27 AM
Hi All,
I had posted the below thread:
Now I am getting the Pie chart.
My query is returning output like this:
<output>
[ { "label": 2011, "data":10}, { "label": 2010, "data":50}, { "label": 2009, "data":30}, { "label": 2008, "data":20}, { "label": 2007, "data":10}, { "label": 2006, "data":70}]
</output>
But in Pie chart I am getting values in %.e.g 2011, 5%...2006, 37%..
this is the code:
onDataReceived($(data).find("output").text()); // navigating to output element of what is returned from AJAX call
function onDataReceived(series) {
// var obj = JSON.parse(series);
var obj = eval('(' series ')');
//data =parse( series );
$.plot($("#placeholder"), obj, options); // specifying the data for the chart
}
}
I want the values as it is coming from query not in %.Any idea how to get this.
Thanks in advance.
Regards
Manisha
Edited by: Michael Appleby on Aug 16, 2011 1:46 PM Put in blocks for better presentation.
Hi Manisha
try options as
options = {
series: {
pie: {
show: true,
radius: 1,
label: {
show: true,
radius: 1,
formatter: function(label, series){
return '<div style="font-size:8pt;text-align:center;padding:2px;color:white;">'+label+'<br/>'+series.data[0][1]+'</div>';
},
background: { opacity: 0.8 }
}
}
},
legend: {
show: false
}
}
Thanks
Anshul
Edited by: Anshul Sahu on Aug 16, 2011 10:10 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Anshul,
I dont want like this.My concern is I want data as it is coming from Query template ,not with %.
e.g Query is returning for 2010 data is 50
<output>
[ { "label": 2011, "data":10}, { "label": 2010, "data":50}, { "label": 2009, "data":30}, { "label": 2008, "data":20}, { "label": 2007, "data":10}, { "label": 2006, "data":70}]
</output>
So in Pie chart I want 2010 50 instead of 2010 26%.
Regards
Manisha
User | Count |
---|---|
11 | |
6 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.