Menu

Overlapping Datalabels

Abraham
2016-04-26
2016-04-28
  • Abraham

    Abraham - 2016-04-26

    I can see in later versions of Highcharts that the default to allowOverlapping datalabels is FALSE. And so I would guess that datalabels shouldn't overlap. But Moxie GWT Highcharts doesn't have a method for this ability. And I don't think this is an option in the version that Moxie uses. I suppose I'm looking to see if anyone can verify this to be the case, and if it's not, how might I keep the datalabels from overlapping. See attachment for a screenshot of the overlapping data labels.

    I'm using:
    <dependency>
    <groupId>org.moxieapps</groupId>
    <artifactId>gwt-highcharts</artifactId>
    <version>1.7.0</version>
    </dependency>

     

    Last edit: Abraham 2016-04-26
  • Shawn Quinn

    Shawn Quinn - 2016-04-26

    You should be able to use the "setOption" method for cases like this. E.g. config.setOption("allowOverlapping", false)

     
    • Abraham

      Abraham - 2016-04-27

      Thanks. I thought I tried that and it didn't seem to disallow overlapping. I'll take a look at it again.

       
  • Abraham

    Abraham - 2016-04-27

    This what I have ... I've been messing around with the different possibilities:

    series
                    .setPlotOptions(new SeriesPlotOptions()
                        .setAllowPointSelect(false)
                        .setDataLabels(new DataLabels()
                            .setEnabled(true)
                            .setVerticalAlign(Labels.VerticalAlign.BOTTOM)
                            .setAlign(Labels.Align.LEFT)
                            .setFormatter(formatter)
                            //                  .setColor("#000000")
                            .setStyle(new Style()
                                .setFont("normal 8px Verdana, sans-serif"))
                            .setBackgroundColor("rgba(252, 255, 225, 0.7")
                            .setBorderColor("#CCC")
                            .setBorderWidth(1)
                            .setBorderRadius(3)
                            //                  .setShadow(true)
                            .setPadding(1)
                            .setOption("allowOverlapping", false)
                        ));
    
     

    Last edit: Abraham 2016-04-27
  • Abraham

    Abraham - 2016-04-28

    Fixed.
    Basically, I discovered that even though I thought we were using highcharts version 4.2.4, we were actually using 2.2.5. We have highcharts.js and highcharts.js.gz in our resources folder. Our code reads the .gz which had not been updated in a while.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.