Announcement

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

    Chart Legend Clipping

    Hi Isomorphic,

    We have a problem with some legend data being clipped under certain data sets.

    We have a chart within a window, however, the same problem exists with a chart stand-alone, as shown below in the screenshots.

    Thanks


    Click image for larger version

Name:	chartclipping.png
Views:	111
Size:	29.7 KB
ID:	264075
    Click image for larger version

Name:	chartclipping2.png
Views:	66
Size:	27.9 KB
ID:	264076

    SimpleChartData
    Code:
    public class SimpleChartData extends Record {
    
        public SimpleChartData(String sysUpdatedOn, Integer count) {
            setAttribute("updatedOn", sysUpdatedOn);
            setAttribute("count", count);
        }
    
        public static SimpleChartData[] getData() {
            SimpleChartData[] data = new SimpleChartData[24];
            for (int i = 0; i < data.length; i++) {
                data[i] = new SimpleChartData("2020-11-12 13:00:00.00" + i + " -0500 (1)", 1);
            }
            return data;
        }
    }
    Sandbox9
    Code:
    public class Sandbox9 implements EntryPoint {
    
        @Override
        public void onModuleLoad() {
            Window window = new Window();
            window.setWidth("50%");
            window.setHeight("50%");
            FacetChart chart = getChart();
            window.setTitle("Sandbox9");
            window.addItem(chart);
            window.draw();
        };
    
        private FacetChart getChart() {
            FacetChart chart = new FacetChart();
            chart.setData(SimpleChartData.getData());
            chart.setFacets(new Facet("updatedOn", ""));
            chart.setValueProperty("count");
            chart.setChartType(ChartType.PIE);
            chart.setShowTitle(Boolean.FALSE);
            return chart;
        }
    }

    #2
    The problem may not be the chart but rather its context. First step is to look at whether the chart is being clipped - first step is to use the Watch Tab to see if it's extents are outside of its container (vs clipping somehow occurring within the chart).

    Is case we need to try to reproduce this: what skin is this? Can you reproduce it with a stock skin with no customizations at all (settings or CSS)?

    Comment


      #3
      The simple code I provided produces it with Tahoe, without any customizations.

      Comment


        #4
        Really? OK. And we forgot to remind you: we need the product and version you're using.

        Comment


          #5
          My sandbox environment, where I created a standalone test, has an earlier release of SmartClient Version: v12.0p_2019-08-18/Pro Deployment (built 2019-08-18).

          However, in my current development environment, where I first noticed it, I am running SmartClient Version: v12.1p_2020-09-29/Pro Deployment (built 2020-09-29).

          Not exactly sure what you want to see from the Watch Tab, but here is a screenshot for reference.

          Thank you

          Click image for larger version

Name:	watchtab.png
Views:	79
Size:	34.7 KB
ID:	264083

          Comment


            #6
            We don't need the Watch Tab part anymore, but to clarify, you can see that the bottom edge of the outline of the chart cuts off the legend. If instead the chart was in some kind of container, and the bottom edge of the outline extended past where the legend was clipped off, that would mean that the legend was being cut off by whatever contained the chart, not by the chart itself.

            That's what we wanted you to check out, but again, no longer needed with these other details.

            Comment


              #7
              Thanks

              Comment


                #8
                There was indeed an issue with how the legend is calculated, and it's now fixed.

                Note that with a legend of this size, you will need to allocate more space for the chart as a whole, otherwise, the pie portion is going to be just a couple of pixels across.

                Comment


                  #9
                  Thank you, will apply new build as soon as we can to verify.

                  Comment

                  Working...
                  X