ASP / VBS / SORTING CHART

S

spectre

Hello,

I'am not a specialist! more a copy / paste and ...adapt. So...

I use a query (with ADO) which provides me with a name, an amount and a
currency


jean 30 $
pierre 35 £
alex 45 $


I sort the query on the amount and the user uses a filter to choose a
specific currency.


I have a Chart, based on this query, which should display :

- on the X axis, the names,
- on the Y axis the amounts, SORTED BY AMOUNT
- as category, the currency

The user can choose various types of graph, such as line, bar...

The question and problem :
- the sorting is made on the names, but not on the amounts as I need.
- the chart displays the names on the Y axis and not the X axis
- the chart displays the amounts on the X axis and not the Y axis


- componant OWC10, XP PRO



Thanks for your help.

Actual code is as following :


<%@ Language=VBScript %>
<%
'Option Explicit
Response.Expires = -1
Response.ContentType = "image/gif"
on error resume next

nTypeChart = Request.QueryString("nTypeChart")
cbonZoom = Request.QueryString("cbonZoom")
if len(nTypeChart) = 0 then nTypeChart = 3
if len(cbonZoom) = 0 then cbonZoom = 100


Set MySpace = server.CreateObject("OWC10.ChartSpace")
set MyConstants = MySpace.Constants
set MySpace.DataSource = Session("oRs")
MySpace.Border.Color = MyConstants.chColorNone
set MyChart = MySpace.Charts.Add()


MyChart.Type = nTypeChart 'user can choose several types of
charts.

MyChart.HasLegend = TRUE


MySpace.DisplayFieldButtons = False


MyChart.SetData MyConstants.chDimValues, 0, "AMOUNT"
MyChart.SetData MyConstants.chDimSeriesNames, 0, "CURREN"
'currency
MyChart.SetData MyConstants.chDimCategories, 0, "NAME"


MySpace.Charts.Delete 0


If Err.Number=0 Then
x = 500*(cbonZoom/100)
y = 300*(cbonZoom/100)
Response.BinaryWrite MySpace.GetPicture("gif",x, y)

Else
MyImage = Server.MapPath(".") & "\Images\noChart.gif"
Response.BinaryWrite m_objBinaryFile.GetFileBytes(CStr(MyImage))

End IF
%>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top