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

Y-Axis ItemLabel as Text

4 Answers 51 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Woramin
Top achievements
Rank 1
Woramin asked on 15 Nov 2011, 05:23 AM
Hi there,

I would like chartArea's Y-Axis in the RadChart not to have the label as the number but as the text just like the image below
http://upic.me/i/f1/chartonoff.png


The details are
- Have Y-Axis ItemLabel as only "On" and "Off"
- X-Axis ItemLabel still be the collection of text from the XCategory
- Have no any point shown in the chart area

Is it possible to do something like this at this moment

Thanks

4 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay
Telerik team
answered on 17 Nov 2011, 08:28 AM
Hello Woramin,

Please, find attached a sample application, which demonstrates how to achieve the desired behavior.

Hope this helps. 

Kind regards,
Nikolay
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Woramin
Top achievements
Rank 1
answered on 18 Nov 2011, 11:02 AM
Hi Nikolay,

I found the problem to my customized solution about your code

The Problem is about this event

private void RadChart_DataBound(object sender, ChartDataBoundEventArgs e)
{
    RadChart chart = sender as RadChart;
 
    foreach (TickPoint tick in chart.DefaultView.ChartArea.AxisY.TickPoints)
    {
        tick.Label = MyClass.Processes[(int)tick.Value];
    }
}



According to my code, I turn off defaultViewLayout and then create own multiple chart Area with same step as this link in the code behind C#

http://www.telerik.com/help/silverlight/radchart-populating-with-data-data-binding-to-many-chart-areas.html


Then,  since I add chartArea into Grid (And grid become radChart.Content), Instead of call chartArea from the DefaultView, How can I call chartArea(s) from the Grid in the event DataBound (Suppose I have 3 chartArea in it)
0
Accepted
Nikolay
Telerik team
answered on 23 Nov 2011, 09:43 AM
Hello Woramin,

In this case the best alternative would be to subscribe to the specific chart area's AxisY.RangeChanged event :
ChartArea chartArea3 = new ChartArea();
chartArea3.Name = "Area3_Name";
chartArea3.AxisY.RangeChanged +=new EventHandler(AxisY_RangeChanged);

 instead of doing it on the DataBound event of the RadChart.

All the best,
Nikolay
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Woramin
Top achievements
Rank 1
answered on 25 Nov 2011, 05:00 AM
Thanks Nikolay,

The code works fine now.
Tags
Chart
Asked by
Woramin
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Woramin
Top achievements
Rank 1
Share this question
or