2

I have a ZedGraph stacked bar graph, and I want each bar to show its value on a label. So far no problem.

But is there any built-in function to prevent labels from overlapping?

Here is a screenshot showing the problem:

enter image description here

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Fender
  • 3,055
  • 1
  • 17
  • 25

1 Answers1

1

I would suggest just changing the angle property for your labels' FontSpec. Use i.e. about 30-45 degrees and you have your problem solved.

See:
http://zedgraph.sourceforge.net/documentation/html/T_ZedGraph_TextObj.htm

Gacek
  • 10,184
  • 9
  • 54
  • 87
  • thanks, but that looks kinda ugly in bars where this is not needed. the labels are centered in the bar. so is there a easy possibility to detect overlapping labels and just rotate them? – Fender Feb 04 '11 at 13:56
  • I don't think so. You will probably need to check all labels and validate their rectangle area – Gacek Feb 04 '11 at 14:12