Jump to content
Software FX Community

XY Plot using Resultset


User (Legacy)

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

Archived

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

×
×
  • Create New...