Candle Series
Q: How can I remove weekends on Candle ODBC database Charts?
To set your date labels, select your table "Date" field in the "Labels" combobox in the datasource tab. Q: How can I remove weekends programmatically?
TChart1.Series(0).XValues.DateTime = False You should now configure the XAxis so that it displays Series points. Probably the easiest way to do this is by changing the Label Style property: TChart1.Axis.Bottom.Labels.Style = talMark From here you have two options, both of which assume that one of the fields in your database table contains the dates you want to publish, i.e. dates with the weekends already removed. The first option is to use the PointLabel property (here we're using ADO to bring data from the TeeChart Pro Database into the chart): With Record .MoveFirst While Not .EOF TChart1.Series(0).Add .Fields("Salary"), .Fields("LastName"), clTeeColor TChart1.Series(0).PointLabel(t) = .Fields("Birth_Date") t = t + 1 .MoveNext Wend End With The second option is to change the XAxis labels using the OnGetAxisLabel() event: Private Sub TChart1_OnGetAxisLabel(ByVal Axis As Long, ByVal SeriesIndex As Long, ByVal ValueIndex As Long, LabelText As String) If Axis = atBottom Then With TChart1 If .SeriesCount > 0 Then If .Series(0).Count > 0 Then If ValueIndex <> -1 Then LabelText = LabelLocations(ValueIndex) End If End If End If End With End If End Sub In this instance we have copied the data field into the global array LabelLocations to avoid having to open the database a second time. |