Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

FacetChart X-Axis formatter does not work

$
0
0
The ValueFormatter for X axis does not work in FacetChart (smartgwt pro 4.0p).

The code is:
Code:

        final Record r1 = new Record();
        r1.setAttribute("label", "A");
        r1.setAttribute("count", "2");

        final Record r2 = new Record();
        r2.setAttribute("label", "B");
        r2.setAttribute("count", "5");

        final Facet facet = new Facet("label", "X-labels..");

        final FacetChart chart = new FacetChart();
        chart.setFacets(facet);
        chart.setValueProperty("count");
        chart.setValueTitle("Y-labels..");
        chart.setData(new Record[]{r1 ,r2});
       
        chart.setXAxisValueFormatter(new ValueFormatter() {
            public String format(Object value) {
                return "X";
            }
        });

        chart.setYAxisValueFormatter(new ValueFormatter() {
            public String format(Object value) {
                return "Y";
            }
        });

As a result all the gradation labels on the y-axis show "Y", but the y-axis ones are "A" and "B".

Viewing all articles
Browse latest Browse all 4756