I've been using TeeChart successfully with line and bar charts however I'm having trouble with a horizontal Histogram.
I have a range or numbers, for example one hundred numbers between 1 and 5. In other words x number are 1, x number are 2, x number are 3 etc etc.
I need to plot the nmbers 1 - 5 on the Y axis and the number of occurences on the X and display horizontal bars displaying the number of occurences for each. Something like this
5 ||||||||||||
4 ||||||
3 |||||||||||||||||
2 ||||
1 ||||||||||||
0 5 10 15 20 25
I'm having trouble creating a series and adding it in such a way to produce the chart required. Any help would be much appreciated, many thanks.
Need help with Horizontal histogram!
-
- Newbie
- Posts: 6
- Joined: Thu Apr 24, 2008 12:00 am
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi edgemeistergeneral,
To achieve what you request you need to populate horizontal series like this:
To achieve what you request you need to populate horizontal series like this:
Code: Select all
horizHistogram1.Add(25, 0);
horizHistogram1.Add(13, 1);
horizHistogram1.Add(23, 2);
horizHistogram1.Add(19, 3);
horizHistogram1.Add(3, 4);
horizHistogram1.Add(6, 5);
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 6
- Joined: Thu Apr 24, 2008 12:00 am
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi edgemeistergeneral,
Yes, you can either set axes min. and max. offset:
or manually set left axis min. and max. values:
Yes, you can either set axes min. and max. offset:
Code: Select all
tChart1.Axes.Left.MaximumOffset = 30;
tChart1.Axes.Left.MinimumOffset = 30;
Code: Select all
tChart1.Axes.Left.SetMinMax(horizHistogram1.MinYValue() - 1, horizHistogram1.MaxYValue() + 1);
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |