Jump to content
Software FX Community

DataSet and BarCharts


User (Legacy)

Recommended Posts

Hi,

I'm new to Chart FX and trying to plug a dataset into a Bar Chart

The data has the following format:-

Key Series

Col1 Col2 .... <uncharted columns>

<key value> Series A 1.0

2.0 ....

<key value> Series B 3.0

4.0 ....

As I understand it, I need to set DataSource settings for the Chart object

using DataType values.

I'm unclear on the following points:-

The relation of NSeries and NValues to the contents of the

table in my DataSet

How to correctly use the Data Type settings where:-

- I have 1 series column

- n values I wish to plot (do i use XValue

or Value ??! - and what other settings should I touch pr not touch)

- how to set labels for the column (can I

manually set these?)

Any other settings required to get the chart working!

I'd like to avoid having to have to generate DataSets along the following

lines:-

Key1 Series A Col1 1

Key1 Series A Col2 2

Key1 Series B Col1 3

Key1 Series B Col2 4

And then plot each row as a distinct value (the long way round). This is not

a 'natural' way to retrieve data from a database in a highly-denormalised

manner, so I assume Chart FX can handle normalised data from a database :)

Help greatly appreciated. Thanks in advance.

Link to comment
Share on other sites

Dear Craig,

You would need to tell ChartFX what columns to plot and how they are used.

You would most probably need something like this:

using SoftwareFX.ChartFX;

chart1.DataType[0] = DataType.KeyLegend; // Key (this one is tricky and I am

not sure what you want here)

chart1.DataType[1] = DataType.Label; // Series for the axis

chart1.DataType[2] = DataType.Value; // Col1

chart1.DataType[3] = DataType.Value; // Col2

chart1.DataType[4] = DataType.NotUsed; // uncharted 1

chart1.DataType[5] = DataType.NotUsed; // uncharted 2 ...

...

...

adapter.Fill(myDataSource);

chart1.DataSource = myDataSource;

If you are binding to a DataSet using the DataSource Property NSeries and

NValues will be set automatically.

XValues are for dates.

Lastly, you can manually set labels or use the DataType array as shown

above.

On our support site http://support.softwarefx.com/cfxnet/ we have a whole

section dedicated to passing data.

Click on Samples&Resources-> ChartFX for .NET->PassingData

Now, as you have your data in that format please have a read of the CrossTab

section as it might be just up your alley.

Hope this helps.

-c

"Craig Cant" <craig.cant1@ntlworld.com> wrote in message

news:VIfrnghwFHA.1764@webserver3.softwarefx.com...

> Hi,

>

> I'm new to Chart FX and trying to plug a dataset into a Bar Chart

>

> The data has the following format:-

>

>

> Key Series

> Col1 Col2 .... <uncharted columns>

> <key value> Series A 1.0

> 2.0 ....

> <key value> Series B 3.0

> 4.0 ....

>

>

> As I understand it, I need to set DataSource settings for the Chart object

> using DataType values.

>

> I'm unclear on the following points:-

>

> The relation of NSeries and NValues to the contents of the

> table in my DataSet

> How to correctly use the Data Type settings where:-

> - I have 1 series column

> - n values I wish to plot (do i use XValue

> or Value ??! - and what other settings should I touch pr not touch)

> - how to set labels for the column (can I

> manually set these?)

>

> Any other settings required to get the chart working!

>

>

> I'd like to avoid having to have to generate DataSets along the following

> lines:-

>

>

> Key1 Series A Col1 1

> Key1 Series A Col2 2

> Key1 Series B Col1 3

> Key1 Series B Col2 4

>

>

> And then plot each row as a distinct value (the long way round). This is

> not

> a 'natural' way to retrieve data from a database in a highly-denormalised

> manner, so I assume Chart FX can handle normalised data from a database :)

>

>

> Help greatly appreciated. Thanks in advance.

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...