ASE Home Page Products Download Purchase Support About ASE
ChartDirector General
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Multi-Layer Bar Chart Side-by-side
Posted by Robert on Jul-17-2009 03:49
Attachments:
I'm trying to create a bar chart where I have two layers, one green one red.  For each x value there is a green and a red bar.  The green bar uses yAxis1 and the red bar uses yAxis2.  Now, normally with this side-by-side bar chart you would add multiple datasets to the same layer, but because each dataset is using a different axis this isn't possible.  Also, if I try adding two layers and setting the correct axis for each layer then they show up on top of each other.  Is there any way of accomplishing this?  I've added a sketch of what I want below.  I would appreciate any help.
graph_1.gif

  Re: Multi-Layer Bar Chart Side-by-side
Posted by Peter Kwan on Jul-18-2009 01:18
Hi Robert,

You can add one bar layer with two data sets, in a side-by-side layout. You can bind each data set to a different axis using DataSet.setUseYAxis2.

For example, in VB/VBScript:

Set layer = c.addBarLayer2(cd.Side)
Call layer.addDataSet(myData0, &Hff9999, "Data Series 1")
Call layer.addDataSet(myData2, &H99ff99, "Data Series 2").setUseYAxis2()

Hope this can help.

Regards
Peter Kwan

  Re: Multi-Layer Bar Chart Side-by-side
Posted by Robert on Jul-18-2009 01:22
Peter Kwan wrote:
You can add one bar layer with two data sets, in a side-by-side layout. You can bind each data set to a different axis using DataSet.setUseYAxis2.

Brilliant, that's exactly what I was looking for.  Thanks!