Search code examples
gxt

How can I change the font on a GXT chart legend?


I am rendering a GXT 3.0 line chart, and drawing a legend. I cannot see where in the API the font on the legend can be changed from times roman ( the default) to arial.

It doesn't seem to be a method on the chart object, or on the legend configuration object, or on the series. Is there a connection to the 'sprite' object on the series?

Any thoughts would be appreciated.


Solution

  • From what I could find there is no direct way to do this, but I did see that all the Legend title's style related settings are done in LegendItem and there its setting the fonts etc. So you can write a custom implementation of LegendItem (and Legend too so that you can use this custom LegendItem) and then set the fonts and any other property that you want.

    Let me know if it works.