1. #1
    Sencha User
    Join Date
    Oct 2012
    Location
    Russia, Smolensk
    Posts
    11
    Vote Rating
    0
    rfrate is on a distinguished road

      0  

    Default Answered: How to display on the axis decimal values

    Answered: How to display on the axis decimal values


    How can I display decimal values ​​on the axis? screenshot below Code by which built the y axis:
    rfrate.jpg
    Code:
    axis.setPosition(Position.LEFT);        
            axis.addField(props.y());           
            title.setFontSize(24);          
            title.setFill(RGB.ORANGE);
            axis.setTitleConfig(title);        
            axis.setDisplayGrid(false);
            PathSprite orange = new PathSprite();
            orange.setStroke(RGB.ORANGE);
            axis.setAxisConfig(orange);
            TextSprite whiteText = new TextSprite();
            whiteText.setFill(RGB.ORANGE);
            whiteText.setTextBaseline(TextBaseline.MIDDLE);
            axis.setLabelConfig(whiteText);         
    
    
            if (rangeChart != null){
                axis.setMinimum(rangeChart.minValue * 0.99);
                axis.setMaximum(rangeChart.maxValue * 1.01);                
            } else {
                axis.setMinimum(10);
                axis.setMaximum(70);                
            }
            chart.addAxis(axis);

  2. You don't seem to have the whole axis listed (constructor? other setup?) but in case you aren't trying this elsewhere: You can add a LabelProvider<Number> to the NumericAxis<MyObject>, and specify exactly how you want those numbers to be rendered. The default (See the NumericAxis constructor) is to use a RoundNumberProvider, which rounds to the nearest whole number.

  3. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,734
    Answers
    109
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      1  

    Default


    You don't seem to have the whole axis listed (constructor? other setup?) but in case you aren't trying this elsewhere: You can add a LabelProvider<Number> to the NumericAxis<MyObject>, and specify exactly how you want those numbers to be rendered. The default (See the NumericAxis constructor) is to use a RoundNumberProvider, which rounds to the nearest whole number.

  4. #3
    Sencha User
    Join Date
    Jul 2011
    Posts
    133
    Answers
    3
    Vote Rating
    12
    Andreas Samjeske will become famous soon enough

      0  

    Default NumericAxis automatic scaling with deactivated lines

    NumericAxis automatic scaling with deactivated lines


    I have a Chart with a NumericAxis, where neither minimum nor maximum is set. When I deactivate some lines via legend, I expect the scale of the Axis to change, according to the remaining values shown. But it doesn't.

    I've been looking for help in demo section. But all linecharts have fixed scaling from 0 to 100 like this:
    http://www.sencha.com/examples/#ExamplePlace:linechart

    AreaCharts show the desired behavior. Deactivating lines changes the scale:
    http://www.sencha.com/examples/#ExamplePlace:areachart

    Who to achieve this for linechart?

  5. #4
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,734
    Answers
    109
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    Andreas, is this related to the current post? I don't see how. If not, you really should be starting another thread.

    The LineSeries does not control the scaling on the axis - the NumericAxis, and the data in that axis controls this. If your axis isn't informed of what fields (i.e. ValueProvider instances) are being used in the various Series, it can't adjust its values. This makes sense, since it is possible to have a Y-axis on both the left and right of the chart - each series only makes sense to tie to a single one.

    Can you share a runnable sample that shows how you are wiring these up, but that it still isn't working?