Announcement

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

    Column Chart with proportionally incorrect column sections

    SmartClient Version: v9.1p_2014-08-19/Pro Deployment (built 2014-08-19)
    FF 24.7.0

    I have created a sample that demonstrates the problem below.

    The A.1 portion of the A column has a value (count) of 6, and that value is properly displayed on the axis, however, the axis is not starting at 0 (not sure why), therefore, the chart misrepresents the actual proportions, making the A.2 portion of the A column with a value (count) of 1 look like it is a larger portion, which it is not.

    What I would like to see is that the axis values begin at 0, which would hopefully address the proportion issue too.

    Thanks

    Code:
    import com.smartgwt.client.data.Record;
    import com.smartgwt.client.data.RecordList;
    import com.smartgwt.client.widgets.Window;
    import com.smartgwt.client.widgets.chart.FacetChart;
    import com.smartgwt.client.widgets.cube.Facet;
    
    public class ColumnChartProblem extends FacetChart {
    
        public ColumnChartProblem() {
            init();
        }
    
        private void init() {
    
            setWidth100();
            setHeight100();
            setMargin(10);
            setShowTitle(Boolean.FALSE);
            setValueProperty("count");
    
            setShowDataAxisLabel(Boolean.TRUE);
            Facet[] facets = new Facet[] { new Facet("f1", "F1"), new Facet("f2", "F2") };
            setFacets(facets);
            RecordList recordList = new RecordList();
            Record r = new Record();
            r.setAttribute("f1", "A");
            r.setAttribute("f2", "A.1");
            r.setAttribute("count", 6);
            recordList.add(r);
            r = new Record();
            r.setAttribute("f1", "A");
            r.setAttribute("f2", "A.2");
            r.setAttribute("count", 1);
            recordList.add(r);
            setData(recordList);
            Window window = new Window();
            window.setWidth("50%");
            window.setHeight("50%");
            window.addItem(this);
            window.show();
        }
    }
    Attached Files

    #2
    I was able to address the issue by forcing the start value using setAxisStartValue(0.0d).
    Last edited by stonebranch2; 25 Aug 2014, 08:33.

    Comment

    Working...
    X