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

[Solved] Show Gridlines from code and change title size

1 Answer 78 Views
Chart for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rami Laiho
Top achievements
Rank 1
Rami Laiho asked on 18 Oct 2013, 02:19 PM

I have programically created chart. Chart works fine, but I'm not able to show gridlines or change axis title font size.

Here's my code:

RadCartesianChart chart = new RadCartesianChart();

CartesianChartGrid grid = new CartesianChartGrid();
grid.MajorLinesVisibility = GridLineVisibility.XY;
chart.Grid = grid;

var barSeries = new BarSeries() {ItemsSource = dataItems};
barSeries.CategoryBinding = new PropertyNameDataPointBinding("Category");
barSeries.ValueBinding = new PropertyNameDataPointBinding("Value");
LinearAxis VeAx = new LinearAxis();
VeAx.HorizontalLocation = AxisHorizontalLocation.Left;
VeAx.Title = "Axis title";
barSeries.VerticalAxis = VeAx;
chart.Series.Add(barSeries);

MyStackPanel.Children.Add(chart);
MyStackPanel.UpdateLayout();

1 Answer, 1 is accepted

Sort by
0
Accepted
Rosy Topchiyska
Telerik team
answered on 21 Oct 2013, 04:17 PM
Hi Rami,

Thank you for using RadControls for Windows 8!.

The grid lines are drawn according to the chart axes, therefore you have to set the VerticalAxis and HorizontalAxis properties of the RadCartesianChart instance.

You can change the style of the title via the TitleTemplate property of the axis. I have attached a sample project that demonstrates how you can achieve this.

I hope this was useful and feel free to contact us if you need further assistance.

Regards,
Rositsa Topchiyska
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Chart for XAML
Asked by
Rami Laiho
Top achievements
Rank 1
Answers by
Rosy Topchiyska
Telerik team
Share this question
or