Transparent plot.

Oystein Bjorke hace 10 años actualizado por bmelon hace 9 años 1
This discussion was imported from CodePlex

bitmatic wrote at 2014-04-12 13:21:

I have a wpf window that has a Gradient background.

I am trying to make a plot that shows the background gradient through the plot.

I have tried setting both the PlotModel's Background and PlotAreaBackground to transparent, but it just doesn't work. The plot always has a White Background.

Is it not possible to have transparent background on an OxyPlot?

tibel wrote at 2014-04-12 13:29:

Try to set it in XAML on Plot element:
Background="Transparent"

bitmatic wrote at 2014-04-12 13:49:

Exactly what i needed to do.... Thanks a lot.
I was using Background="{0:null}" and not Background="Transparent" (WPF) and was not getting zoom etc to work - now I know why.

With a null background, mouse/gesture events (such as zoom), are not captured - I have to have the cursor over a drawn element such as series line or the numbers of the axis for zoom to work when there is a transparent background. Using Transparent fixed it. null backgrounds sound useful in some situations though when you want background controls to get mouse events - good to know!