How to connect teechart to sql server dataset/database
-
- Newbie
- Posts: 14
- Joined: Mon Sep 12, 2011 12:00 am
How to connect teechart to sql server dataset/database
Can you please provide some details about teechart and sql server database connection. There is a series tab and a sub tab called data source in tee chart editor. when we select database from dropdown then dataset is empty. Can you please shed some light on it. How to utilize this feature.
Thanks.
Telvent user
Thanks.
Telvent user
Re: How to connect teechart to sql server dataset/database
Hello TelventUser,
I recommend that take a look in the Asp Demo C:\Program Files\Steema Software\TeeChart for .NET 2010\TeeChartForNET concretely in Datasets examples and in the Tutorial8 - ADO.NET Database Access, if you have more problems or demo doesn't help you, please let me know.
I hope will helps.
Thanks,
I recommend that take a look in the Asp Demo C:\Program Files\Steema Software\TeeChart for .NET 2010\TeeChartForNET concretely in Datasets examples and in the Tutorial8 - ADO.NET Database Access, if you have more problems or demo doesn't help you, please let me know.
I hope will helps.
Thanks,
Best Regards,
Sandra Pazos / 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 |
-
- Newbie
- Posts: 14
- Joined: Mon Sep 12, 2011 12:00 am
Re: How to connect teechart to sql server dataset/database
Thanks Sandra,
with your help I am able to load data. Although I have another question.
In the .net sample examples , I am able to select right,left bottom and top axis at run time or design time using editor window properties.
But when I do the same thing with my database loaded graph using editor it is not displaying right or top axis.
Do you have any idea what step I am missing.
Thanks
Telvent user.
with your help I am able to load data. Although I have another question.
In the .net sample examples , I am able to select right,left bottom and top axis at run time or design time using editor window properties.
But when I do the same thing with my database loaded graph using editor it is not displaying right or top axis.
Do you have any idea what step I am missing.
Thanks
Telvent user.
Re: How to connect teechart to sql server dataset/database
Hello TelventUser,
Run time:
You must use next code to achieve as you want:
Design time:
You must follow next steps:
1.- Open Editor
2.- Go to tab Series\General
3.- Select Horizontal and Vertical axes you want works as Horizontal or Vertical.
I hope will helps.
Thanks,
Besides using to visible the right or top axis, you need assign the series HorizAxis and VerticalAxis to both. You can do it in run time or in design time with editor, you only need follow next steps:But when I do the same thing with my database loaded graph using editor it is not displaying right or top axis. Do you have any idea what step I am missing.
Run time:
You must use next code to achieve as you want:
Code: Select all
Series1.VertAxis = VerticalAxis.Both; or line1.VertAxis = VerticalAxis.Right;
Series1.HorizAxis = HorizontalAxis.Both; or line1.HorizAxis = HorizontalAxis.Top;
You must follow next steps:
1.- Open Editor
2.- Go to tab Series\General
3.- Select Horizontal and Vertical axes you want works as Horizontal or Vertical.
I hope will helps.
Thanks,
Best Regards,
Sandra Pazos / 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 |
-
- Newbie
- Posts: 14
- Joined: Mon Sep 12, 2011 12:00 am
Re: How to connect teechart to sql server dataset/database
Thanks Sandra for your help. I am able to generate graphs from database using different axis with your help.
Another issue I am experiencing is, I installed infragistics win form on my server to use infragistics datagrid binded with the TChart object.
When I switch to design view in visual studio 2008 I am getting System.OutofMemoryException on UI window.
(I am using windows server 2008 server R2). My rest of the forms are correctly displaying designer windows along with all the infragistics controls e.g datagrid, comboboxes etc. But the forms on which I am using Steema TChart object are not showing up in designer window. And I am getting system.outofMemoryException error.
Do you have any idea what could be the reason of this.
Thanks for your help.
Telvent User.
Another issue I am experiencing is, I installed infragistics win form on my server to use infragistics datagrid binded with the TChart object.
When I switch to design view in visual studio 2008 I am getting System.OutofMemoryException on UI window.
(I am using windows server 2008 server R2). My rest of the forms are correctly displaying designer windows along with all the infragistics controls e.g datagrid, comboboxes etc. But the forms on which I am using Steema TChart object are not showing up in designer window. And I am getting system.outofMemoryException error.
Do you have any idea what could be the reason of this.
Thanks for your help.
Telvent User.
Re: How to connect teechart to sql server dataset/database
Hello TelventUser,
Thanks,
Can you tell us if you reproduce the same problem using TeeChart without infragistics components? On the other hand, would be very helpful for us, if you could say us, what is the control you are used in the WinForm where is produced the exception and standard component of where it is inherited?Another issue I am experiencing is, I installed infragistics win form on my server to use infragistics datagrid binded with the TChart object.
When I switch to design view in visual studio 2008 I am getting System.OutofMemoryException on UI window.
(I am using windows server 2008 server R2). My rest of the forms are correctly displaying designer windows along with all the infragistics controls e.g datagrid, comboboxes etc. But the forms on which I am using Steema TChart object are not showing up in designer window. And I am getting system.outofMemoryException error.
Thanks,
Best Regards,
Sandra Pazos / 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 |
-
- Newbie
- Posts: 14
- Joined: Mon Sep 12, 2011 12:00 am
Re: How to connect teechart to sql server dataset/database
Yes, Actually I created a Test form without any infragistics control and when I switched to designer window I am getting the same error. Error screen shot is are attached. Although my code is successfully compiled and I am able to view the form and the graph at run time.
Below is my code behind file.
Thanks
Telvent User.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.OleDb;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Security;
using System.Security.Permissions;
using Steema.TeeChart;
namespace OASySDNA.GasHMI.MultiGraphForms
{
public partial class TestGraph : Form
{
private Steema.TeeChart.Axis leftAxis;
private Steema.TeeChart.Axis rightAxis;
private Steema.TeeChart.Styles.Bar volumeBar;
private Steema.TeeChart.Styles.Bar pressureBar;
//private Steema.TeeChart.Styles.Bar series;
Steema.TeeChart.TChart tChart1;
private void TestGraph_Load(object sender, EventArgs e)
{
}
public TestGraph()
{
// This call is required by the Windows Form Designer.
InitializeComponent();
InitializeChart();
volumeBar.CustomVertAxis = leftAxis;
pressureBar.CustomVertAxis = rightAxis;
volumeBar.Title = "Volume";
pressureBar.Title = "Pressure";
//Use of elected Partner Axes to limit GridLine zone
tChart1.Series[0].DataSource = GetGraphData("Meter1");
tChart1.Series[0].XValues.DateTime = true;
tChart1.Series[0].XValues.DataMember = "contractTime";
tChart1.Series[0].YValues.DataMember = "pressure";
tChart1.Series[1].DataSource = GetGraphData("Meter1");
tChart1.Series[1].XValues.DateTime = true;
tChart1.Series[1].XValues.DataMember = "contractTime";
tChart1.Series[1].YValues.DataMember = "volume";
}
private void InitializeChart()
{
tChart1.Dock = DockStyle.Fill;
this.Controls.Add(tChart1);
tChart1.DoubleClick += new EventHandler(tChart1_DoubleClick);
}
public DataSet GetGraphData(string objName)
{
DataSet TeeDataSet = new DataSet();
DataTable TeeDataTable = new DataTable();
MultiGraphProxy.ReadhourlyMeterReadings(TeeDataTable, objName);
TeeDataSet.Tables.Add(TeeDataTable);
return TeeDataSet;
}
void tChart1_DoubleClick(object sender, EventArgs e)
{
tChart1.ShowEditor();
}
}
}
Below is my code behind file.
Thanks
Telvent User.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.OleDb;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Security;
using System.Security.Permissions;
using Steema.TeeChart;
namespace OASySDNA.GasHMI.MultiGraphForms
{
public partial class TestGraph : Form
{
private Steema.TeeChart.Axis leftAxis;
private Steema.TeeChart.Axis rightAxis;
private Steema.TeeChart.Styles.Bar volumeBar;
private Steema.TeeChart.Styles.Bar pressureBar;
//private Steema.TeeChart.Styles.Bar series;
Steema.TeeChart.TChart tChart1;
private void TestGraph_Load(object sender, EventArgs e)
{
}
public TestGraph()
{
// This call is required by the Windows Form Designer.
InitializeComponent();
InitializeChart();
volumeBar.CustomVertAxis = leftAxis;
pressureBar.CustomVertAxis = rightAxis;
volumeBar.Title = "Volume";
pressureBar.Title = "Pressure";
//Use of elected Partner Axes to limit GridLine zone
tChart1.Series[0].DataSource = GetGraphData("Meter1");
tChart1.Series[0].XValues.DateTime = true;
tChart1.Series[0].XValues.DataMember = "contractTime";
tChart1.Series[0].YValues.DataMember = "pressure";
tChart1.Series[1].DataSource = GetGraphData("Meter1");
tChart1.Series[1].XValues.DateTime = true;
tChart1.Series[1].XValues.DataMember = "contractTime";
tChart1.Series[1].YValues.DataMember = "volume";
}
private void InitializeChart()
{
tChart1.Dock = DockStyle.Fill;
this.Controls.Add(tChart1);
tChart1.DoubleClick += new EventHandler(tChart1_DoubleClick);
}
public DataSet GetGraphData(string objName)
{
DataSet TeeDataSet = new DataSet();
DataTable TeeDataTable = new DataTable();
MultiGraphProxy.ReadhourlyMeterReadings(TeeDataTable, objName);
TeeDataSet.Tables.Add(TeeDataTable);
return TeeDataSet;
}
void tChart1_DoubleClick(object sender, EventArgs e)
{
tChart1.ShowEditor();
}
}
}
- Attachments
-
- error1.png (55.86 KiB) Viewed 15630 times
Re: How to connect teechart to sql server dataset/database
Hello TelventUser,
I inform you that I can not reproduce your error using your code and last version of TeeChart. Can you please send us your project so we can try to open it here and reproduce your error that occurs in the designer ?
Thanks
I inform you that I can not reproduce your error using your code and last version of TeeChart. Can you please send us your project so we can try to open it here and reproduce your error that occurs in the designer ?
Thanks
Best Regards,
Sandra Pazos / 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 |
-
- Newbie
- Posts: 14
- Joined: Mon Sep 12, 2011 12:00 am
Re: How to connect teechart to sql server dataset/database
Hi Sandra,
I have few questions.
First question is, On this forum, I did not find any way to start a new post/thread. I only found "Post a reply" link at the bottom of an existing thread and I always click that and ask questions which is very confusing. Is there anyway I can start a totally new post.
Second question is On mouse right click event of the tchart I dont want context menu. I just want to use right click for the movement of the graph. Is there anyway I can hide the context menu on right click.
Thanks for your help.
Telvent User.
I have few questions.
First question is, On this forum, I did not find any way to start a new post/thread. I only found "Post a reply" link at the bottom of an existing thread and I always click that and ask questions which is very confusing. Is there anyway I can start a totally new post.
Second question is On mouse right click event of the tchart I dont want context menu. I just want to use right click for the movement of the graph. Is there anyway I can hide the context menu on right click.
Thanks for your help.
Telvent User.
Re: How to connect teechart to sql server dataset/database
Hello TelventUser,
Thanks,
To made a New Topic you only need go to Board index ‹ TeeChart ‹ .NET and click NewTopic as you can see in next image:First question is, On this forum, I did not find any way to start a new post/thread. I only found "Post a reply" link at the bottom of an existing thread and I always click that and ask questions which is very confusing. Is there anyway I can start a totally new post.
Can you tell us ican you tell us which IDE are you using(Winforms, Asp.Net, Wpf, Silverlight)? So we can try to find a good solution for you.Second question is On mouse right click event of the tchart I dont want context menu. I just want to use right click for the movement of the graph. Is there anyway I can hide the context menu on right click.
Thanks,
Best Regards,
Sandra Pazos / 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 |
-
- Newbie
- Posts: 14
- Joined: Mon Sep 12, 2011 12:00 am
Re: How to connect teechart to sql server dataset/database
Thanks Sandra,
I am using Winforms / visual studio 2008.
Telvent User
I am using Winforms / visual studio 2008.
Telvent User
Re: How to connect teechart to sql server dataset/database
Hello TelventUser,
Thanks,
If you refer to Context Menu appears when you click right button in design time, you need know that in design time you isn't allowed do scroll chart if you want change the axis range you only can do it using Editor->Axes->Axes(bottom, right,left,top or Depth) and change its properties. If you refer to run time, when you works in Winforms if you do click with right button to default the chart is scrolled.I just want to use right click for the movement of the graph. Is there anyway I can hide the context menu on right click.
Thanks,
Best Regards,
Sandra Pazos / 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 |
-
- Newbie
- Posts: 14
- Joined: Mon Sep 12, 2011 12:00 am
Re: How to connect teechart to sql server dataset/database
Hi Sandra,
I am refering to runtime. So when I click right mouse button the chart scrolls which is fine but also getting context menu which I do not want. I mean to say I just want to scroll the graph and dont want context menu to pop up. Is there anyway I can disable the context menu.
Thanks
Telvent User.
I am refering to runtime. So when I click right mouse button the chart scrolls which is fine but also getting context menu which I do not want. I mean to say I just want to scroll the graph and dont want context menu to pop up. Is there anyway I can disable the context menu.
Thanks
Telvent User.
Re: How to connect teechart to sql server dataset/database
Hello TelventUser,
I have made simple code where combine the MouseClick and Scroll Events so that when you scroll the chart the Context Menu is not active and if you do click with Left button the Context Menu is active again.
Can you tell us if previous code works as you expect?
Thanks,
I have made simple code where combine the MouseClick and Scroll Events so that when you scroll the chart the Context Menu is not active and if you do click with Left button the Context Menu is active again.
Code: Select all
ToolStripMenuItem stripAfficheCharte;
ContextMenuStrip contextMenu ;
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
Steema.TeeChart.Styles.Line line1 = new Line(tChart1.Chart);
line1.FillSampleValues();
stripAfficheCharte = new ToolStripMenuItem("Action here");
contextMenu = new ContextMenuStrip();
contextMenu.Items.AddRange(new ToolStripItem[] { stripAfficheCharte });
tChart1.MouseClick += new MouseEventHandler(tChart1_MouseClick);
}
void tChart1_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
this.ContextMenuStrip = contextMenu;
tChart1.Refresh();
}
}
void tChart1_Scroll(object sender, EventArgs e)
{
this.ContextMenuStrip = null;
tChart1.Refresh();
}
Thanks,
Best Regards,
Sandra Pazos / 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 |
-
- Newbie
- Posts: 14
- Joined: Mon Sep 12, 2011 12:00 am
Re: How to connect teechart to sql server dataset/database
Hi Sandra,
I don't think the code is working as I am expecting. Look at the attachment, when I scroll the graph using right mouse button I am getting the menu which I want to disable or hide.
So basically I don't want the menu on left click neither on right click.
Thanks.
I don't think the code is working as I am expecting. Look at the attachment, when I scroll the graph using right mouse button I am getting the menu which I want to disable or hide.
So basically I don't want the menu on left click neither on right click.
Thanks.
- Attachments
-
- ContextMenu.JPG (56.49 KiB) Viewed 15498 times