红框中x坐标名称过长太挤, 我想隐藏或者去掉,保留右边紫色边框中的标题就行了
代码
protected void CreateChartByYear(BarSeries YearValueSeries, Unit top, Unit left, Unit width)
{
//YearNameSeries.v
FarPoint.Web.Chart.YPlotArea plotArea = new FarPoint.Web.Chart.YPlotArea();
//FarPoint.Web.Chart.Y
plotArea.Location = new System.Drawing.PointF(0.1f, 0.2f);
plotArea.Size = new System.Drawing.SizeF(0.7f, 0.6f);
YearValueSeries.VaryColors = true;
plotArea.Series.Add(YearValueSeries);
FarPoint.Web.Chart.LabelArea label = new FarPoint.Web.Chart.LabelArea();
label.Text = hfFirstYear.Value;
label.Location = new System.Drawing.PointF(0.5f, 0.02f);
label.AlignmentX = 0.5f;
label.AlignmentY = 0.0f;
FarPoint.Web.Chart.LegendArea legend = new FarPoint.Web.Chart.LegendArea();
legend.Location = new System.Drawing.PointF(0.98f, 0.5f);
legend.AlignmentX = 1.0f;
legend.AlignmentY = 0.5f;
FarPoint.Web.Chart.ChartModel model = new FarPoint.Web.Chart.ChartModel();
model.LabelAreas.Add(label);
model.LegendAreas.Add(legend);
model.PlotAreas.Add(plotArea);
SpreadChart chart = new SpreadChart();
chart.Model = model;
if (fpSpreades.ActiveSheetView.Charts.Count != 0)
{
fpSpreades.ActiveSheetView.Charts.RemoveAt(0);
}
fpSpreades.ActiveSheetView.Charts.Add(chart);
fpSpreades.ActiveSheetView.Charts[0].Left = left;
fpSpreades.ActiveSheetView.Charts[0].Top = top;
fpSpreades.ActiveSheetView.Charts[0].Width = width;
}
|
|