This is a migrated thread and some comments may be shown as answers.
Y-Axis Label Scaling
5 Answers 36 Views
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 11 Sep 2013, 10:18 AM
I've just started with the chart control, but seem to be hitting a brick wall. I'm trying to get the labels, primarily on the Y-Axis to scale properly. Skip entries is probably a better term than scale possibly.

When the window size is changed the charts scale with the window, but the labels don't and they end up all compressed and scrunched up. I don't know if it's the parent control that's causing this or some other issue.

I've attached a couple of files showing the normal view (uncompressed) and then when I resize the window (compressed). The charts are in a standard WPF grid, which is in a RadPane. I can post the XAML if needs be, but it's doing nothing more than binding to the data at present.


5 Answers, 1 is accepted

Sort by
0
Accepted
Petar Kirov
Telerik team
answered on 15 Sep 2013, 12:43 PM
Hi Mike,

I have attached a sample project that shows how you can achieve such skipping label fit mode.

I hope this helps.
 
Regards,
Petar Kirov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Mike
Top achievements
Rank 1
answered on 25 Sep 2013, 07:21 PM
Excellent, thanks.

Is this functionality likely to reach the actual product as a feature? I would image it's a common "ask".
0
Petar Kirov
Telerik team
answered on 30 Sep 2013, 07:23 AM
Hi Mike,

I'm glad that the solution I provided was helpful. 

I agree that it would be nice if the control provided this functionality out-of-the-box. That's why I logged this as a feature request in our Public Issue Tracker on this link. You are invited to vote for it and promote it. More votes will push it with a higher priority in our backlog.

Regards,
Petar Kirov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Andrew
Top achievements
Rank 1
answered on 16 Apr 2015, 04:04 PM

I'm having a similar problem but in reverse. 

My application opens in a windowed state so the chart starts out with the y axis labels compressed but looks fine when maximised. 

I've tried implementing the sample code but find that I can't adapt it to work for the first display of a chart as labels.Count() always returns 0 and the chart.PlotAreaClip is not yet set. 

The provided code works perfectly when I maximise the window then return it to a windowed state. 

Could you recommend a way to stop the axis titles from compressing together to begin with before resizing? 

0
Martin Ivanov
Telerik team
answered on 20 Apr 2015, 10:55 AM
Hello Andrew,

I tested your scenario with the Petar's project and our latest release Q1 2015 SP1 and everything works as expected on load of the window. The SizeChanged event is called when the chart is measured and the custom logic is executed properly. 

Also keep in mind that currently we are working on such functionality to be supported out of the box by the chart. We have it logged in our feedback portal where you can track its status. If you follow the item you will be notified as soon as there is any change in the feedback item's status.

In the mean time you can always show only several labels so that they never overlap. Or you can try to execute the logic from the Petar's project in a Dispatcher in the Loaded event of the chart. For example:
void chart_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
    Dispatcher.BeginInvoke(new Action(() => {
        CalculateVerticalLabelInterval();
    }));
}

Regards,
Martin
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Asked by
Mike
Top achievements
Rank 1
Answers by
Petar Kirov
Telerik team
Mike
Top achievements
Rank 1
Andrew
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or