Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,664
    Vote Rating
    7
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default [CLOSED-EXTJSIV-1765][4.0.0] Barchart with numeric axis still renders wrong

    [CLOSED-EXTJSIV-1765][4.0.0] Barchart with numeric axis still renders wrong


    see yourself:

    PHP Code:
    Ext.onReady(function() {
        var 
    myData =
                [
                    [
    'Users_1','4'],
                    [
    'Users_2','1'],
                    [
    'Users_3','3']
                ];

        var 
    store = new Ext.data.ArrayStore({
            
    fields: [
                {
    name'title'},
                {
    name'value'}
            ],
            
    datamyData
        
    });

        var 
    panel_usr Ext.create('widget.panel',
        {
            
    width580,
            
    height300,
            
    renderToExt.getBody(),
            
    title'Users',
            
    layout'fit',
            
    items:
            {
                
    id'chartCmp',
                
    xtype'chart',
                
    animatetrue,
                
    shadowtrue,
                
    storestore,
                
    axes: [
                    {
                        
    type'Numeric',
                        
    position'left',
                        
    fields: ['value'],
                        
    maximum10,
                        
    minimum0,
                        
    majorTickSteps2,
                        
    minorTickSteps1,
                        
    title'Numeric',
                        
    gridtrue,
                        
    label: {
                            
    rendererExt.util.Format.numberRenderer('0')
                        }
                    },
                    {
                        
    type'Category',
                        
    position'bottom',
                        
    fields: ['title']
                    }
                ],
                
    series:
                        [
                            {
                                
    type'column',
                                
    axis'left',
                                
    label:
                                {
                                    
    display'insideEnd',
                                    
    orientation'vertical',
                                    
    'text-anchor''middle',
                                    
    field'value'
                                
    },
                                
    xField'title',
                                
    yField'value'
                            
    }
                        ]
            }
        });
    }); 
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  2. #2
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,664
    Vote Rating
    7
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    The point is the label renderer. Using Ext.util.Format.numberRenderer('0') you get 3 instead of 3.33, so the complete chart doesn't match with the label.

    This is a dilemma, and i only see a chance in using a snap-configuration which corresponds with label renderer.

    But with this setting used in the example:
    Code:
    maximum: 10,
    minimum: 0,
    majorTickSteps: 2,
    inorTickSteps: 1,
    I would expect steps of 2 and minor on 1:
    0,2,4,6,8,10

    i see/get
    0,3.33,6.66,10
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  3. #3
    Sencha User
    Join Date
    Nov 2010
    Posts
    168
    Vote Rating
    0
    philogb is on a distinguished road

      0  

    Default


    Hi, thanks for your report.

    I don't see this as a bug, as you noticed the renderer is flooring the value. If you add a decimal to the current axis values you'll see everything displaying correctly.

    I defined majorTickSteps to be the number of major ticks between the minimum and maximum markers in the axis. This is analogous to defining the minorTickSteps as the number of ticks between two majorTicks.

    Either way this is just a convention for the configuration.

    Thanks again!

  4. #4
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,664
    Vote Rating
    7
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    Hi,

    Quote Originally Posted by philogb View Post

    I defined majorTickSteps to be the number of major ticks between the minimum and maximum markers in the axis. This is analogous to defining the minorTickSteps as the number of ticks between two majorTicks.

    Either way this is just a convention for the configuration.

    Thanks again!
    then the naming is wrong. Steps is clearly the devision, so going from 0 to 10 in steps of 2 gives 0,2,4,6,8,10
    Now it is the number of in-between lines, something different, minimum and maximum are also ticks but excluded. Hard to understand and hard to communicate imho.
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  5. #5
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,664
    Vote Rating
    7
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    I discussed it with Ed at the SourceDevCon, and both ways to define the axis make sense.

    majorTickSteps and minorTicksteps, from the naming is what we had before with majorUnit and minorUnit, and it makes totally sense for configuration if you know minimum and maximum, so you can exactly define the way the axis is devided, like:
    minimum: 0, maximum: 0, majorTickSteps: 2, minorTicksteps: 1, which would result in axis with
    0, (1), 2, (3), 4, (5), 6, (7), 8, (9), 10

    The way it behave now should be renamed to a more meaningful naming, like
    majorNumberOfTicks and minorNumberOfTicks (just a naming suggestion). This would be the preferred way if you don't know the maximum value and you want a fixed devision on axis.
    for example:
    majorNumberOfTicks:3, minorNumberOfTicks: 1
    which would result with a min value of 0 and max of 800 in
    0, (100), 200, (300), 400, (500), 600, (700), 800
    or with min of -4 and max of +4 in
    -4, (-3), -2, (-1), 0, (1) 2, (3), 4

    You see what i mean?
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  6. #6
    Sencha Premium Member
    Join Date
    Oct 2009
    Location
    Germany
    Posts
    330
    Vote Rating
    1
    PranKe01 is on a distinguished road

      0  

    Default


    Hi guys,

    I got the problem, that I don't know the maximum number at the axis. How can I config my chart, to only use the integer values, like steffen described?

    "minimum: 0, maximum: 0, majorTickSteps: 2, minorTicksteps: 1, which would result in axis with 0, (1), 2, (3), 4, (5), 6, (7), 8, (9), 10"

    Does not work for me - the chart is empty because of maximum is set to 0.

    Any hints?

Similar Threads

  1. Replies: 3
    Last Post: 18 Apr 2011, 7:20 AM
  2. [FIXED-EXTJSIV-799]New issue with Numeric/Time axis
    By James Goddard in forum Ext:Bugs
    Replies: 1
    Last Post: 8 Apr 2011, 1:52 PM
  3. Replies: 1
    Last Post: 4 Apr 2011, 1:17 PM
  4. [CLOSED EXTJSIV-146] Several issues with numeric axis
    By James Goddard in forum Ext:Bugs
    Replies: 6
    Last Post: 24 Mar 2011, 7:49 PM
  5. [OPEN-EXTJSIV-205] Numeric axis issues
    By vdan in forum Ext:Bugs
    Replies: 1
    Last Post: 20 Mar 2011, 11:21 PM

Thread Participants: 2