Band Title Problem

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
vifani
Posts: 49
Joined: Thu May 02, 2013 8:35 am

Band Title Problem

Post by vifani » Thu May 12, 2016 10:33 am

Hi,
I have a chart with some bands like the picture below:
BandTitleProblem.png
BandTitleProblem.png (9.08 KiB) Viewed 7763 times
If the band is too thin, band titles are unreadable.
Is there a way to show the title only if there is the minimum space to show it?

vifani
Posts: 49
Joined: Thu May 02, 2013 8:35 am

Re: Band Title Problem

Post by vifani » Mon May 16, 2016 3:33 pm

Any news?
Is the problem clear?

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: Band Title Problem

Post by ArctionPasi » Tue May 17, 2016 5:38 am

Hi.

You can convert the band's ValueBegin and ValueEnd to screen coordinates with xAxis.ValueToCoord method. Then you get the horizontal size in pixels.

Measure the title text with chart.MeasureText method, where you pass the band title font and the text. You'll get the width of the text in pixels. If title width is larger than the space calculated above, set band.Title.Visible = false.
LightningChart Support Team, PT

Post Reply