the kendo chart does not seem to handle very small values well. We included two examples one with very small values, the other one with a bit larger values. The edge case seems to lie in values 1.0e-7.
Can somebody help, explain etc?
Kind regards Dennis
6 Answers, 1 is accepted
Could you please give me the sample with your very small values thus I will be able to observe the problem and advice you further?
Regards,Hristo Germanov
Telerik
the fiddle contains two charts with small values the top 1 does not render correctly, the second one does.
hope this clarifies the problem
Dennis
I think that your jsFiddle isn't the correct one. Could you please give me your test page and I will be able to help you.
Regards,Hristo Germanov
Telerik
http://jsfiddle.net/eEeau/
for completeness here is the jscript:
/////////////////
var sharedDataSource = new kendo.data.DataSource({
data: [
{ id: 1, value: 1.0e-16, item: "Item1" },
{ id: 2, value: 1.0e-16, item: "Item2" },
{ id: 3, value: 11.0e-16, item: "Item3" },
{ id: 4, value: 81.0e-16, item: "Item4" },
{ id: 5, value: 1.0e-16, item: "Item5" },
{ id: 6, value: 111.0e-16, item: "Item6" }
],
schema: {
model: {
id: "id",
fields: {
id: { type: "number", editable: false },
value: { type: "number" },
item: { type: "string" }
}
}
}
});
$("#chart").kendoChart({
dataSource: sharedDataSource,
autoBind: false,
categoryAxis: {
field: "item"
},
series: [
{ field: "value", name: "Value" }
]
});sharedDataSource.read();
var sharedDataSource2 = new kendo.data.DataSource({
data: [
{ id: 1, value: 1.0e-6, item: "Item1" },
{ id: 2, value: 1.0e-6, item: "Item2" },
{ id: 3, value: 11.0e-6, item: "Item3" },
{ id: 4, value: 81.0e-6, item: "Item4" },
{ id: 5, value: 1.0e-6, item: "Item5" },
{ id: 6, value: 111.0e-6, item: "Item6" }
],
schema: {
model: {
id: "id",
fields: {
id: { type: "number", editable: false },
value: { type: "number" },
item: { type: "string" }
}
}
}
});
$("#chart2").kendoChart({
dataSource: sharedDataSource2,
autoBind: false,
categoryAxis: {
field: "item"
},
series: [
{ field: "value", name: "Value" }
]
});sharedDataSource2.read();
The problem here is that we have a restriction for the chart values(the values must be with no more then 6 digits after comma separator). This issue haven't easy fix.
I would suggest to submit your request in Kendo's UserVoice so other members of the community can evaluate, comment on and vote for it.
As a possible workaround you can use values without floating point and in the labels template you can add the precision that you want: http://jsfiddle.net/eEeau/2/
Apologies for the caused inconvenience.
Hristo Germanov
Telerik
http://feedback.kendoui.com/forums/127393-kendo-ui-feedback/suggestions/5331128-support-very-small-numbers-smaller-than-6-digits-
Dennis, please contribute your vote.
R