Dark GWT Style

64 views
Skip to first unread message

David Illescas

unread,
Nov 23, 2011, 6:06:44 AM11/23/11
to GFlot General Discussion
Hello. I have selected the "Dark" theme under my .gwt.xml file, but
this means I can't read the axis labels given the default settings. I
was wondering how I could change the colour of the text, or what I
woulld apply the setStyleName() function/css style to.

Thank you very much for any assistance.

Nicolas Morel

unread,
Nov 23, 2011, 8:14:32 AM11/23/11
to GFlot General Discussion
flot support it in axis option, it's the option "color".
But gflot currently doesn't have it. You can extend the class
AxisOptions and define a method setColor like this :

public AxisOptions setColor(String color) {
put("color", color);
return this;
}

Or use the css class defined by flot. The class name for those label
is "tickLabel".

Katerina Blinova

unread,
Jun 28, 2013, 6:47:24 PM6/28/13
to gf...@googlegroups.com
Hi,

I am using gflot 3.1.1 and am trying to set color of the axis labels by calling setColor() function on the xAxis and yAxis options. It does not work. The color stays as before. The setTickColor() works, however. 

If I use css rule
.font-text
{
   color: yellow !important;
}
that works. Is there something that overwrites setting of color on the axis properties?

Thanks,

Katerina

Katerina Blinova

unread,
Jun 28, 2013, 6:56:09 PM6/28/13
to gf...@googlegroups.com
I meant to say 
flot-text, not font-text.

K

Nicolas Morel

unread,
Jun 30, 2013, 12:27:21 PM6/30/13
to gf...@googlegroups.com
You're right. The color option on AxisOptions seems to only change the line's color inside the grid but not the label. 

I missed a new option 'font' from flot 0.8. You can find informations here : https://github.com/flot/flot/blob/master/API.md#customizing-the-axes

I added the support for it on 3.1.2-SNAPSHOT and added an example : https://github.com/nmorel/gflot/commit/3c7be55624146461e739682e804692ee0ec56d15
You can also use it now with the version 3.1.1. Just create a JsonObject with the options you want and call the method put("font", yourFontObject) on the axis option.
Reply all
Reply to author
Forward
0 new messages