Announcement

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

    Scatter Chart - One data point with value > 8 digits - YAxis data (too much)

    SmartClient Version: v11.0p_2016-09-08/PowerEdition Deployment (built 2016-09-08)
    Google Chrome Version 53.0.2785.143 m

    Client recently upgraded from SmartClient V9. In that version:-
    • A scatter chart, for example sake, has one data point 10,000 (US Million Dollars)
    • YAxis data is in US Dollars (M) (11,000, 10,500 etc down to 0)
    • A button is available that changes YAxis from US Dollars (M) to Us Dollars
    • When button is clicked the chart refreshes and displays numbers on Y Axis. (11,000,000,000 10,000,000,000 etc down to 0) and point on chart with value E.G. 10,400,000,000
    After upgrade,
    • When there is a single scatter point
    • And the number is longer than 8 digits "One data point - 9 digits.png"
    • When the button is clicked to display as US Dollars
    • Then the chart refreshes but the YAxis has too many data items making the YAxis and the chart canvas unreadable
    When there is > 1 scatter data item the YAxis and data plot resolve OK. "Two data points - 11 digits and 5 digits.png"
    When there is 1 scatter data item and digits lengths < 9 then OK "One data point - 8 digits.png"

    Example
    Code:
    public class DynamicScatterChart extends FacetChart {
    
        class SimpleChartData extends Record { 
    
            public SimpleChartData() {
                
            }
              
            public SimpleChartData(int region, String product, Long sales) {  
                setAttribute("region", region);  
                setAttribute("product", product);  
                setAttribute("sales", sales);  
            }  
          
            public SimpleChartData[] getData() {  
                return new SimpleChartData[] {  
                    new SimpleChartData(1, "Cars", 11000000000L),  
                    new SimpleChartData(1, "Trucks", 50000)
                };  
            }  
          
        }  
        
        protected DynamicScatterChart() {
           
           setData(new SimpleChartData().getData());  
            setChartType(ChartType.SCATTER);  
            setTitle("Sales by Product and Region");  
    
            Facet groupingFacet = new Facet();
            groupingFacet.setValues(new FacetValue("sales"), new FacetValue("region"));
            groupingFacet.setInlinedValues(true);
            groupingFacet.setId("metric");
            
            Facet field = new Facet();
            field.setId("product");
              setFacets(groupingFacet, field);
        }
    }
    Sample from Dev log when too much YAxis data
    Code:
    09:10:00.896:MUP1[E1]:INFO:redraws:isc_Canvas_5:Immediate redraw (label measurement: 9,000,000,000)
    09:10:00.896:MUP1[E1]:INFO:drawing:isc_Canvas_5:$ra(): redrawing
    09:10:00.897:MUP1[E1]:INFO:sizing:isc_Canvas_5:Specified size: 1x1, drawn scroll size: 59x15, border: 0x0, margin: 0x0, old size: 59x15, reason: redraw
    09:10:00.898:MUP1[E1]:INFO:redraws:isc_Canvas_5:Immediate redraw (label measurement: 9,050,000,000)
    09:10:00.898:MUP1[E1]:INFO:drawing:isc_Canvas_5:$ra(): redrawing
    09:10:00.898:MUP1[E1]:INFO:sizing:isc_Canvas_5:Specified size: 1x1, drawn scroll size: 59x15, border: 0x0, margin: 0x0, old size: 59x15, reason: redraw
    09:10:00.899:MUP1[E1]:INFO:redraws:isc_Canvas_5:Immediate redraw (label measurement: 9,100,000,000)
    09:10:00.899:MUP1[E1]:INFO:drawing:isc_Canvas_5:$ra(): redrawing
    09:10:00.900:MUP1[E1]:INFO:sizing:isc_Canvas_5:Specified size: 1x1, drawn scroll size: 59x15, border: 0x0, margin: 0x0, old size: 59x15, reason: redraw
    09:10:00.901:MUP1[E1]:INFO:redraws:isc_Canvas_5:Immediate redraw (label measurement: 9,150,000,000)
    09:10:00.901:MUP1[E1]:INFO:drawing:isc_Canvas_5:$ra(): redrawing
    09:10:00.902:MUP1[E1]:INFO:sizing:isc_Canvas_5:Specified size: 1x1, drawn scroll size: 59x15, border: 0x0, margin: 0x0, old size: 59x15, reason: redraw
    09:10:00.902:MUP1[E1]:INFO:redraws:isc_Canvas_5:Immediate redraw (label measurement: 9,200,000,000)
    09:10:00.903:MUP1[E1]:INFO:drawing:isc_Canvas_5:$ra(): redrawing
    09:10:00.903:MUP1[E1]:INFO:sizing:isc_Canvas_5:Specified size: 1x1, drawn scroll size: 59x15, border: 0x0, margin: 0x0, old size: 59x15, reason: redraw
    09:10:00.904:MUP1[E1]:INFO:redraws:isc_Canvas_5:Immediate redraw (label measurement: 9,250,000,000)
    09:10:00.904:MUP1[E1]:INFO:drawing:isc_Canvas_5:$ra(): redrawing
    09:10:00.905:MUP1[E1]:INFO:sizing:isc_Canvas_5:Specified size: 1x1, drawn scroll size: 59x15, border: 0x0, margin: 0x0, old size: 59x15, reason: redraw
    09:10:00.905:MUP1[E1]:INFO:redraws:isc_Canvas_5:Immediate redraw (label measurement: 9,300,000,000)
    09:10:00.906:MUP1[E1]:INFO:drawing:isc_Canvas_5:$ra(): redrawing
    09:10:00.906:MUP1[E1]:INFO:sizing:isc_Canvas_5:Specified size: 1x1, drawn scroll size: 59x15, border: 0x0, margin: 0x0, old size: 59x15, reason: redraw
    09:10:00.907:MUP1[E1]:INFO:redraws:isc_Canvas_5:Immediate redraw (label measurement: 9,350,000,000)
    09:10:00.907:MUP1[E1]:INFO:drawing:isc_Canvas_5:$ra(): redrawing
    09:10:00.908:MUP1[E1]:INFO:sizing:isc_Canvas_5:Specified size: 1x1, drawn scroll size: 59x15, border: 0x0, margin: 0x0, old size: 59x15, reason: redraw
    09:10:00.908:MUP1[E1]:INFO:redraws:isc_Canvas_5:Immediate redraw (label measurement: 9,400,000,000)
    09:10:00.909:MUP1[E1]:INFO:drawing:isc_Canvas_5:$ra(): redrawing
    09:10:00.909:MUP1[E1]:INFO:sizing:isc_Canvas_5:Specified size: 1x1, drawn scroll size: 59x15, border: 0x0, margin: 0x0, old size: 59x15, reason: redraw
    09:10:00.910:MUP1[E1]:INFO:redraws:isc_Canvas_5:Immediate redraw (label measurement: 9,450,000,000)
    09:10:00.910:MUP1[E1]:INFO:drawing:isc_Canvas_5:$ra(): redrawing
    09:10:00.911:MUP1[E1]:INFO:sizing:isc_Canvas_5:Specified size: 1x1, drawn scroll size: 59x15, border: 0x0, margin: 0x0, old size: 59x15, reason: redraw
    09:10:00.912:MUP1[E1]:INFO:redraws:isc_Canvas_5:Immediate redraw (label measurement: 9,500,000,000)
    09:10:00.912:MUP1[E1]:INFO:drawing:isc_Canvas_5:$ra(): redrawing
    09:10:00.912:MUP1[E1]:INFO:sizing:isc_Canvas_5:Specified size: 1x1, drawn scroll size: 59x15, border: 0x0, margin: 0x0, old size: 59x15, reason: redraw
    09:10:00.913:MUP1[E1]:INFO:redraws:isc_Canvas_5:Immediate redraw (label measurement: 9,550,000,000)
    09:10:00.913:MUP1[E1]:INFO:drawing:isc_Canvas_5:$ra(): redrawing
    09:10:00.914:MUP1[E1]:INFO:sizing:isc_Canvas_5:Specified size: 1x1, drawn scroll size: 59x15, border: 0x0, margin: 0x0, old size: 59x15, reason: redraw
    09:10:00.915:MUP1[E1]:INFO:redraws:isc_Canvas_5:Immediate redraw (label measurement: 9,600,000,000)
    09:10:00.915:MUP1[E1]:INFO:drawing:isc_Canvas_5:$ra(): redrawing
    09:10:00.916:MUP1[E1]:INFO:sizing:isc_Canvas_5:Specified size: 1x1, drawn scroll size: 59x15, border: 0x0, margin: 0x0, old size: 59x15, reason: redraw
    09:10:00.916:MUP1[E1]:INFO:redraws:isc_Canvas_5:Immediate redraw (label measurement: 9,650,000,000)
    09:10:00.917:MUP1[E1]:INFO:drawing:isc_Canvas_5:$ra(): redrawing
    09:10:00.917:MUP1[E1]:INFO:sizing:isc_Canvas_5:Specified size: 1x1, drawn scroll size: 59x15, border: 0x0, margin: 0x0, old size: 59x15, reason: redraw
    09:10:00.918:MUP1[E1]:INFO:redraws:isc_Canvas_5:Immediate redraw (label measurement: 9,700,000,000)
    09:10:00.918:MUP1[E1]:INFO:drawing:isc_Canvas_5:$ra(): redrawing
    09:10:00.919:MUP1[E1]:INFO:sizing:isc_Canvas_5:Specified size: 1x1, drawn scroll size: 59x15, border: 0x0, margin: 0x0, old size: 59x15, reason: redraw
    09:10:00.919:MUP1[E1]:INFO:redraws:isc_Canvas_5:Immediate redraw (label measurement: 9,750,000,000)
    09:10:00.920:MUP1[E1]:INFO:drawing:isc_Canvas_5:$ra(): redrawing
    09:10:00.920:MUP1[E1]:INFO:sizing:isc_Canvas_5:Specified size: 1x1, drawn scroll size: 59x15, border: 0x0, margin: 0x0, old size: 59x15, reason: redraw
    09:10:00.921:MUP1[E1]:INFO:redraws:isc_Canvas_5:Immediate redraw (label measurement: 9,800,000,000)
    09:10:00.921:MUP1[E1]:INFO:drawing:isc_Canvas_5:$ra(): redrawing
    09:10:00.922:MUP1[E1]:INFO:sizing:isc_Canvas_5:Specified size: 1x1, drawn scroll size: 59x15, border: 0x0, margin: 0x0, old size: 59x15, reason: redraw
    09:10:00.922:MUP1[E1]:INFO:redraws:isc_Canvas_5:Immediate redraw (label measurement: 9,850,000,000)
    09:10:00.923:MUP1[E1]:INFO:drawing:isc_Canvas_5:$ra(): redrawing
    09:10:00.923:MUP1[E1]:INFO:sizing:isc_Canvas_5:Specified size: 1x1, drawn scroll size: 59x15, border: 0x0, margin: 0x0, old size: 59x15, reason: redraw
    09:10:00.924:MUP1[E1]:INFO:redraws:isc_Canvas_5:Immediate redraw (label measurement: 9,900,000,000)
    09:10:00.924:MUP1[E1]:INFO:drawing:isc_Canvas_5:$ra(): redrawing
    09:10:00.925:MUP1[E1]:INFO:sizing:isc_Canvas_5:Specified size: 1x1, drawn scroll size: 59x15, border: 0x0, margin: 0x0, old size: 59x15, reason: redraw
    09:10:00.926:MUP1[E1]:INFO:redraws:isc_Canvas_5:Immediate redraw (label measurement: 9,950,000,000)
    09:10:00.926:MUP1[E1]:INFO:drawing:isc_Canvas_5:$ra(): redrawing
    09:10:00.926:MUP1[E1]:INFO:sizing:isc_Canvas_5:Specified size: 1x1, drawn scroll size: 59x15, border: 0x0, margin: 0x0, old size: 59x15, reason: redraw
    09:10:00.927:MUP1[E1]:INFO:redraws:isc_Canvas_5:Immediate redraw (label measurement: 10,000,000,000)
    09:10:00.927:MUP1[E1]:INFO:drawing:isc_Canvas_5:$ra(): redrawing
    09:10:00.928:MUP1[E1]:INFO:sizing:isc_Canvas_5:Specified size: 1x1, drawn scroll size: 64x15, border: 0x0, margin: 0x0, old size: 59x15, reason: redraw
    09:10:00.929:MUP1[E1]:INFO:redraws:isc_Canvas_5:Immediate redraw (label measurement: 10,050,000,000)
    09:10:00.929:MUP1[E1]:INFO:drawing:isc_Canvas_5:$ra(): redrawing
    09:10:00.930:MUP1[E1]:INFO:sizing:isc_Canvas_5:Specified size: 1x1, drawn scroll size: 64x15, border: 0x0, margin: 0x0, old size: 64x15, reason: redraw
    09:10:00.930:MUP1[E1]:INFO:redraws:isc_Canvas_5:Immediate redraw (label measurement: 10,100,000,000)
    Looked at setExtraAxisMetrics and minDataSpreadPercent with no affect. Is there an Chart API setting required?
    Has there been a change in how numeric data type conversions are handled? (Had to make code change to handle instance of Number in a grid)
    Any ideas?
    Attached Files

    #2
    For a more succinct example, take the SmartGWT example from http://www.smartclient.com/smartgwte...erPlotCharting
    Delete all the example data but leave one data item E.G. new ScatterPlotChartData(0.033f, 0.02f, "Moose")
    Change the value for data item from float to Long E.G. new ScatterPlotChartData(0.033f, [COLOR=#c00000]10,000,000,000L[/COLOR], "Moose") and update constructor float to long
    Run the code and you'll see the chart fill with grey lines because so many YAxis data points are plotted.

    Am I missing something fundamental? Used to work for this application, after upgrade it doesn't.
    The question is how to plot a single data point for a scatter chart where value is > 8 digits. Thank you.

    Comment


      #3
      We've applied a fix to SGWT 6.0p/SC 11.0p and newer branches, and it will be available in the nightly builds dated 2016-10-27 and beyond.

      Comment


        #4
        When will the next stable build be available? (We will need this for an upcoming release) The last stable build was 23/10/2016.
        http://www.smartclient.com/builds/Sm...p/PowerEdition

        After a retest with the 'd' build dated 27/10/2016 the fixes seem to resolve this issue and issue 241025. Thanks.

        Comment

        Working...
        X