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

Message ListMessage List     Post MessagePost Message

  Is this type of graph/scaling possible?
Posted by Frank on Jan-22-2015 19:56
Attachments:
Hello Peter,

Thank you for all your replies to us users.

I have a question for you: is this graph possible to create with Chartdirector? Is the type of scaling? Can we set the scaling parameters ourselves?

Thank you for answering,

Frank
graph_chartdir.jpg

  Re: Is this type of graph/scaling possible?
Posted by Frank on Jan-22-2015 19:57
Oops, we work in .asp.

  Re: Is this type of graph/scaling possible?
Posted by Peter Kwan on Jan-23-2015 02:06
Hi Frank,

Yes. You can use any scale you like. Basically, it is just a kind of labelling the axis, and
ChartDirector allows you to put any label at any position on the axis.

From your attached image, I am not sure the exact formula for your scale. Assume your
scale is defined by a function that maps the data value to a position on the axis, where 0
means the left end of the axis, and 100 means the right end of the axis. As an example,
lets assume the function is position = value * value * 3 + 10

Function myFunction(x)
   myFunction = x * x * 3 + 10
End Function

The code is then:

'0 = left end, 100 = right end. Initially no labels
Call c.xAxis().setLinearScale2(0, 100, Array())

'Add the label 1, 2, 3, 4, 5 at the proper position
For i = 1 to 5
    Call c.xAxis().addLabel(myFunction(i), i)
Next

When you want to plot a chart, you need to put the points in the proper position to:

For i = 0 To Ubound(myXData)
    myXData(i) = myFunction(myXData(i))
Next


Hope this can help.

Regards
Peter Kwan

  Re: Is this type of graph/scaling possible?
Posted by Frank on Jan-23-2015 19:35
Thank you, Peter! We only needed to tweak the function, it works fine.