Jump to content
Software FX Community

XY Plot using Resultset


User (Legacy)
 Share

Recommended Posts

Hi,

I am trying to plot an XY chart with x axis data stored in SQL DB as one

column "FLOW" and y axis data stored in another "HEAD". Below is the code I

am using to generate a resultset and pass data to Chart FX.

However, what I got is two series of data with x axis as "1,2,3...". Is

there any way I can assign value to the x axis using the resultset instead

of using .ValueEX and . YValueEX?

Thanks a lot,

Hao Deng

Code I used

"

'Execute SQL and obtain resultset

Set RS = Conn.Execute("SELECT flow, head FROM Pump_Test")

'Create Ado object from the Chart FX Resultset

Set CfxData = CreateObject("CfxData.Ado")

'Assign the resultset to the ChartFX Data Provider

CfxData.ResultSet = RS

'Let Chart FX take information from the data provider

Chart1.GetExternalData CfxData

"

Link to comment
Share on other sites

You must use the DataType property of the chart to let ChartFX know how your

columns should be used, something like

Chart1.DataType(0) = CDT_XVALUE

Chart1.DataType(1) = CDT_VALUE

The index of the datatype property should match the columns order in your

SQL statement.

--

Regards,

JC

Software FX Support

"Hao Deng" <hdeng@bechtel.com> wrote in message

news:Lf5YYc7PCHA.2040@webserver1.softwarefx.com...

> Hi,

>

> I am trying to plot an XY chart with x axis data stored in SQL DB as one

> column "FLOW" and y axis data stored in another "HEAD". Below is the code

I

> am using to generate a resultset and pass data to Chart FX.

>

> However, what I got is two series of data with x axis as "1,2,3...". Is

> there any way I can assign value to the x axis using the resultset instead

> of using .ValueEX and . YValueEX?

>

> Thanks a lot,

>

> Hao Deng

>

> Code I used

> "

> 'Execute SQL and obtain resultset

> Set RS = Conn.Execute("SELECT flow, head FROM Pump_Test")

>

> 'Create Ado object from the Chart FX Resultset

> Set CfxData = CreateObject("CfxData.Ado")

>

> 'Assign the resultset to the ChartFX Data Provider

> CfxData.ResultSet = RS

>

> 'Let Chart FX take information from the data provider

> Chart1.GetExternalData CfxData

> "

>

>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...