I am setting up a page with a column chart and below is the constructor. I want to format the datalabels so they show what is on the xaxis. As soon as I add the bolded piece of code below I get a javascript error saying type undefined if I remove the chunk everything works fine I just get the wrong datalabels. I copied this chunk of code pretty much exactly from the DataLabelsFormatter class javadocs. Any ideas?:
final DynamicForm controlForm = new DynamicForm();
controlForm.setWidth(450);
controlForm.setIsGroup(true);
ComboBoxItem accountCombo = new ComboBoxItem();
accountCombo.setTitle("Account");
accountCombo.setType("comboBox");
accountCombo.setValueMap("1");
DateItem fromDate = new DateItem();
fromDate.setTitle("From");
fromDate.setUseTextField(true);
DateItem toDate = new DateItem();
toDate.setTitle("To");
toDate.setUseTextField(true);
controlForm.setItems(accountCombo, fromDate, toDate);
chart = new Chart().setType(Type.COLUMN);
chart.getYAxis().setAxisTitleText("% Contribution");
I just tried the following code, and didn't run into any issues. Some of the callback handler code was adjusted in the 1.1.1 release, so it may be that it was fixed there.
Chart chart = new Chart().setType(Series.Type.COLUMN);
chart.setSeriesPlotOptions(new SeriesPlotOptions()
.setDataLabels(new DataLabels()
.setEnabled(true)
.setFormatter(new DataLabelsFormatter() {
public String format(DataLabelsData dataLabelsData) {
return "A";
}
})
)
);
Series series = chart.createSeries()
.setPoints(new Number[]{163, 203, 276, 408, 547, 729, 628});
chart.addSeries(series);
Can you try upgrading to version 1.1.1 and let us know if that clears the issue you're seeing or not?
I am setting up a page with a column chart and below is the constructor. I want to format the datalabels so they show what is on the xaxis. As soon as I add the bolded piece of code below I get a javascript error saying type undefined if I remove the chunk everything works fine I just get the wrong datalabels. I copied this chunk of code pretty much exactly from the DataLabelsFormatter class javadocs. Any ideas?:
chart.setSeriesPlotOptions(new SeriesPlotOptions().setDataLabels(new DataLabels().setFormatter(new DataLabelsFormatter()
{
public String format(DataLabelsData dataLabelsData)
{
return "A";
}
})));
I just tried the following code, and didn't run into any issues. Some of the callback handler code was adjusted in the 1.1.1 release, so it may be that it was fixed there.
Can you try upgrading to version 1.1.1 and let us know if that clears the issue you're seeing or not?
https://sourceforge.net/projects/gwt-highcharts/files/1.1.1/