Query on text to be displayed on bar charts

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
spacemanspiff
Newbie
Newbie
Posts: 10
Joined: Fri Jul 02, 2004 4:00 am
Contact:

Query on text to be displayed on bar charts

Post by spacemanspiff » Tue Oct 18, 2005 6:13 am

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Oct 18, 2005 11:12 am

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;
		}
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply