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

Line Chart: A and Y Axis labels not accepting font changes

5 Answers 87 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 09 Apr 2012, 02:05 PM
Good Morning,

I've been working on a line chart for a project, and managed to solve all o fmy questions, save one.  I changed the font size of the chart's X and Y axis labels to 15, then hit save.  I noticed that on the designer, the changes were shown.  However, when I hit preview to test those changes, the font remains the same 8.25 it was before.  The properties field shows the font size I asked for as well.  Needless to say, I am little confused as to why Telerik is refusing to accept changes.  Does this have to happen programatically, instead of the properties interface?

Thanks!

5 Answers, 1 is accepted

Sort by
0
Hadib Ahmabi
Top achievements
Rank 1
answered on 09 Apr 2012, 03:07 PM
If you use skin, some of the chart properties are reset. If this is the case, simply set these properties programmatically in the constructor after the InitializeComponent() method call. 
0
Matt
Top achievements
Rank 1
answered on 09 Apr 2012, 03:11 PM
Thanks.  That is what I was afraid of.  I don't understand the programming side of this at all.  I know how to manipulate the properties menus, and that's about it.

Thanks for the quick response!!
0
Steve
Telerik team
answered on 09 Apr 2012, 03:49 PM
Hello Matt,

Although we push our efforts in creating an unique report designer, so that you can do everything from design time, there are still cases when one would have to write a few lines of code, after all Telerik Reporting is a tool aiming at developers and it requires developer skills.
I've attached a screenshot that shows the line of code we added after InitializeComponent in the Report.cs file.

Hope this helps.

Kind regards,
Steve
the Telerik team
NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.
0
Matt
Top achievements
Rank 1
answered on 10 Apr 2012, 02:36 PM
Ok.  So I used the string of code you sent through, and it is still refusing to make the changes to the chart.  To give you an idea of where I thought this had to go:

this

.chart2.PlotArea.YAxis.Appearance.TextAppearance.TextProperties.Font = new System.Drawing.Font("Arial", 15F);

this.chart2.PlotArea.YAxis.AxisLabel.TextBlock.Text = "Capacity";

It pretty much breaks the chart.  I'm sorry that this is so frustrating, but I just can't figure this thing out.  Having a properties menu that doesn't work doesn't help things either.

0
Steve
Telerik team
answered on 11 Apr 2012, 10:01 AM
Hello Matt,

As explained earlier, the properties menu runs, but the style properties are overridden when you use Skin. This behavior is by design and cannot be changed. If you aim at entirely customizing your chart look, then remove the Skin of the chart and set its style manually from the designer and you won't have to write a single line of code.
I've also included a report that shows the correct behavior of the code you're trying to use. Note that in order for the AxisLabel text to show, you should set its Visible property to true first as it is hidden by default. Place the attached report in your application and run it to see the code is taken into account.

Kind regards,
Steve
the Telerik team
NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.
Tags
General Discussions
Asked by
Matt
Top achievements
Rank 1
Answers by
Hadib Ahmabi
Top achievements
Rank 1
Matt
Top achievements
Rank 1
Steve
Telerik team
Share this question
or