Chart Connector Example

Do you have any chart examples using a connector? I am trying to set up a chart_connector.php which looks partly like the following:

$qry = [large query goes here]; echo $qry; $conn = sqlsrv_connect( $db_host, $connectionOptions) or die("Couldn't connect to Database. Please try again later."); $chartConn = new ChartConnector($conn, "MsSQL"); $chartConn->render_sql($qry,'date','date,dow,LDPStatus,rx,otc,other');
When I cut and paste the query into SQL Server Managment Studio and run it, I get the following results:[code]
dow date LDPStatus rx otc other

Wed 10/12/2011 1 42 48 1
Mon 10/10/2011 1 44 22 0
Fri 10/7/2011 1 20 24 1
Thu 10/6/2011 1 26 26 1
When I run the chart_connector.php script by itself, I get only:<data> </data>
Am I using the ChartConnector correctly?

The code which you are using is correct. ( chart connector doesn’t differ from other connectors - it uses the same logic of initialization )

If issue still occurs - please try to enable logging and provide log content for the problematic operation. … nd_logging

Looks like the query variable needs to be simple. I was trying to use a complicated query using a CTE. When I made the CTE a view and simplified my query, things worked fine.