Page 1 of 1

Gaps Between dates on my X axis

Posted: Mon Mar 22, 2004 2:44 pm
by 6925002
The dates look a little out of the ordinary where i have lot of dates on my X axis.
When i have dates like 1/12/2004,1/13/2004,1/14/2004,1/17/2004, 1/18/2004 on my x axis,I see like 3 gap space between date 1/14 and 1/17.How do i avoid this gap?

Posted: Mon Mar 22, 2004 5:09 pm
by Pep
Hi,

you can see one example which show you how to solve this in the TeeChart Pro AX v6 Demo Features project under :
Welcome ! -> Previous Version -> New Features -> Series -> Candle -> Axis labels no weekends

but where in code?

Posted: Mon Mar 22, 2004 6:19 pm
by 6925002
i found the code, but what code say to avoid the gaps?

Posted: Mon Mar 22, 2004 6:26 pm
by Pep
Hi,

in this example you can see the strategy which you can use to remove the gaps.

still dont know

Posted: Mon Mar 22, 2004 6:44 pm
by 6925002
i looked the code , but i dont have a hint how to remove the gap.

Here is my code, can you modify code?


Chart.AddSeries scLine
Chart.Series(0).asLine.LinePen.Width = 3

Chart.Series(0).Color = VbColor(16)
Chart.Series(0).Title = "Schedule Performance Index"

Chart.Series(0).XValues.DateTime = True
Chart.Series(0).Add CDec(GraphArray(0, i)), Format(GraphArray(1, i), "mm/dd/yyyy"), VbColor(16)

Posted: Tue Mar 23, 2004 1:46 pm
by Chris
Hi --

The example Pep mentioned is the answer you're looking for.

Try opening the Feature Demo source code under:
C:\Program Files\Steema Software\TeeChart Pro v6 ActiveX Control\Examples\Visual Basic\TeeChartAXV6Demo

Open the form CandleAxisLabelsForm and change the AddAsDatetime() method to the following:

Code: Select all

Private Sub AddAsDatetime()
Dim tmpopen, tmp As Integer
  ' This option simulates a sequential datetime Axis
  ' Candle Series
  NotDateTime = False
  TChart1.RemoveAllSeries
  TChart1.AddSeries (scCandle)
  TChart1.Axis.Bottom.Labels.Angle = 90

  With TChart1.Series(0)
    .Clear
    tmpopen = 1000 + Rnd(100)
    For t = 0 To 14
      tmp = Int(100 * Rnd - 50)
      If (Weekday(Format(Now - 15, "000000") + t) <> 1) And (Weekday(Format(Now - 15, "000000") + t) <> 7) Then
        .asCandle.AddCandle Format(Now - 15, "000000") + t, tmpopen, tmpopen + 20, tmpopen - 20, tmpopen + tmp
      End If
      tmpopen = tmpopen + tmp
    Next t
  End With
End Sub
Now run the project and open the form again -- you should be able to see how this technique removes the gaps more clearly.