Redraw After Font Change

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
User avatar
blakeadkins
Posts: 44
Joined: Tue Feb 25, 2014 7:49 pm

Redraw After Font Change

Post by blakeadkins » Thu Apr 02, 2015 4:25 pm

I'm having an issue with the Axes Title when I change the font size; the containing "rectangle" is not recalculated when binding. I believe this was fixed for annotations, but I'm seeing this on Chart title as well. Is there a way to force a redraw? I've tried FullRepaint, but that doesn't do it.

I've attached 2 files that show the cutoff after changing the size.
Attachments
afterSizeChange.PNG
afterSizeChange.PNG (1.47 KiB) Viewed 14657 times
beforeSizeChange.PNG
beforeSizeChange.PNG (2.55 KiB) Viewed 14657 times

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

Re: Redraw After Font Change

Post by ArctionPasi » Thu Apr 02, 2015 4:59 pm

You are right, there is a problem in font size setter.

It needs creating a new font:
m_chart.ViewXY.XAxes[0].Title.Font = new WPFFont(m_chart.ViewXY.XAxes[0].Title.Font.Family.ToString(), m_chart.ViewXY.XAxes[0].Title.Font.Size + 2f);

Then the size is adjusted correctly.

We'll provide fix in the next assembly pack. Our apologies.
LightningChart Support Team, PT

User avatar
blakeadkins
Posts: 44
Joined: Tue Feb 25, 2014 7:49 pm

Re: Redraw After Font Change

Post by blakeadkins » Thu Apr 02, 2015 5:35 pm

Thanks Pasi!

Do you have an estimate on time when the next assembly will be coming?

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

Re: Redraw After Font Change

Post by ArctionPasi » Thu Apr 02, 2015 5:49 pm

2-3 weeks.
LightningChart Support Team, PT

srinin2k
Posts: 25
Joined: Thu Jun 18, 2015 9:22 pm

Re: Redraw After Font Change

Post by srinin2k » Thu Jan 25, 2018 11:52 pm

We are using V8.1.2. So, I have the same problem with the font size. I use the following code to update fonts size.

try
{
BeginUpdate();
if (xAxisChart.LabelsFont.Size != value)
{
xAxisChart.LabelsFont.Size = value;
yAxisChart.LabelsFont.Size = value;
xAxisChart.Title.Font.Size = value;
yAxisChart.Title.Font.Size = value;
LegendBox.SeriesTitleFont.Size = value;
}
Chart.UpdateLayout();
}
finally
{
EndUpdate();
}

If I start from low font and move to higher font, the labels of Y axis and Legend are cut off.

Everything works if I plot the points again. Do I have to do this?

ArctionKestutis
Posts: 552
Joined: Mon Mar 14, 2016 9:22 am

Re: Redraw After Font Change

Post by ArctionKestutis » Fri Jan 26, 2018 3:51 pm

Hi,

It should be enough to include pair of BeginUpdate() and EndUpdate() method call. Chart’s EndUpdate() methods just informs chart that new frame should be rendered.
I don't see any problems, at least in semi-bindable LightningChart v8.2.2.1: with each Value increase, labels and Title increased, and margins have been updated.
Check that you did not use manual margins: _chart.ViewXY.AxisLayout.AutoAdjustMargins = true

There is no use for Chart.UpdateLayout() call.
If you want to re-create all draw data use _chart.FullRepaint();

Hope this helps.
All the best.

Post Reply