Hide Y-Axis labels

2 posts, 0 answers
  1. Manishkumar
    Manishkumar avatar
    240 posts
    Member since:
    Feb 2009

    Posted 01 Nov 2011 Link to this post

     

    Hi,

    I have bar chart with  Y-Axis having range from 0 to 100. On the same chartarea I have one more Y-Axis(right hand side) having range from -100 to 100 in the step of 50. i want to make -100, -50 label values invisible so that 0 starts in the middle of the Y-axis.  I am using this Y-Axis for showing line chart but while assigning I am giving value as minmumvalue = -1.00,MaxValue = 1.10,step as 0.5. Please help me achieve this.
    as we have Go Live on 2/11/11
    Here is the sample code I have tried to achive this
     

    radchartarea.AdditionalYAxes.Add(axisy);

    radchartarea.AdditionalYAxes[0].AutoRange =

     

    false;

     

    radchartarea.AdditionalYAxes[0].AddRange(-_intMaxValYAxisSec, _intMaxValYAxisSec + 0.10, (_intMaxValYAxisSec * 2) / 4);

    radchartarea.AdditionalYAxes[0].PlotAreaAxisVisibility =

     

    Visibility.Collapsed;

     

    radchartarea.AdditionalYAxes[0].DefaultLabelFormat =

     

    "#VAL{P0}";

     



    Here We are adding the additional Y -Axis --axisY. And after that we are making te value of lable as Blank.

     

     

    foreach (TickPoint point in radchartarea.AdditionalYAxes[0].TickPoints)

     

    {

     

     

    if (point.Value < 0)

     

    {

    point.Label =  " ";

     

    }

    }

    If Give the minvalue as -100,Maxvalue as 100,Step as 50 then the above solution with for loop works.
    But if I give the value as  minvalue as -1.10,Maxvalue as 1.10,Step as 0.5  then it does not work with above solution and not able to hide the values can you please Provide me the solution ASAP.

    Please provide solution ASAP 
  2. Peshito
    Admin
    Peshito avatar
    585 posts

    Posted 03 Nov 2011 Link to this post

    Hello Manishkumar,

    You can review my answer in the other thread you have started here:
    http://www.telerik.com/community/forums/wpf/chart/hide-y-axis-labels.aspx

    Please, keep the discussion in a single thread, as it would be easier for both sides to follow.

    Greetings,
    Peshito
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Back to Top