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

Support for minor grid lines in ChartView?

4 Answers 175 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Don
Top achievements
Rank 1
Don asked on 10 Jun 2013, 05:09 PM
How do I display minor gridlines in a ChartView?  The data is displayed in a standard cartesian grid with an X and Y axis.

4 Answers, 1 is accepted

Sort by
0
Accepted
Rosko
Telerik team
answered on 12 Jun 2013, 10:38 AM
Hi Donald,

Currently, we do not support minor ticks, thus, the same applies for minor gridlines.

I can offer you the following workaround using CustomGridLines as part of the Annotations feature (demo and help topic) of ChartView.

First of all, you need to have explicitly set Minimum, Maximum, and MajorStep of the axis:
<telerik:RadCartesianChart.VerticalAxis>
                <telerik:LinearAxis Maximum="100"
                              Minimum="0"
                              MajorStep="20"/>
</telerik:RadCartesianChart.VerticalAxis>

Then, you can generate the custom grid lines in the constructor of the window:
public MainWindow()
        {
            InitializeComponent();
            var chartVerticalAxis = (this.chart.VerticalAxis as LinearAxis);
            var min = chartVerticalAxis.Minimum;
            var max = chartVerticalAxis.Maximum;
            var majorStep = chartVerticalAxis.MajorStep;
            var minorOffset = majorStep / 2;
 
            for (double i = minorOffset; i < max; i += majorStep)
            {
                chart.Annotations.Add(new CartesianGridLineAnnotation() { Value = i, Stroke = new SolidColorBrush(Colors.Red), StrokeThickness = 1, Axis = chartVerticalAxis});
            }
        }

I hope that this will server you well.

Regards, Rosko
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Don
Top achievements
Rank 1
answered on 12 Jun 2013, 08:47 PM
Thanks.  Works for me. :)
0
Saurabh
Top achievements
Rank 1
answered on 04 Aug 2014, 08:01 PM
I see this is still a non-implemented feature at Q2 2014 release. How and when are you planning to implement minor grid lines in Chart view? Also, the current workaround will be very tedious if I have to do it for live like in your example - http://demos.telerik.com/silverlight/#ChartView/LiveData. (I know that is link to a silverlight demo)
0
Martin Ivanov
Telerik team
answered on 07 Aug 2014, 10:15 AM
Hi Saurabh,

I already answered your question in the Creating Custom Major Lines  when using LogarithmicAxis forum.

Regards,
Martin
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
ChartView
Asked by
Don
Top achievements
Rank 1
Answers by
Rosko
Telerik team
Don
Top achievements
Rank 1
Saurabh
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or