or
var messages = new kendo.data.DataSource({ transport: { read: function(operation) { var cachedData = localStorage.getItem("cachedMessages"); if (cachedData != null || cachedData != undefined) { operation.success(JSON.parse(cachedData)); } else { operation.success(getMessages()); } } } });<ul id="messages-list-view" data-role="listview" data-source="messages" data-template="message-template" data-pull-to-refresh="true"></ul>$("#" + chartDiv).kendoChart({ title: { text: chartName + " " + chartLabel }, legend: { visible: false, position: "bottom" }, seriesDefaults: { type: "donut", startAngle: 150 }, theme: defaultTheme, series: [{ name: "Prior Period", overlay: { gradient: "none" }, categoryField: "Value.Description", field: "Value.Value", tooltip: { visible: true, template: "${dataItem.Value.Description} - ${dataItem.Value.FormattedValue} - Prior Period" }, data: jsonPrior }, { name: labelDateRange, overlay: { gradient: "none" }, categoryField: "Value.Description", field: "Value.Value", tooltip: { visible: true, template: "${dataItem.Value.Description} - ${dataItem.Value.FormattedValue} - " + labelDateRange }, data: jsonData, labels: { template: "${dataItem.Value.Description} - ${dataItem.Value.FormattedValue}", position: "outsideEnd", font: "10px Arial,Helvetica,sans-serif", align: "circle", visible: true, distance: 15, background: "transparent" }, }] });