CT 4.2 Chart Freeze Adding a Canvas
Created at 27 May 2022, 08:45
CT 4.2 Chart Freeze Adding a Canvas
27 May 2022, 08:45
Hi,
I have noticed a break in functionality from CT 4.1, when you add a canvas to a chart for an indicator it freezes the chart and you cannot move it, I have added some code as an example.
namespace cAlgo
{
[Indicator(AccessRights = AccessRights.None)]
public class CanvasTest : Indicator
{
[Parameter(DefaultValue = "Hello world!")]
public string Message { get; set; }
[Output("Main")]
public IndicatorDataSeries Result { get; set; }
protected override void Initialize()
{
var blueRectangle = new Rectangle()
{
Width = 80,
Height = 60,
FillColor = Color.Blue,
Left = 10,
Top = 10
};
Canvas canvas = new();
canvas.AddChild(blueRectangle);
Chart.AddControl(canvas);
}
public override void Calculate(int index)
{
// Calculate value at specified index
// Result[index] =
}
}
}
Replies
Jiri
27 May 2022, 10:14
I have noticed this as well, it's acting as if the canvas is having transparent background which makes it capture mouse events. You can set IsHitTestVisible to false to fix that but that will affect all the child items which might not be desirable. Setting the BackgroundColor to null does not help.
@Jiri
amusleh
27 May 2022, 09:05
Hi,
Thanks for reporting, we were able to reproduce it and it will be fixed on future releases.
@amusleh