This is a migrated thread and some comments may be shown as answers.

turning off point labels

5 Answers 44 Views
Chart
This is a migrated thread and some comments may be shown as answers.
MacKenzie Mickelsen
Top achievements
Rank 1
MacKenzie Mickelsen asked on 16 Mar 2010, 04:24 PM

Hello, I am hoping that you can help me here. We have a situation where we are using your Silverlight Chart control and displaying some information. In this case we want to turn off the point labels for certain points. Is there a way for us to do this? Or is there a way to position the label such that it is behind one of the bars?



Thanks in advance
MacKenzie

5 Answers, 1 is accepted

Sort by
0
Velin
Telerik team
answered on 18 Mar 2010, 01:51 PM
Hi MacKenzie Mickelsen,

I'm afraid that you can not turn off labels for certain points out-of-the-box. You can either turn off labels for the entire visual series or you could use MVVM like approach to do this. The latter is clearly demonstrated with the bar series of our online "Meteo Chart" example.

Greetings,
Velin
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
MacKenzie Mickelsen
Top achievements
Rank 1
answered on 18 Mar 2010, 09:12 PM
Thank you for your response. I am taking some of the ideas from the Demo that you suggested. I have developed a template for my SeriesItemLabel, however the text color is black instead of the bar color. Is there a way that I can use the bar color for my foreground color?

Here is my Template sample, MacKenzie

<

 

Style x:Key="ChartSeriesItemLabelStyle" TargetType="chart:SeriesItemLabel">

 

 

 

<Setter Property="Template" >

 

 

 

<Setter.Value>

 

 

 

<ControlTemplate TargetType="chart:SeriesItemLabel">

 

 

 

<Canvas>

 

 

 

<TextBlock x:Name="PART_TextContainer"

 

 

Canvas.Top="{TemplateBinding TextContainerCanvasTop}"

 

 

Canvas.Left="{TemplateBinding TextContainerCanvasLeft}"

 

 

VerticalAlignment="Stretch"

 

 

TextAlignment="Center"

 

 

FontStyle="Italic"

 

 

Text="{TemplateBinding Content}"

 

 

Foreground="{TemplateBinding Foreground}" />

 

 

 

</Canvas>

 

 

 

</ControlTemplate>

 

 

 

</Setter.Value>

 

 

 

</Setter>

 

 

 

</Style>

 

0
Velin
Telerik team
answered on 24 Mar 2010, 09:32 AM
Hi MacKenzie Mickelsen,

I'm afraid that this is not supported by the control out of the box. You could again use the MVVM approach to set custom foreground color but you will need to handle this by hand.

All the best,
Velin
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
MacKenzie Mickelsen
Top achievements
Rank 1
answered on 26 Mar 2010, 08:07 PM
Thank you Velin, one more question if you dont mind. We have implemented the tempate for the point label on the chart. We have tried to use your new smart label stuff to control the positioning. When we select the "Outside" option now the label is showing up right in the middle of the top of the bar. If we take off the template "stuff" then it behaves as we would suspect. Any ideas on how we could fix the placement of the label with the template?

Thanks again
MacKenzie
0
Velin
Telerik team
answered on 31 Mar 2010, 05:53 PM
Hello MacKenzie Mickelsen,

Could you, please, elaborate a bit further on what the problem is and why the result is different from what you expected. Also, it would be great if you provide a screenshot and/or a sample project. Thanks.

Greetings,
Velin
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Chart
Asked by
MacKenzie Mickelsen
Top achievements
Rank 1
Answers by
Velin
Telerik team
MacKenzie Mickelsen
Top achievements
Rank 1
Share this question
or