3

I have a RangeBar chart type. I wish to display a label on the bars, but only if the label text does not exceed the boundries of the bar itself.

My problem can be seen in the image below - Labels of small bars are written on-top of other labels causing them to be unreadable. ChartExample I set the label like this within a loop:

s.Points[pointIndex].Label = item.Label;

The label is a descriptive string.

Chart is initialized like this:

Series s = new Series();
s.YValuesPerPoint = 2;
s.ChartType = SeriesChartType.RangeBar;
s["PointWidth"] = "0.9";
s.IsValueShownAsLabel = false;

Chart physical dimensions (in pixels) vary as well as the number of hours shown in the chart.

How can I avoid labels on bars where the label text doesn't fit?

Mr. Blonde
  • 711
  • 2
  • 12
  • 27

0 Answers0