当我将steema tee图以pdf格式导出时,在底部带有图例的情况下,抛出异常,提示高度必须为非负数。
我通过调试器检查了所有的height属性都不包含负值。
TChart图表= new TChart();
chart.CurrentTheme = ThemeType.Opera;
chart.Walls.Back.Visible = true;
chart.Walls.Back.Pen.Visible = true;
chart.Legend.MaxNumRows = 2;
chart.Legend.Pen.Visible = false;
Line lineSeries = new Line(chart.Chart);
lineSeries.FillSampleValues();
Line lineSeries1 = new Line(chart.Chart);
lineSeries1.FillSampleValues();
chart.Legend.Visible = true;
chart.Legend.Alignment = LegendAlignments.Bottom;
chart.Legend.Pen.Visible = true;
chart.Draw();
chart.Export.Image.PDF.Width = chart.Width;
chart.Export.Image.PDF.Height = chart.Height;
chart.Export.Image.PDF.Save(filepath);
我检查了图例是否在右侧,它可以正常工作,但我想在图的底部显示图例。