TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
-
Narcís
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Tue Jun 03, 2008 9:56 am
Hi gs,
In that case I'd do something like this:
Code: Select all
protected void Page_Load(object sender, EventArgs e)
{
Steema.TeeChart.Chart ch1 = WebChart1.Chart;
Steema.TeeChart.Styles.Bar free = new Steema.TeeChart.Styles.Bar(ch1);
Steema.TeeChart.Styles.Bar used = new Steema.TeeChart.Styles.Bar(ch1);
free.MultiBar = Steema.TeeChart.Styles.MultiBars.Stacked;
used.MultiBar = Steema.TeeChart.Styles.MultiBars.Stacked;
free.Add(DateTime.Parse("03/06/08 00:00:00"), 300, "data free");
free.Add(DateTime.Parse("03/06/08 01:00:00"), 600, "log free");
free.Add(DateTime.Parse("03/06/08 02:00:00"), 300, "used free");
used.Add(DateTime.Parse("03/06/08 00:00:00"), 700, "data used");
used.Add(DateTime.Parse("03/06/08 01:00:00"), 200, "log used");
used.Add(DateTime.Parse("03/06/08 02:00:00"), 800, "used used");
ch1.Axes.Bottom.Labels.Items.Clear();
ch1.Axes.Bottom.Labels.Items.Add(DateTime.Parse("03/06/08 00:00:00").ToOADate(), "data");
ch1.Axes.Bottom.Labels.Items.Add(DateTime.Parse("03/06/08 01:00:00").ToOADate(), "log");
ch1.Axes.Bottom.Labels.Items.Add(DateTime.Parse("03/06/08 02:00:00").ToOADate(), "used");
}
Hope this helps!
-
gs
- Newbie
- Posts: 84
- Joined: Mon Mar 20, 2006 12:00 am
- Location: US
Post
by gs » Wed Jun 04, 2008 11:00 am
what is the code to change label position on bar graph
-
Narcís
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Wed Jun 04, 2008 11:10 am
Hi gs,
Sorry but I don't understand your exact question. Have you looked at ch1.Axes.Bottom.Labels.Items.Add method's signature and available overrides?
-
gs
- Newbie
- Posts: 84
- Joined: Mon Mar 20, 2006 12:00 am
- Location: US
Post
by gs » Thu Jun 05, 2008 1:15 pm
I am not finding any good help with Teechart on tutorials, its better through support:)
Thanks for your help. I am able to diff types of bar graphs.
The earlier request was through X-Axiis as DATE but one more requirement for me is where X-axis is string and y-axix is double i am following the same steps as I did for x-axix as date but changed the datatype of x-axix to string and I am getting
"Input string not in correct format".
please help me with this.
-
Narcís
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Thu Jun 05, 2008 1:22 pm
Hi gs,
Could you please send us a simple example project we can run "as-is" or a code snippet so that we can reproduce the problem here?
You can either post your files at news://
www.steema.net/steema.public.attachments newsgroup or at our
upload page.
Thanks in advance.
-
gs
- Newbie
- Posts: 84
- Joined: Mon Mar 20, 2006 12:00 am
- Location: US
Post
by gs » Thu Jun 05, 2008 1:57 pm
INSTANCE_NAME COLLECTDATE DEVICE TOTAL (Mb) USED (Mb) FREE (Mb)
LDNCTW1OBS 04/06/2008 00:00:00 DAT 207195 202975 4220
LDNCTW1OBS 04/06/2008 00:00:00 LOG 8606 4192 4414
LDNCTW1OBS 04/06/2008 00:00:00 TEMPDB 1100 1100 0
LDNUAT3OBS 04/06/2008 00:00:00 DAT 335729 205285 130444
LDNUAT3OBS 04/06/2008 00:00:00 LOG 21459 4562 16897
LDNUAT3OBS 04/06/2008 00:00:00 TEMPDB 700 700 0
This is my actual data
here my x-axis is instance_name which is string, y col is "Used (MB)" but when I am seeting s.Yvalues.DataMember = "Used (Mb" is giving "Input string not in correct format" error but when I use "COLLECTDATE" as x-aix it works fine. Please help on this.
-
Narcís
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Thu Jun 05, 2008 2:01 pm
Hi gs,
I can't see anything wrong here. Would you be so kind to arrange an example as the one Christopher Ireland posted
here? You could manually add data you posted to the data table.
Thanks in advance.
-
gs
- Newbie
- Posts: 84
- Joined: Mon Mar 20, 2006 12:00 am
- Location: US
Post
by gs » Mon Jun 09, 2008 8:38 am
Hi,
I have looked at that example, mine is little bit diff to that, there xcol is "ID" whcih is integer so fine but in my case x-axis is string which errors here is the code
Steema.TeeChart.Styles.Bar s = new Steema.TeeChart.Styles.Bar();
s.MultiBar = Steema.TeeChart.Styles.MultiBars.Stacked;
s.Clear();
if(data[item.Value].Columns[0].DataType.ToString() = "System.DateTime")
s.XValues.DateTime = true;
s.DataSource = data[item.Value];// this is my table
s.YValues.DataMember = "used (MB)" // This double
//s.XValues.DataMember = "Instance Name" // this is string
s.LabelMember = "Instance Name" // this is string
s.CheckDataSource();
s.Color = colours[WebChart1.Chart.Series.Count];
s.Marks.ArrowLength = -15;
s.AutoMarkPosition = true;
s.StackGroup = stackGroup;
WebChart1.Chart.Series.Add(s);
if put this code, it works fine but only problem is all the labels will come as instance names which i donot wannt, I want exact values of ycolumn to be printed. but x-aix names are correctly printed as instance names.
How can I work around this problem to show x-axis columns as instance names and labels as values
-
Narcís
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Mon Jun 09, 2008 9:00 am
Hi gs,
Thanks for the information. In that case you can try setting marks like this:
Code: Select all
b.Marks.Style = MarksStyles.Value;
-
gs
- Newbie
- Posts: 84
- Joined: Mon Mar 20, 2006 12:00 am
- Location: US
Post
by gs » Mon Jun 09, 2008 10:49 am
I am not getting called "MarksStyle" property which library is this I even Itries Steema.TeeChart.MarksStyle no luck
-
Narcís
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Mon Jun 09, 2008 1:13 pm
Hi gs,
Ok, you can use this:
Code: Select all
b.Marks.Style = Steema.TeeChart.Styles.MarksStyles.Value;
Or include namespace Steema.TeeChart.Styles at your WebForm.
-
gs
- Newbie
- Posts: 84
- Joined: Mon Mar 20, 2006 12:00 am
- Location: US
Post
by gs » Mon Jun 09, 2008 1:43 pm
Thanks. Its working perfect now.