vertical axe in a Horizontal bar graph
vertical axe in a Horizontal bar graph
Hi,
Is it possible to have a vertical axe in a horizontal bar graph that always aligns to 0 on the horizontal axe? The 0 aligns in the middle and the bars are, dependent of their values, on the left or the right side of the vertical axe.
I hope it's a bit clear what I mean.
Greetings,
Ricky
Is it possible to have a vertical axe in a horizontal bar graph that always aligns to 0 on the horizontal axe? The 0 aligns in the middle and the bars are, dependent of their values, on the left or the right side of the vertical axe.
I hope it's a bit clear what I mean.
Greetings,
Ricky
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Ricky,
Yes, this is possible, you can try doing something like this:
Yes, this is possible, you can try doing something like this:
Code: Select all
private void Form1_Load(object sender, EventArgs e)
{
for (int i = 0; i < 10; i++)
{
horizBar1.Add((i - 5) * 10);
}
}
private void tChart1_BeforeDrawAxes(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
Rectangle rect = tChart1.Chart.ChartRect;
tChart1.Axes.Left.PositionUnits = Steema.TeeChart.PositionUnits.Pixels;
tChart1.Axes.Left.RelativePosition = tChart1.Axes.Bottom.CalcPosValue(0) - rect.Left;
tChart1.Axes.Left.StartPosition = 0;
tChart1.Axes.Left.EndPosition = rect.Bottom - rect.Top;
}
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 |
I don't know if this is te right sollution. I have an image wich explains the situation a bit better.
The bar should be on the 0 between the bars on the left and the right side.
The bar should be on the 0 between the bars on the left and the right side.
Last edited by SNSSEC on Thu Nov 30, 2006 10:42 am, edited 1 time in total.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi SNSSEC,
The code snippet I posted does what you request for me here using latest TeeChart for .NET v2 release at the client area. Which TeeChart version are you using? Are you using the code in the BeforeDrawAxes event?
The code snippet I posted does what you request for me here using latest TeeChart for .NET v2 release at the client area. Which TeeChart version are you using? Are you using the code in the BeforeDrawAxes event?
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Ricky
I guess that this offset is caused by the "-200%" label which goes out of the bottom axis. You can try setting bottom axes offsets:
I guess that this offset is caused by the "-200%" label which goes out of the bottom axis. You can try setting bottom axes offsets:
Code: Select all
tChart1.Axes.Bottom.MinimumOffset = 10;
tChart1.Axes.Bottom.MaximumOffset = 10;
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi SNSSEC,
Could you please send us a simple example we can run "as-is" to reproduce the problem here or export the image chart to a .ten file? We will try if we can find a solution to this issue.
You can post your files at news://www.steema.net/steema.public.attachments newsgroup.
Thanks in advance.
Could you please send us a simple example we can run "as-is" to reproduce the problem here or export the image chart to a .ten file? We will try if we can find a solution to this issue.
You can post your files at news://www.steema.net/steema.public.attachments newsgroup.
Thanks in advance.
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 |
Hi,
because of security reasons I can't get on the newsgroup, so I've uploaded the file somewhere else.
http://www.yousendit.com/transfer.php?a ... 0a161d5d16
Thanks in advance.
Greetings,
Ricky
because of security reasons I can't get on the newsgroup, so I've uploaded the file somewhere else.
http://www.yousendit.com/transfer.php?a ... 0a161d5d16
Thanks in advance.
Greetings,
Ricky
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Ricky,
Thanks for your the file. It works fine for me here importing your file and forcing the chart to be re-drawn after loading it:
I'm using latest TeeChart for .NET v2 maintenance release available at the client area. Which TeeChart version are you using?
I've also tried to reproduce the problem in a new project without success:
If the problem persists, could you pleas modify my code so that we can reproduce the problem here?
Thanks in advance.
Thanks for your the file. It works fine for me here importing your file and forcing the chart to be re-drawn after loading it:
Code: Select all
private void Form1_Load(object sender, System.EventArgs e)
{
this.tChart1.Import.Template.Load("Chart1.ten");
//Call to force the chart being re-drawn and axes positions calculated:
Bitmap bmp = this.tChart1.Bitmap;
}
private void tChart1_BeforeDrawAxes(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
Rectangle rect = tChart1.Chart.ChartRect;
tChart1.Axes.Left.PositionUnits = Steema.TeeChart.PositionUnits.Pixels;
tChart1.Axes.Left.RelativePosition = tChart1.Axes.Bottom.CalcPosValue(0) - rect.Left;
tChart1.Axes.Left.StartPosition = 0;
tChart1.Axes.Left.EndPosition = rect.Bottom - rect.Top;
}
I've also tried to reproduce the problem in a new project without success:
Code: Select all
private void Form1_Load(object sender, EventArgs e)
{
tChart1.Aspect.View3D = false;
Steema.TeeChart.Styles.HorizBar horizBar1 = new Steema.TeeChart.Styles.HorizBar(tChart1.Chart);
for (int i = 0; i < 10; i++)
{
horizBar1.Add((i - 5) * 10);
}
tChart1.Axes.Bottom.SetMinMax(-100, 100);
}
private void tChart1_BeforeDrawAxes(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
Rectangle rect = tChart1.Chart.ChartRect;
tChart1.Axes.Left.PositionUnits = Steema.TeeChart.PositionUnits.Pixels;
tChart1.Axes.Left.RelativePosition = tChart1.Axes.Bottom.CalcPosValue(0) - rect.Left;
tChart1.Axes.Left.StartPosition = 0;
tChart1.Axes.Left.EndPosition = rect.Bottom - rect.Top;
}
private void tChart1_GetAxisLabel(object sender, Steema.TeeChart.GetAxisLabelEventArgs e)
{
if (sender == tChart1.Axes.Bottom)
{
e.LabelText += " %";
}
}
Thanks in advance.
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Ricky,
Importing your .ten file, as I posted previously, also works fine for me using the latest TeeChart for .NET v1 update build we posted last week at the client area. Can you please test if it works fine at your end?
Importing your .ten file, as I posted previously, also works fine for me using the latest TeeChart for .NET v1 update build we posted last week at the client area. Can you please test if it works fine at your end?
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 |
I've installed the latest build (Build 1.1.2531.28391), but the problem still exists. I just don't understand why it isn't a standard option within teechart to have an axe on that postion, instead of finding a workaround. When you want a horizontal bar graph with negatives in one side and the positives on the other, it's most likely you want to devide them with an axe.
As it seems now I have to do it without one, because leaving it in there like this is a bit useless.
Thanks for your help though. I hope someone finds a solution to solve this problem.
Greetings,
Ricky
As it seems now I have to do it without one, because leaving it in there like this is a bit useless.
Thanks for your help though. I hope someone finds a solution to solve this problem.
Greetings,
Ricky
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Ricky,
Have you checked that your project's TeeChart.dll reference has been properly updated? If the problem persists could you please send us a simple example project we can run "as-is" to reproduce the problem here?
Thanks in advance.
Have you checked that your project's TeeChart.dll reference has been properly updated? If the problem persists could you please send us a simple example project we can run "as-is" to reproduce the problem here?
Thanks in advance.
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 |