Hi,
I have a chart with some bands like the picture below:
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?
Band Title Problem
Moderator: Queue Moderators
Re: Band Title Problem
Any news?
Is the problem clear?
Is the problem clear?
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Band Title Problem
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.
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