Menu

#34 Incorrect graph positioning when there is a large legend

open
nobody
None
5
2005-05-23
2005-05-23
Angel Marin
No

Under some circumstances, when the number of elements
in the legend is big enough, the graph is drawn as
shown in the png attached.

Code that reproduces the problem:

System.Random rnd = new System.Random();
NPlot.Bitmap.PlotSurface2D graph = new
NPlot.Bitmap.PlotSurface2D(500, 300);
graph.Title = "Title";
for ( int i=0; i<50; i++) {
NPlot.LinePlot lp = new NPlot.LinePlot();
int[] ds = new int[10];
for ( int j=0; j<10; j++) {
ds[j] = rnd.Next();
}
lp.DataSource = ds;
lp.Color = System.Drawing.Color.RosyBrown;
lp.ShowInLegend = true;
lp.Label = System.String.Concat ("LinePlot ", i);
graph.Add( lp );
}
graph.Legend = new NPlot.Legend();
graph.XAxis1.Label = "XAxis1.Label";
graph.Refresh();
graph.Bitmap.Save("bitmap.png");

Discussion

  • Angel Marin

    Angel Marin - 2005-05-23

    Graph that shows the positioning problem

     
  • Angel Marin

    Angel Marin - 2005-05-23

    Logged In: YES
    user_id=627967

    Forgot to mention: NPlot v0.9.8.8

     

Log in to post a comment.

MongoDB Logo MongoDB