Hi..
I use "TeeChart 2.0.3033.18431" in a web application (Steema.TeeChart.Chart). The Datasource is defined for a gannt (X,Y,start,end,nexttask,color). Everything is ok except the color of the gantts. they are always beeing shown in standard colors (~orange & ~red). But wenn I use the same code in a normal windows form (with Steema.TeeChart.TChart) then works everything normal..
Do you have any idea?Thanks...
Gantt color does not change..
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi MU,
This works fine for me here using this code:
Could you please modify it or send a simple example project we can run "as-is" to reproduce the problem here? You could reproduce datasource as in the example Christopher Ireland posted here.
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
This works fine for me here using this code:
Code: Select all
Steema.TeeChart.Styles.Gantt gantt1 = new Steema.TeeChart.Styles.Gantt(WebChart1.Chart);
gantt1.Add(DateTime.Parse("14/07/2008"), DateTime.Parse("18/07/2008"), 0, System.Drawing.Color.Yellow);
gantt1.Add(DateTime.Parse("13/07/2008"), DateTime.Parse("15/07/2008"), 1, System.Drawing.Color.Red);
gantt1.Add(DateTime.Parse("16/07/2008"), DateTime.Parse("19/07/2008"), 2, System.Drawing.Color.Blue);
gantt1.Add(DateTime.Parse("12/07/2008"), DateTime.Parse("16/07/2008"), 3, System.Drawing.Color.Green);
gantt1.Add(DateTime.Parse("13/07/2008"), DateTime.Parse("17/07/2008"), 4, System.Drawing.Color.White);
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
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 Narcis...
I used the ShowSeries.aspx...
As I said everything is ok except the color (in asp.net).
it works windows for with Steema.Teechart.TChart.
I used the ShowSeries.aspx...
Code: Select all
chart= new Chart();
/*
//Datatable
DataTable table = new DataTable();
table.Columns.Add("Label", typeof(string));
table.Columns.Add("Y", typeof(int));
table.Columns.Add("Next", typeof(int));
table.Columns.Add("Start", typeof(DateTime));
table.Columns.Add("End", typeof(DateTime));
table.Columns.Add("ColorTask", typeof(Color));
*/
//Add Series to Chart
switch (Request.QueryString["seriestype"])
{
case "Line": chart.Series.Add(new Steema.TeeChart.Styles.Line());
chart.Series.Add(new Steema.TeeChart.Styles.Line()); break;
case "Bar": chart.Series.Add(new Steema.TeeChart.Styles.Bar()); break;
case "HorizBar": chart.Series.Add(new Steema.TeeChart.Styles.HorizBar()); break;
case "Area": chart.Series.Add(new Steema.TeeChart.Styles.Area()); break;
case "Point": chart.Series.Add(new Steema.TeeChart.Styles.Points()); break;
case "Surface": chart.Series.Add(new Steema.TeeChart.Styles.Surface()); break;
case "Gantt":
if (Session["ProjectTable"] != null)//datasource
{
Gantt gannt = new Gantt();
DataTable table = (DataTable)Session["ProjectTable"];
gannt.ColorEach = false;
gannt.DataSource = table;
gannt.EndValues.DataMember = "End";
gannt.EndValues.DateTime = true;
gannt.LabelMember = "Label";
gannt.NextTasks.DataMember = "Next";
gannt.StartValues.DataMember = "Start";
gannt.StartValues.DateTime = true;
gannt.XValues.DataMember = "Start";
gannt.XValues.DateTime = true;
gannt.YValues.DataMember = "Y";
gannt.ColorMember = "ColorTask";
gannt.Title = "Title...";
gannt.LinePen.Width = 2;
gannt.LinePen.Color = Color.Green;
gannt.CheckDataSource();
chart.Series.Add(gannt);
}
}
it works windows for with Steema.Teechart.TChart.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi MU,
Have you tried setting ColorEach property to true instead of false as in the code snippet you posted?
Code below works fine for me here:
Have you tried setting ColorEach property to true instead of false as in the code snippet you posted?
Code below works fine for me here:
Code: Select all
protected void Page_Load(object sender, EventArgs e)
{
DataTable table = new DataTable();
table.Columns.Add("Label", typeof(string));
table.Columns.Add("Y", typeof(int));
table.Columns.Add("Next", typeof(int));
table.Columns.Add("Start", typeof(DateTime));
table.Columns.Add("End", typeof(DateTime));
table.Columns.Add("ColorTask", typeof(Color));
DataRow dataRow;
dataRow = table.NewRow();
dataRow[0] = "Project 1";
dataRow[1] = 1;
dataRow[2] = 2;
dataRow[3] = DateTime.Parse("14/07/2008");
dataRow[4] = DateTime.Parse("18/07/2008"); ;
dataRow[5] = System.Drawing.Color.Red;
table.Rows.Add(dataRow);
dataRow = table.NewRow();
dataRow[0] = "Project 2";
dataRow[1] = 2;
dataRow[2] = 3;
dataRow[3] = DateTime.Parse("16/07/2008");
dataRow[4] = DateTime.Parse("20/07/2008"); ;
dataRow[5] = System.Drawing.Color.Blue;
table.Rows.Add(dataRow);
dataRow = table.NewRow();
dataRow[0] = "Project 3";
dataRow[1] = 3;
dataRow[2] = -1;
dataRow[3] = DateTime.Parse("23/07/2008");
dataRow[4] = DateTime.Parse("30/07/2008"); ;
dataRow[5] = System.Drawing.Color.Yellow;
table.Rows.Add(dataRow);
dataRow = table.NewRow();
dataRow[0] = "Project 4";
dataRow[1] = 4;
dataRow[2] = -1;
dataRow[3] = DateTime.Parse("25/07/2008");
dataRow[4] = DateTime.Parse("28/07/2008"); ;
dataRow[5] = System.Drawing.Color.Green;
table.Rows.Add(dataRow);
Steema.TeeChart.Styles.Gantt gantt = new Steema.TeeChart.Styles.Gantt(WebChart1.Chart);
//gantt.ColorEach = false;
gantt.DataSource = table;
gantt.EndValues.DataMember = "End";
gantt.EndValues.DateTime = true;
gantt.LabelMember = "Label";
gantt.NextTasks.DataMember = "Next";
gantt.StartValues.DataMember = "Start";
gantt.StartValues.DateTime = true;
gantt.XValues.DataMember = "Start";
gantt.XValues.DateTime = true;
gantt.YValues.DataMember = "Y";
gantt.ColorMember = "ColorTask";
gantt.Title = "Title...";
gantt.LinePen.Width = 2;
gantt.LinePen.Color = Color.Green;
gantt.CheckDataSource();
}
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 MU,
In that case you can try storing and retrieving session variables as in the Zooming example at the live ASP.NET demo.
If this doesn't help please send us a simple example project we can run "as-is" to reproduce the problem here.
Thanks in advance.
In that case you can try storing and retrieving session variables as in the Zooming example at the live ASP.NET demo.
If this doesn't help 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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi MU.
As an upgrade, code below works fine for me here. Could you please check if it works fine at your end?
As an upgrade, code below works fine for me here. Could you please check if it works fine at your end?
Code: Select all
protected void Page_Load(object sender, EventArgs e)
{
if (Session["ProjectTable"] == null)
{
DataTable table = new DataTable();
table.Columns.Add("Label", typeof(string));
table.Columns.Add("Y", typeof(int));
table.Columns.Add("Next", typeof(int));
table.Columns.Add("Start", typeof(DateTime));
table.Columns.Add("End", typeof(DateTime));
table.Columns.Add("ColorTask", typeof(Color));
DataRow dataRow;
dataRow = table.NewRow();
dataRow[0] = "Project 1";
dataRow[1] = 1;
dataRow[2] = 2;
dataRow[3] = DateTime.Parse("14/07/2008");
dataRow[4] = DateTime.Parse("18/07/2008"); ;
dataRow[5] = System.Drawing.Color.Red;
table.Rows.Add(dataRow);
dataRow = table.NewRow();
dataRow[0] = "Project 2";
dataRow[1] = 2;
dataRow[2] = 3;
dataRow[3] = DateTime.Parse("16/07/2008");
dataRow[4] = DateTime.Parse("20/07/2008"); ;
dataRow[5] = System.Drawing.Color.Blue;
table.Rows.Add(dataRow);
dataRow = table.NewRow();
dataRow[0] = "Project 3";
dataRow[1] = 3;
dataRow[2] = -1;
dataRow[3] = DateTime.Parse("23/07/2008");
dataRow[4] = DateTime.Parse("30/07/2008"); ;
dataRow[5] = System.Drawing.Color.Yellow;
table.Rows.Add(dataRow);
dataRow = table.NewRow();
dataRow[0] = "Project 4";
dataRow[1] = 4;
dataRow[2] = -1;
dataRow[3] = DateTime.Parse("25/07/2008");
dataRow[4] = DateTime.Parse("28/07/2008"); ;
dataRow[5] = System.Drawing.Color.Green;
table.Rows.Add(dataRow);
Session.Add("ProjectTable", table);
}
Steema.TeeChart.Styles.Gantt gantt = new Steema.TeeChart.Styles.Gantt(WebChart1.Chart);
//gantt.ColorEach = false;
DataTable sessionTable = (DataTable)Session["ProjectTable"];
gantt.DataSource = sessionTable;
gantt.EndValues.DataMember = "End";
gantt.EndValues.DateTime = true;
gantt.LabelMember = "Label";
gantt.NextTasks.DataMember = "Next";
gantt.StartValues.DataMember = "Start";
gantt.StartValues.DateTime = true;
gantt.XValues.DataMember = "Start";
gantt.XValues.DateTime = true;
gantt.YValues.DataMember = "Y";
gantt.ColorMember = "ColorTask";
gantt.Title = "Title...";
gantt.LinePen.Width = 2;
gantt.LinePen.Color = Color.Green;
gantt.CheckDataSource();
}
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 |