Problem with TBoxSeries

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Johan Ingemansson
Newbie
Newbie
Posts: 59
Joined: Fri May 28, 2004 4:00 am
Location: Sweden

Problem with TBoxSeries

Post by Johan Ingemansson » Mon Sep 20, 2004 12:16 pm

Hi,

Problem 1

If the TBoxSerie only has one value, then the box should be shrinken and only the median should be showed, or? If I have this outcome a complete box will be drawn. Does anyone know how to solve this problem?

Problem 2

This problem may be stupid but I haven´t completely understood how the XLabel system works, here it goes. If I want to create a chart with X different TBoxSeries in it, then I add one serie at a time to the Chart, increasing the position with one unit. But here comes my problem if I want to set the XLabels. Say for example that I want to add two TBoxSeries. Then if I set Serie1.XLabel[0]:='test1', Serie1.XLabel[1]:='test2', and with Serie2.XLabel[0]:='test1',Serie2.XLabel[1]:='test2'.
If I do this then I get double labels, on each label, but if I just define Serie1.XLabel[0]:='test1' and Series2.XLabel[1]:='test2', this does the trick in some cases. But sometimes it fails, and one label is left blank. I´ve stepped this and confirmed that the label text is inputed correctly. Does anyone know how to solve this problem? I think I´m missing something fundamental here.

Best Regards,

Johan Ingemansson

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Mon Sep 20, 2004 1:16 pm

Hi.

[quote]Problem 1[/qoute]
The first problem looks like a bug to me. I'll change the internal Percentile calculation for single point. In the meantime the workaround in this case is to manually set all box series properties (see TeeChart demo to see how it can be done).
[quote]Problem 2[/qoute]
The XLabels won't do you any good in this case (the same situation as with multiple bar series). Instead, the best solution is to use custom axis labeling and define label for each series by using the code bellow:

Code: Select all

var i: Integer;
begin
  Series1.Title := 'First'+#13+'dataset';
  Series2.Title := 'Second'+#13+'dataset';
  Series1.Add(10);
  Series2.Add(10);
  Series2.Add(11);
  Series2.Add(15);

  // setup custom labels for bottom axis
  With Chart1.Axes.Bottom.Items do
  begin
    Clear;
    for i := 0 to Chart1.SeriesCount -1 do
      if (Chart1.Series[i] is TBoxSeries) then
        Add(TBoxSeries(Chart1.Series[i]).Position,Chart1.Series[i].Title)
  end;
Marjan Slatinek,
http://www.steema.com

Johan Ingemansson
Newbie
Newbie
Posts: 59
Joined: Fri May 28, 2004 4:00 am
Location: Sweden

Post by Johan Ingemansson » Mon Sep 20, 2004 4:48 pm

Hi,

If I draw a boxplot having the following values: 0,0,0,30,480. Then the box will go from zero to about 137, and the upper whisker will go down into the box to the value 30. The value 480 will be identified as a mild outlier. As I see it the box should go from zero to 30, no whiskers should be shown and the value 480 should be an extreme outlier, or?

Best Regards,

Johan Ingemansson

Post Reply