问题
Here's screenshot of my form with a Zedgraph:
It's how I want it: grey graph on a grey form; no graph or chart borders. The only problem is the aliasing. So I add this:
zedGraphControl1.IsAntiAlias = true;
but then I get this:
How can I get rid of that partial border on the top and left of the graph that now appears?
回答1:
zedgraphControl1.MasterPane.Border.IsVisible = false;
Should fix it.
回答2:
i dug around the zedgraph source; couldn't find any easy cause/fix. so, i just turned off antialiasing for the whole graph (in the designer) and then turned it on for the individual components:
myPane.XAxis.Title.FontSpec.IsAntiAlias = true;
LineItem curve_x = new LineItem("x", x_values, sensor_x, Color.Red, SymbolType.None, 2.5F);
LineItem curve_y = new LineItem("y", x_values, sensor_y, Color.Blue, SymbolType.None, 2.5F);
LineItem curve_z = new LineItem("z", x_values, sensor_z, Color.Green, SymbolType.None, 2.5F);
curve_x.Line.IsAntiAlias = true;
curve_y.Line.IsAntiAlias = true;
curve_z.Line.IsAntiAlias = true;
myPane.XAxis.Scale.FontSpec.IsAntiAlias = true;
myPane.YAxis.Scale.FontSpec.IsAntiAlias = true;
that did the trick.
http://www.eff1fan.com/antialias-workaround.png
来源:https://stackoverflow.com/questions/17287666/isantialias-creates-border-around-graph