Customize the borders of PlotView: PlotAreaBorderThickness is not a Thickness, but a double

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

Auriou wrote at 2014-05-24 14:55:

Hi all, I would not have a border at the top and right side of my graphics.

But it seems that this is not possible because the PlotAreaBorderThickness PlotView property is a double, not a Thickness. (currently PlotAreaBorderThickness = "1")

Should be able to write
PlotAreaBorderThickness = "1,0,0,1" like BorderThickness = "1,0,0,1"

Thank.

Auriou wrote at 2014-05-24 18:35:

I found the solution:

var model = new PlotModel()
{
    PlotAreaBorderThickness = 0, 
};

var lineAxis = new LinearAxis()
{
      AxislineStyle = LineStyle.Solid
 };
model.Axes.Add(lineAxis);

....Other axes with AxislineStyle = LineStyle.Solid

model.Axes.Add(dateTimeAxis);

objo wrote at 2014-05-25 13:51:

This should be covered by http://oxyplot.codeplex.com/workitem/10006
I agree it is a good idea! But I am not sure who should have the responsibility of drawing those lines - the axes or the plot...

objo wrote at 2014-05-25 15:47:

This should be fixed now.
I am sorry about breaking the build for those who have used PlotAreaBorderThickness, but it should be very easy to correct. Simply replace the double value by new OxyThickness(x).

Auriou wrote at 2014-05-26 09:09:

Great, thank you! it's true that it's normal that the PlotAreaBorderThickness property that must manage the plot borders and not axes responsibility.

  PlotAreaBorderThickness = new OxyThickness() { Bottom = 1, Left = 1, Right = 0, Top = 0}
now it works, thank you again.
CodePlex