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

Message ListMessage List     Post MessagePost Message

  generate graph dynamically without hardcoding values
Posted by Venkat on May-10-2011 18:11
Hello Peter

I've Products and Categories (category may exceed more than 3)

At present I've hardcoded the values in displaying the graph for three categories , in future, it may exceed,

If i need one graph for all the categories without hardcoding that is dynamically , how do I handle your code in Multi Shape Bar.

Please advise

Thank you.

Venkat

  Re: generate graph dynamically without hardcoding values
Posted by Peter Kwan on May-11-2011 01:48
Hi Venkat,

You can freely use any categories you like. You do not have to hard coded anything. However, if you are using the Multi-Shape Bar chart, you have to find a way to specify the shape for each category.

An example is like (in VB/VBScript "pseudo code"):

Set layer = c.addBarLayer2(cd.Side, 9)

For i = 0 To noOfCategories - 1
    dataArray = ... get data for that category ...
    Call layer.addDataSet(dataArray, -1, categoryName)
    Call layer.setBarShape(cd.PolygonShape(i + 3), i)
Next

Hope this can help.

Regards
Peter Kwan