Closed kvenkataraman closed 2 months ago
UPDATE:
Looks like you need to set the Height and Width properties in order for the chart to render if it's on a sub-control. Is this expected? The samples don't explicitly call out having to set those properties.
Hello.
That depends on the layout the chart is placed on.
LiveCharts controls do not set an initial size, it is up to the developer to build that, maybe in a Future we will consider adding min height and width constraints to prevent this confusion.
Bug (?): Not entirely convinced this is a bug, but perhaps how the DataContext for the charts is being resolved. In any case ...
Embedded a CartesianChart in an AvaloniaUserControl (SubControlView/SubControlViewModel) and placed that on the MainView. The chart does not render when embedded in the control, but will render if placed directly on the MainView/MainViewModel.
To Reproduce Steps to reproduce the behavior:
Expected behavior Expect charts to render whether from a control or main window.
Desktop (please complete the following information):
Additional context Have tried ReflectionBinding, and setting RelativeSource but to no avail. Possibly related to this: https://github.com/beto-rodriguez/LiveCharts2/issues/1566