Plot not filling parent container (WPF)

Oystein Bjorke 10 years ago 0
This discussion was imported from CodePlex

nsudac wrote at 2013-05-24 11:12:

I'm quite new to both WPF and OxyPlot so please forgive me if I'm missing something obvious. I'm using the DLLs from OxyPlot-NET45-2013.1.35.1.zip.

I have an OxyPlot inside a WPF Viewbox, something like the following:

<Viewbox Name="ViewBig">
<oxy:Plot Model="{Binding CameraGraph}" Name="OxyPlot" />
</Viewbox>

I would like the plot to automatically size to fit the Viewbox, as happens if I put an Image for example in the Viewbox. The problem I am having is that unless I explicitly set the Width and Height of the plot, it remains invisible. I know that the Binding to the model is working correctly as when I do set to the Width and Height explicitly the data is all there.

Am I missing something here?

Thanks in advance for any guidance.

objo wrote at 2013-06-08 12:13:

The plot control will use the available space, so you need to put it inside a container with defined width/height, or you must set the width/height of the plot control.