user1664642
user1664642

Reputation: 11

AxisLabel Stacked Column Chart using MsWeb Chart

I'm using Ms Web Chart to have stacked column chart. The Axis Label are coming properly if the no of columns are <= 9. if it is more than 9 then the lables are not coming properly.

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";

if the pointindex is less than = 9 then it is coming fine if it is > 9 then the axis labels are coming properly

Upvotes: 1

Views: 333

Answers (1)

jabeen
jabeen

Reputation: 1

<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>

Add this LabelAutoFitStyle="LabelsAngleStep90" Interval="1" to your axis info . you can see as many labels as you want

Upvotes: 0

Related Questions