Marked Zone Label TextBlock: Position Auto / BringToFront / MainColorOpacity

Thread is closed for posting
4 posts, 0 answers
  1. Zarni Winlatt
    Zarni Winlatt avatar
    2 posts
    Member since:
    Jul 2009

    Posted 17 Jun 2010 Link to this post

    Hello

    I am working on line graph and came across this issue which I could not resolve, hopefully someone can answer me on this

    Referring to the attached part of my graph, i am trying to label the highest point using marked zone

    However, depending on the dynamic value of my points, there will be situations where the label will be overlapped below the line

    I tried:

    • myMarkedZone.Label.TextBlock.BringToFront(), and radChart.save() failed
    • myMarkedZone.Label.TextBlock.Appearance.FillStyle.MainColorOpacity = 50, and was told that this property is ReadOnly
    • myMarkedZone.Label.TextBlock.Appearance.Position.Auto = true, and it appears to be positioned TopLeft

    Can anyone enlighten me on how to resolve this issue?

    Thanks!
  2. Ves
    Admin
    Ves avatar
    2926 posts

    Posted 22 Jun 2010 Link to this post

    Hello Zarni,

    The marked zones will always appear behind the series. I would suggest using the ChartSeriesItem label. You can find the item with max value and hide the labels for the rest of the items, while leaving this one visible and customized. Here is an example:


    void RadChart1_DataBound(object sender, EventArgs e)
        {
            var maxItem = RadChart1.Series[0].Items.Aggregate((a, b) => b.YValue > a.YValue ? b : a);
            foreach (var item in RadChart1.Series[0].Items)
            {
                if (item != maxItem)
                    item.Label.Visible = false;
                else
                    item.Label.TextBlock.Text = "My Max";
            }
        }

    Best regards,
    Ves
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Zarni Winlatt
    Zarni Winlatt avatar
    2 posts
    Member since:
    Jul 2009

    Posted 22 Jun 2010 Link to this post

    Thanks for the suggestion, the solution worked!

    However, it triggered another issue, where there seems to have truncated label with maximum character count on the label (see attached)

    I tried setting LabelAppearance-Dimensions-AutoSize="false" and LabelAppearance-Dimensions-Width="500" but both does not work

    Kindly enlighten me or whether this is a limitation?

    Thanks!
  4. Ves
    Admin
    Ves avatar
    2926 posts

    Posted 24 Jun 2010 Link to this post

    Hello Zarni,

    This is the default behavior for all text elements within RadChart. In this case it is controlled by the
    ChartSeries.Appearance.TextAppearance.MaxLength property. The default value is 30, so the ellipsis points appear after the 30-th character. You can increase the value as per your needs.

    Greetings,
    Ves
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top