Page 1 of 1

Redraw After Font Change

Posted: Thu Apr 02, 2015 4:25 pm
by blakeadkins
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.

Re: Redraw After Font Change

Posted: Thu Apr 02, 2015 4:59 pm
by ArctionPasi
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.

Re: Redraw After Font Change

Posted: Thu Apr 02, 2015 5:35 pm
by blakeadkins
Thanks Pasi!

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

Re: Redraw After Font Change

Posted: Thu Apr 02, 2015 5:49 pm
by ArctionPasi
2-3 weeks.

Re: Redraw After Font Change

Posted: Thu Jan 25, 2018 11:52 pm
by srinin2k
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?

Re: Redraw After Font Change

Posted: Fri Jan 26, 2018 3:51 pm
by ArctionKestutis
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.