Vaadin Charts - no Title

In my chart I would like to have no title. I tried

Configuration configuration = new Configuration();
configuration.getTitle().setText(null);

because the method “setTitle()” in class Title says that null will disable the title. But infact the title will be the default “Chart title”. Am I doing something wrong, is this a bug or just a wrong description?
At the moment I use setTitle(“”) but this results in an empty gap at the top of the chart. Any ideas to disable the title?

Hi,

Looks like there is bit odd default in the client side library. Definitely a bug - now fixed.

http://dev.vaadin.com/ticket/11091#comment:1

Luckily you brought this up just in time to make it into final release that you can expect to be available tomorrow. Thanks!

cheers,
matti

Great! Thanks for the fast fix.

I tried the final version and it is works like expected, the title is disabled and no gap/empty line left.
If I set title to null but have a subtitle with some text, the title is disabled but there is a gap/empty line! Is it possible to remove this gap so the subtitle is at the top?

Furthermore I played around with the titles for the axis. Setting the title of the XAxis class to null is working fine but the YAxis class has the same problem the title had. Setting it to null will result in the default “Y-Values”.

Hi,

You can programmatically adjust the sub title position (example below), but I’d just use the title and style it with smaller text (which is what I assume you are trying to achieve.

The y axis title seems to have bit weird default as well. You can though get rid of it by using empty string. This should indeed work like the main title (or even better the default should be no title at all), but the workaround is IMO acceptable.



        conf.setTitle((String)null);
        conf.setSubTitle("Foobar");
        conf.getSubTitle().setY(10);
        YAxis y = new YAxis();
        y.setTitle("");
        conf.addyAxis(y);

Thanks again for your valuable feedback!

cheers,
matti