Problem on TChart.Legend.LegendStyle
Problem on TChart.Legend.LegendStyle
Dear Sir
Problem on TChart.Legend.LegendStyle = Steema.TeeChart.LegendStyles.Series
Add 2 Pie chart into tchart and set LegendStyle = Series.
TChart show Pie1 and Pie2 in the legend.
Tchart version = 2.0.2489.20951
Thank
Eric
Problem on TChart.Legend.LegendStyle = Steema.TeeChart.LegendStyles.Series
Add 2 Pie chart into tchart and set LegendStyle = Series.
TChart show Pie1 and Pie2 in the legend.
Tchart version = 2.0.2489.20951
Thank
Eric
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Dear Eric,
This is as designed, please notice that when setting LegendStyle to Series Legend draws the Series Titles even if there's only one Series in the chart.
This is as designed, please notice that when setting LegendStyle to Series Legend draws the Series Titles even if there's only one Series in the chart.
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 |
Dear Sir
What are you trying to said? I can't undestand what you trying to explain.
Anyway below is the sample code.
Step by step
1. Click then button 1. Legend displaying USA and Japen
2. Click the button 2 or button 3. the legend no longer display USA and Japen. So what should I do to correct back?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
AddSeries("USA")
AddSeries("Japen")
AddSeriesItem(0, 450, "Food")
AddSeriesItem(1, 1450, "Food")
End Sub
Public Sub AddSeriesItem(ByVal SeriesIndex As Long, ByVal value As Double, ByVal DisplayName As String)
Call TChart.Series(SeriesIndex).Add(value, DisplayName, TChart.Series(SeriesIndex).Color)
End Sub
Public Sub AddSeries(ByVal SeriesTitle As String)
TChart.Series.Add(New Steema.TeeChart.Styles.Bar3D)
TChart.Legend.LegendStyle = Steema.TeeChart.LegendStyles.Series
TChart.Series(TChart.Series.Count - 1).Title = SeriesTitle
TChart.Series(TChart.Series.Count - 1).Marks.Clip = True
TChart.Series(TChart.Series.Count - 1).Cursor = System.Windows.Forms.Cursors.Hand
TChart.Legend.LegendStyle = Steema.TeeChart.LegendStyles.Series
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim objChartStyle As New Steema.TeeChart.Styles.Pie
Steema.TeeChart.Styles.Series.ChangeType(TChart.Series(0), objChartStyle.GetType)
TChart.Series(0).ColorEach = True
objChartStyle = TChart.Series(0)
objChartStyle.AutoMarkPosition = True
Steema.TeeChart.Styles.Series.ChangeType(TChart.Series(1), objChartStyle.GetType)
TChart.Series(1).ColorEach = True
objChartStyle = TChart.Series(1)
objChartStyle.AutoMarkPosition = True
objChartStyle = Nothing
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim objChartStyle As New Steema.TeeChart.Styles.Bar3D
Steema.TeeChart.Styles.Series.ChangeType(TChart.Series(0), objChartStyle.GetType)
Steema.TeeChart.Styles.Series.ChangeType(TChart.Series(1), objChartStyle.GetType)
objChartStyle = Nothing
End Sub
Thank
Eric
What are you trying to said? I can't undestand what you trying to explain.
Anyway below is the sample code.
Step by step
1. Click then button 1. Legend displaying USA and Japen
2. Click the button 2 or button 3. the legend no longer display USA and Japen. So what should I do to correct back?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
AddSeries("USA")
AddSeries("Japen")
AddSeriesItem(0, 450, "Food")
AddSeriesItem(1, 1450, "Food")
End Sub
Public Sub AddSeriesItem(ByVal SeriesIndex As Long, ByVal value As Double, ByVal DisplayName As String)
Call TChart.Series(SeriesIndex).Add(value, DisplayName, TChart.Series(SeriesIndex).Color)
End Sub
Public Sub AddSeries(ByVal SeriesTitle As String)
TChart.Series.Add(New Steema.TeeChart.Styles.Bar3D)
TChart.Legend.LegendStyle = Steema.TeeChart.LegendStyles.Series
TChart.Series(TChart.Series.Count - 1).Title = SeriesTitle
TChart.Series(TChart.Series.Count - 1).Marks.Clip = True
TChart.Series(TChart.Series.Count - 1).Cursor = System.Windows.Forms.Cursors.Hand
TChart.Legend.LegendStyle = Steema.TeeChart.LegendStyles.Series
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim objChartStyle As New Steema.TeeChart.Styles.Pie
Steema.TeeChart.Styles.Series.ChangeType(TChart.Series(0), objChartStyle.GetType)
TChart.Series(0).ColorEach = True
objChartStyle = TChart.Series(0)
objChartStyle.AutoMarkPosition = True
Steema.TeeChart.Styles.Series.ChangeType(TChart.Series(1), objChartStyle.GetType)
TChart.Series(1).ColorEach = True
objChartStyle = TChart.Series(1)
objChartStyle.AutoMarkPosition = True
objChartStyle = Nothing
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim objChartStyle As New Steema.TeeChart.Styles.Bar3D
Steema.TeeChart.Styles.Series.ChangeType(TChart.Series(0), objChartStyle.GetType)
Steema.TeeChart.Styles.Series.ChangeType(TChart.Series(1), objChartStyle.GetType)
objChartStyle = Nothing
End Sub
Thank
Eric
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Eric,
This is because the series title is not saved when changing the series type, to solve this you can do something like this:
This is because the series title is not saved when changing the series type, to solve this you can do something like this:
Code: Select all
Dim Title1, Title2 As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Title1 = "USA"
Title2 = "Japan"
AddSeries(Title1)
AddSeries(Title2)
AddSeriesItem(0, 450, "Food")
AddSeriesItem(1, 1450, "Food")
End Sub
Public Sub AddSeriesItem(ByVal SeriesIndex As Long, ByVal value As Double, ByVal DisplayName As String)
Call TChart.Series(SeriesIndex).Add(value, DisplayName, TChart.Series(SeriesIndex).Color)
End Sub
Public Sub AddSeries(ByVal SeriesTitle As String)
TChart.Series.Add(New Steema.TeeChart.Styles.Bar3D)
TChart.Legend.LegendStyle = Steema.TeeChart.LegendStyles.Series
TChart.Series(TChart.Series.Count - 1).Title = SeriesTitle
TChart.Series(TChart.Series.Count - 1).Marks.Clip = True
TChart.Series(TChart.Series.Count - 1).Cursor = System.Windows.Forms.Cursors.Hand
TChart.Legend.LegendStyle = Steema.TeeChart.LegendStyles.Series
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim objChartStyle As New Steema.TeeChart.Styles.Pie
Steema.TeeChart.Styles.Series.ChangeType(TChart.Series(0), objChartStyle.GetType)
TChart.Series(0).ColorEach = True
objChartStyle = TChart.Series(0)
objChartStyle.AutoMarkPosition = True
Steema.TeeChart.Styles.Series.ChangeType(TChart.Series(1), objChartStyle.GetType)
TChart.Series(1).ColorEach = True
objChartStyle = TChart.Series(1)
objChartStyle.AutoMarkPosition = True
objChartStyle = Nothing
SetSeriesTitle()
End Sub
Private Sub SetSeriesTitle()
TChart.Series(0).Title = Title1
TChart.Series(1).Title = Title2
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim objChartStyle As New Steema.TeeChart.Styles.Bar3D
Steema.TeeChart.Styles.Series.ChangeType(TChart.Series(0), objChartStyle.GetType)
Steema.TeeChart.Styles.Series.ChangeType(TChart.Series(1), objChartStyle.GetType)
objChartStyle = Nothing
SetSeriesTitle()
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 |
Dear Sir
Before I upgrade to latest version. We don't have any problem in series title and all the chart data is stored in the large database.
That is not a good ideas to re-execute the query just because the series title.
Do you think TChart is a good control?
Just a simple change chart type, all the series will automatic miss and need the developer to write a code to restore back the series title.. Wa... what chart control are you provide????
Very disappointed!! Every time upgrade the TChart must have some function is not working well.
Before I upgrade to latest version. We don't have any problem in series title and all the chart data is stored in the large database.
That is not a good ideas to re-execute the query just because the series title.
Do you think TChart is a good control?
Just a simple change chart type, all the series will automatic miss and need the developer to write a code to restore back the series title.. Wa... what chart control are you provide????
Very disappointed!! Every time upgrade the TChart must have some function is not working well.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Dear Eric,
This is certainly a bug (TF02011875) which I added to our defect list to be fixed for future releases.
This is certainly a bug (TF02011875) which I added to our defect list to be fixed for future releases.
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 Eric,
We can't tell this for now, please be aware at new releases announcements for what's being implemented/fixed in each of them.
We can't tell this for now, please be aware at new releases announcements for what's being implemented/fixed in each of them.
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:
Dear Eric,
You are right, this bug hasn't been fixed yet. I can't tell you when this will be fixed. Currently we don't have a public bug tracking system, but you providing this internal code helps us to easily track the issue. Please be aware at this forum for new release announcements and what's implemented/fixed on them.
You are right, this bug hasn't been fixed yet. I can't tell you when this will be fixed. Currently we don't have a public bug tracking system, but you providing this internal code helps us to easily track the issue. Please be aware at this forum for new release announcements and what's implemented/fixed on them.
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 Eric,
As a follow up to my previous reply, you already have an easy workaround for this, you previously said:
As a follow up to my previous reply, you already have an easy workaround for this, you previously said:
However this shouldn't be a problem as you could save the series titles in a variable/array the first time you execute the query and don't have to execute it anymore.That is not a good ideas to re-execute the query just because the series title.
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 |
Hi.
No, not at all. We're only saying that for the moment the only solution is to use the workaround Narcis suggested.
Looking at the sources it appears the best solution is to modify Series.cs AssignFormat method and add additional line:
and similarly for AssignSeriesFormat
This should fix the problem when changing series type. If there aren't any problems with thix fix, we'll include it in next maintenance release.
No, not at all. We're only saying that for the moment the only solution is to use the workaround Narcis suggested.
Looking at the sources it appears the best solution is to modify Series.cs AssignFormat method and add additional line:
Code: Select all
title = source.Title;
Code: Select all
source.Title = title;
Marjan Slatinek,
http://www.steema.com
http://www.steema.com
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi DAPESCO,
Yes, it is a general Series issue, Series.cs contains the series base class.
Yes, it is a general Series issue, Series.cs contains the series base class.
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 |