0

I'm trying to get the graph view horizontally centered inside my layout, but I'm not able to "remove" that left bar, which is actually where the "range" settings are.

This is a screenshot from the official demo app, showing this undesired effect which I'm also getting on my app.

Any ideas how to completely remove this?

official demo app - red border shows undesired effect

Henrique
  • 4,921
  • 6
  • 36
  • 61

1 Answers1

0

Try:

plot.getGraphWidget().setMarginLeft(0);

That should actually get rid of everything on the left including the area where the range labels are currently being drawn so you may need to play with it to find the value that looks good with your range values / range font configuration.

Nick

Nick
  • 8,181
  • 4
  • 38
  • 63
  • 1
    Try adding plot.getLayoutManager().refreshLayout() immediately before the redraw(). Some layout methods do not implicitly refresh the layout because it's an expensive operation and it's normal to invoke 2 or more layout methods at a time. – Nick Mar 21 '14 at 15:28
  • This works, thanks! BTW, after some trials I've found that redraw() should be placed at the end of codes for drawing control, otherwise setMarginLeft would not work either. – Xieyi Mar 22 '14 at 06:14