Jump to content
Software FX Community

Crosstab with multiple columns


User (Legacy)

Recommended Posts

Hello,

I followed the provided code sample and I managed to bind a chart to a

crosstabdataprovider.

I found, as expected, that I could display values in a multi-series chart

too. However, only the first value datatype is displayed.

I'd like to to have 2 dataset columns displayed on a multi-series graph, one

line for each rowheading

In my context, the row heading column has 3 distinct values and I`d like to

display 2 columns as distinct series (that is 6 series displayed in total).

It seems that the crosstabdatatype provider only finds the Datatype column

in the array that is of .Value type and crosstabs it by the row heading

column.

Shouldn't it work for all datatype columns of type value? Or is it a bug in

my code.

Thanks in advance for any answer.

Fran

Link to comment
Share on other sites

The Crosstab provider accepts only one value per entry. Each distinct

rowheading will become one point in the chart, and each distinct

columnheading value will become a different series. If I understand

correctly, you want to have three points (rowheadings) with two series each.

If this is the case, you only need to populate the Crosstab with data

containing three distinct values as rowheadings and two distinct values as

columnheadings, such as:

Rowheading Columnheading Value

------------- --------------- ------

1 A 200

1 B 300

2 A 150

2 B 75

3 A 100

3 B 200

Your code needs to be modified like this:

With cfxCT

.DataType(0) = CrosstabDataType.RowHeading

.DataType(1) = CrosstabDataType.ColumnHeading

.DataType(2) = CrosstabDataType.Value

.DataSource = dt

End With

.DataSourceSettings.DataSource = cfxCT

Make sure your data is sorted by the rowheading column.

---

IG

Software FX

"Fran

Link to comment
Share on other sites

I want something a bit different that what you suggest.

In fact, it is not exactly a crosstab that I want but I thought the crosstab

would do the job. In fact it does half the job (one value per entry).

My data looks like that in a DataSet.

TimeStep Priority MaxValue MinValue

rowheading colheading value value

------------ ------------ ----------- -------------

1 1 10 30

1 2 8 32

1 3 5 35

2 1 12 32

2 2 9 35

2 3 7 36

3 1 5 35

3 1 3 38

3 1 2 40

That is for each time step (x axis), I want to display 6 points :

MaxValue (Priority 1)

MaxValue (Priority 2)

MaxValue (Priority 3)

MinValue (Priority 1)

MinValue (Priority 2)

MinValue (Priority 3)

There is a crosstab decomposition in 3 series for each series (MaxValue and

MinValue).

With the crosstab provider, I can show the MinValues series or the MaxValues

series, but not both as the Crosstab provider accepts only one value per

entry.

Is there a way to show the 3 series for each values without restructuring

the data in the dataset? I can imagine using a listprovider to give it as

input the output of 2 distinct crosstabproviders (one for each value)? I'm

not sure exactly how to proceed (how to match columns, the sample provided

uses arrays, not dataset columns) or if it would work at all. Please

comment or provide a code sample.

Thanks in advance for the help. Francois

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

news:cIm2Wo0WDHA.228@WEBSERVER1...

> The Crosstab provider accepts only one value per entry. Each distinct

> rowheading will become one point in the chart, and each distinct

> columnheading value will become a different series. If I understand

> correctly, you want to have three points (rowheadings) with two series

each.

> If this is the case, you only need to populate the Crosstab with data

> containing three distinct values as rowheadings and two distinct values as

> columnheadings, such as:

>

> Rowheading Columnheading Value

> ------------- --------------- ------

> 1 A 200

> 1 B 300

> 2 A 150

> 2 B 75

> 3 A 100

> 3 B 200

>

> Your code needs to be modified like this:

>

> With cfxCT

> .DataType(0) = CrosstabDataType.RowHeading

> .DataType(1) = CrosstabDataType.ColumnHeading

> .DataType(2) = CrosstabDataType.Value

> .DataSource = dt

> End With

>

> .DataSourceSettings.DataSource = cfxCT

>

> Make sure your data is sorted by the rowheading column.

> ---

> IG

> Software FX

>

> "Fran

Link to comment
Share on other sites

You actually need 6 different series: Max-1, Max-2, Max-3, Min-1, Min-2 and

Min-3. In order to use the Crosstab provider you will need to modify your

dataset to return something like this:

TimeStep Priority

rowheading colheading value

------------ ------------ -----------

1 Max-1 10

1 Min-1 30

1 Max-2 8

1 Min-2 32

1 Max-3 5

1 Min-3 35

2 Max-1 12

2 Min-1 32

2 Max-2 9

2 Min-2 35

2 Max-3 7

2 Min-3 36

3 Max-1 5

3 Min-1 35

3 Max-2 3

3 Min-2 38

3 Max-3 2

3 Min-3 40

---

IG

Software FX

"Fran

Link to comment
Share on other sites

If I have to rework the data at all, I would rather make it 6 columns in the

dataset and do a regular binding without using the crosstabadapter.

What type of object is output from the crosstadapter? what type of object

are inputs of the listadapter?

Can I bind the chart datasource columns directly to the output of the

crosstabprovider? Something like

cfx.datasource(0) = cfxCT(0)

or something like

dim a databoundControl()

a(0).datasource = cfxCT

a(0).datamember = cfxCT.column(0)

a(1).datasource = cfxCT

a(1).datamember = cfxCT.column(1)

.... for the other two series coming out of the first crosstabprovider with

MinValues as value

... and a(3).datasource = cfxCT2 for the 2nd crosstabprovider with MaxValue

as values

then :

dim lp as new listprovider(a)

cfx.datasettings.datasource = lp

I'm not that familiar with databinding or with your chart but I guess there

is a way to expose/access the outpout of a crosstabadapter. And to set the

datasource of the chart series by series or using a list provider. Or is

that just not possible and I'll have to fall back to changing the structure

of the data?

Thanks.

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

news:vYrWFb2WDHA.228@WEBSERVER1...

> You actually need 6 different series: Max-1, Max-2, Max-3, Min-1, Min-2

and

> Min-3. In order to use the Crosstab provider you will need to modify your

> dataset to return something like this:

>

> TimeStep Priority

> rowheading colheading value

> ------------ ------------ -----------

> 1 Max-1 10

> 1 Min-1 30

> 1 Max-2 8

> 1 Min-2 32

> 1 Max-3 5

> 1 Min-3 35

> 2 Max-1 12

> 2 Min-1 32

> 2 Max-2 9

> 2 Min-2 35

> 2 Max-3 7

> 2 Min-3 36

> 3 Max-1 5

> 3 Min-1 35

> 3 Max-2 3

> 3 Min-2 38

> 3 Max-3 2

> 3 Min-3 40

>

> ---

> IG

> Software FX

>

>

> "Fran

Link to comment
Share on other sites

The crosstab data provider sets the series, points and values to Chart FX

internally, thus it doesn't expose an object you can manipulate on your own.

For a complete detail of how to use Chart FX databinding capabilities please

refer to the documentation. You can also contact tech support directly at

chartfx@softwarefx.com

---

IG

Software FX

"Fran

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...