View Full Version : [FIXED] Bug at creating a chart

17 Jan 2012, 12:26 AM
I am unable to create a chart as when I create the series it is thrown the following stack trace: Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(Unknown Source)
at com.sencha.gxt.chart.client.chart.series.Series.getValueProviderName(Series.java:610)
at com.sencha.gxt.chart.client.chart.series.ScatterSeries.setYField(ScatterSeries.java:312)
at com.oghmasys.nomad.gui.client.gird.CrudGridFactory.createChart(CrudGridFactory.java:75)

Where the line 75 of CrudGridFactory is:
series.setYField(new CrudDataValueProvider<CrudRowModel, Number>(

According to the code of Series.getValueProviderName:
protected String getValueProviderName(ValueProvider<M, ? extends Number> provider) {
String name = provider.getClass().getName();
int start = name.indexOf('_') + 1;
name = name.substring(start, name.indexOf('_', start));
return name;

It seems you are trying to parse the value provider name that should have a certain naming pattern.

17 Jan 2012, 11:23 AM
This has been fixed for the next release. Now if the field has no path the legend names will default to "Field #" or "Series #".