Project

General

Profile

Axis titles not showing

Added by Matt Russell over 9 years ago

I cannot seem to get axis titles to show in Wt 3.3.4 Linux. (see attached image)

They just get clipped off. I've tried adjusting the margins, fonts, padding, etc. The chart image is simply produced with the Y axis title partially clipped off, and the X-axis title totally clipped.

I'm using a Wt::Chart::WCartesianChart, and attempting to use titles with

    chart->axis(Wt::Chart::XAxis).setTitle(Wt::WString("anything"));
    chart->axis(Wt::Chart::YAxis).setTitle(Wt::WString("anything Y"));
    chart->axis(Wt::Chart::YAxis).setTitleOrientation(Wt::Vertical);

This is being bound to a Wt::WDialog.

Help?


Replies (4)

RE: Axis titles not showing - Added by Matt Russell over 9 years ago

I think the solution is to set my axis padding with Wt::Chart::WAbstractChart::setPlotAreaPadding

RE: Axis titles not showing - Added by Bruce Toll over 9 years ago

Another option to consider with recent versions of Wt is setAutoLayoutEnabled().

RE: Axis titles not showing - Added by Koen Deforche over 9 years ago

Hey, the latest git version should fix this issue.

RE: Axis titles not showing - Added by Matt Russell over 9 years ago

Hi,

Unfortunately, I'm stuck on 3.3.4.. For now at least. My file is full of "TODO" notes to use things like setAutoLayoutEnabled() as soon as we upgrade.

Thanks though.

Using setPlotAreaPadding gave me room for an Xaxis title and a plot title, and because my Y data is percentages, changing the ylabels/format to show percentage got me around needing a Yaxis title

    (1-4/4)