This is a migrated thread and some comments may be shown as answers.

Marked Zone Label TextBlock: Position Auto / BringToFront / MainColorOpacity

3 Answers 70 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Zarni Winlatt
Top achievements
Rank 1
Zarni Winlatt asked on 17 Jun 2010, 10:16 AM
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!

3 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 22 Jun 2010, 07:43 AM
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
0
Zarni Winlatt
Top achievements
Rank 1
answered on 22 Jun 2010, 11:54 AM
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!
0
Ves
Telerik team
answered on 24 Jun 2010, 12:58 PM
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
Tags
Chart (Obsolete)
Asked by
Zarni Winlatt
Top achievements
Rank 1
Answers by
Ves
Telerik team
Zarni Winlatt
Top achievements
Rank 1
Share this question
or