Note that there are some explanatory texts on larger screens.

plurals
  1. POKendoUI Pie Chart not Working
    primarykey
    data
    text
    <p>I cannot get this simple KendoUI Pie chart to work and I do not see anything wrong with the code. </p> <p>I only have some basic JSON which I am trying to bind to. As you can see the source data contains already calculated percentages and also the actual values. I am only trying to bind the pie chart to the percentage columns. The reason for the percentageUnit and percentageValue is because I already have code in place to switch between the two. The actual value and unit fields will be used as tooltips. So it is important to have all that data in the source.</p> <p>The chart does populate but looks totally messed up. Is it me or Kendo?</p> <p><a href="http://jsfiddle.net/jqIndy/38gH4/" rel="nofollow noreferrer">http://jsfiddle.net/jqIndy/38gH4/</a></p> <p><img src="https://i.stack.imgur.com/YtGx8.png" alt="Pie Chart Result"></p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="utf-8" /&gt; &lt;title&gt;JS Bin&lt;/title&gt; &lt;script src="http://code.jquery.com/jquery-1.8.2.min.js"&gt;&lt;/script&gt; &lt;script src="http://cdn.kendostatic.com/2012.3.1114/js/kendo.all.min.js"&gt;&lt;/script&gt; &lt;link href="http://cdn.kendostatic.com/2012.3.1114/styles/kendo.common.min.css" rel="stylesheet" /&gt; &lt;link href="http://cdn.kendostatic.com/2012.3.1114/styles/kendo.default.min.css" rel="stylesheet" /&gt; &lt;link href="http://cdn.kendostatic.com/2012.3.1114/styles/kendo.dataviz.min.css" rel="stylesheet" /&gt; &lt;link href="http://cdn.kendostatic.com/2012.3.1114/styles/kendo.dataviz.default.min.css" rel="stylesheet" /&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="client-order-status"&gt;&lt;/div&gt; &lt;script&gt; var dr = [{ Status: "CANCELLED", Units:554615.000000000000, Value:12194910.410000000000, PercentageUnits:12.955700000000, PercentageValue:25.479241000000 },{ Status: "INVOICED", Units:3260369.000000000000, Value:31610141.095120000000, PercentageUnits:76.161596000000, PercentageValue:66.044143000000 },{ Status: "OPEN", Units: 465873.000000000000, Value: 4057089.598000000000, PercentageUnits: 10.882704000000, PercentageValue: 8.476615000000 }]; var dsCOStatus = new kendo.data.DataSource({ data: dr, schema: { type: "json", model: { fields: { Status: "Status", PercentageUnits: "PercentageUnits", PercentageValue: "PercentageValue", Units: "Units", Value: "Value" } } }, }); $(function () { $("#client-order-status").kendoChart({ dataSource: dsCOStatus, title: { text: "Client Order Status (past 12 months)" }, legend: { position: "bottom" //labels: { // template: "#= text # (#= value #%)" //} }, seriesDefaults: { type: "pie" //labels: { // visible: true, // format: "{0}%" //} }, series: [{ field: "Status", categoryField: "Value" }], tooltip: { visible: true //format: "{0}" } }).show(); }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>In XML I have the same problem:</p> <pre><code>var drXML = "&lt;D&gt;&lt;Report&gt;&lt;Status&gt;CANCELLED&lt;/Status&gt;&lt;Units&gt;554615.000000000000&lt;/Units&gt;&lt;Value&gt;12194910.410000000000&lt;/Value&gt;&lt;PercentageUnits&gt;12.955700000000&lt;/PercentageUnits&gt;&lt;PercentageValue&gt;25.479241000000&lt;/PercentageValue&gt;&lt;/Report&gt;&lt;Report&gt;&lt;Status&gt;INVOICED&lt;/Status&gt;&lt;Units&gt;3260369.000000000000&lt;/Units&gt;&lt;Value&gt;31610141.095120000000&lt;/Value&gt;&lt;PercentageUnits&gt;76.161596000000&lt;/PercentageUnits&gt;&lt;PercentageValue&gt;66.044143000000&lt;/PercentageValue&gt;&lt;/Report&gt;&lt;Report&gt;&lt;Status&gt;OPEN&lt;/Status&gt;&lt;Units&gt;465873.000000000000&lt;/Units&gt;&lt;Value&gt;4057089.598000000000&lt;/Value&gt;&lt;PercentageUnits&gt;10.882704000000&lt;/PercentageUnits&gt;&lt;PercentageValue&gt;8.476615000000&lt;/PercentageValue&gt;&lt;/Report&gt;&lt;/D&gt;"; var dsCOStatus = new kendo.data.DataSource({ data: drXML, schema: { type: "xml", data: "/D/Report", model: { fields: { Status: "Status/text()", PercentageUnits: "PercentageUnits/text()", PercentageValue: "PercentageValue/text()", Units: "Units/text()", Value: "Value/text()" } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload