1

我正在使用 Ms Web Chart 来堆叠柱形图。如果列数 <= 9,则轴标签正确出现。如果超过 9,则标签无法正确出现。

for(int pointIndex = 0; pointIndex < 10; pointIndex++)
{
    Chart1.Series["Series1"].Points.AddY(Math.Round((double)random.Next(45, 95),0));
    Chart1.Series["Series2"].Points.AddY(Math.Round((double)random.Next(5, 75),0));
    Chart1.Series["Series3"].Points.AddY(Math.Round((double)random.Next(5, 95), 0));
    Chart1.Series["Series4"].Points.AddY(Math.Round((double)random.Next(35, 95), 0));

    Chart1.Series["Series1"].Points[pointIndex].AxisLabel = "test" + pointIndex;  
}

Chart1.Series["Series1"].ChartType = "StackedColumn";
Chart1.Series["Series2"].ChartType = "StackedColumn";
Chart1.Series["Series3"].ChartType = "StackedColumn";
Chart1.Series["Series4"].ChartType = "StackedColumn";

如果pointindex小于= 9,那么它会很好,如果它> 9,那么轴标签会正确出现

4

1 回答 1

0
<AxisX LineColor="64, 64, 64, 64"  Title="Instrument Type" IsLabelAutoFit="true" TitleFont="Microsoft Sans Serif, 15pt, style=Bold" LabelAutoFitStyle="LabelsAngleStep90" Interval="1" > <LabelStyle Font="Microsoft Sans Serif, 7pt, style=Bold" /> </AxisX>

将此添加LabelAutoFitStyle="LabelsAngleStep90" Interval="1" 到您的轴信息。您可以查看任意数量的标签

于 2012-09-28T07:38:47.617 回答