This is a migrated thread and some comments may be shown as answers.

Kendo chart does not handle very small values

6 Answers 165 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Dennis
Top achievements
Rank 1
Dennis asked on 05 Nov 2013, 08:50 AM
see fiddle http://jsfiddle.net/A2URt/

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

Sort by
0
Hristo Germanov
Telerik team
answered on 05 Nov 2013, 09:03 AM
Hello Dannis,

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
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Dennis
Top achievements
Rank 1
answered on 05 Nov 2013, 12:01 PM
hi christo, i had included a jsfiddle, if this is not a correct way, please make clear what you'd expect of a sample.

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
0
Hristo Germanov
Telerik team
answered on 05 Nov 2013, 12:44 PM
Hello 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
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Dennis
Top achievements
Rank 1
answered on 05 Nov 2013, 01:05 PM
Hi Christo, I'm terribly sorry about including the wrong fiddle

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();
 
0
Hristo Germanov
Telerik team
answered on 06 Nov 2013, 09:32 AM
Hi Dennis,

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.

Regards,
Hristo Germanov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
JamesD
Top achievements
Rank 1
answered on 09 Jan 2014, 02:48 PM
Here you go:
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
Tags
Charts
Asked by
Dennis
Top achievements
Rank 1
Answers by
Hristo Germanov
Telerik team
Dennis
Top achievements
Rank 1
JamesD
Top achievements
Rank 1
Share this question
or