Dear Sir,
I want to know if it is possible to rotate the boxplot in order to have a horizontal display of It ?
Is it possible also to trace the means value in addition to the median ?
Thank you
Philippe
Horizontal BoxPlot
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Horizontal BoxPlot
Hello Philippe,
Yes, both these things are possible, as shown in the code below:Philippe wrote:I want to know if it is possible to rotate the boxplot in order to have a horizontal display of It ?
Is it possible also to trace the means value in addition to the median ?
Code: Select all
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
HorizBox hBox = new HorizBox(tChart1.Chart);
hBox.FillSampleValues();
MessageBox.Show(hBox.XValues.Value.Take(hBox.XValues.Count).Average().ToString());
}
Best Regards,
Christopher Ireland / 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 |
Re: Horizontal BoxPlot
Dear Christopher,
Thank you for your reply.
About the rotation of the boxplot it's ok, but I want to draw a line with the mean value into the box plot.
Do you know if it's possible ?
Thank you.
Philippe
Thank you for your reply.
About the rotation of the boxplot it's ok, but I want to draw a line with the mean value into the box plot.
Do you know if it's possible ?
Thank you.
Philippe
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Horizontal BoxPlot
Hello Philippe,
Yes, you can "custom draw" on the chart using code similar to the following:Philippe wrote: About the rotation of the boxplot it's ok, but I want to draw a line with the mean value into the box plot.
Do you know if it's possible ?
Code: Select all
HorizBox hBox;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
hBox = new HorizBox(tChart1.Chart);
hBox.FillSampleValues();
tChart1.AfterDraw += TChart1_AfterDraw1;
}
private void TChart1_AfterDraw1(object sender, Graphics3D g)
{
double average = hBox.XValues.Value.Take(hBox.XValues.Count).Average();
Point start = new Point(100, 100);
g.Font.Color = Color.Red;
g.Font.Size = 16;
g.TextOut(start.X - 30, start.Y - 30, "Average: " + average.ToString("N2"));
g.Pen.Color = Color.Red;
g.Pen.Width = 2;
g.Line(start, new Point(hBox.CalcXPosValue(average), hBox.CalcYPosValue(0)));
}
Best Regards,
Christopher Ireland / 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 |