Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Bar Chart Label Clipping

    Hi Isomorphic,

    We upgraded from SmartClient Version: v12.1p_2020-09-29/Pro Deployment (built 2020-09-29) to SmartClient Version: v12.1p_2021-10-30/Pro Deployment (built 2021-10-30) and are now experiencing clipping on chart labels.

    We were able to reproduce the behaviour in sample code.

    It seems to be related to chart.setShowDataAxisLabel(Boolean.FALSE);. If set to Boolean.TRUE, there is no label clipping.

    Thanks

    Code:
    package com.sandbox.client;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.sandbox.client.data.SimpleChartData21;
    import com.smartgwt.client.types.ChartType;
    import com.smartgwt.client.widgets.Window;
    import com.smartgwt.client.widgets.chart.FacetChart;
    import com.smartgwt.client.widgets.cube.Facet;
    
    public class Sandbox21 implements EntryPoint {
    
        @Override
        public void onModuleLoad() {
            FacetChart chart = new FacetChart();
            chart.setData(SimpleChartData21.getData());
            chart.setFacets(new Facet("status", "Status"));
            chart.setValueProperty("count");
            chart.setChartType(ChartType.BAR);
            chart.setHeight100();
            chart.setWidth100();
            chart.setShowDataAxisLabel(Boolean.FALSE);
            chart.setShowTitle(Boolean.FALSE);
    
            Window window = new Window();
            window.setTitle("Statuses");
            window.addItem(chart);
            window.setHeight("50%");
            window.setWidth("50%");
            window.show();
        }
    }
    Code:
    package com.sandbox.client.data;
    
    import com.smartgwt.client.data.Record;
    
    public class SimpleChartData21 extends Record {
    
        public SimpleChartData21(String status, Integer count) {
            setAttribute("status", status);
            setAttribute("count", count);
        }
    
        public static SimpleChartData21[] getData() {
            return new SimpleChartData21[] { new SimpleChartData21("Queued", 37), new SimpleChartData21("In Doubt", 29),
                    new SimpleChartData21("Running/Problems", 80), new SimpleChartData21("Running", 87) };
        }
    }
    Click image for larger version

Name:	clipped.png
Views:	137
Size:	15.6 KB
ID:	266851
    Click image for larger version

Name:	label_no_clipping.png
Views:	110
Size:	18.1 KB
ID:	266852

    #2
    This one was fixed 11/11. Our apologies that you hit a window where this regression was visible (it was fallout from a bugfix).

    Comment


      #3
      Thank you

      Comment

      Working...
      X