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

How to hide Y Axis labels

1 Answer 146 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Manishkumar
Top achievements
Rank 1
Manishkumar asked on 04 Aug 2011, 09:06 AM
Hi,

I have chart having two Y-axis, one on left of the chart and the other on the right. In the attached image i want to hide the labels from the right Y axis which have negative values. (-50% , -100%). Can u please help me with it.


Thanks.

1 Answer, 1 is accepted

Sort by
0
Peshito
Telerik team
answered on 08 Aug 2011, 03:50 PM
Hi Manishkumar,

This feature is not supported out of the box. However there is a workaround you could use in order to achieve similar scenario. 

Wire to the Chart's BeforeLayout event and set the value of each ChartAxisItem which YAxis2 Value is < 0 in radChart.PlotArea.YAxis2.Items to empty string like this:
protected void radChart_BeforeLayout(object sender, EventArgs e)
    {
        foreach (ChartAxisItem axisItem in radChart.PlotArea.YAxis2.Items)
        {
            if (axisItem.Value < 0)
            {
                axisItem.TextBlock.Text = " ";
            }
        }
    }

For your convenience I've attached a sample project you could refer to.

If this solution does not fit your needs, we will need a sample screenshot of the desired result as well as any additional information that can be helpful.

All the best,
Peshito
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
General Discussions
Asked by
Manishkumar
Top achievements
Rank 1
Answers by
Peshito
Telerik team
Share this question
or