【发布时间】:2014-05-15 23:08:43
【问题描述】:
我正在尝试为图表添加一条虚线,但它一直显示为实线。我该如何解决?
static public NPlot.Bitmap.PlotSurface2D getDashlineGraph(int itemID, int width, int height)
{
NPlot.Bitmap.PlotSurface2D plot = new NPlot.Bitmap.PlotSurface2D(width, height);
plot.BackColor = Color.WhiteSmoke;
plot.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
LinePlot TotaldashLine = new LinePlot(straightline, timer);
float[] pattern = { 5.0f, 10.0f };
TotaldashLine.Pen = new Pen(Color.Green,0.5f);
TotaldashLine.Pen.DashPattern = pattern;
plot.Add(TotaldashLine, NPlot.PlotSurface2D.XAxisPosition.Bottom, NPlot.PlotSurface2D.YAxisPosition.Right, 100);
Grid oGrid = new Grid();
oGrid.HorizontalGridType = Grid.GridType.Coarse;
oGrid.VerticalGridType = Grid.GridType.Coarse;
plot.Add(oGrid);
plot.Refresh();
return plot;
}
【问题讨论】: