|
$(function () {
$("#PivotClient").ejPivotClient({
///…,
chartType: 'pie',
title: "Relational Browser",
renderSuccess: "setChartProperties",
displaySettings: {
mode: 'chartonly',
}
});
});
function setChartProperties(args) {
if (args._successAction == undefined || args._successAction == "Filter") {
this._pivotChart.model.legend.visible = false;
this._pivotChart.model.load = function (args) {
var annotations = [];
if (!ej.isNullOrUndefined(this.model.series) && this.model.series.length == 1) {
$(this.model.series[0].dataSource).each(function (index, item) {
var iDiv = document.createElement('div'); iDiv.id = 'label_' + index;
iDiv.textContent = item.xValues;
document.getElementsByTagName('body')[0].appendChild(iDiv); $("#" + iDiv.id).css("display", "none");
annotations.push({ visible: true, content: iDiv.id, coordinateUnit: "points", x: index, verticalAlignment: "top" });
});
}
this.model.annotations = annotations; // you can add the annotations here
}
}
} |