Hi,
I tried to create a pie chart. I did my own filtering from controller. So far I am not having any script errors but my chart is not displaying at all. When I put a break point on script I can see the data is coming correctly as array. Couldn't figure out why it is not displaying.
So far my data response is as follow;
{"Data":[{"AisStateType":"Under Way Using Engine","TotalDistance":9806.0141499469737,"DistancePercentage":100.0,"TotalTime":1536.0666666666666,"TimePercentage":100.0,"Id":1,"Form":null,"CustomProperties":{}},{"AisStateType":"At Anchor","TotalDistance":0.0,"DistancePercentage":0.0,"TotalTime":0.0,"TimePercentage":0.0,"Id":2,"Form":null,"CustomProperties":{}},{"AisStateType":"Not Under Command","TotalDistance":0.0,"DistancePercentage":0.0,"TotalTime":0.0,"TimePercentage":0.0,"Id":3,"Form":null,"CustomProperties":{}},{"AisStateType":"Restricted Maneuverability","TotalDistance":0.0,"DistancePercentage":0.0,"TotalTime":0.0,"TimePercentage":0.0,"Id":4,"Form":null,"CustomProperties":{}},{"AisStateType":"Constrained by Her Draught","TotalDistance":0.0,"DistancePercentage":0.0,"TotalTime":0.0,"TimePercentage":0.0,"Id":5,"Form":null,"CustomProperties":{}},{"AisStateType":"Moored","TotalDistance":0.0,"DistancePercentage":0.0,"TotalTime":0.0,"TimePercentage":0.0,"Id":6,"Form":null,"CustomProperties":{}},{"AisStateType":"Aground","TotalDistance":0.0,"DistancePercentage":0.0,"TotalTime":0.0,"TimePercentage":0.0,"Id":7,"Form":null,"CustomProperties":{}},{"AisStateType":"Engaged in Fishing","TotalDistance":0.0,"DistancePercentage":0.0,"TotalTime":0.0,"TimePercentage":0.0,"Id":8,"Form":null,"CustomProperties":{}},{"AisStateType":"Under Way Sailing","TotalDistance":0.0,"DistancePercentage":0.0,"TotalTime":0.0,"TimePercentage":0.0,"Id":9,"Form":null,"CustomProperties":{}},{"AisStateType":"Reserved for future amendment of navigational status for ships carrying DG, HS, or MP, or IMO hazard or pollutant category C","TotalDistance":0.0,"DistancePercentage":0.0,"TotalTime":0.0,"TimePercentage":0.0,"Id":10,"Form":null,"CustomProperties":{}}],"Total":10,"ExtraData":null,"Errors":null,"Form":null,"CustomProperties":{}}
and my cshtml is;
<
div
id
=
"piechart"
></
div
>
<
script
>
function createChart() {
$("#piechart").kendoChart({
dataSource: {
type: "json",
transport: {
read: {
url: "@Html.Raw(Url.Action("AisReportList", "AisTrackingAdmin"))",
type: "POST",
dataType: "json",
data: additionalData
}
},
schema: {
data: function (response) {
return response.Data; // twitter's response is { "statuses": [ /* results */ ] }
}
},
requestEnd: function (e) {
if (e.type == "update") {
this.read();
}
},
error: function (e) {
display_kendoui_chart_error(e);
// Cancel the changes
this.cancelChanges();
}
},
title: {
position: "bottom",
text: "Ais Data Report for @Model.ShipName, @Model.StartDate - @Model.EndDate"
},
legend: {
visible: false
},
chartArea: {
background: ""
},
seriesDefaults: {
labels: {
visible: true,
background: "transparent",
template: "#= AisStateType #: \n #= DistancePercentage#%"
}
},
series: [{
type: "pie",
startAngle: 150,
field: "AisStateType",
categoryField: "DistancePercentage"
}],
tooltip: {
visible: true,
format: "{0}%"
}
});
}
$(document).ready(createChart);
$(document).bind("kendo:skinChange", createChart);
</
script
>
</
div
>
<
script
>
$(document).ready(function () {
//search button
$('#search-aisdata').click(function () {
//search
$("#piechart").data("kendoChart").dataSource.read();
$("#piechart").data("kendoChart").redraw();
return false;
});
$("#@Html.IdFor(model => model.AisReportSearchModel.SearchDestination)").keydown(function (event) {
if (event.keyCode === 13) {
$("#search-aisdata").click();
return false;
}
});
});
function additionalData() {
var data = {
ShipId: $("#@Html.IdFor(model => model.AisReportSearchModel.ShipId) option:selected").val(),
SearchDestination: $('#@Html.IdFor(model => model.AisReportSearchModel.SearchDestination)').val(),
SearchStartDate: $('#@Html.IdFor(model => model.AisReportSearchModel.SearchStartDate)').val(),
SearchEndDate: $('#@Html.IdFor(model => model.AisReportSearchModel.SearchEndDate)').val()
};
addAntiForgeryToken(data);
return data;
}
</
script
>
Hi everyone
I'm using Angular 2 kendo grid component and want to select/unselect grid row programmatically, from the code.
Is there any solution for this issue?
Thanks
Vladan
I have a kendo grid that was working before the following upgrade
2015 Q1 (2014.3.1411) -> v2017.3.1026
Along with this, we also upgraded from angular1.2 to angular1.6
The grid has some columns like the following example. But after the upgrade the edit input does not show in the column.
If I add a breakpoint right after the appendTo I can see that the editor function actually gets fired, and the inputs is added to the DOM, but then it disapears, (I'm guessing after an angularjs digest cycle or something). If I dont add any breakpoint it happens so fast that it is impossible to notice that the input is actually added to the DOM for a millisecond only the disappear immediately.
What could have happened in the upgrade to break this... or any idea how to fix it?
Thanks
columns: [{
field: "account",
title: "accounts",
editor: function (container, options){
$('<
input
id
=
"' + options.field + '"
data-bind
=
"value:' + options.field + '"
class
=
"form-control"
' + ' />')
.appendTo(container);
}
}, ...
Hello!
I've tried to put ToolTip into TreeView node. This is my note template:
<
script
id
=
"treeview-template"
type
=
"text/kendo-ui-template"
>
<
div
style
=
"width:500px"
>
<
span
class
=
"#: item.icon #"
style
=
"width:18px"
></
span
>
<
span
>#: item.name() #</
span
>
# if (item.description() != null) { #
<
span
class
=
"ico-tooltip fa fa-info-circle"
data-toggle
=
"tooltip"
data-placement
=
"bottom"
title
=
""
data-original-title
=
"#: item.description() #"
></
span
>
# } #
<
button
type
=
"button"
class
=
"btn btn-xs"
style
=
"height:16px;margin-left:5px"
>
<
i
class
=
"fa fa-lg fa-plus-square-o"
></
i
>
</
button
>
</
div
>
</
script
>
<
i
class
=
"ico-tooltip fa fa-info-circle"
data-bind
=
"kendoTooltip: { content: item.description() }"
></
i
>
For some reason the default tooltip for the box plot chart formats the lower, q1, mean, median, q3, and upper fields as currency. I am not dealing with currency, how can I change the format of the data in the tooltip.
To view what I am talking about go to the demo page of the Box Plot Chart here: https://demos.telerik.com/kendo-ui/box-plot-charts/index
Notice that the chart is showing statistical information about temperature, but if you mouse over a box the tooltip formats the details as currency.
Hello,
I have a grid with a column that has template to displays a label based on a key ( ie: "#= getLabel(key) #"). The issue is that the sorting for this column is incorrect since the column is being sorted by the key and not the label ( which the user sees).
I implemented a custom sort for the grid but now every column clicked goes thru my custom compare function. I put this at the column item level in the columns array in the configuration.
Is it possible to have a custom compare for 1 column but not all ( ie: alphanumeric, date columns would go to default sorting)?
If only 1 sort function is allowed, how can I tell what column is clicked in that 1 sort function?
Thanks,
Bruce Radtke
Hi,
I have a fixed set of rows in spreadsheet. Whenever a row is deleted from this spreadsheet, the next row in sequence is selected.
But when I try to delete the last row of the spreadsheet, I want the previous row in sequence to be selected.
Is there a way to set a specific row as selected post deletion?
Thanks
Kajal
I user kendo js vession 2017.1.118 when I use iPad Pro - Smart Keyboard , when I type on textbox it will show correct on word choice like pic.1,
but when I type on Editor it can't show the word choice like pic.2
Hi,
Is it possible to wrap the content (basically just a long line of text) of a notification without using templates?
Regards,
Pieter