我正在使用Ms Web Chart来创建堆叠柱状图。如果列数<=9.如果它超过9,那么lables就不能正常出现。
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";
如果点索引小于=9,那么它就可以了。如果它>9,那么轴标签就可以正确地到达
<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"
添加到轴信息中。您可以看到任意数量的标签