Menu

#34 Axis tick label partial not shown when legend is invisible

v0.8.0
closed-fixed
nobody
swtchart (30)
5
2014-02-19
2012-11-27
chenli868
No

When setting the legend to invisible, the last axis tick label is only partially shown. The code to reproduce this:
double[] xSeries = { 40, 68, 85, 120 };
double[] ySeries = { 19, 19, 29, 29};
// create a chart
Chart chart = new Chart(parent, SWT.NONE);

// set titles
chart.getTitle().setVisible(false);
chart.getLegend().setVisible(false);
chart.setBackgroundInPlotArea(new Color(Display.getDefault(), 0, 0, 0));

IAxis xAxis = chart.getAxisSet().getXAxis(0);
xAxis.setRange(new Range(40, 120));
xAxis.getTitle().setText("Cycle Time");

IAxis yAxis = chart.getAxisSet().getYAxis(0);
yAxis.getTitle().setText("Offset");

// create line series
ILineSeries lineSeries = (ILineSeries) chart.getSeriesSet().createSeries(SeriesType.LINE, "line series");
lineSeries.setSymbolType(PlotSymbolType.NONE);
lineSeries.setXSeries(xSeries);
lineSeries.setYSeries(ySeries);
lineSeries.setLineStyle(LineStyle.SOLID);
lineSeries.setLineColor(new Color(Display.getDefault(), 51, 255, 255));

yAxis.adjustRange();

Discussion

  • chenli868

    chenli868 - 2012-11-27
     
  • yoshitaka

    yoshitaka - 2013-12-10

    fixed by attached patch

     
  • yoshitaka

    yoshitaka - 2013-12-10
    • status: open --> pending
     
  • yoshitaka

    yoshitaka - 2014-02-19
    • Status: pending --> closed-fixed