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

Message ListMessage List     Post MessagePost Message

  Regarding Date Manipulation in Graphs
Posted by E.RaviKiran on Sep-12-2005 21:43
Attachments:
I do want to know how to move vertical bar according to the Date Change.i..e i have planned date on y-axis
and i want to move the vertical bar along with the date data retrieved from the database.
for u'r understanding iam enclosing a sample picture with this.plz reply me soon
thankz
Ravi.
image002.gif

  Re: Regarding Date Manipulation in Graphs
Posted by Peter Kwan on Sep-13-2005 00:45
Hi Ravi,

You can just plot using date on the y-axis. ChartDirector allows this. The exact details depnds on your programming language. For exmaple, in VB/VBScript, you may use:

Set barLayer = c.addBarLayer2(cd.Side)
Call barLayer.addDataSet(myPlannedDates, &H800080, "Planned")
Call barLayer.addDataSet(myActualDates, &Hffffcc, "Actual")

Call c.yAxis().setDateScale(DateSerial(2004, 11, 9), DateSerial(2005, 5, 28), 50)

In the above, myPlannedDates and myActualDates are an array of dates (VBScript variables of type Date).

Hope this can help.

Regards
Peter Kwan

  Re: Regarding Date Manipulation in Graphs
Posted by Ravi on Sep-14-2005 22:22
Thanks for u'r reply .Iam doing it in vb.net.
but problem is
Call barLayer.addDataSet(myPlannedDates, &H800080, "Planned")
doesn't accepts date values as parameters only double array can be entered in place of  myPlannedDates

i want to accept it as an date array as u mentioned in u'r reply.

I had given like below
Dim endDate() As Date = {DateSerial(2004, 8, 30), DateSerial(2004, 10, 18), _
            DateSerial(2004, 9, 13), DateSerial(2004, 9, 27), DateSerial(2004, 10, 4), _
            DateSerial(2004, 10, 11), DateSerial(2004, 11, 8), DateSerial(2004, 10, 18....}

  Dim layer As BarLayer = c.addBarLayer2(Chart.Side)
        layer.addDataSet(endDate, &HFF8080, "Year 2002")


Thanks and regards
Ravi
Peter Kwan wrote:
> Hi Ravi,
>
> You can just plot using date on the y-axis. ChartDirector allows this. The exact details depnds on your programming language. For exmaple, in VB/VBScript, you may use:
>
> Set barLayer = c.addBarLayer2(cd.Side)
> Call barLayer.addDataSet(myPlannedDates, &H800080, "Planned")
> Call barLayer.addDataSet(myActualDates, &Hffffcc, "Actual")
>
> Call c.yAxis().setDateScale(DateSerial(2004, 11, 9), DateSerial(2005, 5, 28), 50)
>
> In the above, myPlannedDates and myActualDates are an array of dates (VBScript variables of type Date).
>
> Hope this can help.
>
> Regards
> Peter Kwan

  Re: Regarding Date Manipulation in Graphs
Posted by Peter Kwan on Sep-14-2005 22:52
Hi Ravi,

Yes. Because VB.NET is a strongly typed language, you need to explicitly convert the Date array to double array, otherwise the compiler will not even compile the code. (For weakly typed languges like VB/VBScript, PHP, Perl, Python, the interpreter will accept anything and ChartDirector will do the conversion automatically.)

So in VB.NET, the code shoud be:

layer.addDataSet(Chart.CTime2(endDate), &HFF8080, "Year 2002")

Hope this can help.

Regards
Peter Kwan

  Re: Regarding Date Manipulation in Graphs
Posted by Ravi on Sep-15-2005 17:17
Thankz u'r logic was worked out very fyn but i have some other thing to do

i want to keep another y-axis on right side with numericals (say 0-10) and i want to keep an numeric data displayed on the vertical bar (say the diff of planned date,actual date)

Thankz once again

Regards
Ravi.E

  Re: Regarding Date Manipulation in Graphs
Posted by Peter Kwan on Sep-15-2005 18:22
Hi Ravi,

You can supply your numerical data to ChartDirector, and ask ChartDirector to bind the dataset to the right y-axis. For example:

layer.addDataSet(myNumericDataArray, &H9999FF, "Difference").setUseYAxis2()

Hope this can help.

Regards
Peter Kwan

  Re: Regarding Date Manipulation in Graphs
Posted by Ravi on Sep-15-2005 19:36
Attachments:
Thankz kwan
i worked in another manner like c.yAxis2().setDateScale(-2.0, 10.0, 2) and used u'r logic it's wrking fyn

and for me i want to place any data on top of every vertical bar i..ee i want to show the diff of planned and actual as an numeric on the bar for each month

and another reqt is i want to display the whole date value on y-axis but with the usage of cmd
c.yAxis().setDateScale(DateSerial(2005, 1, 1), DateSerial(2006, 1, 1)) iam getting only month and year i want day of month also.

and u can c in jpg file tht data is overlapping at x-axis

Thankz in advance
WebForm5[6].png

  Re: Regarding Date Manipulation in Graphs
Posted by Venkat on Feb-03-2010 18:39
Dear Peter,

Is there any provision to change date/time format in ChartDirector, i.e. from mm-dd-yyyy to dd-mm-yyyy

with regards
Venkat

  Re: Regarding Date Manipulation in Graphs
Posted by Peter Kwan on Feb-03-2010 23:56
Hi Venkat,

Yes. Please use:

c.yAxis().setLabelFormat("{value|dd-mm-yyyy}")

Hope this can help.

Regards
Peter Kwan