Results 1 to 3 of 3

Thread: GXT Chart with BarSeries generates a invalid SVG (rect without height)

    You found a bug! We've classified it as EXTGWT-3286 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium Member
    Join Date
    Mar 2013

    Default GXT Chart with BarSeries generates a invalid SVG (rect without height)

    Hello all,

    We found a problem when we use BarSeries in Chart.

    When the series has a big diference between values, the scala makes the minor value disappear completely in chart. This only happens when the BarSeries is configured to column.

    In this case, the rect that represents that value in chart will be inserted with height 0.
    That causes a lot of problems, mainly when you use some framework as Batik to export the generated SVG to a Image.

    The problem is in class com.sencha.gxt.chart.client.chart.series.BarSerie, line 788, version 3.0.1:
    PHP Code:
    rect.setHeight(Math.max(rect.getHeight() - diff0)); 
    When the max value is zero, the rect isn't in SVG.
    A possible workaround is change the line to:
    PHP Code:
    rect.setHeight(Math.max(rect.getHeight() - diff0.1)); 
    Was this problem reported before?
    Is there another workaround?

    Cassiano Faria.

  2. #2
    Sencha User
    Join Date
    Feb 2009


    Thanks for the report! I have opened a new bug in the tracker, though I think that any fix for this will also affect and vice versa.

  3. #3


    Hi Cassiano Faria/,have you found any work around for SVG having no height attribute when there is minor value for the column ?
    Update: Seems like there is a workaround for this issue .
    Following is the workaround:
    • Check whether the height is 0 on render of the column/bar
    • if height is 0 we have put the height attribute to 1 or any other minimum possible
    • gave the column color as the background color which is white in our case
    code is as follows
    column.setRenderer(new SeriesRenderer<ModelData>() {
    public void spriteRenderer(Sprite sprite, int index, ListStore<ModelData> store) {
    RectangleSprite s = ((RectangleSprite) sprite);

    // If height is 0, set the color to transparent and height to min 1, to arrest pdf error.
    if (s.getHeight() <= 1.0){
    s.setFill(new Color("#ffffff"));

Tags for this Thread

Posting Permissions

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