1. #1
    Ext Premium Member
    Join Date
    Feb 2010
    Posts
    40
    Vote Rating
    0
    Francois Lecroart is on a distinguished road

      0  

    Question how work renderer with Ext.chart.series.Bar and stacked = true

    how work renderer with Ext.chart.series.Bar and stacked = true


    I try to customize color of background in a chart bar with stacked option to true.
    But i don't understand how work.
    i take "StackedBar" exemple and add a
    Code:
    renderer: function () {
      console.log(arguments);
      return arguments[2];
    }
    but i don't understand what is index (arguments[3]) or why some time they are no record

    resulte of firebug:

    [Object { id="ext-sprite-1066", transformations=, more...}, Object { phantom=true, internalId="ext-record-61", more...}, Object { stroke-width=6, stroke-opacity=0.05, more...}, 0, Object { data={...}, events={...}, more...}]

    [Object { id="ext-sprite-1067", transformations=, more...}, Object { phantom=true, internalId="ext-record-61", more...}, Object { stroke-width=4, stroke-opacity=0.1, more...}, 0, Object { data={...}, events={...}, more...}]

    [Object { id="ext-sprite-1068", transformations=, more...}, Object { phantom=true, internalId="ext-record-61", more...}, Object { stroke-width=2, stroke-opacity=0.15, more...}, 0, Object { data={...}, events={...}, more...}]

    [Object { id="ext-sprite-1069", transformations=, more...}, Object { phantom=true, internalId="ext-record-61", more...}, Object { fill="#94ae0a", height=48, more...}, 0, Object { data={...}, events={...}, more...}]

    [Object { id="ext-sprite-1071", transformations=, more...}, Object { phantom=true, internalId="ext-record-62", more...}, Object { fill="#115fa6", height=48, more...}, 1, Object { data={...}, events={...}, more...}]

    [Object { id="ext-sprite-1073", transformations=, more...}, Object { phantom=true, internalId="ext-record-63", more...}, Object { fill="#a61120", height=48, more...}, 2, Object { data={...}, events={...}, more...}]

    [Object { id="ext-sprite-1075", transformations=, more...}, Object { phantom=true, internalId="ext-record-64", more...}, Object { fill="#ff8809", height=48, more...}, 3, Object { data={...}, events={...}, more...}]

    [Object { id="ext-sprite-1077", transformations=, more...}, Object { phantom=true, internalId="ext-record-62", more...}, Object { stroke-width=6, stroke-opacity=0.05, more...}, 4, Object { data={...}, events={...}, more...}]

    [Object { id="ext-sprite-1078", transformations=, more...}, Object { phantom=true, internalId="ext-record-62", more...}, Object { stroke-width=4, stroke-opacity=0.1, more...}, 4, Object { data={...}, events={...}, more...}]

    [Object { id="ext-sprite-1079", transformations=, more...}, Object { phantom=true, internalId="ext-record-62", more...}, Object { stroke-width=2, stroke-opacity=0.15, more...}, 4, Object { data={...}, events={...}, more...}]

    [Object { id="ext-sprite-1080", transformations=, more...}, undefined, Object { fill="#94ae0a", height=48, more...}, 4, Object { data={...}, events={...}, more...}]

    [Object { id="ext-sprite-1082", transformations=, more...}, undefined, Object { fill="#115fa6", height=48, more...}, 5, Object { data={...}, events={...}, more...}]

    ...
    Last edited by Francois Lecroart; 9 Mar 2011 at 2:49 AM. Reason: not store but record. add some firebug result

  2. #2
    Sencha Premium Member
    Join Date
    Apr 2012
    Posts
    7
    Vote Rating
    0
    texasbrian is on a distinguished road

      0  

    Default Why is record sometimes empty in renderer??

    Why is record sometimes empty in renderer??


    Using stacked bar as well...
    I was trying to set the height of the bar based on the record.
    Let's say I have 40 records. In the renderer, it seems that the first 40 index, the bar heights are properly set, then the renderer continues to execute 200 times in all, with the last 160 executions (index 40-200) having the record empty.

    What is happening?

  3. #3
    Sencha Premium Member
    Join Date
    Apr 2012
    Posts
    7
    Vote Rating
    0
    texasbrian is on a distinguished road

      0  

    Default Changing hieght of bar based on renderer

    Changing hieght of bar based on renderer


    So, I want to change to height of bars based on data, currently using approach below which seems to loop too many times and results are not desired. Should I be using different approach to accomplish this?

    In bar series...

    renderer: function(sprite, record, barAttr, index, store) {
    //barAttr.height = 6;
    // TODO Sets correctly, then is overwritten
    //Why is the renderer called so many times with a null record?
    if (record) {
    if (record.get('normal') == 0) {
    barAttr.height = 6;
    } else {
    barAttr.height = 2;
    }
    }

    return barAttr;
    }

  4. #4
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    975
    Vote Rating
    110
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      0  
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter

Similar Threads

  1. [Chart] How do I build a dynamic series in Ext.Chart ?
    By soulgen in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 27 Oct 2010, 12:44 AM
  2. chart! the series of chart refresh
    By yanasdf789 in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 13 Jul 2010, 8:29 PM
  3. chart!! the skin of series in chart can't be visible!!!!!
    By yanasdf789 in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 11 Jul 2010, 8:58 AM
  4. Stacked bar chart layout
    By Jba in forum Ext GWT: Discussion
    Replies: 0
    Last Post: 26 May 2010, 2:12 AM
  5. ChartListener for Stacked bar chart
    By kamisama in forum Ext GWT: Discussion
    Replies: 7
    Last Post: 4 Feb 2010, 12:39 PM

Thread Participants: 2