Feb 03, 2014, 2:29 PM
Chart lineSeries renderer
Hi I would like to create a pareto chart :
I use a store with 3 fields:
I do not wish to populate it on server side, so i decided to add a renderer to the line series:
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:
thanks for your help !
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: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 !