Hello,
For some reason, my legend is only showing the last point in the legend. I really don't have anything that is making it only show 1 point, but it is. Here is the code... How can I have it show the last 6 points? Or better yet, how can I zoom a chart (by button push) such that only the last 6 points are being shown and they are all in the legend.
code
With TChart2
.Legend.Visible = True
.Legend.Gradient.StartColor = RGB(125, 125, 125)
.Legend.Gradient.EndColor = vbWhite
.Series(0).ShowInLegend = False
.Series(1).ShowInLegend = True
.Series(2).ShowInLegend = False
.Legend.Alignment = laRight
.Legend.Shadow.Transparency = 100
End With
Thanks!
Andrew
How to show only last 6 values in the legend
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Andrew,
Yes, this can be achieved doing something like:
Yes, this can be achieved doing something like:
Code: Select all
Private Sub Command1_Click()
TChart1.Series(1).ShowInLegend = False
TChart1.Series(2).ShowInLegend = False
TChart1.Legend.LegendStyle = lsValues
With TChart1.Series(0)
TChart1.Axis.Bottom.SetMinMax .XValues.Value(.Count - 6), _
.XValues.Value(.Count - 1)
TChart1.Legend.FirstValue = .Count - 6
End With
End Sub
Private Sub Command2_Click()
With TChart1.Axis
.Left.Automatic = True
.Bottom.Automatic = True
End With
TChart1.Series(1).ShowInLegend = True
TChart1.Series(2).ShowInLegend = True
TChart1.Legend.LegendStyle = lsAuto
End Sub
Private Sub Form_Load()
For i = 0 To TChart1.SeriesCount - 1
TChart1.Series(i).FillSampleValues 25
Next
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Andrew,
Could you please send us an example we can run "as-is" to reproduce the problem here?
You can post your files at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup.
Could you please send us an example we can run "as-is" to reproduce the problem here?
You can post your files at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup.
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Andrew,
Thanks for the example but I'm afraid that form files are missing. Could you please check it?
Thanks in advance.
Thanks for the example but I'm afraid that form files are missing. Could you please check it?
Thanks in advance.
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 |