Hi Steema Support,
We want to create Tornado plot For that we are using horizontal Bar. We are facing a issue that the bar is always starting from axis origin as shown in image below:
in this we have given value:
horizbar.Add(8,"Dip");
so it is drawing like the above img.
But we want something like the below image:
So here we want that our bar should draw between value 8 to 23 as shown in above image.
Means we do not want to draw bar from axis scale or from origin.
please provide any solution asap.
Thanks in advance.
Regards,
Planoresearch
Tornado Plot using horizontal Bar
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Tornado Plot using horizontal Bar
Hello,
You could try using a Gantt series, e.g.
which gives this:
You could try using a Gantt series, e.g.
Code: Select all
Gantt series;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
series = new Gantt(tChart1.Chart);
series.Add(8, 23, 0, "Dip", Color.Red);
series.Pointer.VertSize = 40;
series.XValues.DateTime = false;
tChart1.Axes.Bottom.SetMinMax(0, 25);
}
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: Tornado Plot using horizontal Bar
Hi Steema Support.
Thanks for the response. I am using the the way you have suggested but I am unable to show the Markstip on the Chart. How to show the Markstip as showing in the above image.
When we use Gantt.marks.visible =true;
then it shows markstip on the mid of the series but we want show it on both side (left side of the bar and right side of the bar not in the mid of the series). as shown in above image.
Please provide the solution as soon as possible. very urgent..
Thanks in advance.
Plano Research Corporation
Thanks for the response. I am using the the way you have suggested but I am unable to show the Markstip on the Chart. How to show the Markstip as showing in the above image.
When we use Gantt.marks.visible =true;
then it shows markstip on the mid of the series but we want show it on both side (left side of the bar and right side of the bar not in the mid of the series). as shown in above image.
Please provide the solution as soon as possible. very urgent..
Thanks in advance.
Plano Research Corporation
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Tornado Plot using horizontal Bar
Hello,
As you already know, it is possible to draw custom elements onto the chart. If you wish full control over the series marks, you could simply draw your own e.g.
As you already know, it is possible to draw custom elements onto the chart. If you wish full control over the series marks, you could simply draw your own e.g.
Code: Select all
Gantt series;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
series = new Gantt(tChart1.Chart);
series.Add(8, 23, 0, "Dip", Color.Red);
series.Pointer.VertSize = 40;
series.XValues.DateTime = false;
tChart1.Axes.Bottom.SetMinMax(0, 35);
tChart1.AfterDraw += TChart1_AfterDraw;
}
private void TChart1_AfterDraw(object sender, Graphics3D g)
{
Action DrawMarks = () =>
{
for (int i = 0; i < series.Count; i++)
{
g.Font.Size = 16;
string text = series.Labels[i];
int buffer = 5;
int height = (int)Math.Ceiling(g.TextHeight(text)) + buffer;
int width = (int)Math.Ceiling(g.TextWidth(text)) + buffer;
int xPos = series.CalcXPosValue(series.EndValues[i]) + width;
int yPos = series.CalcYPos(i) - (height / 2);
Rectangle rect = Utils.FromLTRB(xPos, yPos, xPos + width, yPos + height);
g.Brush.Color = Color.Yellow;
g.Rectangle(rect);
g.TextOut(rect.X + (buffer / 2), rect.Y + (buffer / 2), text);
g.Pen.Color = Color.White;
g.Pen.Width = 3;
g.HorizontalLine(xPos - width, xPos, yPos + (height / 2));
}
};
DrawMarks();
}
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: Tornado Plot using horizontal Bar
Hi Steema Support
Thanks a lot. One more thing I want to also display the Markstip Left Side of the Bar as well.
Thanks in Advance
Plano Research
Thanks a lot. One more thing I want to also display the Markstip Left Side of the Bar as well.
Thanks in Advance
Plano Research