Results 1 to 10 of 10

Thread: Ext Chart Axis: displaying small float numbers

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    Mar 2010
    Posts
    5

    Default Ext Chart Axis: displaying small float numbers

    Hi all,

    I'm working on "column chart" and having problem with displaying small float number data:

    - The data is float and always smaller than 1 (usually 0.0x or 0.00x)

    Example store data:
    Code:
    "data": [
            {
                "date": "29/04/2013",
                "data": 0.0295
            },
            {
                "date": "30/04/2013",
                "data": 0.0113
            },
            {
                "date": "01/05/2013",
                "data": 0.0373
            },
            {
                "date": "02/05/2013",
                "data": 0.0293
            },
            {
                "date": "03/05/2013",
                "data": 0.0308
            },
            {
                "data": "04/05/2013",
                "ctr": 0.0285
            },
            {
                "date": "05/05/2013",
                "data": 0.0316
            },
            {
                "date": "06/05/2013",
                "data": 0.0218
            }
        ]
    And the result is: small_number.png

    As you see the data is always at the bottom of the chart so that we just can't see the changes of each day.

    Any suggestion?

    Thanks

    *EDIT BY SLEMMON
    Issue observed in 4.1.1, 4.1.3, 4.2, and 4.2.1.883 with the below inline test case (manually setting the minimum to 0 and maximum to .014 shows the desired rendered effect)

    Code:
    var chartDataStore = Ext.create("Ext.data.Store", {
        storeId: "chartData",
        fields: ['data', 'date'],
        data: [{
                data: 0.0031,
                date: '2013-01-02'
            }, {
                data: 0.0022,
                date: '2013-01-03'
            }, {
                data: 0.0015,
                date: '2013-01-04'
            }, {
                data: 0.0054,
                date: '2013-01-05'
            }, {
                data: 0.0032,
                date: '2013-01-06'
            }, {
                data: 0.0133,
                date: '2013-01-07'
            },
        ]
    
    
    });
    
    
    var win = Ext.create("Ext.chart.Chart", {
        width: 600,
        height: 400,
        renderTo: document.body,
        layout: "fit",
        animate: true,
        store: chartDataStore,
        axes: [{
                type: "Numeric",
                position: "left",
                fields: ["data"],
                title: "Value"
            }, {
                type: "Category",
                position: "bottom",
                fields: ["date"],
                title: "Date"
            }
        ],
        series: [{
                type: "line",
                axis: "left",
                xField: "date",
                yField: "data"       
            }
        ]
    });
    Last edited by slemmon; 21 May 2013 at 3:05 PM. Reason: Additional test notes

  2. #2
    Sencha User
    Join Date
    Mar 2010
    Posts
    5

    Default

    anyone?

  3. #3
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165

    Default

    Are you setting a maximum on your left-numeric axis by chance?

  4. #4
    Sencha User
    Join Date
    Mar 2010
    Posts
    5

    Default

    Quote Originally Posted by slemmon View Post
    Are you setting a maximum on your left-numeric axis by chance?
    No, I'm not. But even when I set the property "maximum" to 1, nothing changes.

    The configuration for the left axis is just simple like this:
    Code:
     
    {
        title: 'Data',
        type: 'Numeric',
        position: 'left',
        fields: ['data']
    }

  5. #5
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165

    Default

    Any chance you can post a code snippet showing your chart/axis/series that uses your data snippet?

  6. #6
    Sencha User
    Join Date
    Mar 2010
    Posts
    5

    Default

    Quote Originally Posted by slemmon View Post
    Any chance you can post a code snippet showing your chart/axis/series that uses your data snippet?
    Here is a simple example I made with jsfiddle http://jsfiddle.net/JPEEv/75/
    which represents my problem.

    You can help me by fixing the code and give your URL

    Thanks in advance!

  7. #7
    Sencha User
    Join Date
    Mar 2010
    Posts
    5

    Default

    Up

  8. #8
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165

    Default

    I'm moving this over to the bugs forum to have the devs take a look. In the meantime can you set your minimum and maximum on the axis manually by chance?

    Code:
    minimum: 0,
    maximum: 0. 14

  9. #9
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

  10. #10
    Sencha User
    Join Date
    Aug 2017
    Posts
    1

    Default

    Quote Originally Posted by slemmon View Post
    Thanks for the report! I have opened a bug in our bug tracker.
    I realize it's an old issue but we are still using ExtJS 4 and I just ran into the same problem. Was this ever fixed? If yes, which version?

    Thanks,
    Andy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •