Marks on Stacked Bar Chart Do Not Show
Marks on Stacked Bar Chart Do Not Show
When using a Stack Bar Chart (MultiBar = Stacked) the marks of the bars do not show since those are being behind the next bar.
Thus seeing only the mark of the top most bar.
There is a solution to change the y-position of the mark (modify the arrow property), however I do not want to change the y-position, as the marks should be slightly above the bar they belong to.
Is there a way to make the marks visible in any other way?
see attached image:
Thanks in advance
Elad
Thus seeing only the mark of the top most bar.
There is a solution to change the y-position of the mark (modify the arrow property), however I do not want to change the y-position, as the marks should be slightly above the bar they belong to.
Is there a way to make the marks visible in any other way?
see attached image:
Thanks in advance
Elad
Re: Marks on Stacked Bar Chart Do Not Show
Hello Elad,
Sorry, but for the moment it is not possible. I have added your suggestion as Feature request number [TF02014895] to the wish-list to be considered for inclusion in future releases.
Thanks,
Sorry, but for the moment it is not possible. I have added your suggestion as Feature request number [TF02014895] to the wish-list to be considered for inclusion in future releases.
Thanks,
Best Regards,
Sandra Pazos / 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 |
Re: Marks on Stacked Bar Chart Do Not Show
Hey Sandra
This request is not a suggestion, this is regression bug, and a critical bug on our side.
We've upgraded from the Delphi version where it used to work and in the .Net version it doesn't.
In addition in 3D charts the marks are visible as expected.
We would like your cooperation in supplying a workaround for this bug or a patch to fix this issue.
Thanks a lot
Elad
This request is not a suggestion, this is regression bug, and a critical bug on our side.
We've upgraded from the Delphi version where it used to work and in the .Net version it doesn't.
In addition in 3D charts the marks are visible as expected.
We would like your cooperation in supplying a workaround for this bug or a patch to fix this issue.
Thanks a lot
Elad
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Marks on Stacked Bar Chart Do Not Show
Hi Elad,
Actually, wish or bug/defect lists are internally the same list. What changes is the category of the issue but most important for us is the priority we give to each issue and this is quite an important one. Anyway, we changed issues category to "bug report" instead of "feature request".This request is not a suggestion, this is regression bug, and a critical bug on our side.
Really? Which Delphi and TeeChart versions? Current TeeChart VCL versions also suffer from this problem in 2D charts. We have implemented Series.Marks.OnTop property for next TeeChart VCL releases to solve this.We've upgraded from the Delphi version where it used to work and in the .Net version it doesn't.
Yes, we are aware of that. OnTop property will be only for 2D charts and false by default. Setting it to true will paint marks as you request.In addition in 3D charts the marks are visible as expected.
A workaround would be replacing series marks with Annotation tools as shown here:We would like your cooperation in supplying a workaround for this bug or a patch to fix this issue.
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
for (int i = 0; i < 5; i++)
{
tChart1.Series.Add(new Steema.TeeChart.Styles.Bar());
tChart1[i].FillSampleValues();
((Steema.TeeChart.Styles.Bar)tChart1[i]).MultiBar = Steema.TeeChart.Styles.MultiBars.Stacked;
}
tChart1.AfterDraw += new Steema.TeeChart.PaintChartEventHandler(tChart1_AfterDraw);
tChart1.Draw();
}
void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
ReplaceMarks();
}
private void ReplaceMarks()
{
foreach (Steema.TeeChart.Styles.Series s in tChart1.Series)
{
for (int i = 0; i < s.Marks.Positions.Count; i++)
{
Steema.TeeChart.Tools.Annotation annotation1 = new Steema.TeeChart.Tools.Annotation(tChart1.Chart);
Steema.TeeChart.Styles.SeriesMarks.Position pos = s.Marks.Positions[i];
annotation1.Text = s.YValues[i].ToString();
annotation1.Shape.CustomPosition = true;
annotation1.Shape.Left = pos.LeftTop.X;
annotation1.Shape.Top = pos.LeftTop.Y;
annotation1.Shape.Width = pos.Width;
annotation1.Shape.Height = pos.Height;
}
s.Marks.Visible = false;
}
}
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 |
Re: Marks on Stacked Bar Chart Do Not Show
Thanks Narcís
I'll try your suggestion
Regards,
Elad
I'll try your suggestion
Regards,
Elad
Re: Marks on Stacked Bar Chart Do Not Show
Hey Narcís
I've tried working with your solution, I'm facing the following problems.
Whenever the chart size is changed the annotations position is given from the old marks positions (position prior to the resize).
I have tried adding code for the chart's BeforeDraw, BeforeDrawSeries or Resize events or GetSeriesMark (Bar's event).
But with no luck.
In addition it appears that GetSeriesMark is called after AfterDraw, which doesn't make sense, since in order to draw there's a need to know the marks position.
Any help would be appreciated,
Elad
I've tried working with your solution, I'm facing the following problems.
Whenever the chart size is changed the annotations position is given from the old marks positions (position prior to the resize).
I have tried adding code for the chart's BeforeDraw, BeforeDrawSeries or Resize events or GetSeriesMark (Bar's event).
But with no luck.
In addition it appears that GetSeriesMark is called after AfterDraw, which doesn't make sense, since in order to draw there's a need to know the marks position.
Any help would be appreciated,
Elad
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Marks on Stacked Bar Chart Do Not Show
Hi Elad,
In that case you can do this:
In that case you can do this:
Code: Select all
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
for (int i = 0; i < 5; i++)
{
tChart1.Series.Add(new Steema.TeeChart.Styles.Bar());
tChart1[i].FillSampleValues();
((Steema.TeeChart.Styles.Bar)tChart1[i]).MultiBar = Steema.TeeChart.Styles.MultiBars.Stacked;
}
tChart1.AfterDraw += new Steema.TeeChart.PaintChartEventHandler(tChart1_AfterDraw);
tChart1.Resize += new EventHandler(tChart1_Resize);
tChart1.Draw();
tChart1.Dock = DockStyle.Fill;
}
void tChart1_Resize(object sender, EventArgs e)
{
RefreshMarksPosition();
}
private void RefreshMarksPosition()
{
foreach (Steema.TeeChart.Styles.Series s in tChart1.Series)
{
s.Marks.Visible = true;
}
tChart1.Draw();
ReplaceMarks();
}
void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
ReplaceMarks();
}
private void ReplaceMarks()
{
tChart1.Tools.Clear();
foreach (Steema.TeeChart.Styles.Series s in tChart1.Series)
{
for (int i = 0; i < s.Marks.Positions.Count; i++)
{
Steema.TeeChart.Tools.Annotation annotation1 = new Steema.TeeChart.Tools.Annotation(tChart1.Chart);
Steema.TeeChart.Styles.SeriesMarks.Position pos = s.Marks.Positions[i];
annotation1.Text = s.YValues[i].ToString();
annotation1.Shape.CustomPosition = true;
annotation1.Shape.Left = pos.LeftTop.X;
annotation1.Shape.Top = pos.LeftTop.Y;
annotation1.Shape.Width = pos.Width;
annotation1.Shape.Height = pos.Height;
}
s.Marks.Visible = false;
}
}
This event was designed to customize marks text, not its position.In addition it appears that GetSeriesMark is called after AfterDraw, which doesn't make sense, since in order to draw there's a need to know the marks position.
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 |
Re: Marks on Stacked Bar Chart Do Not Show
Hey Narcís
I've been working for the past few days on implementing this fix, and everything works fine except on some occasions when zooming in the chart.
using m_chart.Page.MaxPointsPerPage, where not all the marks should be visible.
calling the RefreshMarksPosition() does update the annotations positions as needed, except for the ones that should be off screen (or invisible)
I believe this is since the marks that shouldn't be visible do not get updated.
Is there a way to know which marks should be visible and which shouldn't?
s.Marks.Visible gives the visibility of all the marks in the current series.
Thanks
Elad
I've been working for the past few days on implementing this fix, and everything works fine except on some occasions when zooming in the chart.
using m_chart.Page.MaxPointsPerPage, where not all the marks should be visible.
calling the RefreshMarksPosition() does update the annotations positions as needed, except for the ones that should be off screen (or invisible)
I believe this is since the marks that shouldn't be visible do not get updated.
Is there a way to know which marks should be visible and which shouldn't?
s.Marks.Visible gives the visibility of all the marks in the current series.
Thanks
Elad
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Marks on Stacked Bar Chart Do Not Show
Hi Elad,
To support Zoom and Scroll you need to use corresponding events and only paint marks for visible points as in this example:
To support Zoom and Scroll you need to use corresponding events and only paint marks for visible points as in this example:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
for (int i = 0; i < 5; i++)
{
tChart1.Series.Add(new Steema.TeeChart.Styles.Bar());
tChart1[i].FillSampleValues();
((Steema.TeeChart.Styles.Bar)tChart1[i]).MultiBar = Steema.TeeChart.Styles.MultiBars.Stacked;
}
tChart1.AfterDraw += new Steema.TeeChart.PaintChartEventHandler(tChart1_AfterDraw);
tChart1.Resize += new EventHandler(tChart1_Resize);
tChart1.Zoomed += new EventHandler(tChart1_Zoomed);
tChart1.UndoneZoom += new EventHandler(tChart1_UndoneZoom);
tChart1.Scroll += new EventHandler(tChart1_Scroll);
tChart1.Draw();
tChart1.Dock = DockStyle.Fill;
}
void tChart1_Scroll(object sender, EventArgs e)
{
RefreshMarksPosition();
}
void tChart1_UndoneZoom(object sender, EventArgs e)
{
RefreshMarksPosition();
}
void tChart1_Zoomed(object sender, EventArgs e)
{
RefreshMarksPosition();
}
void tChart1_Resize(object sender, EventArgs e)
{
RefreshMarksPosition();
}
private void RefreshMarksPosition()
{
foreach (Steema.TeeChart.Styles.Series s in tChart1.Series)
{
s.Marks.Visible = true;
}
tChart1.Draw();
ReplaceMarks();
}
void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
ReplaceMarks();
}
private void ReplaceMarks()
{
tChart1.Tools.Clear();
foreach (Steema.TeeChart.Styles.Series s in tChart1.Series)
{
//for (int i = 0; i < s.Marks.Positions.Count; i++)
for (int i = s.FirstVisibleIndex; i <= s.LastVisibleIndex; i++)
{
Steema.TeeChart.Tools.Annotation annotation1 = new Steema.TeeChart.Tools.Annotation(tChart1.Chart);
Steema.TeeChart.Styles.SeriesMarks.Position pos = s.Marks.Positions[i];
annotation1.Text = s.YValues[i].ToString();
annotation1.Shape.CustomPosition = true;
annotation1.Shape.Left = pos.LeftTop.X;
annotation1.Shape.Top = pos.LeftTop.Y;
annotation1.Shape.Width = pos.Width;
annotation1.Shape.Height = pos.Height;
}
s.Marks.Visible = false;
}
}
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 |
Re: Marks on Stacked Bar Chart Do Not Show
Thanks Narcis,
That's works fine except when there's only one column being shown.
In that case the first and last cover all the marks
Is this a known issue?
Thanks
Elad
That's works fine except when there's only one column being shown.
In that case the first and last cover all the marks
Is this a known issue?
Thanks
Elad
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Marks on Stacked Bar Chart Do Not Show
Hi Elad,
I'm not sure about what do you mean here. Could you please attach a screen-shot of what you get and let us know the exact TeeChart version you are using?
Thanks in advance.
I'm not sure about what do you mean here. Could you please attach a screen-shot of what you get and let us know the exact TeeChart version you are using?
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 |
Re: Marks on Stacked Bar Chart Do Not Show
Hey Narcís,
TeeChart version is 3.5.3425.20244
Here is the chart before the zoom:
And the chart after multiple zooms:
This problem occurs only when there's a single bar shown, could that be the issue?
Whenever there's only one bar then FirstVisibleIndex = 0 LastVisibleIndex = series.Marks.Positions.Count - 1.
Thanks
Elad
TeeChart version is 3.5.3425.20244
Here is the chart before the zoom:
And the chart after multiple zooms:
This problem occurs only when there's a single bar shown, could that be the issue?
Whenever there's only one bar then FirstVisibleIndex = 0 LastVisibleIndex = series.Marks.Positions.Count - 1.
Thanks
Elad
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Marks on Stacked Bar Chart Do Not Show
Hi Elad,
Please notice there are newer TeeChart for .NET v3 versions available. Yours is from May 2009.TeeChart version is 3.5.3425.20244
Using latest v3 release I can only reproduce something similar when zooming over the top of top-most bar. Can you reproduce this using latest v3 release? Should I perform any specific action? Could you attach a simple example project we can run "as-is" to reproduce this behaviour here?This problem occurs only when there's a single bar shown, could that be the issue?
I'm not able to reproduce this using latest v3 and v2010 releases.Whenever there's only one bar then FirstVisibleIndex = 0 LastVisibleIndex = series.Marks.Positions.Count - 1.
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 |
Re: Marks on Stacked Bar Chart Do Not Show
Hey Narcis,
Using the latest TeeChart.DLL solved the last issue.
Thanks a lot for all your help on this issue
Elad
Using the latest TeeChart.DLL solved the last issue.
Thanks a lot for all your help on this issue
Elad
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Marks on Stacked Bar Chart Do Not Show
Hello Elad,
You're very welcome. I'm glad to hear that.
You're very welcome. I'm glad to hear that.
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 |