teechart lable is not showing

202 Views Asked by At

i am using steema.teeChart component in our application to generate reports. i am drowing a line from the left to the rigth and on the rigth side we have a lable with text like: E7, B8, ext... per line

The problem is: When the lines are close to each other the text/line name is not showing in the repport. enter image description here in the image you can see 3 lines. the poroblem is that the line name of the top line is not visible.

Here is an example when it is ok:

enter image description here

Here is the code i am using,

Any advice will be appreciated

Dim mrk As Styles.Points
mrk = Me.addMark(Color.Transparent, " ")
mrk.Marks.Visible = False
mrk.Marks.Transparent = True
mrk.VertAxis = Styles.VerticalAxis.Both
mrk.UseAxis = True

mrk.Add(maxX, CSng(drw!afn_x), drw!afn_label.ToString)

Private Function addMark(ByVal color As Color, ByVal oms As String) As Styles.Points
    Dim lpt As New Styles.Points
    chart.Series.Add(lpt)
    lpt.ShowInLegend = False
    lpt.Marks.Visible = True
    lpt.Marks.Transparent = True
    lpt.Marks.Color = color
    lpt.Marks.Style = Styles.MarksStyles.Label
    lpt.Marks.Text = oms
    lpt.Marks.ArrowLength = -8
    lpt.Marks.Arrow.Visible = False
    lpt.Pointer.Visible = False
    lpt.LinePen.Visible = False
    lpt.Color = color.Transparent
    lpt.Pointer.Color = lpt.Color
    lpt.LinePen.Color = lpt.Color
    lpt.UseAxis = False
    lpt.Title = ""
    Return lpt
End Function
1

There are 1 best solutions below

0
On

This is to prevent label overlapping. Automatic labels are not plotted if they'd overlap. You can overcome this issue using custom labels. You'll find an example at All Features\Welcome !\Axes\Labels\Custom labels in the features demo at TeeChart's program group. For example:

  tChart1.Axes.Left.Labels.Items.Clear();

  (tChart1.Axes.Left.Labels.Items.Add(123,"Hello")).Font.Size=16;
  (tChart1.Axes.Left.Labels.Items.Add(466,"Good\n\rbye")).Transparent=false;
  tChart1.Axes.Left.Labels.Items.Add(300);
  AxisLabelItem a = tChart1.Axes.Left.Labels.Items.Add(-100);
  a.Transparent=false;
  a.Color=Color.Blue;
  a.Transparency=50;

If this doesn't help please send us a Short, Self Contained, Correct (Compilable), Example. You can post your files here.