Chart lineSeries renderer

  1. #1

    Chart lineSeries renderer

    Hi I would like to create a pareto chart :
    I use a store with 3 fields:

     private static Store BuildStore(this BiziPharmaDAL.TableauPareto TP)
            {
                Store store = new Store
                {
                    ID = "tsgPare" + idcounter,
                    Model = 
                { 
                    new Model 
                    {
                        Fields = 
                        {
                            new ModelField("libelle", ModelFieldType.String),
                            new ModelField("cumul", ModelFieldType.Int),
                            new ModelField("qte", ModelFieldType.Int),
                   
                        }
                    }
                }
                };
    
                store.DataSource = TP.lignes;
    
                return store;
            }
    "cumul" field is the running total.
    I do not wish to populate it on server side, so i decided to add a renderer to the line series:

    ColumnSeries colqte = new ColumnSeries();
    colqte.XField = new string[] { "libelle" };
    colqte.YField = new string[] { "qte" };
    LineSeries colcum = new LineSeries();
    colcum.XField = new string[] { "libelle" };
    colcum.YField = new string[] { "cumul" };
    colcum.Renderer.Handler = @"record.data.cumul= (index > 0 ? (store.getAt(index - 1).data.cumul) : 0) + record.data.qte; return record.data.cumul;";
    it does not render as i expect it to:
    Click image for larger version. 

Name:	Capture.PNG 
Views:	10 
Size:	48.4 KB 
ID:	7554

    as well, firebug tells me "TypeError: record.data is undefined"

    I tried replacing record.data.qte by store.getAt(index).data.qte : this time firebug tells me storeGetAt is undefined, and so on...

    can you please tell me what i am doing wrong ?

    As well, i use the same store to build a gridpanel (see on scrennshot) : in this panl, column "cumul" is also renderered:

     Renderer= { Handler=@" record.data.cumul= (rowIndex > 0 ? (store.getAt(rowIndex - 1).data.cumul) : 0) + record.data['qte']; return record.data.cumul;"}
    and this works...

    thanks for your help !
  2. #2
    Can you provide runable sample?
    It seems renderer works fine in the following sample
    http://examples2.ext.net/#/Chart/Bar/Renderer/

    Please note that it is required to return attributes (not value)
    Vladimir Shcheglov
    Sr. Developer
  3. #3
    Hi, thanks for your answer, i did not understand it was required to return attributes, i thought it could return values too.
    Is there any way i can set the values of a series on the fly, or must i populate the store ?
    as well, we also could imagine "stacked" values for line series : it would do the same, but appearently, it is not possbile.
    thanks

Similar Threads

  1. [CLOSED] Format Line chart Tips Renderer
    By PriceRightHTML5team in forum 2.x Premium Help
    Replies: 4
    Last Post: Sep 24, 2013, 5:48 AM
  2. [CLOSED] Renderer on Tips of Series of Chart in code behind
    By reinout.mechant@imprss.be in forum 2.x Premium Help
    Replies: 5
    Last Post: Jun 21, 2013, 4:29 PM
  3. [CLOSED] [#13] labels LineSeries aren't shown into the chart
    By tactime10 in forum 2.x Premium Help
    Replies: 19
    Last Post: May 30, 2013, 5:58 AM
  4. Replies: 14
    Last Post: Sep 27, 2012, 1:57 PM
  5. [CLOSED] How can increase the size line of the lineSeries
    By tactime10 in forum 2.x Premium Help
    Replies: 3
    Last Post: Sep 21, 2012, 2:59 PM

Posting Permissions