Hi,
I have the following problem, I have an application where the user can calculate simple(1 TBarSeries) or grouped bar diagram(More then 1 TBarSeries), if simple then 1 TBarSeries is created and values are inserted. I also calculate a XX% Confidence intervall for each bar/value. I display the XX% CI with using a TBoxSeries, I manually set the median/Q1/Q3 to the value in the TBarSeries, to display the upper/lower limit in the CI, the whiskers in the TBoxSeries are used and given appropiate values. When I add the TBoxSeries, I set the TBoxSeries.Position = 0(for first bar/value), = 1 for second bar/value,.... and this works fine when I have 1 TBarSeries in the Chart.
The problem occurs when I have more then 1 TBarSeries, then the position isnt the same as with 1 TBarSeries(i.e first bar has position 0, and so on). So my question is, does anyone know how I can get the "position" for each of the bars displayed in the TChart when I have more then 1 TBarSeries?
I would really appreciate any ideas regarding this problem, Im hoping its really easy, and its just something I missed
Best Regards,
Johan Ingemansson
A problem finding bar positions using multiple TBarSeries
-
- Newbie
- Posts: 59
- Joined: Fri May 28, 2004 4:00 am
- Location: Sweden
Hi Johan,
the BoxPlot Series has not been prepared to be displayed as a "Side" like Bar Series but a trick could be to use the following code to set the position of specific box :
Series4.Position:= XPosition + 2*(Series2.BarWidth / 100);
the BoxPlot Series has not been prepared to be displayed as a "Side" like Bar Series but a trick could be to use the following code to set the position of specific box :
Series4.Position:= XPosition + 2*(Series2.BarWidth / 100);
Pep Jorge
http://support.steema.com
http://support.steema.com
-
- Newbie
- Posts: 59
- Joined: Fri May 28, 2004 4:00 am
- Location: Sweden
A strange problem....
Hi agin,
Ive used the following to calculate the position of the TBoxSeries
Serie4.Position:=Chart.BottomAxis.CalcPosPoint(Chart.Series[0].CalcXPos(0)+Chart.Series[0] as TBarSeries).BarWidth div 2));
And I thought this worked nicely....but the strangest thing occured, when I have the case with for example 2 BarSeries(grouped) but only 1 value in each serie, then the expression above always returns 0... If anyone has any theory how this problem occurs I would be grateful...
Best Regards,
Johan Ingemansson
Ive used the following to calculate the position of the TBoxSeries
Serie4.Position:=Chart.BottomAxis.CalcPosPoint(Chart.Series[0].CalcXPos(0)+Chart.Series[0] as TBarSeries).BarWidth div 2));
And I thought this worked nicely....but the strangest thing occured, when I have the case with for example 2 BarSeries(grouped) but only 1 value in each serie, then the expression above always returns 0... If anyone has any theory how this problem occurs I would be grateful...
Best Regards,
Johan Ingemansson
-
- Newbie
- Posts: 59
- Joined: Fri May 28, 2004 4:00 am
- Location: Sweden
Hi again,
The problem mentioned above only happens if the TBoxSeries.Position is 0 before I make the calculation, if I change the position to for example 1 then the expression above doesnt return 0 and the boxseries are positioned corretly! But, the bars arent positioned in the center of the chart i.e its skewed...so I guess the trick is to "unskew" the chart, does anyone have any ideas to do this?
Best Regards,
Johan Ingemansson
The problem mentioned above only happens if the TBoxSeries.Position is 0 before I make the calculation, if I change the position to for example 1 then the expression above doesnt return 0 and the boxseries are positioned corretly! But, the bars arent positioned in the center of the chart i.e its skewed...so I guess the trick is to "unskew" the chart, does anyone have any ideas to do this?
Best Regards,
Johan Ingemansson
-
- Newbie
- Posts: 59
- Joined: Fri May 28, 2004 4:00 am
- Location: Sweden
Hi !
Ive studied the function CalcPosPoint, in TeEngine, as I see it the following expression : tmp:=tmp*IRange/IAxisSize, will always return 0 in the case when all grouped TBarSeries.Count = 1, since IRange will be 0(maximum=minimum), so to solve this Ive put Maximum = 0.5 and Minimum = -0.5, then It seems to work correclty. I would just like to confirm this hypothesis with anyone, otherwise this monolog will continue forever
Best Regards,
Johan Ingemansson
Ive studied the function CalcPosPoint, in TeEngine, as I see it the following expression : tmp:=tmp*IRange/IAxisSize, will always return 0 in the case when all grouped TBarSeries.Count = 1, since IRange will be 0(maximum=minimum), so to solve this Ive put Maximum = 0.5 and Minimum = -0.5, then It seems to work correclty. I would just like to confirm this hypothesis with anyone, otherwise this monolog will continue forever
Best Regards,
Johan Ingemansson
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Johan,
You're right about what's wrong but we are not sure this is the best solution. I've added this defect (TV52011795) to our bug list to be reviewed for next releases.
You're right about what's wrong but we are not sure this is the best solution. I've added this defect (TV52011795) to our bug list to be reviewed for next releases.
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 |