adding new serie of data to a chart

S

spectre

Hi,

The code listed below works well. But I have difficulties to add a new serie
on the chart.


Currently, I have
on the x axis ; SALARY
on the Y axis : NOM

I'd like to add on the X axis a new serie : PREVSALARY. How to add it to the
current chart?

Thanks in advance for your help


:////////////////////////////////////
<%@ 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
MyChart.HasLegend = TRUE


MySpace.DisplayFieldButtons = False



MyChart.SetData MyConstants.chDimSeriesNames, 0, "CURREN"
MyChart.SetData MyConstants.chDimCategories, 0, "NOM"
MyChart.SetData MyConstants.chDimValues, 0, "SALARY"



' Modification de l'axes des ordonnées pour l'axe
with MyChart.Axes(MyConstants.chAxisPositionBottom)
.MajorUnit = 20000
.NumberFormat = "0 000"

end with

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


%>
 
S

spectre

Thanks . I am going to try it. Bi
Thao Moua said:
Change your code to this

MySpace.plotallaggregates = chPlotAggregatesSeries
MyChart.SetData MyConstants.chDimValues, 0, array("SALARY", "PREVSALARY")

FYI:
-chPlotAggregatesNone (0) - plot the first active total aggregate
-chPlotAggregatesSeries (1)- plot all the total aggregates (put all the
total aggregate on the data zone)
-chPlotAggregatesCategories (2) - plot all the aggregates (put all the
total
aggregate on the row axis)
-chPlotAggregatesCharts (3) - show all the all the aggregates names, but
only plot the first aggregate
----------------------------------------------------------------------
Thao Moua
OWC Chartspace Support

This posting is provided "AS IS" with no warranties, and
confers no rights. Use of included script samples are
subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
 

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