ASP.NET MVC: @(Html.EJ().Chart("container") //... .ToolTipInitialize("tooltipInitialize") ) function tooltipInitialize(sender) { var model = @Html.Raw(Json.Encode(Model)), pointIndex = sender.data.pointIndex; //By default depends upon the x values in series.points, the point collection will get sorted, so we need to sort your data source also with respect to x value(XBusinessValue) which is obtained from controller. model = model.sort(sortNumber); textCollection = sender.data.currentText.split("<br/>"); textCollection[0] = model[pointIndex].Function; sender.data.currentText = textCollection.join(); } //Method to sort your data source function sortNumber(a,b) { return parseInt(a.XBusinessValue) - parseInt(b.XBusinessValue); } |