Page 1 of 1

How can I do this graph?

Posted: Thu Feb 19, 2004 8:11 am
by 6931136
Hi, I would like to implement the following graph. Note that
the bottom axis shall be logarithmic.

http://www.osiris.no/jakob/graph.jpg

Best regards
/Jakob

Posted: Thu Feb 19, 2004 9:04 am
by Pep
Hi Jakob,

you should be able to do this using the following code :

Code: Select all

		private void Form1_Load(object sender, System.EventArgs e)
		{
			tChart1.Aspect.View3D = false;
			horizBar1.Marks.Visible = false;			
			horizBar2.Marks.Visible = false;
			horizBar1.Add (3,"DiagnoseX");
			horizBar1.Add (-2,"DiagnoseC");
			horizBar1.Origin = 1;
			horizBar2.Add (2,"DiagnoseX");
			horizBar2.Add (-3,"DiagnoseC");
			horizBar2.Origin = 1;
			//tChart1.Axes.Bottom.Logarithmic = true;
			horizBar2.MultiBar = Steema.TeeChart.Styles.MultiBars.Stacked;			
		}
But, it seems to be a bug setting an Origin and Stacked style. I've added it on our defect list and a fix for it will be considered to inclusion for the next maintenance releases.

Posted: Thu Feb 19, 2004 10:23 am
by 6931136
Pep wrote: But, it seems to be a bug setting an Origin and Stacked style. I've added it on our defect list and a fix for it will be considered to inclusion for the next maintenance releases.
Yes, this is exactly what I had problem with! When is the next releas scheduled? Is there any other possibility to do this? I have a release coming up very soon.

Is there any way to have bars have several colors (like my example graph) without using stacked bars`?

Regards
/Jakob

Posted: Mon Feb 23, 2004 12:09 pm
by Chris
Hi --
Is there any way to have bars have several colors (like my example graph) without using stacked bars`?
You can try something similar to this

Code: Select all

private void Form1_Load(object sender, System.EventArgs e) {
	tChart1.Aspect.View3D = false; 
	horizBar1.Marks.Visible = false;          
	horizBar2.Marks.Visible = false; 
	horizBar1.Add (3,1,"DiagnoseX", Color.Green);
	horizBar1.Add (2,1,"DiagnoseX", Color.Red); 
	horizBar1.Add (-3,2,"DiagnoseC", Color.Green); 
	horizBar1.Add (-2,2,"DiagnoseC", Color.Red); 
	horizBar1.Origin = 1; 
}
When is the next releas scheduled?
Build 1.1.1499.42325 was released on 9/Feb/2004, meaning that the next maintenance release should be available in May/June.

Posted: Wed Feb 25, 2004 2:10 pm
by 8123134
Thanks Chris.

But: Do you mean that I should use ony one HorizBar series for all my values? Or is it just a typo? However when I tried to use 2 HorizBars with 2 values each (with the same y-value) they appear fine in the graph, but only one of them gets there associated name printed on the left axis?

Regards
/Jakob

Posted: Thu Feb 26, 2004 8:43 am
by Chris
Hi --
Do you mean that I should use ony one HorizBar series for all my values? Or is it just a typo? However when I tried to use 2 HorizBars with 2 values each (with the same y-value) they appear fine in the graph, but only one of them gets there associated name printed on the left axis?
Did you run the code I sent you in my last message? Let me give it to you again without the typos :D:

Code: Select all

private void Form1_Load(object sender, System.EventArgs e) { 
   tChart1.Aspect.View3D = false; 
   horizBar1.Marks.Visible = false;          
   horizBar1.Add (3,1,"DiagnoseX", Color.Green); 
   horizBar1.Add (2,1,"DiagnoseX", Color.Red); 
   horizBar1.Add (-3,2,"DiagnoseC", Color.Green); 
   horizBar1.Add (-2,2,"DiagnoseC", Color.Red); 
   horizBar1.Origin = 1; 
}