Multi Pie Chart Title
Multi Pie Chart Title
Is there any way to display a title directly underneath a pie chart. I would like to display the current month/year for the data that is being displayed directly underneath the pie chart. I have multiple pie charts in my graph so I would need this funtionality for all displayed pies.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi JW,
Yes, you can use TChart.Canvas.TextOut method as shown here:
Yes, you can use TChart.Canvas.TextOut method as shown here:
Code: Select all
Private Sub Form_Load()
With TChart1
.Legend.Visible = True
For i = 0 To 3
.AddSeries scPie
.Series(i).FillSampleValues 7
.Series(i).Marks.Style = smsValue
Next i
End With
End Sub
Private Sub TChart1_OnSeriesBeforeDrawValues(ByVal SeriesIndex As Long)
'Place the new location of the Chart before painting the Series
With TChart1
Select Case SeriesIndex
Case 0: .ChartRect 0, 0, .Canvas.Width / 2, .Canvas.Height / 2
.Canvas.TextOut .Canvas.Width / 4, (.Canvas.Height / 2) - 10, "Series" + CStr(SeriesIndex)
Case 1: .ChartRect .Canvas.Width / 2, 0, .Canvas.Width, .Canvas.Height / 2
.Canvas.TextOut .Canvas.Width / 1.3, (.Canvas.Height / 2) - 10, "Series" + CStr(SeriesIndex)
Case 2: .ChartRect 0, .Canvas.Height / 2, .Canvas.Width / 2, .Canvas.Height
.Canvas.TextOut .Canvas.Width / 4, .Canvas.Height - 20, "Series" + CStr(SeriesIndex)
Case 3: .ChartRect .Canvas.Width / 2, .Canvas.Height / 2, .Canvas.Width, .Canvas.Height
.Canvas.TextOut .Canvas.Width / 1.3, .Canvas.Height - 20, "Series" + CStr(SeriesIndex)
End Select
End With
End Sub
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Narcís,
Many thanks on this answer. Sorry it took so long to return the post-reply, but I had to resort to using the annotations versus the printing the text (plus the annotations were a big hit w/ QA).
I THINK that trapping the events at print-time for a var like say, m_bChartPrinting, in the code as described above and alter the FONT size by using the HEIGHT of the printer font may solve some BIG printing problems?
Many thanks on this answer. Sorry it took so long to return the post-reply, but I had to resort to using the annotations versus the printing the text (plus the annotations were a big hit w/ QA).
I THINK that trapping the events at print-time for a var like say, m_bChartPrinting, in the code as described above and alter the FONT size by using the HEIGHT of the printer font may solve some BIG printing problems?
Hi,
I'm not sure what you refer here, using the above code you should be able to print the pies with the text into the pie chart.
In case you want to change the font and print , you should use font.height to define the font size.
I'm not sure what you refer here, using the above code you should be able to print the pies with the text into the pie chart.
In case you want to change the font and print , you should use font.height to define the font size.
Pep Jorge
http://support.steema.com
http://support.steema.com