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.
Redraw After Font Change
Moderator: Queue Moderators
- blakeadkins
- Posts: 44
- Joined: Tue Feb 25, 2014 7:49 pm
Redraw After Font Change
- Attachments
-
- afterSizeChange.PNG (1.47 KiB) Viewed 14793 times
-
- beforeSizeChange.PNG (2.55 KiB) Viewed 14793 times
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Redraw After Font Change
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.
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
- blakeadkins
- Posts: 44
- Joined: Tue Feb 25, 2014 7:49 pm
Re: Redraw After Font Change
Thanks Pasi!
Do you have an estimate on time when the next assembly will be coming?
Do you have an estimate on time when the next assembly will be coming?
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Redraw After Font Change
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?
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?
-
- Posts: 555
- Joined: Mon Mar 14, 2016 9:22 am
Re: Redraw After Font Change
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.
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.