Page 1 of 1
Bar Chart without bar labels
Posted: Tue May 21, 2013 10:02 am
by 15664465
My company have purchased teechart to make charts, but our client dont want labels on top of each bar. i couldnt think out any idea to solve this.
I hope you could help me
Re: Bar Chart without bar labels
Posted: Tue May 21, 2013 12:15 pm
by 10050769
Hello Fulcurm,
You have some alternative to achieve as the Marks of Bar Series doesn't paint on top of each bar.
1.- You can use Mark tip tools that allow you show marks only when the mouse is over on the bar. You can see an example in demo example
All Features\Welcome !\Tools\Mark tips.
2.- You can use property of Bar MarksOnBar that allow you draw the marks on the bar. You can find an example in
All Feature\Welcome !\Chart styles\Standard\Bar\Marks on Bar.
3.- You can use Annotation tool as Mark and draw it in the position as you want. You can see the demo examples
All Features\Welcome !\Tools\Annotation to understand as you do to use Annotation tool
4.- You can use custom position of marks as do in next
thread.
I hope will helps.
Thanks,
Re: Bar Chart without bar labels
Posted: Wed May 22, 2013 8:46 am
by 15664465
Thanks for answering me Sandra, but i am searching for one of this options:
-Eliminate them from the chart
-Change the label names into values without changing the bottom axis
Re: Bar Chart without bar labels
Posted: Wed May 22, 2013 12:21 pm
by 10050769
Hello Fulcrum,
Thanks for your clarifications.
In the case you want remove Marks from the chart, you only need set these as not visible as do in next line of code:
In the case you want change the marks text but you doesn't want change the text of axis labels, I recomend you an easy option that consist in use the GetMarkText event and combine it using GetLabelText event as do in next simple code:
Code: Select all
Steema.TeeChart.Styles.Bar series1;
private void InitializeChart()
{
tChart1.Walls.Back.Visible = false;
series1 = new Bar(tChart1.Chart);
series1.FillSampleValues(10);
series1.BarStyle = BarStyles.Rectangle;
series1.Marks.Style = MarksStyles.Label;
series1.GetSeriesMark = series1_GetSeriesMark;
tChart1.GetAxisLabel = tChart1_GetAxisLabel;
}
void tChart1_GetAxisLabel(object sender, GetAxisLabelEventArgs e)
{
e.LabelText = "Nueva";
}
void series1_GetSeriesMark(Series series, GetSeriesMarkEventArgs e)
{
e.MarkText= "Series1:" e.ValueIndex.ToString();
}
I hope will helps.
Thanks,
Re: Bar Chart without bar labels
Posted: Thu May 23, 2013 7:24 am
by 15664465
Thank you Sandra, i have used
series1.Marks.Visible=false
and it works for me