Owc.chart Object

J

jtsena

hi there!

i am just beginning to use OWC.CHART object and i still have a lot to
learn. we are developing a web project that will display charts based
on data stored in a database.

we need to display a chart having two y axes. what chart type constant
corresponds to this? we have only one SERIES but it is to be plotted
against two VALUES.

i will appreciate it very very much if you coukd provide me with the
code of how to go about my problem.

thanks very much. more power! :>
 
M

mariaasl

Hi,



It is chChartTypeColumnClustered type.



'Create a new bar chart.

Set ChartSpace1 = CreateObject("OWC10.Chartspace")

Set c = ChartSpace1.Constants

Set Cht = ChartSpace1.Charts.Add

Cht.Type = c.chChartTypeColumnClustered





With Cht.SeriesCollection.Add

.Caption = "Beverages"

.SetData c.chDimCategories, c.chDataLiteral, aNames

.SetData c.chDimValues, c.chDataLiteral, aSales

End With



With Cht.SeriesCollection.Add

.Caption = "Condiments"

.SetData c.chDimCategories, c.chDataLiteral, aNames1

.SetData c.chDimValues, c.chDataLiteral, aSales1

End With
 
J

jtsena

thanks so much! but i think this code will display only one y-axis. i
learned of a way to add another y-axis. i hope this helps you in your
future projects -



using the same code you sent, add this:





objCht.Axes.Add objCht.Scalings(c.chDimValues), & _
c.chAxisPositionRight, c.chValueAxis







thanks again! :>
 

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