Results 1 to 2 of 2

Thread: Chart render fail

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1

    Join Date
    Dec 2012
    Posts
    2
    Vote Rating
    0
      0  

    Default Chart render fail

    Hi,

    we render pie chart with labels outside of the chart but the css fails. The text is enclosed by a rectangle which doesn't wrap the text properly. See the screenshot. Can we get rid of the rectangle and leave just the text?
    We use GXT 4.0.2

    gxt-4.0.2-css-fail.jpg


    we use this code to render the chart
    Code:
    public class PieWidget extends Portlet {
    public static final WidgetDataProperties dataModelProperties = GWT.create(WidgetDataProperties.class);
    private SimpleContainer chartLayout;
    private ListStore<WidgetData> listStore;
    private Chart chart;
    
    private void paintChart() {
      chartLayout = new SimpleContainer();
      add(chartLayout);
      // Setup the chart list store
    listStore = new ListStore<WidgetData>(dataModelProperties.id());
    
      // Setup the chart
    chart = new Chart<WidgetData>();
      chart.setStore(listStore);
      chart.setAnimated(true);
      chartLayout.add(chart);
      TextSprite textConfig = new TextSprite();
      textConfig.setFont("Arial");
      textConfig.setTextBaseline(TextSprite.TextBaseline.MIDDLE);
      textConfig.setFontSize(18);
      textConfig.setTextAnchor(TextSprite.TextAnchor.MIDDLE);
      textConfig.setZIndex(15);
    
      SeriesLabelConfig<WidgetData> labelConfig = new SeriesLabelConfig<WidgetData>();
      labelConfig.setSpriteConfig(textConfig);
      labelConfig.setLabelPosition(Series.LabelPosition.OUTSIDE);
      labelConfig.setValueProvider(dataModelProperties.name(), new StringLabelProvider<String>());
    
      Gradient badColor = new Gradient(45);
      badColor.addStop(new Stop(0, new RGB(166, 17, 32)));
      badColor.addStop(new Stop(100, new RGB(120, 12, 23)));
      Gradient averageColor = new Gradient(45);
      averageColor.addStop(new Stop(0, new RGB(17, 95, 166)));
      averageColor.addStop(new Stop(100, new RGB(12, 69, 120)));
      PieSeries<WidgetData> series = new PieSeries<WidgetData>();
      Gradient goodColor = new Gradient(45);
      goodColor.addStop(new Stop(0, new RGB(148, 174, 10)));
      goodColor.addStop(new Stop(100, new RGB(107, 126, 7)));
      series.addColor(badColor);
      series.addColor(averageColor);
      series.addColor(goodColor);
      series.setAngleField(dataModelProperties.value());
      series.setLabelConfig(labelConfig);
      series.setHighlighting(true);
      chart.addSeries(series);
    }
    
    private void doRepaint(List<WidgetData> data) {
      listStore.clear();
      listStore.addAll(data);
      chart.redrawChart();
    }
    }
    Thanks a lot,
    Martin
    Last edited by zdary; 26 Nov 2017 at 8:38 PM. Reason: added code

  2. #2

    Join Date
    Dec 2012
    Posts
    2
    Vote Rating
    0
      0  

    Default

    it turns out that the code which breaks the labels is:
    textConfig.setTextBaseline(TextSprite.TextBaseline.MIDDLE);
    textConfig.setTextAnchor(TextSprite.TextAnchor.MIDDLE);

    just removing those lines fixes it

Similar Threads

  1. [CLOSED] [5.0.1.1255] Component fail to render when containing binded children
    By christophe.geiser in forum Ext 5: Bugs
    Replies: 2
    Last Post: 24 Sep 2014, 4:10 AM
  2. Theme Fail: failed to render widgets within 30 sec.
    By ClintNash in forum Sencha Cmd
    Replies: 3
    Last Post: 28 Mar 2013, 12:46 PM
  3. [CLOSED][3.0.0] Charts with tiny values fail to render
    By mcouillard in forum Ext 3.x: Bugs
    Replies: 2
    Last Post: 19 Aug 2009, 3:57 AM
  4. Render fail in process to restore grid state
    By gilcachaca in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 18 Aug 2009, 9:29 AM
  5. [1.1] Toolbars fail to render when setUrl() is used
    By seade in forum Ext 1.x: Bugs
    Replies: 2
    Last Post: 21 Aug 2007, 5:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •