Jump to content
Software FX Community

Mapping columns to horizontal labels


User (Legacy)

Recommended Posts

A database I'm working against has a proc that returns sales data. The proc 

returns something like this:

Store, Year, Jan, Feb, Mar [...]

Let's say that we have data for 2 stores and 2 years. The resulting data

rows might look like this:

1, 2005, 40232.00, 49371.00, 50123.00 [...]

1, 2006, [...]

2, 2005, [...]

2, 2006, [...]

What I want to do is easily map this into a chart that, for each store and

year, will show the sales data for all 12 months. I can't figure out how to

set the DataType and DataStyle properties to appropriate values. The hard

part seems to be getting the chart to recognize that the database column

"Jan" should be displayed as the first of 12 horizontal chart labels.

It's a little bit of a pain to do this (not for technical reasons, but

because of something else), but would I be better off returning a dataset

that looks like: Store, Year, Month, Value?

Thanks!

--Shaun

Link to comment
Share on other sites

By default, each column will be a series in the chart.

If I understand you correctly you want each row to be a series and have

always 12 points for each series (Jan - Dec) Right ?

You need to set:

chart1.DataSourceSettings.DataStyle |= DataStyle.Transpose;

chart1.DataSourceSettings.DataStyle |= DataStyle.Transpose;

chart1.DataType[0] = DataType.Label; // Store

chart1.DataType[1] = DataType.Label; // Year

The rest of the columns remains as default (values).

--

Francisco Padron

www.chartfx.com

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...