Jump to content
Software FX Community

How do I refresh the chart?


User (Legacy)

Recommended Posts

Using ChartFXLite with C#:

I've got my chart bound to a dataset

this.chart1.DataSource = this.dataSet11._Table;

and I want to manually update the chart display. I added a refresh button

whose onclick event does:

private void refreshbutton_Click(object sender, System.EventArgs e) {

dataSet11.Clear();

sqlDataAdapter1.Fill(dataSet11);

}

and ChartFX chart1 drops the Y values to zero. I've tried setting the

datasource to null and back to dataSet11._Table to no avail. What am I

missing?

Ken

Link to comment
Share on other sites

Using ChartFXLite with C#:

I've got my chart bound to a dataset

this.chart1.DataSource = this.dataSet11._Table;

and I want to manually update the chart display. I added a refresh button

whose onclick event does:

private void refreshbutton_Click(object sender, System.EventArgs e) {

dataSet11.Clear();

sqlDataAdapter1.Fill(dataSet11);

}

and ChartFX chart1 drops the Y values to zero. I've tried setting the

datasource to null and back to dataSet11._Table to no avail. What am I

missing?

Ken

Link to comment
Share on other sites

  • 2 weeks later...

"SoftwareFX Support" <support@softwarefx.com> wrote in message

news:5PnDM1WqDHA.1900@WEBSERVER1...

> We are unable to reproduce this problem. Do you have a repro case ?

>

> --

> FP

> Software FX, Inc.

>

>

To restate the problem, ChartFXLite is displaying a chart in a WinForm

application. When another application updates the database, I want to

refresh the data in the chart. However, the "refreshbutton_Click" causes

all the values of the y-axis to become zero. I'm sure I'm just missing

something simple....

Here's the Form1.cs source code:

using System;

using System.Drawing;

using System.Collections;

using System.ComponentModel;

using System.Windows.Forms;

using System.Data;

using SoftwareFX.ChartFX.Lite;

namespace Chart01

{

/// <summary>

/// Summary description for Form1.

/// </summary>

public class Form1 : System.Windows.Forms.Form

{

private System.Data.SqlClient.SqlConnection sqlConnection1;

private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;

private System.Data.SqlClient.SqlCommand sqlSelectCommand1;

private Chart01.DataSet1 dataSet11;

private SoftwareFX.ChartFX.Lite.Chart chart1;

private System.Windows.Forms.Button refreshbutton;

private System.Windows.Forms.TabControl tabControl1;

private System.Windows.Forms.TabPage ChartTab;

private System.Windows.Forms.TabPage DGTab;

private System.Windows.Forms.DataGrid dataGrid1;

/// <summary>

/// Required designer variable.

/// </summary>

private System.ComponentModel.Container components = null;

public Form1()

{

//

// Required for Windows Form Designer support

//

InitializeComponent();

this.chart1.Titles[0].Text = "First Letters of Students Last Names";

this.chart1.Titles[0].TextColor = Color.BlanchedAlmond;

this.chart1.Series[0].Color = Color.Maroon;

this.chart1.PointLabelColor = Color.Yellow;

//

// TODO: Add any constructor code after InitializeComponent call

//

}

/// <summary>

/// Clean up any resources being used.

/// </summary>

protected override void Dispose( bool disposing )

{

if( disposing )

{

if (components != null)

{

components.Dispose();

}

}

base.Dispose( disposing );

}

#region Windows Form Designer generated code

/// <summary>

/// Required method for Designer support - do not modify

/// the contents of this method with the code editor.

/// </summary>

private void InitializeComponent()

{

this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();

this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();

this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();

this.dataSet11 = new Chart01.DataSet1();

this.chart1 = new SoftwareFX.ChartFX.Lite.Chart();

this.refreshbutton = new System.Windows.Forms.Button();

this.tabControl1 = new System.Windows.Forms.TabControl();

this.ChartTab = new System.Windows.Forms.TabPage();

this.DGTab = new System.Windows.Forms.TabPage();

this.dataGrid1 = new System.Windows.Forms.DataGrid();

((System.ComponentModel.ISupportInitialize)(this.dataSet11)).BeginInit();

this.tabControl1.SuspendLayout();

this.ChartTab.SuspendLayout();

this.DGTab.SuspendLayout();

((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();

this.SuspendLayout();

//

// sqlConnection1

//

this.sqlConnection1.ConnectionString = "data

source=computername\\VSdotNET;initial catalog=OnTrack;integrated

security=SSPI;per" +

"sist security info=False;workstation id=*******;packet size=4096";

//

// sqlDataAdapter1

//

this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1;

this.sqlDataAdapter1.TableMappings.AddRange(new

System.Data.Common.DataTableMapping[] {

new System.Data.Common.DataTableMapping("Table",

"Table", new System.Data.Common.DataColumnMapping[] {

new

System.Data.Common.DataColumnMapping("Letter", "Letter"),

new

System.Data.Common.DataColumnMapping("Total", "Total")})});

//

// sqlSelectCommand1

//

this.sqlSelectCommand1.CommandText = "SELECT SUBSTRING(Last_Name, 1, 1)

AS Letter, COUNT(SUBSTRING(Last_Name, 1, 1)) AS" +

" Total FROM Students GROUP BY SUBSTRING(Last_Name, 1, 1)";

this.sqlSelectCommand1.Connection = this.sqlConnection1;

//

// dataSet11

//

this.dataSet11.DataSetName = "DataSet1";

this.dataSet11.Locale = new System.Globalization.CultureInfo("en-US");

//

// chart1

//

this.chart1.AxisX.Title.Text = "Letters";

this.chart1.AxisY.Gridlines = true;

this.chart1.AxisY.LabelsFormat.Decimals = 0;

this.chart1.AxisY.Title.Text = "Number";

this.chart1.BackColor = System.Drawing.SystemColors.Desktop;

this.chart1.DataSource = this.dataSet11._Table;

this.chart1.Font = new System.Drawing.Font("Arial", 10F,

System.Drawing.FontStyle.Bold);

this.chart1.InsideColor = System.Drawing.Color.BurlyWood;

this.chart1.Location = new System.Drawing.Point(24, 16);

this.chart1.Name = "chart1";

this.chart1.PointLabels = true;

this.chart1.Size = new System.Drawing.Size(648, 400);

this.chart1.TabIndex = 0;

this.chart1.ToolBar = true;

//

// refreshbutton

//

this.refreshbutton.BackColor = System.Drawing.Color.DarkBlue;

this.refreshbutton.Font = new System.Drawing.Font("Palatino Linotype",

12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point,

((System.Byte)(0)));

this.refreshbutton.ForeColor = System.Drawing.Color.Gainsboro;

this.refreshbutton.Location = new System.Drawing.Point(296, 488);

this.refreshbutton.Name = "refreshbutton";

this.refreshbutton.Size = new System.Drawing.Size(184, 24);

this.refreshbutton.TabIndex = 1;

this.refreshbutton.Text = "Refresh Data";

this.refreshbutton.Click += new

System.EventHandler(this.refreshbutton_Click);

//

// tabControl1

//

this.tabControl1.Controls.Add(this.ChartTab);

this.tabControl1.Controls.Add(this.DGTab);

this.tabControl1.Location = new System.Drawing.Point(24, 16);

this.tabControl1.Name = "tabControl1";

this.tabControl1.SelectedIndex = 0;

this.tabControl1.Size = new System.Drawing.Size(712, 464);

this.tabControl1.TabIndex = 2;

//

// ChartTab

//

this.ChartTab.Controls.Add(this.chart1);

this.ChartTab.Location = new System.Drawing.Point(4, 22);

this.ChartTab.Name = "ChartTab";

this.ChartTab.Size = new System.Drawing.Size(704, 438);

this.ChartTab.TabIndex = 0;

this.ChartTab.Text = "Chart";

//

// DGTab

//

this.DGTab.Controls.Add(this.dataGrid1);

this.DGTab.Location = new System.Drawing.Point(4, 22);

this.DGTab.Name = "DGTab";

this.DGTab.Size = new System.Drawing.Size(704, 438);

this.DGTab.TabIndex = 1;

this.DGTab.Text = "DataGrid";

//

// dataGrid1

//

this.dataGrid1.CaptionText = "Table";

this.dataGrid1.DataMember = "Table";

this.dataGrid1.DataSource = this.dataSet11;

this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;

this.dataGrid1.Location = new System.Drawing.Point(56, 40);

this.dataGrid1.Name = "dataGrid1";

this.dataGrid1.Size = new System.Drawing.Size(592, 344);

this.dataGrid1.TabIndex = 0;

//

// Form1

//

this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);

this.ClientSize = new System.Drawing.Size(766, 525);

this.Controls.Add(this.tabControl1);

this.Controls.Add(this.refreshbutton);

this.Name = "Form1";

this.Text = "Form1";

this.Load += new System.EventHandler(this.Form1_Load);

((System.ComponentModel.ISupportInitialize)(this.dataSet11)).EndInit();

this.tabControl1.ResumeLayout(false);

this.ChartTab.ResumeLayout(false);

this.DGTab.ResumeLayout(false);

((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();

this.ResumeLayout(false);

}

#endregion

/// <summary>

/// The main entry point for the application.

/// </summary>

[sTAThread]

static void Main()

{

Application.Run(new Form1());

}

private void oleDbDataAdapter1_RowUpdated(object sender,

System.Data.OleDb.OleDbRowUpdatedEventArgs e) {

}

private void Form1_Load(object sender, System.EventArgs e) {

this.sqlDataAdapter1.Fill(this.dataSet11);

}

private void refreshbutton_Click(object sender, System.EventArgs e) {

this.dataSet11.Clear();

this.sqlDataAdapter1.Fill(this.dataSet11);

}

}

}

Link to comment
Share on other sites

"SoftwareFX Support" <support@softwarefx.com> wrote in message

news:5PnDM1WqDHA.1900@WEBSERVER1...

> We are unable to reproduce this problem. Do you have a repro case ?

>

> --

> FP

> Software FX, Inc.

>

>

To restate the problem, ChartFXLite is displaying a chart in a WinForm

application. When another application updates the database, I want to

refresh the data in the chart. However, the "refreshbutton_Click" causes

all the values of the y-axis to become zero. I'm sure I'm just missing

something simple....

Here's the Form1.cs source code:

using System;

using System.Drawing;

using System.Collections;

using System.ComponentModel;

using System.Windows.Forms;

using System.Data;

using SoftwareFX.ChartFX.Lite;

namespace Chart01

{

/// <summary>

/// Summary description for Form1.

/// </summary>

public class Form1 : System.Windows.Forms.Form

{

private System.Data.SqlClient.SqlConnection sqlConnection1;

private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;

private System.Data.SqlClient.SqlCommand sqlSelectCommand1;

private Chart01.DataSet1 dataSet11;

private SoftwareFX.ChartFX.Lite.Chart chart1;

private System.Windows.Forms.Button refreshbutton;

private System.Windows.Forms.TabControl tabControl1;

private System.Windows.Forms.TabPage ChartTab;

private System.Windows.Forms.TabPage DGTab;

private System.Windows.Forms.DataGrid dataGrid1;

/// <summary>

/// Required designer variable.

/// </summary>

private System.ComponentModel.Container components = null;

public Form1()

{

//

// Required for Windows Form Designer support

//

InitializeComponent();

this.chart1.Titles[0].Text = "First Letters of Students Last Names";

this.chart1.Titles[0].TextColor = Color.BlanchedAlmond;

this.chart1.Series[0].Color = Color.Maroon;

this.chart1.PointLabelColor = Color.Yellow;

//

// TODO: Add any constructor code after InitializeComponent call

//

}

/// <summary>

/// Clean up any resources being used.

/// </summary>

protected override void Dispose( bool disposing )

{

if( disposing )

{

if (components != null)

{

components.Dispose();

}

}

base.Dispose( disposing );

}

#region Windows Form Designer generated code

/// <summary>

/// Required method for Designer support - do not modify

/// the contents of this method with the code editor.

/// </summary>

private void InitializeComponent()

{

this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();

this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();

this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();

this.dataSet11 = new Chart01.DataSet1();

this.chart1 = new SoftwareFX.ChartFX.Lite.Chart();

this.refreshbutton = new System.Windows.Forms.Button();

this.tabControl1 = new System.Windows.Forms.TabControl();

this.ChartTab = new System.Windows.Forms.TabPage();

this.DGTab = new System.Windows.Forms.TabPage();

this.dataGrid1 = new System.Windows.Forms.DataGrid();

((System.ComponentModel.ISupportInitialize)(this.dataSet11)).BeginInit();

this.tabControl1.SuspendLayout();

this.ChartTab.SuspendLayout();

this.DGTab.SuspendLayout();

((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();

this.SuspendLayout();

//

// sqlConnection1

//

this.sqlConnection1.ConnectionString = "data

source=computername\\VSdotNET;initial catalog=OnTrack;integrated

security=SSPI;per" +

"sist security info=False;workstation id=*******;packet size=4096";

//

// sqlDataAdapter1

//

this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1;

this.sqlDataAdapter1.TableMappings.AddRange(new

System.Data.Common.DataTableMapping[] {

new System.Data.Common.DataTableMapping("Table",

"Table", new System.Data.Common.DataColumnMapping[] {

new

System.Data.Common.DataColumnMapping("Letter", "Letter"),

new

System.Data.Common.DataColumnMapping("Total", "Total")})});

//

// sqlSelectCommand1

//

this.sqlSelectCommand1.CommandText = "SELECT SUBSTRING(Last_Name, 1, 1)

AS Letter, COUNT(SUBSTRING(Last_Name, 1, 1)) AS" +

" Total FROM Students GROUP BY SUBSTRING(Last_Name, 1, 1)";

this.sqlSelectCommand1.Connection = this.sqlConnection1;

//

// dataSet11

//

this.dataSet11.DataSetName = "DataSet1";

this.dataSet11.Locale = new System.Globalization.CultureInfo("en-US");

//

// chart1

//

this.chart1.AxisX.Title.Text = "Letters";

this.chart1.AxisY.Gridlines = true;

this.chart1.AxisY.LabelsFormat.Decimals = 0;

this.chart1.AxisY.Title.Text = "Number";

this.chart1.BackColor = System.Drawing.SystemColors.Desktop;

this.chart1.DataSource = this.dataSet11._Table;

this.chart1.Font = new System.Drawing.Font("Arial", 10F,

System.Drawing.FontStyle.Bold);

this.chart1.InsideColor = System.Drawing.Color.BurlyWood;

this.chart1.Location = new System.Drawing.Point(24, 16);

this.chart1.Name = "chart1";

this.chart1.PointLabels = true;

this.chart1.Size = new System.Drawing.Size(648, 400);

this.chart1.TabIndex = 0;

this.chart1.ToolBar = true;

//

// refreshbutton

//

this.refreshbutton.BackColor = System.Drawing.Color.DarkBlue;

this.refreshbutton.Font = new System.Drawing.Font("Palatino Linotype",

12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point,

((System.Byte)(0)));

this.refreshbutton.ForeColor = System.Drawing.Color.Gainsboro;

this.refreshbutton.Location = new System.Drawing.Point(296, 488);

this.refreshbutton.Name = "refreshbutton";

this.refreshbutton.Size = new System.Drawing.Size(184, 24);

this.refreshbutton.TabIndex = 1;

this.refreshbutton.Text = "Refresh Data";

this.refreshbutton.Click += new

System.EventHandler(this.refreshbutton_Click);

//

// tabControl1

//

this.tabControl1.Controls.Add(this.ChartTab);

this.tabControl1.Controls.Add(this.DGTab);

this.tabControl1.Location = new System.Drawing.Point(24, 16);

this.tabControl1.Name = "tabControl1";

this.tabControl1.SelectedIndex = 0;

this.tabControl1.Size = new System.Drawing.Size(712, 464);

this.tabControl1.TabIndex = 2;

//

// ChartTab

//

this.ChartTab.Controls.Add(this.chart1);

this.ChartTab.Location = new System.Drawing.Point(4, 22);

this.ChartTab.Name = "ChartTab";

this.ChartTab.Size = new System.Drawing.Size(704, 438);

this.ChartTab.TabIndex = 0;

this.ChartTab.Text = "Chart";

//

// DGTab

//

this.DGTab.Controls.Add(this.dataGrid1);

this.DGTab.Location = new System.Drawing.Point(4, 22);

this.DGTab.Name = "DGTab";

this.DGTab.Size = new System.Drawing.Size(704, 438);

this.DGTab.TabIndex = 1;

this.DGTab.Text = "DataGrid";

//

// dataGrid1

//

this.dataGrid1.CaptionText = "Table";

this.dataGrid1.DataMember = "Table";

this.dataGrid1.DataSource = this.dataSet11;

this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;

this.dataGrid1.Location = new System.Drawing.Point(56, 40);

this.dataGrid1.Name = "dataGrid1";

this.dataGrid1.Size = new System.Drawing.Size(592, 344);

this.dataGrid1.TabIndex = 0;

//

// Form1

//

this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);

this.ClientSize = new System.Drawing.Size(766, 525);

this.Controls.Add(this.tabControl1);

this.Controls.Add(this.refreshbutton);

this.Name = "Form1";

this.Text = "Form1";

this.Load += new System.EventHandler(this.Form1_Load);

((System.ComponentModel.ISupportInitialize)(this.dataSet11)).EndInit();

this.tabControl1.ResumeLayout(false);

this.ChartTab.ResumeLayout(false);

this.DGTab.ResumeLayout(false);

((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();

this.ResumeLayout(false);

}

#endregion

/// <summary>

/// The main entry point for the application.

/// </summary>

[sTAThread]

static void Main()

{

Application.Run(new Form1());

}

private void oleDbDataAdapter1_RowUpdated(object sender,

System.Data.OleDb.OleDbRowUpdatedEventArgs e) {

}

private void Form1_Load(object sender, System.EventArgs e) {

this.sqlDataAdapter1.Fill(this.dataSet11);

}

private void refreshbutton_Click(object sender, System.EventArgs e) {

this.dataSet11.Clear();

this.sqlDataAdapter1.Fill(this.dataSet11);

}

}

}

Link to comment
Share on other sites

  • 1 month later...

Any suggestions on this?  It's been a while....

"Ken Arway" <karway@jaguar.worldnet.att.net> wrote in message

news:qijX0WZqDHA.1560@WEBSERVER1...

>

> "SoftwareFX Support" <support@softwarefx.com> wrote in message

> news:5PnDM1WqDHA.1900@WEBSERVER1...

> > We are unable to reproduce this problem. Do you have a repro case ?

> >

> > --

> > FP

> > Software FX, Inc.

> >

> >

>

> To restate the problem, ChartFXLite is displaying a chart in a WinForm

> application. When another application updates the database, I want to

> refresh the data in the chart. However, the "refreshbutton_Click" causes

> all the values of the y-axis to become zero. I'm sure I'm just missing

> something simple....

>

> Here's the Form1.cs source code:

>

> using System;

> using System.Drawing;

> using System.Collections;

> using System.ComponentModel;

> using System.Windows.Forms;

> using System.Data;

> using SoftwareFX.ChartFX.Lite;

>

> namespace Chart01

> {

> /// <summary>

> /// Summary description for Form1.

> /// </summary>

> public class Form1 : System.Windows.Forms.Form

> {

> private System.Data.SqlClient.SqlConnection sqlConnection1;

> private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;

> private System.Data.SqlClient.SqlCommand sqlSelectCommand1;

> private Chart01.DataSet1 dataSet11;

> private SoftwareFX.ChartFX.Lite.Chart chart1;

> private System.Windows.Forms.Button refreshbutton;

> private System.Windows.Forms.TabControl tabControl1;

> private System.Windows.Forms.TabPage ChartTab;

> private System.Windows.Forms.TabPage DGTab;

> private System.Windows.Forms.DataGrid dataGrid1;

> /// <summary>

> /// Required designer variable.

> /// </summary>

> private System.ComponentModel.Container components = null;

>

> public Form1()

> {

> //

> // Required for Windows Form Designer support

> //

> InitializeComponent();

> this.chart1.Titles[0].Text = "First Letters of Students Last Names";

> this.chart1.Titles[0].TextColor = Color.BlanchedAlmond;

> this.chart1.Series[0].Color = Color.Maroon;

> this.chart1.PointLabelColor = Color.Yellow;

>

> //

> // TODO: Add any constructor code after InitializeComponent call

> //

> }

>

> /// <summary>

> /// Clean up any resources being used.

> /// </summary>

> protected override void Dispose( bool disposing )

> {

> if( disposing )

> {

> if (components != null)

> {

> components.Dispose();

> }

> }

> base.Dispose( disposing );

> }

>

> #region Windows Form Designer generated code

> /// <summary>

> /// Required method for Designer support - do not modify

> /// the contents of this method with the code editor.

> /// </summary>

> private void InitializeComponent()

> {

> this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();

> this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();

> this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();

> this.dataSet11 = new Chart01.DataSet1();

> this.chart1 = new SoftwareFX.ChartFX.Lite.Chart();

> this.refreshbutton = new System.Windows.Forms.Button();

> this.tabControl1 = new System.Windows.Forms.TabControl();

> this.ChartTab = new System.Windows.Forms.TabPage();

> this.DGTab = new System.Windows.Forms.TabPage();

> this.dataGrid1 = new System.Windows.Forms.DataGrid();

>

((System.ComponentModel.ISupportInitialize)(this.dataSet11)).BeginInit();

> this.tabControl1.SuspendLayout();

> this.ChartTab.SuspendLayout();

> this.DGTab.SuspendLayout();

>

((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();

> this.SuspendLayout();

> //

> // sqlConnection1

> //

> this.sqlConnection1.ConnectionString = "data

> source=computername\\VSdotNET;initial catalog=OnTrack;integrated

> security=SSPI;per" +

> "sist security info=False;workstation id=*******;packet size=4096";

> //

> // sqlDataAdapter1

> //

> this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1;

> this.sqlDataAdapter1.TableMappings.AddRange(new

> System.Data.Common.DataTableMapping[] {

> new

System.Data.Common.DataTableMapping("Table",

> "Table", new System.Data.Common.DataColumnMapping[] {

> new

> System.Data.Common.DataColumnMapping("Letter", "Letter"),

> new

> System.Data.Common.DataColumnMapping("Total", "Total")})});

> //

> // sqlSelectCommand1

> //

> this.sqlSelectCommand1.CommandText = "SELECT SUBSTRING(Last_Name, 1, 1)

> AS Letter, COUNT(SUBSTRING(Last_Name, 1, 1)) AS" +

> " Total FROM Students GROUP BY SUBSTRING(Last_Name, 1, 1)";

> this.sqlSelectCommand1.Connection = this.sqlConnection1;

> //

> // dataSet11

> //

> this.dataSet11.DataSetName = "DataSet1";

> this.dataSet11.Locale = new System.Globalization.CultureInfo("en-US");

> //

> // chart1

> //

> this.chart1.AxisX.Title.Text = "Letters";

> this.chart1.AxisY.Gridlines = true;

> this.chart1.AxisY.LabelsFormat.Decimals = 0;

> this.chart1.AxisY.Title.Text = "Number";

> this.chart1.BackColor = System.Drawing.SystemColors.Desktop;

> this.chart1.DataSource = this.dataSet11._Table;

> this.chart1.Font = new System.Drawing.Font("Arial", 10F,

> System.Drawing.FontStyle.Bold);

> this.chart1.InsideColor = System.Drawing.Color.BurlyWood;

> this.chart1.Location = new System.Drawing.Point(24, 16);

> this.chart1.Name = "chart1";

> this.chart1.PointLabels = true;

> this.chart1.Size = new System.Drawing.Size(648, 400);

> this.chart1.TabIndex = 0;

> this.chart1.ToolBar = true;

> //

> // refreshbutton

> //

> this.refreshbutton.BackColor = System.Drawing.Color.DarkBlue;

> this.refreshbutton.Font = new System.Drawing.Font("Palatino Linotype",

> 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point,

> ((System.Byte)(0)));

> this.refreshbutton.ForeColor = System.Drawing.Color.Gainsboro;

> this.refreshbutton.Location = new System.Drawing.Point(296, 488);

> this.refreshbutton.Name = "refreshbutton";

> this.refreshbutton.Size = new System.Drawing.Size(184, 24);

> this.refreshbutton.TabIndex = 1;

> this.refreshbutton.Text = "Refresh Data";

> this.refreshbutton.Click += new

> System.EventHandler(this.refreshbutton_Click);

> //

> // tabControl1

> //

> this.tabControl1.Controls.Add(this.ChartTab);

> this.tabControl1.Controls.Add(this.DGTab);

> this.tabControl1.Location = new System.Drawing.Point(24, 16);

> this.tabControl1.Name = "tabControl1";

> this.tabControl1.SelectedIndex = 0;

> this.tabControl1.Size = new System.Drawing.Size(712, 464);

> this.tabControl1.TabIndex = 2;

> //

> // ChartTab

> //

> this.ChartTab.Controls.Add(this.chart1);

> this.ChartTab.Location = new System.Drawing.Point(4, 22);

> this.ChartTab.Name = "ChartTab";

> this.ChartTab.Size = new System.Drawing.Size(704, 438);

> this.ChartTab.TabIndex = 0;

> this.ChartTab.Text = "Chart";

> //

> // DGTab

> //

> this.DGTab.Controls.Add(this.dataGrid1);

> this.DGTab.Location = new System.Drawing.Point(4, 22);

> this.DGTab.Name = "DGTab";

> this.DGTab.Size = new System.Drawing.Size(704, 438);

> this.DGTab.TabIndex = 1;

> this.DGTab.Text = "DataGrid";

> //

> // dataGrid1

> //

> this.dataGrid1.CaptionText = "Table";

> this.dataGrid1.DataMember = "Table";

> this.dataGrid1.DataSource = this.dataSet11;

> this.dataGrid1.HeaderForeColor =

System.Drawing.SystemColors.ControlText;

> this.dataGrid1.Location = new System.Drawing.Point(56, 40);

> this.dataGrid1.Name = "dataGrid1";

> this.dataGrid1.Size = new System.Drawing.Size(592, 344);

> this.dataGrid1.TabIndex = 0;

> //

> // Form1

> //

> this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);

> this.ClientSize = new System.Drawing.Size(766, 525);

> this.Controls.Add(this.tabControl1);

> this.Controls.Add(this.refreshbutton);

> this.Name = "Form1";

> this.Text = "Form1";

> this.Load += new System.EventHandler(this.Form1_Load);

> ((System.ComponentModel.ISupportInitialize)(this.dataSet11)).EndInit();

> this.tabControl1.ResumeLayout(false);

> this.ChartTab.ResumeLayout(false);

> this.DGTab.ResumeLayout(false);

> ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();

> this.ResumeLayout(false);

>

> }

> #endregion

>

> /// <summary>

> /// The main entry point for the application.

> /// </summary>

> [sTAThread]

> static void Main()

> {

> Application.Run(new Form1());

> }

>

> private void oleDbDataAdapter1_RowUpdated(object sender,

> System.Data.OleDb.OleDbRowUpdatedEventArgs e) {

>

> }

>

> private void Form1_Load(object sender, System.EventArgs e) {

> this.sqlDataAdapter1.Fill(this.dataSet11);

> }

>

> private void refreshbutton_Click(object sender, System.EventArgs e) {

> this.dataSet11.Clear();

> this.sqlDataAdapter1.Fill(this.dataSet11);

> }

>

>

> }

> }

>

>

Link to comment
Share on other sites

Any suggestions on this?  It's been a while....

"Ken Arway" <karway@jaguar.worldnet.att.net> wrote in message

news:qijX0WZqDHA.1560@WEBSERVER1...

>

> "SoftwareFX Support" <support@softwarefx.com> wrote in message

> news:5PnDM1WqDHA.1900@WEBSERVER1...

> > We are unable to reproduce this problem. Do you have a repro case ?

> >

> > --

> > FP

> > Software FX, Inc.

> >

> >

>

> To restate the problem, ChartFXLite is displaying a chart in a WinForm

> application. When another application updates the database, I want to

> refresh the data in the chart. However, the "refreshbutton_Click" causes

> all the values of the y-axis to become zero. I'm sure I'm just missing

> something simple....

>

> Here's the Form1.cs source code:

>

> using System;

> using System.Drawing;

> using System.Collections;

> using System.ComponentModel;

> using System.Windows.Forms;

> using System.Data;

> using SoftwareFX.ChartFX.Lite;

>

> namespace Chart01

> {

> /// <summary>

> /// Summary description for Form1.

> /// </summary>

> public class Form1 : System.Windows.Forms.Form

> {

> private System.Data.SqlClient.SqlConnection sqlConnection1;

> private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;

> private System.Data.SqlClient.SqlCommand sqlSelectCommand1;

> private Chart01.DataSet1 dataSet11;

> private SoftwareFX.ChartFX.Lite.Chart chart1;

> private System.Windows.Forms.Button refreshbutton;

> private System.Windows.Forms.TabControl tabControl1;

> private System.Windows.Forms.TabPage ChartTab;

> private System.Windows.Forms.TabPage DGTab;

> private System.Windows.Forms.DataGrid dataGrid1;

> /// <summary>

> /// Required designer variable.

> /// </summary>

> private System.ComponentModel.Container components = null;

>

> public Form1()

> {

> //

> // Required for Windows Form Designer support

> //

> InitializeComponent();

> this.chart1.Titles[0].Text = "First Letters of Students Last Names";

> this.chart1.Titles[0].TextColor = Color.BlanchedAlmond;

> this.chart1.Series[0].Color = Color.Maroon;

> this.chart1.PointLabelColor = Color.Yellow;

>

> //

> // TODO: Add any constructor code after InitializeComponent call

> //

> }

>

> /// <summary>

> /// Clean up any resources being used.

> /// </summary>

> protected override void Dispose( bool disposing )

> {

> if( disposing )

> {

> if (components != null)

> {

> components.Dispose();

> }

> }

> base.Dispose( disposing );

> }

>

> #region Windows Form Designer generated code

> /// <summary>

> /// Required method for Designer support - do not modify

> /// the contents of this method with the code editor.

> /// </summary>

> private void InitializeComponent()

> {

> this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();

> this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();

> this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();

> this.dataSet11 = new Chart01.DataSet1();

> this.chart1 = new SoftwareFX.ChartFX.Lite.Chart();

> this.refreshbutton = new System.Windows.Forms.Button();

> this.tabControl1 = new System.Windows.Forms.TabControl();

> this.ChartTab = new System.Windows.Forms.TabPage();

> this.DGTab = new System.Windows.Forms.TabPage();

> this.dataGrid1 = new System.Windows.Forms.DataGrid();

>

((System.ComponentModel.ISupportInitialize)(this.dataSet11)).BeginInit();

> this.tabControl1.SuspendLayout();

> this.ChartTab.SuspendLayout();

> this.DGTab.SuspendLayout();

>

((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();

> this.SuspendLayout();

> //

> // sqlConnection1

> //

> this.sqlConnection1.ConnectionString = "data

> source=computername\\VSdotNET;initial catalog=OnTrack;integrated

> security=SSPI;per" +

> "sist security info=False;workstation id=*******;packet size=4096";

> //

> // sqlDataAdapter1

> //

> this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1;

> this.sqlDataAdapter1.TableMappings.AddRange(new

> System.Data.Common.DataTableMapping[] {

> new

System.Data.Common.DataTableMapping("Table",

> "Table", new System.Data.Common.DataColumnMapping[] {

> new

> System.Data.Common.DataColumnMapping("Letter", "Letter"),

> new

> System.Data.Common.DataColumnMapping("Total", "Total")})});

> //

> // sqlSelectCommand1

> //

> this.sqlSelectCommand1.CommandText = "SELECT SUBSTRING(Last_Name, 1, 1)

> AS Letter, COUNT(SUBSTRING(Last_Name, 1, 1)) AS" +

> " Total FROM Students GROUP BY SUBSTRING(Last_Name, 1, 1)";

> this.sqlSelectCommand1.Connection = this.sqlConnection1;

> //

> // dataSet11

> //

> this.dataSet11.DataSetName = "DataSet1";

> this.dataSet11.Locale = new System.Globalization.CultureInfo("en-US");

> //

> // chart1

> //

> this.chart1.AxisX.Title.Text = "Letters";

> this.chart1.AxisY.Gridlines = true;

> this.chart1.AxisY.LabelsFormat.Decimals = 0;

> this.chart1.AxisY.Title.Text = "Number";

> this.chart1.BackColor = System.Drawing.SystemColors.Desktop;

> this.chart1.DataSource = this.dataSet11._Table;

> this.chart1.Font = new System.Drawing.Font("Arial", 10F,

> System.Drawing.FontStyle.Bold);

> this.chart1.InsideColor = System.Drawing.Color.BurlyWood;

> this.chart1.Location = new System.Drawing.Point(24, 16);

> this.chart1.Name = "chart1";

> this.chart1.PointLabels = true;

> this.chart1.Size = new System.Drawing.Size(648, 400);

> this.chart1.TabIndex = 0;

> this.chart1.ToolBar = true;

> //

> // refreshbutton

> //

> this.refreshbutton.BackColor = System.Drawing.Color.DarkBlue;

> this.refreshbutton.Font = new System.Drawing.Font("Palatino Linotype",

> 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point,

> ((System.Byte)(0)));

> this.refreshbutton.ForeColor = System.Drawing.Color.Gainsboro;

> this.refreshbutton.Location = new System.Drawing.Point(296, 488);

> this.refreshbutton.Name = "refreshbutton";

> this.refreshbutton.Size = new System.Drawing.Size(184, 24);

> this.refreshbutton.TabIndex = 1;

> this.refreshbutton.Text = "Refresh Data";

> this.refreshbutton.Click += new

> System.EventHandler(this.refreshbutton_Click);

> //

> // tabControl1

> //

> this.tabControl1.Controls.Add(this.ChartTab);

> this.tabControl1.Controls.Add(this.DGTab);

> this.tabControl1.Location = new System.Drawing.Point(24, 16);

> this.tabControl1.Name = "tabControl1";

> this.tabControl1.SelectedIndex = 0;

> this.tabControl1.Size = new System.Drawing.Size(712, 464);

> this.tabControl1.TabIndex = 2;

> //

> // ChartTab

> //

> this.ChartTab.Controls.Add(this.chart1);

> this.ChartTab.Location = new System.Drawing.Point(4, 22);

> this.ChartTab.Name = "ChartTab";

> this.ChartTab.Size = new System.Drawing.Size(704, 438);

> this.ChartTab.TabIndex = 0;

> this.ChartTab.Text = "Chart";

> //

> // DGTab

> //

> this.DGTab.Controls.Add(this.dataGrid1);

> this.DGTab.Location = new System.Drawing.Point(4, 22);

> this.DGTab.Name = "DGTab";

> this.DGTab.Size = new System.Drawing.Size(704, 438);

> this.DGTab.TabIndex = 1;

> this.DGTab.Text = "DataGrid";

> //

> // dataGrid1

> //

> this.dataGrid1.CaptionText = "Table";

> this.dataGrid1.DataMember = "Table";

> this.dataGrid1.DataSource = this.dataSet11;

> this.dataGrid1.HeaderForeColor =

System.Drawing.SystemColors.ControlText;

> this.dataGrid1.Location = new System.Drawing.Point(56, 40);

> this.dataGrid1.Name = "dataGrid1";

> this.dataGrid1.Size = new System.Drawing.Size(592, 344);

> this.dataGrid1.TabIndex = 0;

> //

> // Form1

> //

> this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);

> this.ClientSize = new System.Drawing.Size(766, 525);

> this.Controls.Add(this.tabControl1);

> this.Controls.Add(this.refreshbutton);

> this.Name = "Form1";

> this.Text = "Form1";

> this.Load += new System.EventHandler(this.Form1_Load);

> ((System.ComponentModel.ISupportInitialize)(this.dataSet11)).EndInit();

> this.tabControl1.ResumeLayout(false);

> this.ChartTab.ResumeLayout(false);

> this.DGTab.ResumeLayout(false);

> ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();

> this.ResumeLayout(false);

>

> }

> #endregion

>

> /// <summary>

> /// The main entry point for the application.

> /// </summary>

> [sTAThread]

> static void Main()

> {

> Application.Run(new Form1());

> }

>

> private void oleDbDataAdapter1_RowUpdated(object sender,

> System.Data.OleDb.OleDbRowUpdatedEventArgs e) {

>

> }

>

> private void Form1_Load(object sender, System.EventArgs e) {

> this.sqlDataAdapter1.Fill(this.dataSet11);

> }

>

> private void refreshbutton_Click(object sender, System.EventArgs e) {

> this.dataSet11.Clear();

> this.sqlDataAdapter1.Fill(this.dataSet11);

> }

>

>

> }

> }

>

>

Link to comment
Share on other sites

We will be looking into this issue, in the meantime try adding this line to

your refreshbutton_Click handler

this.chart1.DataSource = this.dataSet11._Table;

I apologize for our delay getting back to you.

--

Regards,

JC

Software FX Support

"Ken Arway" <karway@jaguar.worldnet.att.net> wrote in message

news:dBYVPL1zDHA.3512@WEBSERVER1...

> Any suggestions on this? It's been a while....

> "Ken Arway" <karway@jaguar.worldnet.att.net> wrote in message

> news:qijX0WZqDHA.1560@WEBSERVER1...

> >

> > "SoftwareFX Support" <support@softwarefx.com> wrote in message

> > news:5PnDM1WqDHA.1900@WEBSERVER1...

> > > We are unable to reproduce this problem. Do you have a repro case ?

> > >

> > > --

> > > FP

> > > Software FX, Inc.

> > >

> > >

> >

> > To restate the problem, ChartFXLite is displaying a chart in a WinForm

> > application. When another application updates the database, I want to

> > refresh the data in the chart. However, the "refreshbutton_Click"

causes

> > all the values of the y-axis to become zero. I'm sure I'm just missing

> > something simple....

> >

> > Here's the Form1.cs source code:

> >

> > using System;

> > using System.Drawing;

> > using System.Collections;

> > using System.ComponentModel;

> > using System.Windows.Forms;

> > using System.Data;

> > using SoftwareFX.ChartFX.Lite;

> >

> > namespace Chart01

> > {

> > /// <summary>

> > /// Summary description for Form1.

> > /// </summary>

> > public class Form1 : System.Windows.Forms.Form

> > {

> > private System.Data.SqlClient.SqlConnection sqlConnection1;

> > private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;

> > private System.Data.SqlClient.SqlCommand sqlSelectCommand1;

> > private Chart01.DataSet1 dataSet11;

> > private SoftwareFX.ChartFX.Lite.Chart chart1;

> > private System.Windows.Forms.Button refreshbutton;

> > private System.Windows.Forms.TabControl tabControl1;

> > private System.Windows.Forms.TabPage ChartTab;

> > private System.Windows.Forms.TabPage DGTab;

> > private System.Windows.Forms.DataGrid dataGrid1;

> > /// <summary>

> > /// Required designer variable.

> > /// </summary>

> > private System.ComponentModel.Container components = null;

> >

> > public Form1()

> > {

> > //

> > // Required for Windows Form Designer support

> > //

> > InitializeComponent();

> > this.chart1.Titles[0].Text = "First Letters of Students Last Names";

> > this.chart1.Titles[0].TextColor = Color.BlanchedAlmond;

> > this.chart1.Series[0].Color = Color.Maroon;

> > this.chart1.PointLabelColor = Color.Yellow;

> >

> > //

> > // TODO: Add any constructor code after InitializeComponent call

> > //

> > }

> >

> > /// <summary>

> > /// Clean up any resources being used.

> > /// </summary>

> > protected override void Dispose( bool disposing )

> > {

> > if( disposing )

> > {

> > if (components != null)

> > {

> > components.Dispose();

> > }

> > }

> > base.Dispose( disposing );

> > }

> >

> > #region Windows Form Designer generated code

> > /// <summary>

> > /// Required method for Designer support - do not modify

> > /// the contents of this method with the code editor.

> > /// </summary>

> > private void InitializeComponent()

> > {

> > this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();

> > this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();

> > this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();

> > this.dataSet11 = new Chart01.DataSet1();

> > this.chart1 = new SoftwareFX.ChartFX.Lite.Chart();

> > this.refreshbutton = new System.Windows.Forms.Button();

> > this.tabControl1 = new System.Windows.Forms.TabControl();

> > this.ChartTab = new System.Windows.Forms.TabPage();

> > this.DGTab = new System.Windows.Forms.TabPage();

> > this.dataGrid1 = new System.Windows.Forms.DataGrid();

> >

> ((System.ComponentModel.ISupportInitialize)(this.dataSet11)).BeginInit();

> > this.tabControl1.SuspendLayout();

> > this.ChartTab.SuspendLayout();

> > this.DGTab.SuspendLayout();

> >

> ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();

> > this.SuspendLayout();

> > //

> > // sqlConnection1

> > //

> > this.sqlConnection1.ConnectionString = "data

> > source=computername\\VSdotNET;initial catalog=OnTrack;integrated

> > security=SSPI;per" +

> > "sist security info=False;workstation id=*******;packet size=4096";

> > //

> > // sqlDataAdapter1

> > //

> > this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1;

> > this.sqlDataAdapter1.TableMappings.AddRange(new

> > System.Data.Common.DataTableMapping[] {

> > new

> System.Data.Common.DataTableMapping("Table",

> > "Table", new System.Data.Common.DataColumnMapping[] {

> > new

> > System.Data.Common.DataColumnMapping("Letter", "Letter"),

> > new

> > System.Data.Common.DataColumnMapping("Total", "Total")})});

> > //

> > // sqlSelectCommand1

> > //

> > this.sqlSelectCommand1.CommandText = "SELECT SUBSTRING(Last_Name, 1,

1)

> > AS Letter, COUNT(SUBSTRING(Last_Name, 1, 1)) AS" +

> > " Total FROM Students GROUP BY SUBSTRING(Last_Name, 1, 1)";

> > this.sqlSelectCommand1.Connection = this.sqlConnection1;

> > //

> > // dataSet11

> > //

> > this.dataSet11.DataSetName = "DataSet1";

> > this.dataSet11.Locale = new

System.Globalization.CultureInfo("en-US");

> > //

> > // chart1

> > //

> > this.chart1.AxisX.Title.Text = "Letters";

> > this.chart1.AxisY.Gridlines = true;

> > this.chart1.AxisY.LabelsFormat.Decimals = 0;

> > this.chart1.AxisY.Title.Text = "Number";

> > this.chart1.BackColor = System.Drawing.SystemColors.Desktop;

> > this.chart1.DataSource = this.dataSet11._Table;

> > this.chart1.Font = new System.Drawing.Font("Arial", 10F,

> > System.Drawing.FontStyle.Bold);

> > this.chart1.InsideColor = System.Drawing.Color.BurlyWood;

> > this.chart1.Location = new System.Drawing.Point(24, 16);

> > this.chart1.Name = "chart1";

> > this.chart1.PointLabels = true;

> > this.chart1.Size = new System.Drawing.Size(648, 400);

> > this.chart1.TabIndex = 0;

> > this.chart1.ToolBar = true;

> > //

> > // refreshbutton

> > //

> > this.refreshbutton.BackColor = System.Drawing.Color.DarkBlue;

> > this.refreshbutton.Font = new System.Drawing.Font("Palatino

Linotype",

> > 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point,

> > ((System.Byte)(0)));

> > this.refreshbutton.ForeColor = System.Drawing.Color.Gainsboro;

> > this.refreshbutton.Location = new System.Drawing.Point(296, 488);

> > this.refreshbutton.Name = "refreshbutton";

> > this.refreshbutton.Size = new System.Drawing.Size(184, 24);

> > this.refreshbutton.TabIndex = 1;

> > this.refreshbutton.Text = "Refresh Data";

> > this.refreshbutton.Click += new

> > System.EventHandler(this.refreshbutton_Click);

> > //

> > // tabControl1

> > //

> > this.tabControl1.Controls.Add(this.ChartTab);

> > this.tabControl1.Controls.Add(this.DGTab);

> > this.tabControl1.Location = new System.Drawing.Point(24, 16);

> > this.tabControl1.Name = "tabControl1";

> > this.tabControl1.SelectedIndex = 0;

> > this.tabControl1.Size = new System.Drawing.Size(712, 464);

> > this.tabControl1.TabIndex = 2;

> > //

> > // ChartTab

> > //

> > this.ChartTab.Controls.Add(this.chart1);

> > this.ChartTab.Location = new System.Drawing.Point(4, 22);

> > this.ChartTab.Name = "ChartTab";

> > this.ChartTab.Size = new System.Drawing.Size(704, 438);

> > this.ChartTab.TabIndex = 0;

> > this.ChartTab.Text = "Chart";

> > //

> > // DGTab

> > //

> > this.DGTab.Controls.Add(this.dataGrid1);

> > this.DGTab.Location = new System.Drawing.Point(4, 22);

> > this.DGTab.Name = "DGTab";

> > this.DGTab.Size = new System.Drawing.Size(704, 438);

> > this.DGTab.TabIndex = 1;

> > this.DGTab.Text = "DataGrid";

> > //

> > // dataGrid1

> > //

> > this.dataGrid1.CaptionText = "Table";

> > this.dataGrid1.DataMember = "Table";

> > this.dataGrid1.DataSource = this.dataSet11;

> > this.dataGrid1.HeaderForeColor =

> System.Drawing.SystemColors.ControlText;

> > this.dataGrid1.Location = new System.Drawing.Point(56, 40);

> > this.dataGrid1.Name = "dataGrid1";

> > this.dataGrid1.Size = new System.Drawing.Size(592, 344);

> > this.dataGrid1.TabIndex = 0;

> > //

> > // Form1

> > //

> > this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);

> > this.ClientSize = new System.Drawing.Size(766, 525);

> > this.Controls.Add(this.tabControl1);

> > this.Controls.Add(this.refreshbutton);

> > this.Name = "Form1";

> > this.Text = "Form1";

> > this.Load += new System.EventHandler(this.Form1_Load);

> >

((System.ComponentModel.ISupportInitialize)(this.dataSet11)).EndInit();

> > this.tabControl1.ResumeLayout(false);

> > this.ChartTab.ResumeLayout(false);

> > this.DGTab.ResumeLayout(false);

> >

((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();

> > this.ResumeLayout(false);

> >

> > }

> > #endregion

> >

> > /// <summary>

> > /// The main entry point for the application.

> > /// </summary>

> > [sTAThread]

> > static void Main()

> > {

> > Application.Run(new Form1());

> > }

> >

> > private void oleDbDataAdapter1_RowUpdated(object sender,

> > System.Data.OleDb.OleDbRowUpdatedEventArgs e) {

> >

> > }

> >

> > private void Form1_Load(object sender, System.EventArgs e) {

> > this.sqlDataAdapter1.Fill(this.dataSet11);

> > }

> >

> > private void refreshbutton_Click(object sender, System.EventArgs e) {

> > this.dataSet11.Clear();

> > this.sqlDataAdapter1.Fill(this.dataSet11);

> > }

> >

> >

> > }

> > }

> >

> >

>

>

Link to comment
Share on other sites

We will be looking into this issue, in the meantime try adding this line to

your refreshbutton_Click handler

this.chart1.DataSource = this.dataSet11._Table;

I apologize for our delay getting back to you.

--

Regards,

JC

Software FX Support

"Ken Arway" <karway@jaguar.worldnet.att.net> wrote in message

news:dBYVPL1zDHA.3512@WEBSERVER1...

> Any suggestions on this? It's been a while....

> "Ken Arway" <karway@jaguar.worldnet.att.net> wrote in message

> news:qijX0WZqDHA.1560@WEBSERVER1...

> >

> > "SoftwareFX Support" <support@softwarefx.com> wrote in message

> > news:5PnDM1WqDHA.1900@WEBSERVER1...

> > > We are unable to reproduce this problem. Do you have a repro case ?

> > >

> > > --

> > > FP

> > > Software FX, Inc.

> > >

> > >

> >

> > To restate the problem, ChartFXLite is displaying a chart in a WinForm

> > application. When another application updates the database, I want to

> > refresh the data in the chart. However, the "refreshbutton_Click"

causes

> > all the values of the y-axis to become zero. I'm sure I'm just missing

> > something simple....

> >

> > Here's the Form1.cs source code:

> >

> > using System;

> > using System.Drawing;

> > using System.Collections;

> > using System.ComponentModel;

> > using System.Windows.Forms;

> > using System.Data;

> > using SoftwareFX.ChartFX.Lite;

> >

> > namespace Chart01

> > {

> > /// <summary>

> > /// Summary description for Form1.

> > /// </summary>

> > public class Form1 : System.Windows.Forms.Form

> > {

> > private System.Data.SqlClient.SqlConnection sqlConnection1;

> > private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;

> > private System.Data.SqlClient.SqlCommand sqlSelectCommand1;

> > private Chart01.DataSet1 dataSet11;

> > private SoftwareFX.ChartFX.Lite.Chart chart1;

> > private System.Windows.Forms.Button refreshbutton;

> > private System.Windows.Forms.TabControl tabControl1;

> > private System.Windows.Forms.TabPage ChartTab;

> > private System.Windows.Forms.TabPage DGTab;

> > private System.Windows.Forms.DataGrid dataGrid1;

> > /// <summary>

> > /// Required designer variable.

> > /// </summary>

> > private System.ComponentModel.Container components = null;

> >

> > public Form1()

> > {

> > //

> > // Required for Windows Form Designer support

> > //

> > InitializeComponent();

> > this.chart1.Titles[0].Text = "First Letters of Students Last Names";

> > this.chart1.Titles[0].TextColor = Color.BlanchedAlmond;

> > this.chart1.Series[0].Color = Color.Maroon;

> > this.chart1.PointLabelColor = Color.Yellow;

> >

> > //

> > // TODO: Add any constructor code after InitializeComponent call

> > //

> > }

> >

> > /// <summary>

> > /// Clean up any resources being used.

> > /// </summary>

> > protected override void Dispose( bool disposing )

> > {

> > if( disposing )

> > {

> > if (components != null)

> > {

> > components.Dispose();

> > }

> > }

> > base.Dispose( disposing );

> > }

> >

> > #region Windows Form Designer generated code

> > /// <summary>

> > /// Required method for Designer support - do not modify

> > /// the contents of this method with the code editor.

> > /// </summary>

> > private void InitializeComponent()

> > {

> > this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();

> > this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();

> > this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();

> > this.dataSet11 = new Chart01.DataSet1();

> > this.chart1 = new SoftwareFX.ChartFX.Lite.Chart();

> > this.refreshbutton = new System.Windows.Forms.Button();

> > this.tabControl1 = new System.Windows.Forms.TabControl();

> > this.ChartTab = new System.Windows.Forms.TabPage();

> > this.DGTab = new System.Windows.Forms.TabPage();

> > this.dataGrid1 = new System.Windows.Forms.DataGrid();

> >

> ((System.ComponentModel.ISupportInitialize)(this.dataSet11)).BeginInit();

> > this.tabControl1.SuspendLayout();

> > this.ChartTab.SuspendLayout();

> > this.DGTab.SuspendLayout();

> >

> ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();

> > this.SuspendLayout();

> > //

> > // sqlConnection1

> > //

> > this.sqlConnection1.ConnectionString = "data

> > source=computername\\VSdotNET;initial catalog=OnTrack;integrated

> > security=SSPI;per" +

> > "sist security info=False;workstation id=*******;packet size=4096";

> > //

> > // sqlDataAdapter1

> > //

> > this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1;

> > this.sqlDataAdapter1.TableMappings.AddRange(new

> > System.Data.Common.DataTableMapping[] {

> > new

> System.Data.Common.DataTableMapping("Table",

> > "Table", new System.Data.Common.DataColumnMapping[] {

> > new

> > System.Data.Common.DataColumnMapping("Letter", "Letter"),

> > new

> > System.Data.Common.DataColumnMapping("Total", "Total")})});

> > //

> > // sqlSelectCommand1

> > //

> > this.sqlSelectCommand1.CommandText = "SELECT SUBSTRING(Last_Name, 1,

1)

> > AS Letter, COUNT(SUBSTRING(Last_Name, 1, 1)) AS" +

> > " Total FROM Students GROUP BY SUBSTRING(Last_Name, 1, 1)";

> > this.sqlSelectCommand1.Connection = this.sqlConnection1;

> > //

> > // dataSet11

> > //

> > this.dataSet11.DataSetName = "DataSet1";

> > this.dataSet11.Locale = new

System.Globalization.CultureInfo("en-US");

> > //

> > // chart1

> > //

> > this.chart1.AxisX.Title.Text = "Letters";

> > this.chart1.AxisY.Gridlines = true;

> > this.chart1.AxisY.LabelsFormat.Decimals = 0;

> > this.chart1.AxisY.Title.Text = "Number";

> > this.chart1.BackColor = System.Drawing.SystemColors.Desktop;

> > this.chart1.DataSource = this.dataSet11._Table;

> > this.chart1.Font = new System.Drawing.Font("Arial", 10F,

> > System.Drawing.FontStyle.Bold);

> > this.chart1.InsideColor = System.Drawing.Color.BurlyWood;

> > this.chart1.Location = new System.Drawing.Point(24, 16);

> > this.chart1.Name = "chart1";

> > this.chart1.PointLabels = true;

> > this.chart1.Size = new System.Drawing.Size(648, 400);

> > this.chart1.TabIndex = 0;

> > this.chart1.ToolBar = true;

> > //

> > // refreshbutton

> > //

> > this.refreshbutton.BackColor = System.Drawing.Color.DarkBlue;

> > this.refreshbutton.Font = new System.Drawing.Font("Palatino

Linotype",

> > 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point,

> > ((System.Byte)(0)));

> > this.refreshbutton.ForeColor = System.Drawing.Color.Gainsboro;

> > this.refreshbutton.Location = new System.Drawing.Point(296, 488);

> > this.refreshbutton.Name = "refreshbutton";

> > this.refreshbutton.Size = new System.Drawing.Size(184, 24);

> > this.refreshbutton.TabIndex = 1;

> > this.refreshbutton.Text = "Refresh Data";

> > this.refreshbutton.Click += new

> > System.EventHandler(this.refreshbutton_Click);

> > //

> > // tabControl1

> > //

> > this.tabControl1.Controls.Add(this.ChartTab);

> > this.tabControl1.Controls.Add(this.DGTab);

> > this.tabControl1.Location = new System.Drawing.Point(24, 16);

> > this.tabControl1.Name = "tabControl1";

> > this.tabControl1.SelectedIndex = 0;

> > this.tabControl1.Size = new System.Drawing.Size(712, 464);

> > this.tabControl1.TabIndex = 2;

> > //

> > // ChartTab

> > //

> > this.ChartTab.Controls.Add(this.chart1);

> > this.ChartTab.Location = new System.Drawing.Point(4, 22);

> > this.ChartTab.Name = "ChartTab";

> > this.ChartTab.Size = new System.Drawing.Size(704, 438);

> > this.ChartTab.TabIndex = 0;

> > this.ChartTab.Text = "Chart";

> > //

> > // DGTab

> > //

> > this.DGTab.Controls.Add(this.dataGrid1);

> > this.DGTab.Location = new System.Drawing.Point(4, 22);

> > this.DGTab.Name = "DGTab";

> > this.DGTab.Size = new System.Drawing.Size(704, 438);

> > this.DGTab.TabIndex = 1;

> > this.DGTab.Text = "DataGrid";

> > //

> > // dataGrid1

> > //

> > this.dataGrid1.CaptionText = "Table";

> > this.dataGrid1.DataMember = "Table";

> > this.dataGrid1.DataSource = this.dataSet11;

> > this.dataGrid1.HeaderForeColor =

> System.Drawing.SystemColors.ControlText;

> > this.dataGrid1.Location = new System.Drawing.Point(56, 40);

> > this.dataGrid1.Name = "dataGrid1";

> > this.dataGrid1.Size = new System.Drawing.Size(592, 344);

> > this.dataGrid1.TabIndex = 0;

> > //

> > // Form1

> > //

> > this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);

> > this.ClientSize = new System.Drawing.Size(766, 525);

> > this.Controls.Add(this.tabControl1);

> > this.Controls.Add(this.refreshbutton);

> > this.Name = "Form1";

> > this.Text = "Form1";

> > this.Load += new System.EventHandler(this.Form1_Load);

> >

((System.ComponentModel.ISupportInitialize)(this.dataSet11)).EndInit();

> > this.tabControl1.ResumeLayout(false);

> > this.ChartTab.ResumeLayout(false);

> > this.DGTab.ResumeLayout(false);

> >

((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();

> > this.ResumeLayout(false);

> >

> > }

> > #endregion

> >

> > /// <summary>

> > /// The main entry point for the application.

> > /// </summary>

> > [sTAThread]

> > static void Main()

> > {

> > Application.Run(new Form1());

> > }

> >

> > private void oleDbDataAdapter1_RowUpdated(object sender,

> > System.Data.OleDb.OleDbRowUpdatedEventArgs e) {

> >

> > }

> >

> > private void Form1_Load(object sender, System.EventArgs e) {

> > this.sqlDataAdapter1.Fill(this.dataSet11);

> > }

> >

> > private void refreshbutton_Click(object sender, System.EventArgs e) {

> > this.dataSet11.Clear();

> > this.sqlDataAdapter1.Fill(this.dataSet11);

> > }

> >

> >

> > }

> > }

> >

> >

>

>

Link to comment
Share on other sites

No go.  I get a "No value at index -1" error.

Message text:

************** Exception Text **************

System.IndexOutOfRangeException: No value at index -1.

at System.Windows.Forms.CurrencyManager.get_Item(Int32 index)

at System.Windows.Forms.CurrencyManager.get_Current()

at

SoftwareFX.ChartFX.Lite.J.SoftwareFX.ChartFX.Lite.Base.IDataProvider.get_Cur

rent()

at SoftwareFX.ChartFX.Lite.DataSourceSettings.65()

at SoftwareFX.ChartFX.Lite.DataSourceSettings.64(Boolean 0MC)

at SoftwareFX.ChartFX.Lite.DataSourceSettings.set_DataSource(Object

value)

at SoftwareFX.ChartFX.Lite.Chart.set_DataSource(Object value)

at Chart01.Form1.refreshbutton_Click(Object sender, EventArgs e) in

c:\documents and settings\administrator\my documents\visual studio

projects\chart01\form1.cs:line 217

at System.Windows.Forms.Control.OnClick(EventArgs e)

at System.Windows.Forms.Button.OnClick(EventArgs e)

at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)

at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons

button, Int32 clicks)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ButtonBase.WndProc(Message& m)

at System.Windows.Forms.Button.WndProc(Message& m)

at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)

at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,

IntPtr wparam, IntPtr lparam)

(line 217 is thenewly added "this.chart1.DataSource =

this.dataSet11._Table;" line.)

Ken

"SoftwareFX Support" <support@softwarefx.com> wrote in message

news:o5l36lK1DHA.3512@WEBSERVER1...

> We will be looking into this issue, in the meantime try adding this line

to

> your refreshbutton_Click handler

>

> this.chart1.DataSource = this.dataSet11._Table;

>

> I apologize for our delay getting back to you.

>

> --

> Regards,

>

> JC

> Software FX Support

> "Ken Arway" <karway@jaguar.worldnet.att.net> wrote in message

> news:dBYVPL1zDHA.3512@WEBSERVER1...

> > Any suggestions on this? It's been a while....

> > "Ken Arway" <karway@jaguar.worldnet.att.net> wrote in message

> > news:qijX0WZqDHA.1560@WEBSERVER1...

> > >

> > > "SoftwareFX Support" <support@softwarefx.com> wrote in message

> > > news:5PnDM1WqDHA.1900@WEBSERVER1...

> > > > We are unable to reproduce this problem. Do you have a repro case ?

> > > >

> > > > --

> > > > FP

> > > > Software FX, Inc.

> > > >

> > > >

> > >

> > > To restate the problem, ChartFXLite is displaying a chart in a WinForm

> > > application. When another application updates the database, I want to

> > > refresh the data in the chart. However, the "refreshbutton_Click"

> causes

> > > all the values of the y-axis to become zero. I'm sure I'm just

missing

> > > something simple....

> > >

> > > Here's the Form1.cs source code:

> > >

> > > using System;

> > > using System.Drawing;

> > > using System.Collections;

> > > using System.ComponentModel;

> > > using System.Windows.Forms;

> > > using System.Data;

> > > using SoftwareFX.ChartFX.Lite;

> > >

> > > namespace Chart01

> > > {

> > > /// <summary>

> > > /// Summary description for Form1.

> > > /// </summary>

> > > public class Form1 : System.Windows.Forms.Form

> > > {

> > > private System.Data.SqlClient.SqlConnection sqlConnection1;

> > > private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;

> > > private System.Data.SqlClient.SqlCommand sqlSelectCommand1;

> > > private Chart01.DataSet1 dataSet11;

> > > private SoftwareFX.ChartFX.Lite.Chart chart1;

> > > private System.Windows.Forms.Button refreshbutton;

> > > private System.Windows.Forms.TabControl tabControl1;

> > > private System.Windows.Forms.TabPage ChartTab;

> > > private System.Windows.Forms.TabPage DGTab;

> > > private System.Windows.Forms.DataGrid dataGrid1;

> > > /// <summary>

> > > /// Required designer variable.

> > > /// </summary>

> > > private System.ComponentModel.Container components = null;

> > >

> > > public Form1()

> > > {

> > > //

> > > // Required for Windows Form Designer support

> > > //

> > > InitializeComponent();

> > > this.chart1.Titles[0].Text = "First Letters of Students Last

Names";

> > > this.chart1.Titles[0].TextColor = Color.BlanchedAlmond;

> > > this.chart1.Series[0].Color = Color.Maroon;

> > > this.chart1.PointLabelColor = Color.Yellow;

> > >

> > > //

> > > // TODO: Add any constructor code after InitializeComponent call

> > > //

> > > }

> > >

> > > /// <summary>

> > > /// Clean up any resources being used.

> > > /// </summary>

> > > protected override void Dispose( bool disposing )

> > > {

> > > if( disposing )

> > > {

> > > if (components != null)

> > > {

> > > components.Dispose();

> > > }

> > > }

> > > base.Dispose( disposing );

> > > }

> > >

> > > #region Windows Form Designer generated code

> > > /// <summary>

> > > /// Required method for Designer support - do not modify

> > > /// the contents of this method with the code editor.

> > > /// </summary>

> > > private void InitializeComponent()

> > > {

> > > this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();

> > > this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();

> > > this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();

> > > this.dataSet11 = new Chart01.DataSet1();

> > > this.chart1 = new SoftwareFX.ChartFX.Lite.Chart();

> > > this.refreshbutton = new System.Windows.Forms.Button();

> > > this.tabControl1 = new System.Windows.Forms.TabControl();

> > > this.ChartTab = new System.Windows.Forms.TabPage();

> > > this.DGTab = new System.Windows.Forms.TabPage();

> > > this.dataGrid1 = new System.Windows.Forms.DataGrid();

> > >

> >

((System.ComponentModel.ISupportInitialize)(this.dataSet11)).BeginInit();

> > > this.tabControl1.SuspendLayout();

> > > this.ChartTab.SuspendLayout();

> > > this.DGTab.SuspendLayout();

> > >

> >

((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();

> > > this.SuspendLayout();

> > > //

> > > // sqlConnection1

> > > //

> > > this.sqlConnection1.ConnectionString = "data

> > > source=computername\\VSdotNET;initial catalog=OnTrack;integrated

> > > security=SSPI;per" +

> > > "sist security info=False;workstation id=*******;packet

size=4096";

> > > //

> > > // sqlDataAdapter1

> > > //

> > > this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1;

> > > this.sqlDataAdapter1.TableMappings.AddRange(new

> > > System.Data.Common.DataTableMapping[] {

> > > new

> > System.Data.Common.DataTableMapping("Table",

> > > "Table", new System.Data.Common.DataColumnMapping[] {

> > > new

> > > System.Data.Common.DataColumnMapping("Letter", "Letter"),

> > > new

> > > System.Data.Common.DataColumnMapping("Total", "Total")})});

> > > //

> > > // sqlSelectCommand1

> > > //

> > > this.sqlSelectCommand1.CommandText = "SELECT SUBSTRING(Last_Name,

1,

> 1)

> > > AS Letter, COUNT(SUBSTRING(Last_Name, 1, 1)) AS" +

> > > " Total FROM Students GROUP BY SUBSTRING(Last_Name, 1, 1)";

> > > this.sqlSelectCommand1.Connection = this.sqlConnection1;

> > > //

> > > // dataSet11

> > > //

> > > this.dataSet11.DataSetName = "DataSet1";

> > > this.dataSet11.Locale = new

> System.Globalization.CultureInfo("en-US");

> > > //

> > > // chart1

> > > //

> > > this.chart1.AxisX.Title.Text = "Letters";

> > > this.chart1.AxisY.Gridlines = true;

> > > this.chart1.AxisY.LabelsFormat.Decimals = 0;

> > > this.chart1.AxisY.Title.Text = "Number";

> > > this.chart1.BackColor = System.Drawing.SystemColors.Desktop;

> > > this.chart1.DataSource = this.dataSet11._Table;

> > > this.chart1.Font = new System.Drawing.Font("Arial", 10F,

> > > System.Drawing.FontStyle.Bold);

> > > this.chart1.InsideColor = System.Drawing.Color.BurlyWood;

> > > this.chart1.Location = new System.Drawing.Point(24, 16);

> > > this.chart1.Name = "chart1";

> > > this.chart1.PointLabels = true;

> > > this.chart1.Size = new System.Drawing.Size(648, 400);

> > > this.chart1.TabIndex = 0;

> > > this.chart1.ToolBar = true;

> > > //

> > > // refreshbutton

> > > //

> > > this.refreshbutton.BackColor = System.Drawing.Color.DarkBlue;

> > > this.refreshbutton.Font = new System.Drawing.Font("Palatino

> Linotype",

> > > 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point,

> > > ((System.Byte)(0)));

> > > this.refreshbutton.ForeColor = System.Drawing.Color.Gainsboro;

> > > this.refreshbutton.Location = new System.Drawing.Point(296, 488);

> > > this.refreshbutton.Name = "refreshbutton";

> > > this.refreshbutton.Size = new System.Drawing.Size(184, 24);

> > > this.refreshbutton.TabIndex = 1;

> > > this.refreshbutton.Text = "Refresh Data";

> > > this.refreshbutton.Click += new

> > > System.EventHandler(this.refreshbutton_Click);

> > > //

> > > // tabControl1

> > > //

> > > this.tabControl1.Controls.Add(this.ChartTab);

> > > this.tabControl1.Controls.Add(this.DGTab);

> > > this.tabControl1.Location = new System.Drawing.Point(24, 16);

> > > this.tabControl1.Name = "tabControl1";

> > > this.tabControl1.SelectedIndex = 0;

> > > this.tabControl1.Size = new System.Drawing.Size(712, 464);

> > > this.tabControl1.TabIndex = 2;

> > > //

> > > // ChartTab

> > > //

> > > this.ChartTab.Controls.Add(this.chart1);

> > > this.ChartTab.Location = new System.Drawing.Point(4, 22);

> > > this.ChartTab.Name = "ChartTab";

> > > this.ChartTab.Size = new System.Drawing.Size(704, 438);

> > > this.ChartTab.TabIndex = 0;

> > > this.ChartTab.Text = "Chart";

> > > //

> > > // DGTab

> > > //

> > > this.DGTab.Controls.Add(this.dataGrid1);

> > > this.DGTab.Location = new System.Drawing.Point(4, 22);

> > > this.DGTab.Name = "DGTab";

> > > this.DGTab.Size = new System.Drawing.Size(704, 438);

> > > this.DGTab.TabIndex = 1;

> > > this.DGTab.Text = "DataGrid";

> > > //

> > > // dataGrid1

> > > //

> > > this.dataGrid1.CaptionText = "Table";

> > > this.dataGrid1.DataMember = "Table";

> > > this.dataGrid1.DataSource = this.dataSet11;

> > > this.dataGrid1.HeaderForeColor =

> > System.Drawing.SystemColors.ControlText;

> > > this.dataGrid1.Location = new System.Drawing.Point(56, 40);

> > > this.dataGrid1.Name = "dataGrid1";

> > > this.dataGrid1.Size = new System.Drawing.Size(592, 344);

> > > this.dataGrid1.TabIndex = 0;

> > > //

> > > // Form1

> > > //

> > > this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);

> > > this.ClientSize = new System.Drawing.Size(766, 525);

> > > this.Controls.Add(this.tabControl1);

> > > this.Controls.Add(this.refreshbutton);

> > > this.Name = "Form1";

> > > this.Text = "Form1";

> > > this.Load += new System.EventHandler(this.Form1_Load);

> > >

> ((System.ComponentModel.ISupportInitialize)(this.dataSet11)).EndInit();

> > > this.tabControl1.ResumeLayout(false);

> > > this.ChartTab.ResumeLayout(false);

> > > this.DGTab.ResumeLayout(false);

> > >

> ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();

> > > this.ResumeLayout(false);

> > >

> > > }

> > > #endregion

> > >

> > > /// <summary>

> > > /// The main entry point for the application.

> > > /// </summary>

> > > [sTAThread]

> > > static void Main()

> > > {

> > > Application.Run(new Form1());

> > > }

> > >

> > > private void oleDbDataAdapter1_RowUpdated(object sender,

> > > System.Data.OleDb.OleDbRowUpdatedEventArgs e) {

> > >

> > > }

> > >

> > > private void Form1_Load(object sender, System.EventArgs e) {

> > > this.sqlDataAdapter1.Fill(this.dataSet11);

> > > }

> > >

> > > private void refreshbutton_Click(object sender, System.EventArgs e)

{

> > > this.dataSet11.Clear();

> > > this.sqlDataAdapter1.Fill(this.dataSet11);

> > > }

> > >

> > >

> > > }

> > > }

> > >

> > >

> >

> >

>

>

Link to comment
Share on other sites

No go.  I get a "No value at index -1" error.

Message text:

************** Exception Text **************

System.IndexOutOfRangeException: No value at index -1.

at System.Windows.Forms.CurrencyManager.get_Item(Int32 index)

at System.Windows.Forms.CurrencyManager.get_Current()

at

SoftwareFX.ChartFX.Lite.J.SoftwareFX.ChartFX.Lite.Base.IDataProvider.get_Cur

rent()

at SoftwareFX.ChartFX.Lite.DataSourceSettings.65()

at SoftwareFX.ChartFX.Lite.DataSourceSettings.64(Boolean 0MC)

at SoftwareFX.ChartFX.Lite.DataSourceSettings.set_DataSource(Object

value)

at SoftwareFX.ChartFX.Lite.Chart.set_DataSource(Object value)

at Chart01.Form1.refreshbutton_Click(Object sender, EventArgs e) in

c:\documents and settings\administrator\my documents\visual studio

projects\chart01\form1.cs:line 217

at System.Windows.Forms.Control.OnClick(EventArgs e)

at System.Windows.Forms.Button.OnClick(EventArgs e)

at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)

at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons

button, Int32 clicks)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ButtonBase.WndProc(Message& m)

at System.Windows.Forms.Button.WndProc(Message& m)

at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)

at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,

IntPtr wparam, IntPtr lparam)

(line 217 is thenewly added "this.chart1.DataSource =

this.dataSet11._Table;" line.)

Ken

"SoftwareFX Support" <support@softwarefx.com> wrote in message

news:o5l36lK1DHA.3512@WEBSERVER1...

> We will be looking into this issue, in the meantime try adding this line

to

> your refreshbutton_Click handler

>

> this.chart1.DataSource = this.dataSet11._Table;

>

> I apologize for our delay getting back to you.

>

> --

> Regards,

>

> JC

> Software FX Support

> "Ken Arway" <karway@jaguar.worldnet.att.net> wrote in message

> news:dBYVPL1zDHA.3512@WEBSERVER1...

> > Any suggestions on this? It's been a while....

> > "Ken Arway" <karway@jaguar.worldnet.att.net> wrote in message

> > news:qijX0WZqDHA.1560@WEBSERVER1...

> > >

> > > "SoftwareFX Support" <support@softwarefx.com> wrote in message

> > > news:5PnDM1WqDHA.1900@WEBSERVER1...

> > > > We are unable to reproduce this problem. Do you have a repro case ?

> > > >

> > > > --

> > > > FP

> > > > Software FX, Inc.

> > > >

> > > >

> > >

> > > To restate the problem, ChartFXLite is displaying a chart in a WinForm

> > > application. When another application updates the database, I want to

> > > refresh the data in the chart. However, the "refreshbutton_Click"

> causes

> > > all the values of the y-axis to become zero. I'm sure I'm just

missing

> > > something simple....

> > >

> > > Here's the Form1.cs source code:

> > >

> > > using System;

> > > using System.Drawing;

> > > using System.Collections;

> > > using System.ComponentModel;

> > > using System.Windows.Forms;

> > > using System.Data;

> > > using SoftwareFX.ChartFX.Lite;

> > >

> > > namespace Chart01

> > > {

> > > /// <summary>

> > > /// Summary description for Form1.

> > > /// </summary>

> > > public class Form1 : System.Windows.Forms.Form

> > > {

> > > private System.Data.SqlClient.SqlConnection sqlConnection1;

> > > private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;

> > > private System.Data.SqlClient.SqlCommand sqlSelectCommand1;

> > > private Chart01.DataSet1 dataSet11;

> > > private SoftwareFX.ChartFX.Lite.Chart chart1;

> > > private System.Windows.Forms.Button refreshbutton;

> > > private System.Windows.Forms.TabControl tabControl1;

> > > private System.Windows.Forms.TabPage ChartTab;

> > > private System.Windows.Forms.TabPage DGTab;

> > > private System.Windows.Forms.DataGrid dataGrid1;

> > > /// <summary>

> > > /// Required designer variable.

> > > /// </summary>

> > > private System.ComponentModel.Container components = null;

> > >

> > > public Form1()

> > > {

> > > //

> > > // Required for Windows Form Designer support

> > > //

> > > InitializeComponent();

> > > this.chart1.Titles[0].Text = "First Letters of Students Last

Names";

> > > this.chart1.Titles[0].TextColor = Color.BlanchedAlmond;

> > > this.chart1.Series[0].Color = Color.Maroon;

> > > this.chart1.PointLabelColor = Color.Yellow;

> > >

> > > //

> > > // TODO: Add any constructor code after InitializeComponent call

> > > //

> > > }

> > >

> > > /// <summary>

> > > /// Clean up any resources being used.

> > > /// </summary>

> > > protected override void Dispose( bool disposing )

> > > {

> > > if( disposing )

> > > {

> > > if (components != null)

> > > {

> > > components.Dispose();

> > > }

> > > }

> > > base.Dispose( disposing );

> > > }

> > >

> > > #region Windows Form Designer generated code

> > > /// <summary>

> > > /// Required method for Designer support - do not modify

> > > /// the contents of this method with the code editor.

> > > /// </summary>

> > > private void InitializeComponent()

> > > {

> > > this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();

> > > this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();

> > > this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();

> > > this.dataSet11 = new Chart01.DataSet1();

> > > this.chart1 = new SoftwareFX.ChartFX.Lite.Chart();

> > > this.refreshbutton = new System.Windows.Forms.Button();

> > > this.tabControl1 = new System.Windows.Forms.TabControl();

> > > this.ChartTab = new System.Windows.Forms.TabPage();

> > > this.DGTab = new System.Windows.Forms.TabPage();

> > > this.dataGrid1 = new System.Windows.Forms.DataGrid();

> > >

> >

((System.ComponentModel.ISupportInitialize)(this.dataSet11)).BeginInit();

> > > this.tabControl1.SuspendLayout();

> > > this.ChartTab.SuspendLayout();

> > > this.DGTab.SuspendLayout();

> > >

> >

((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();

> > > this.SuspendLayout();

> > > //

> > > // sqlConnection1

> > > //

> > > this.sqlConnection1.ConnectionString = "data

> > > source=computername\\VSdotNET;initial catalog=OnTrack;integrated

> > > security=SSPI;per" +

> > > "sist security info=False;workstation id=*******;packet

size=4096";

> > > //

> > > // sqlDataAdapter1

> > > //

> > > this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1;

> > > this.sqlDataAdapter1.TableMappings.AddRange(new

> > > System.Data.Common.DataTableMapping[] {

> > > new

> > System.Data.Common.DataTableMapping("Table",

> > > "Table", new System.Data.Common.DataColumnMapping[] {

> > > new

> > > System.Data.Common.DataColumnMapping("Letter", "Letter"),

> > > new

> > > System.Data.Common.DataColumnMapping("Total", "Total")})});

> > > //

> > > // sqlSelectCommand1

> > > //

> > > this.sqlSelectCommand1.CommandText = "SELECT SUBSTRING(Last_Name,

1,

> 1)

> > > AS Letter, COUNT(SUBSTRING(Last_Name, 1, 1)) AS" +

> > > " Total FROM Students GROUP BY SUBSTRING(Last_Name, 1, 1)";

> > > this.sqlSelectCommand1.Connection = this.sqlConnection1;

> > > //

> > > // dataSet11

> > > //

> > > this.dataSet11.DataSetName = "DataSet1";

> > > this.dataSet11.Locale = new

> System.Globalization.CultureInfo("en-US");

> > > //

> > > // chart1

> > > //

> > > this.chart1.AxisX.Title.Text = "Letters";

> > > this.chart1.AxisY.Gridlines = true;

> > > this.chart1.AxisY.LabelsFormat.Decimals = 0;

> > > this.chart1.AxisY.Title.Text = "Number";

> > > this.chart1.BackColor = System.Drawing.SystemColors.Desktop;

> > > this.chart1.DataSource = this.dataSet11._Table;

> > > this.chart1.Font = new System.Drawing.Font("Arial", 10F,

> > > System.Drawing.FontStyle.Bold);

> > > this.chart1.InsideColor = System.Drawing.Color.BurlyWood;

> > > this.chart1.Location = new System.Drawing.Point(24, 16);

> > > this.chart1.Name = "chart1";

> > > this.chart1.PointLabels = true;

> > > this.chart1.Size = new System.Drawing.Size(648, 400);

> > > this.chart1.TabIndex = 0;

> > > this.chart1.ToolBar = true;

> > > //

> > > // refreshbutton

> > > //

> > > this.refreshbutton.BackColor = System.Drawing.Color.DarkBlue;

> > > this.refreshbutton.Font = new System.Drawing.Font("Palatino

> Linotype",

> > > 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point,

> > > ((System.Byte)(0)));

> > > this.refreshbutton.ForeColor = System.Drawing.Color.Gainsboro;

> > > this.refreshbutton.Location = new System.Drawing.Point(296, 488);

> > > this.refreshbutton.Name = "refreshbutton";

> > > this.refreshbutton.Size = new System.Drawing.Size(184, 24);

> > > this.refreshbutton.TabIndex = 1;

> > > this.refreshbutton.Text = "Refresh Data";

> > > this.refreshbutton.Click += new

> > > System.EventHandler(this.refreshbutton_Click);

> > > //

> > > // tabControl1

> > > //

> > > this.tabControl1.Controls.Add(this.ChartTab);

> > > this.tabControl1.Controls.Add(this.DGTab);

> > > this.tabControl1.Location = new System.Drawing.Point(24, 16);

> > > this.tabControl1.Name = "tabControl1";

> > > this.tabControl1.SelectedIndex = 0;

> > > this.tabControl1.Size = new System.Drawing.Size(712, 464);

> > > this.tabControl1.TabIndex = 2;

> > > //

> > > // ChartTab

> > > //

> > > this.ChartTab.Controls.Add(this.chart1);

> > > this.ChartTab.Location = new System.Drawing.Point(4, 22);

> > > this.ChartTab.Name = "ChartTab";

> > > this.ChartTab.Size = new System.Drawing.Size(704, 438);

> > > this.ChartTab.TabIndex = 0;

> > > this.ChartTab.Text = "Chart";

> > > //

> > > // DGTab

> > > //

> > > this.DGTab.Controls.Add(this.dataGrid1);

> > > this.DGTab.Location = new System.Drawing.Point(4, 22);

> > > this.DGTab.Name = "DGTab";

> > > this.DGTab.Size = new System.Drawing.Size(704, 438);

> > > this.DGTab.TabIndex = 1;

> > > this.DGTab.Text = "DataGrid";

> > > //

> > > // dataGrid1

> > > //

> > > this.dataGrid1.CaptionText = "Table";

> > > this.dataGrid1.DataMember = "Table";

> > > this.dataGrid1.DataSource = this.dataSet11;

> > > this.dataGrid1.HeaderForeColor =

> > System.Drawing.SystemColors.ControlText;

> > > this.dataGrid1.Location = new System.Drawing.Point(56, 40);

> > > this.dataGrid1.Name = "dataGrid1";

> > > this.dataGrid1.Size = new System.Drawing.Size(592, 344);

> > > this.dataGrid1.TabIndex = 0;

> > > //

> > > // Form1

> > > //

> > > this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);

> > > this.ClientSize = new System.Drawing.Size(766, 525);

> > > this.Controls.Add(this.tabControl1);

> > > this.Controls.Add(this.refreshbutton);

> > > this.Name = "Form1";

> > > this.Text = "Form1";

> > > this.Load += new System.EventHandler(this.Form1_Load);

> > >

> ((System.ComponentModel.ISupportInitialize)(this.dataSet11)).EndInit();

> > > this.tabControl1.ResumeLayout(false);

> > > this.ChartTab.ResumeLayout(false);

> > > this.DGTab.ResumeLayout(false);

> > >

> ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();

> > > this.ResumeLayout(false);

> > >

> > > }

> > > #endregion

> > >

> > > /// <summary>

> > > /// The main entry point for the application.

> > > /// </summary>

> > > [sTAThread]

> > > static void Main()

> > > {

> > > Application.Run(new Form1());

> > > }

> > >

> > > private void oleDbDataAdapter1_RowUpdated(object sender,

> > > System.Data.OleDb.OleDbRowUpdatedEventArgs e) {

> > >

> > > }

> > >

> > > private void Form1_Load(object sender, System.EventArgs e) {

> > > this.sqlDataAdapter1.Fill(this.dataSet11);

> > > }

> > >

> > > private void refreshbutton_Click(object sender, System.EventArgs e)

{

> > > this.dataSet11.Clear();

> > > this.sqlDataAdapter1.Fill(this.dataSet11);

> > > }

> > >

> > >

> > > }

> > > }

> > >

> > >

> >

> >

>

>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...