Hi to all, i'm sorry for my poor english!
I need to add new series at runtime into a LineChart, but i can not
make chart refresh.
I understand by example that the series are the "column" of a store,
but I would like to use new record that i create runtime. I use a
editablegrid and dynamic add of records works. Can you help me? The
following is my code:
private void refresh(String title){
FieldDef[] temp=new FieldDef[field.length+1];
int i=0;
for (;i<field.length;i++) temp[i]=field[i];
temp[i]=new FloatFieldDef(title);
field=temp;
recordChart=new RecordDef(field);
//*******************STORE*********************//
storeChart.removeAll();
storeChart.setRecordDef(recordChart);
for (int r=0;r<data.length;r++){
Object[] array=new Object[field.length];
int q=0;
for (;q<data[r].length;q++) array[q]=data[r][q];
array[q]=value[r];
storeChart.add(recordChart.createRecord(array));
data[r]=array;
}
//*********************************************//
seriesDef=new SeriesDefY[field.length];
for (int k=0;k<field.length;k++) {
seriesDef[k]=new
SeriesDefY(field[k].getName(),field[k].getName());
System.out.println(seriesDef[k].getDisplayName());
}
chart.setSeries(seriesDef);
chart.refresh();
}
I use Store (whit recordDef) and SimpleStore, but i can not make
refresh. Store, recordDef and series are correctly update.
The optimal solution would be create a new series using a new record
of my editablegrid.
Please, help me. Thanks to all for your help!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"GWT-Ext Developer Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/gwt-ext?hl=en
-~----------~----~----~----~------~----~------~--~---