I want same color to Y Axis as its corressponding Line.
Check out the attached image for more information.
Thanx in advance.
Check out the attached image for more information.
Thanx in advance.
4 Answers, 1 is accepted
0
Accepted
Hello Rahul,
You can use a style for the additional axis, with the proper color. This may look something like this:
All the best,
Yavor
the Telerik team
You can use a style for the additional axis, with the proper color. This may look something like this:
<Style x:Key="AxisLineStyle" TargetType="Line">
<Setter Property="Stroke" Value="Orange"/>
<Setter Property="StrokeThickness" Value="5"/>
</Style>
AxisY axisY = new AxisY();
axisY.AxisName = "AxisY_South";
axisY.Title = "Kilowatt [kW]";
axisY.AxisStyles.AxisLineStyle = this.Resources["AxisLineStyle"] as Style;
Chart1.DefaultView.ChartArea.AdditionalYAxes.Add(axisY);
All the best,
Yavor
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Rahul
Top achievements
Rank 2
answered on 16 Mar 2011, 12:30 PM
First of all thanks for ur reply. It helped me a lot.
But one more problem I'm Having is that the no. of Y-axises is not fixed.
It may be one or two or five y-axis will be there.
So how can i manage the line series color with corresponding Y-axis
color.
Please give me solution for this problem.
Try to solve it in code behind or in C#.net.
Thanks in advance.
But one more problem I'm Having is that the no. of Y-axises is not fixed.
It may be one or two or five y-axis will be there.
So how can i manage the line series color with corresponding Y-axis
color.
Please give me solution for this problem.
Try to solve it in code behind or in C#.net.
Thanks in advance.
0
Rahul
Top achievements
Rank 2
answered on 16 Mar 2011, 01:07 PM
First of all thanks for ur reply. It helped me a lot.
But one more problem I'm Having is that the no. of Y-axises is not fixed.
It may be one or two or five y-axis will be there.
So how can i manage the line series color with corresponding Y-axis
color.
Please give me solution for this problem.
Try to solve it in code behind or in C#.net.
Thanks in advance.
But one more problem I'm Having is that the no. of Y-axises is not fixed.
It may be one or two or five y-axis will be there.
So how can i manage the line series color with corresponding Y-axis
color.
Please give me solution for this problem.
Try to solve it in code behind or in C#.net.
Thanks in advance.
0
Accepted
Hi Rahul,
In such case, you can declare statically the maximum number of styles that you expect to have shown in your application, for example 10. Then, once you start adding additional y axis to the control, you can assign a style to each one of them, at the time the axis is created, much in the same manner demonstrated before. I hope this information helps.
Kind regards,
Yavor
the Telerik team
In such case, you can declare statically the maximum number of styles that you expect to have shown in your application, for example 10. Then, once you start adding additional y axis to the control, you can assign a style to each one of them, at the time the axis is created, much in the same manner demonstrated before. I hope this information helps.
Kind regards,
Yavor
the Telerik team