Results 1 to 3 of 3

Thread: Adding renderer to pie chart obliterates shadow

  1. #1

    Default Answered: Adding renderer to pie chart obliterates shadow

    Our back-end reporting mechanism generates data series that often contain zero values. To prevent showing dangling slice labels in pie charts, I've implemented scottmartin's solution of defining a custom renderer, within our series generator, like so:
    Code:
    renderer: function(sprite, record, attributes, index, store) {
        // Remove labels for pie slices with zero values
        if (this.type == "pie" && record.data.value === 0) { record.data.label = ''; }
    }
    This has, however, obliterated the pie chart contours and shadow. Before and after as attachments.

    I have tried adding the shadow: true property to the chart configuration to no avail.

    How can I get these back? Using ExtJS 4.1.0
    Attached Images Attached Images
    Last edited by michaelsanford; 5 Jul 2013 at 9:17 AM. Reason: Added EXT version

  2. You'll need to return the attributes object from the renderer.

    Code:
    renderer: function (sprite, record, attributes, index, store) {
        if (record.data.data === 0) {
            record.data.name = '';
        }
        return attributes;
    }

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

    Default

    You'll need to return the attributes object from the renderer.

    Code:
    renderer: function (sprite, record, attributes, index, store) {
        if (record.data.data === 0) {
            record.data.name = '';
        }
        return attributes;
    }

  4. #3
    Sencha Premium User
    Join Date
    Jun 2011
    Location
    Seattle, WA
    Posts
    33

    Default

    Quote Originally Posted by slemmon View Post
    You'll need to return the attributes object from the renderer.

    Code:
    renderer: function (sprite, record, attributes, index, store) {
        if (record.data.data === 0) {
            record.data.name = '';
        }
        return attributes;
    }
    Lifesaver!

Tags for this Thread

Posting Permissions

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