Jump to content
Software FX Community

X-Axis as Timeaxis


User (Legacy)

Recommended Posts

Hello,

I´ve got a datatable with three numeric columns.

Additional there is a separat start and stoptime (NOT in the Datatable)

This time should be on the X-Axis.

I tried the following codesnipset but it don´t works :-(

// Here I added a fieldmapping for the datatable.

ChartFX.WinForms.FieldMap fieldMapPressure = new

ChartFX.WinForms.FieldMap();

ChartFX.WinForms.FieldMap fieldMapTemperature = new

ChartFX.WinForms.FieldMap();

ChartFX.WinForms.FieldMap fieldMapPulse = new ChartFX.WinForms.FieldMap();

fieldMapPressure.DisplayName = "Druck";

fieldMapPressure.Name = "Druck";

fieldMapPressure.Usage = ChartFX.WinForms.FieldUsage.Value;

fieldMapTemperature.DisplayName = "Temperatur";

fieldMapTemperature.Name = "Temperatur";

fieldMapTemperature.Usage = ChartFX.WinForms.FieldUsage.Value;

fieldMapPulse.DisplayName = "Pulse";

fieldMapPulse.Name = "Durchflu

Link to comment
Share on other sites

You are not supplying X-Values to this chart. I believe what you want to do 

is:

DateTime start = new DateTime(2005, 6, 18);

DateTime date = start;

for (int i = 0; i < 20; i++)

{

chart.Data.X[i] = date.ToOADate(); // Assing X values here

date = date.AddMinutes(10);

}

--

Francisco Padron

www.chartfx.com

"Holger Schaefer" <stuff@ingenieurdienstleistungen.de> wrote in message

news:BF5mfNWvGHA.2572@webserver3.softwarefx.com...

> Hello,

>

> I´ve got a datatable with three numeric columns.

> Additional there is a separat start and stoptime (NOT in the Datatable)

> This time should be on the X-Axis.

> I tried the following codesnipset but it don´t works :-(

>

>

> // Here I added a fieldmapping for the datatable.

> ChartFX.WinForms.FieldMap fieldMapPressure = new

> ChartFX.WinForms.FieldMap();

> ChartFX.WinForms.FieldMap fieldMapTemperature = new

> ChartFX.WinForms.FieldMap();

> ChartFX.WinForms.FieldMap fieldMapPulse = new ChartFX.WinForms.FieldMap();

>

>

> fieldMapPressure.DisplayName = "Druck";

> fieldMapPressure.Name = "Druck";

> fieldMapPressure.Usage = ChartFX.WinForms.FieldUsage.Value;

>

> fieldMapTemperature.DisplayName = "Temperatur";

> fieldMapTemperature.Name = "Temperatur";

> fieldMapTemperature.Usage = ChartFX.WinForms.FieldUsage.Value;

>

> fieldMapPulse.DisplayName = "Pulse";

> fieldMapPulse.Name = "Durchflu

Link to comment
Share on other sites

Hello,

> You are not supplying X-Values to this chart. I believe what you want to do

> is:

>

> DateTime start = new DateTime(2005, 6, 18);

> DateTime date = start;

>

> for (int i = 0; i < 20; i++)

> {

> chart.Data.X[i] = date.ToOADate(); // Assing X values here

> date = date.AddMinutes(10);

> }

thats rigth but I tried this before and got an DivideByZero Exception

deep in paint.

In the meantime I´ve found the problem.

Every time I set

´this.chart.AxisX.LabelsFormat.Format = AxisFormat.DateTime;´

to any value I got this Exception.

Now I know this was caused by setting ´this.chart.MainPane.Visible = false;´

Everything works fine now thanks for your help.

Kind regards

Holger

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...