Page 1 of 1

Query on text to be displayed on bar charts

Posted: Tue Oct 18, 2005 6:13 am
by 8126031
Hi,

I've got a stacked bar chart and I want to know if its possible to display some text information at the middle of every bar that is stacked.
Making the Marks.Visible property to true will display the value at the top of every stacked bar. If the values in the stack are less, then they get cluttered. This is not every elegant. I want to be able to display the same value neatly in the middle of the bar. Please lemme know if its possible.

My 2nd query is regarding the X Axis. I have 3 stacked bars displayed. Instead of having 1, 2, 3 on the X axis, can I display some customized text corresponding to each of the 3 stacked bars ?

Any help on this will be appreciated.

Thanks,
spacemanspiff

Posted: Tue Oct 18, 2005 11:12 am
by narcis
Hi spacemanspiff,

Please see the example below which does what you request.

For marks on each bar you could also use canvas custom drawing.

Regarding axis labels, you can already add custom text when populating the series as shown in the snippet below. By uncommenting the last line you will force axes to display each points text as labels. However, by default, if points have text it is already displayed on the axis.

Code: Select all

		private void Form1_Load(object sender, System.EventArgs e)
		{
			Random randObj = new Random( 100 );

			for (int i=0;i<tChart1.Series.Count;++i)
			{
				for (int j=0;j<5;++j)	
					tChart1[i].Add(randObj.Next(),"Point "+j.ToString());

				tChart1[i].Marks.Arrow.Visible=false;
				tChart1[i].Marks.ArrowLength=-20;
			}

			//tChart1.Axes.Bottom.Labels.Style=Steema.TeeChart.AxisLabelStyle.Text;
		}