11/26/2024 3:25:15 AM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss usage & tips for SalesLogix controls and other 3rd party ActiveX controls. View the code of conduct for posting guidelines.
|
|
|
|
Creating a chart based on a query?
Posted: 27 Jan 10 11:31 AM
|
Hello there,
I'm trying to use the Chart control to create a simple bar (or pie for that matter) chart from a query.
If my query is:
SELECT MyFieldName AS FieldNames, MyValueField AS FieldValues FROM MyTable
And the results looks like this:
SomeMetric 15 SomeOther 23 MetricThree 8
How do I put that on a chart so that there are three columns titled "SomeMetric", "SomeOther" and "MetricThree" with the values 15, 23 and 8 respectively?
I've tried putting FieldNames into the "Label Values field name" box, and "FieldValues" into the "Y Values field name" box, but then I just get one bar labelled "SomeMetric" with a value 15.
Here's a bit of the code-behind:
Dim objSLXDB, objRS, strSQL Set objSLXDB = new SLX_DB Set objRS = objSLXDB.GetNewRecordset strSQL = "TYPE AS FieldNames, COUNT(ACCOUNTID) AS FieldValues FROM ACCOUNT GROUP BY TYPE" objRS.Open strSQL, objSLXDB.Connection chart1.RecordSet = objRS
Thanks,
Mark |
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|