Page 1 of 1
Print Preview / Series Marks problem
Posted: Thu Dec 18, 2003 10:35 am
by 6923813
When i print a chart it comes out OK, with the series marks showing the y axis values as expected. But when i do a print preview, the chart shows the x axis values instead! All i'm doing is either:
TCHart.Printer.PrintChart
or
TCHart.Printer.Preview
Posted: Thu Dec 18, 2003 9:10 pm
by Pep
>TCHart.Printer.Preview
Do you mean TChart.Printer.ShowPreview ?
Which TeeChart version are you using ?
I've test it here using the latest TeeChart Pro v6.04 and works as expected. Could you please attach the code that you are using ?
Josep Lluis Jorge
http://support.steema.com
Posted: Fri Dec 19, 2003 8:53 am
by 6923813
Yes - TChart1.Printer.ShowPreview
I'm using TChart v5.0.3.1 - I'm aware there is an update but previews have worked OK before - there have been some code changes but nothing that should affect print preview.
Code snippets:
With TChart1
.Legend.Visible = False
.Axis.Bottom.Labels.OnAxis = False
.Axis.Bottom.Labels.Angle = 90
'Clear any existing series
.RemoveAllSeries
'Add the single series for these charts
.AddSeries scBar3D
.Series(0).Marks.Visible = True
Dim FirstReading As Integer
FirstReading = 0
Do While HourlyTotals(FirstReading) = 0
FirstReading = FirstReading + 1
Loop
Dim LastReading As Integer
LastReading = 23
Do While HourlyTotals(LastReading) = 0
LastReading = LastReading - 1
Loop
Dim TimeFrom As String
Dim TimeTo As String
TimeFrom = GetSetting(App.ProductName, "Settings", "Start of Day", Format(Now, "dd-mmm-yyyy") & " 08:00")
TimeTo = GetSetting(App.ProductName, "Settings", "End of Day", Format(Now, "dd-mmm-yyyy") & " 18:00")
For i = CInt(Left(TimeFrom, 2)) To CInt(Left(TimeTo, 2)) 'FirstReading To LastReading
Dim Time1 As String
Dim Time2 As String
Time1 = CStr(i) & ":00"
Time2 = CStr(i) & ":59"
If Len(CStr(i)) = 1 Then
Time1 = "0" & Time1
Time2 = "0" & Time2
End If
Select Case chartType
Case E_DAILY_SUMMARY
.Series(0).Add CDbl(HourlyTotals(i) / 60), Time1 & " - " & Time2, vbRed
Case E_CALLS_PER_HOUR
.Series(0).Add CDbl(HourlyTotals(i)), Time1 & " - " & Time2, vbRed
Case E_CALL_DURATIONS
.Series(0).Add CDbl(HourlyTotals(i) / 60), Time1 & " - " & Time2, vbRed
End Select
.Series(0).PointColor(.Series(0).Count - 1) = mmColourPicker.Value
Next i
End With
With TChart1
.Header.Text(0) = chartTitle & lblReportDate & " (" & m_UserName & ")"
.Axis.Bottom.Title.Caption = chartX
.Axis.Left.Title.Caption = chartY
.Header.Alignment = taCenter
.Axis.Bottom.TitleSize = 0
.Axis.Bottom.Title.Font.Size = 8
End With
The chart when Previewed, shows values like '09:00 - 09:59' for the series mark instead of the actual y value which is for example 21.75. When printed it comes out properly.
Posted: Fri Dec 19, 2003 10:29 am
by 6923813
Just upgraded to v 5.0.6.0 and problem still occurs.
Posted: Fri Dec 19, 2003 12:44 pm
by 6923813
Export also does this - i.e. call to TChart1.Export.ShowExport, save chart as BMP. Open BMP - the series marks are set to the x axis labels.
Posted: Fri Dec 19, 2003 3:39 pm
by 6923813
Its sorted now (i think
) - my series marks style was set to 'label' - and i didnt realise that adding points using:series(x).add value, str, vbRed was setting the label to 'str'.
i changed the mark style to 'value' and now OK.
Doesnt explain why on Print & screen display, that the values rather than the labels were used for the marks.
But i've got the charts working how i want them now so i'm happy!