Hello,
question about FastColumnRenderableSeries:
assuming the UseUniformWidth is set to True (all columns are same width) and Series already displayed: how I could get the actual width for one (any) column from code?
I.e. I do not want to use GetColumnWidth(IPointSeries points, IRenderPassData renderPassData) to computes the width of the columns to be drawn.
Just need to get the actual width for column already drawn.
From code.
Thanks!
-Egor
- Egor Baykov asked 6 years ago
- You must login to post comments
Hi Egor
There is no way to get the width of a column drawn, other than to hook into the code in FastColumnRenderableSeries and output an event when column is drawn and report the size.
for example:
public class FastColumnRenderableSeriesEx : FastColumnRenderableSeries
{
public Action<double> OnGetColumnWidth { get; set; }
protected override double GetColumnWidth(IPointSeries points, IRenderPassData renderPassData)
{
double width = base.GetColumnWidth(points, renderPassData);
OnGetColumnWidth?.Invoke(width);
return width;
}
}
this function (GetColumnWidth) is called once when the column series draws.
Does that help?
Best regards,
Andrew
- Andrew Burnett-Thompson answered 5 years ago
- Andrew, thanks a lot – it works! Just to make sure I’m implementing the things in most intelligent way: My task is to adjust the Annotation font with Column width (which is changed based on bar numbers) Please see: https://i.stack.imgur.com/bXUb1.png I.e. reduce FontSize if possible. If it is too small – suppress the annotation. I.e to my vision the logic shall be based on Column width and the hook way you suggested is working for this. Unless there is better way to achieve the same…please let me know Thanks! -Egor
- I think that sounds sane. There was a solution before on adjusting annotation scaling based on chart size: https://www.scichart.com/questions/question/text-annotation-resizing-with-controltemplates
- You must login to post comments
Please login first to submit.