Jump to content
Software FX Community

problems loading chart from dataset


User (Legacy)

Recommended Posts

I am trying the  Chart FX for .NET 6.2 trial version.

I am using a line chart.

When my application runs, the graph displays column 0 along the y axis and

column 1 along the x axis which I don't want.

My dataset consists of the following:

column 0= number (don't want to graph)

column 1= datetime ( I want to display just the year and month along the x

axis)

column 2= number (I want to display it as a percentage along the y axis)

I want to plot a line graph where column 1 is the x coordinate and column 2

is the y coordinate IE- Each month will have a certain percentage. I will

only have 1 record per month.

Column 0 should be ignored since it is extra information provided by the

dataset.

My code is listed below (VB.net):

chartStnAvail.AxisX.LabelsFormat.Format = AxisFormat.Date

chartStnAvail.AxisX.LabelsFormat.CustomFormat = "yyyy-MM"

chartStnAvail.AxisY.LabelsFormat.Format = AxisFormat.Percentage

chartStnAvail.DataSourceSettings.DataType(0) = DataType.NotUsed

chartStnAvail.DataSourceSettings.DataType(1) = DataType.XValue

chartStnAvail.DataSourceSettings.DataType(2) = DataType.Value

chartStnAvail.DataSourceSettings.DataSource = oDataset.Tables(0)

chartStnAvail.DataBind()

Any ideas or code samples?

Thanks in advance,

Link to comment
Share on other sites

The code looks perfect. You should be getting what you want, either what's

coming back from the dataset is NOT what you think or there is some problem

I've not seen.

Please attach a binary file for this chart so that we can analyze the data

contained in it.

Also, check the contents of your dataset in the debugger.

--

FP

Software FX, Inc.

Link to comment
Share on other sites

I checked my dataset and it is what I am expecting. It keeps on graphing

column 0 along the y axis even though I specify that it is not being used.

How do you export the chart to a binary file?

FYI- I am setting all my properties in code. I did not use the wizard.

Thanks,

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

news:qcPKGoAxDHA.3808@WEBSERVER1...

> The code looks perfect. You should be getting what you want, either what's

> coming back from the dataset is NOT what you think or there is some

problem

> I've not seen.

>

> Please attach a binary file for this chart so that we can analyze the data

> contained in it.

>

> Also, check the contents of your dataset in the debugger.

>

> --

> FP

> Software FX, Inc.

>

>

Link to comment
Share on other sites

I think that the other files I sent got removed.

I have attached the two files in this zipped folder.

"Joanne" <jsam@hydro.mb.ca> wrote in message

news:dA7CWHCxDHA.3808@WEBSERVER1...

> The file labelled chart is the binary format of my graph.

>

> Thanks.

>

>

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

> news:85Lmv0BxDHA.3808@WEBSERVER1...

> > You can export the chart using the Export method.

> >

> > Also, please include the first few records of your dataset.

> >

> > --

> > FP

> > Software FX, Inc.

> >

> >

>

>

>

Attachments.zip

Link to comment
Share on other sites

The data is the chart is this:

2003-01 9990.00%

2003-02 9979.00%

2003-03 9948.00%

2003-04 9348.00%

2003-05 9801.00%

This corresponds to columns 1 and 2 (not zero) of your data:

7432.5831600000001,2003-01-01 00:00:00.000,99.900000000000006

6705.9498469999999,2003-02-01 00:00:00.000,99.790000000000006

7401.3664879999997,2003-03-01 00:00:00.000,99.480000000000004

6721.4498539999977,2003-04-01 00:00:00.000,93.480000000000004

7291.8998470000015,2003-05-01 00:00:00.000,98.010000000000005

In percentage format, 1.0 is 100%. So 99.900000000000006 is 9990.00%

I think you incorrectly assumed that column 0 was being plotted but it is

not, column 2 is but it is multiplied by 100 because of the Percentage

format.

From the help file on Format (ValueFormat class)

Percentage:

Displays numbers multiplied by 100 with a percent sign (%) appended to the

right; display two digits to the right of the decimal separator.

--

FP

Software FX, Inc.

Link to comment
Share on other sites

Thanks for your help. It worked.

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

news:RE1BO%23KxDHA.3512@WEBSERVER1...

> The data is the chart is this:

>

> 2003-01 9990.00%

> 2003-02 9979.00%

> 2003-03 9948.00%

> 2003-04 9348.00%

> 2003-05 9801.00%

>

> This corresponds to columns 1 and 2 (not zero) of your data:

>

> 7432.5831600000001,2003-01-01 00:00:00.000,99.900000000000006

> 6705.9498469999999,2003-02-01 00:00:00.000,99.790000000000006

> 7401.3664879999997,2003-03-01 00:00:00.000,99.480000000000004

> 6721.4498539999977,2003-04-01 00:00:00.000,93.480000000000004

> 7291.8998470000015,2003-05-01 00:00:00.000,98.010000000000005

>

> In percentage format, 1.0 is 100%. So 99.900000000000006 is 9990.00%

>

> I think you incorrectly assumed that column 0 was being plotted but it is

> not, column 2 is but it is multiplied by 100 because of the Percentage

> format.

>

> From the help file on Format (ValueFormat class)

>

> Percentage:

> Displays numbers multiplied by 100 with a percent sign (%) appended to the

> right; display two digits to the right of the decimal separator.

>

>

> --

> FP

> Software FX, Inc.

>

>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...