Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    May 2011
    Posts
    1
    Vote Rating
    0
    anant_bobde is on a distinguished road

      0  

    Default ExtJS 4 Pie chart display with 0 Value

    ExtJS 4 Pie chart display with 0 Value


    Hi,

    Just trying a Pie chart in ExtJS and got to know this. Why Pie chart will have a small line for 0 values. Please find the code below for more details.

    Can somebody help out for this.

    Thanks

    Code:

    <html><head>
    test

    <script type="text/javascript" src="/extjs4/bootstrap.js"></script>

    <script type="text/javascript" src="/extjs4/src/core/src/env/FeatureDetector.js"></script>
    <script type="text/javascript">
    Ext.onReady(function(){
    var store = Ext.create('Ext.data.JsonStore', {
    fields: ['name', 'data1', 'data2', 'data3', 'data4', 'data5'],
    data: [{
    'name': 'January',
    'data1': 0
    }, {
    'name': 'February',
    'data1': 0
    }, {
    'name': 'March',
    'data1': 0
    }, {
    'name': 'April',
    'data1': 0
    }, {
    'name': 'May',
    'data1': 20
    }]
    });

    Ext.create('Ext.chart.Chart', {
    renderTo: Ext.getBody(),
    width: 800,
    height: 600,
    animate: true,
    store: store,
    theme: 'Category1',
    legend: { // Pie Chart Legend Position
    position: 'right'
    },
    series: [{
    type: 'pie',
    field: 'data1',
    showInLegend: true,
    tips: {
    trackMouse: true,
    width: 140,
    height: 28
    },
    highlight: {
    segment: {
    margin: 5
    }
    }


    }],


    });

    });

    </script>
    </head>
    <body></body>
    </html>

  2. #2
    Sencha User
    Join Date
    Jul 2011
    Posts
    6
    Vote Rating
    0
    koolchallenger is on a distinguished road

      0  

    Default Pie Chart Labels are even shown on 0 values

    Pie Chart Labels are even shown on 0 values


    I am facing a similar problem. Labels on Pie Chart appear even if there is 0 value for it.
    Any sort of help would be appreciated

  3. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    4
    Vote Rating
    0
    Agupta is on a distinguished road

      0  

    Default Did you get a response for this issue ?

    Did you get a response for this issue ?


    The labels still get rendered and overlap even though the chart is not rendered for an empty dataset.
    Is there a way to hide labels for an empty data set or a data set with some zero values ?

  4. #4
    Sencha User
    Join Date
    Jul 2011
    Posts
    6
    Vote Rating
    0
    koolchallenger is on a distinguished road

      0  

    Default


    Chart Layout is fine as far as labels remain same. The ONLY solution I found if labels change is chart.redraw()

  5. #5
    Sencha User
    Join Date
    Oct 2011
    Posts
    12
    Vote Rating
    0
    Brett89 is on a distinguished road

      0  

    Default My solution

    My solution


    Code:
    ...
    label: {
        display: 'middle',
        field: 'myValue',
        renderer: function (val) {
            return val > 0 ? val : '';
        }
    }
    ...

  6. #6
    Sencha User
    Join Date
    Nov 2012
    Location
    Noida
    Posts
    7
    Vote Rating
    0
    srinivasan1987 is on a distinguished road

      0  

    Default


    Hi Brett,

    Above mentioned code not help to hide zero value labels. can u tell me some other way to hide those labels(which are all having zero count) in pie chart.i attached the chart also.


  7. #7
    Sencha User
    Join Date
    Aug 2012
    Posts
    1
    Vote Rating
    0
    MasterOfMaltAlex is on a distinguished road

      0  

    Default


    It's relatively simple actually at least my implementation of it.

    What you want to do in the label renderer is to check if the value the pie chart is based on is greater than zero and if it is then show the label.

    I have the store defined as a variable in my code so I could reference is simply but otherwise you could use the Ext.getStore() method.

    Code:
    renderer: function(value) {
        var m = pieStore.findRecord('name', value);
        return m.get('val') > 0 ? value : '';
    }

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar