The pie chart does not seem to be able to handle negative values, the graph distorts completely if a negative value is introduced. Any way around this?
Sample data below:
var data_by_location = [
{ "location": "IN", "year": 2012, "month": 1, "revenue": 18228 },
{ "location": "TX", "year": 2012, "month": 1, "revenue": 15014 },
{ "location": "KY", "year": 2012, "month": 1, "revenue": 16898 },
{ "location": "MI", "year": 2012, "month": 1, "revenue": 12186 },
{ "location": "CA", "year": 2012, "month": 1, "revenue": -9945 }
]
I'm including the code for the pie chart below but everything is pretty standard:
$(document).ready(function () {
$("#piechart").kendoChart({
dataSource: data_by_location,
seriesDefaults: {
type: "pie",
labels: {
visible: true,
template: "#= category # - #=kendo.format('{0:p}', percentage) # "
}
},
title: {
text: "Monthly Revenue per Location"
},
legend: {
position: "bottom"
},
series: [{
field: "revenue",
categoryField: "location"
}],
tooltip: {
visible: true,
format: "N0"
}
});
Sample data below:
var data_by_location = [
{ "location": "IN", "year": 2012, "month": 1, "revenue": 18228 },
{ "location": "TX", "year": 2012, "month": 1, "revenue": 15014 },
{ "location": "KY", "year": 2012, "month": 1, "revenue": 16898 },
{ "location": "MI", "year": 2012, "month": 1, "revenue": 12186 },
{ "location": "CA", "year": 2012, "month": 1, "revenue": -9945 }
]
I'm including the code for the pie chart below but everything is pretty standard:
$(document).ready(function () {
$("#piechart").kendoChart({
dataSource: data_by_location,
seriesDefaults: {
type: "pie",
labels: {
visible: true,
template: "#= category # - #=kendo.format('{0:p}', percentage) # "
}
},
title: {
text: "Monthly Revenue per Location"
},
legend: {
position: "bottom"
},
series: [{
field: "revenue",
categoryField: "location"
}],
tooltip: {
visible: true,
format: "N0"
}
});