How to display Axis Labels for Stacked Column chart ( Asp.net chart control )?

Manish picture Manish · Jul 6, 2011 · Viewed 7.3k times · Source

I'm using ASP.NET Chart Controls for displaying some data. I'm not pulling any data from the database through a dataset. I'm adding them manually. I don't know how to add AxisLabels to X-axis or Y-axis. I've tried using Axis.title, customlabels.Add() etc.. but I couldn't display anything.

And I've this stacked column chart which has columns added through a for loop. How to add different AxisLabels to it?

for (int i= 0; i< 10; i++)

{

     Chart1.Series["1"].Points.AddY(5);

     Chart1.Series["2"].Points.AddY(8);

}

How do I add AxisLabels to these 10 columns ?

Thanks, Manish

Answer

Manish picture Manish · Jul 12, 2011
Chart1.Series(1).Points(i).AxisLabel = val;

This itself is the answer for the question. I was writing AxisX.Enabled = false; that's why I wasn't able to display axis labels for AxisX.