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

ShowLabel=True : Change label font-color

2 Answers 200 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Nitin Nitin
Top achievements
Rank 1
Nitin Nitin asked on 26 Jul 2013, 10:14 AM
Hi,

I am enabling ShowLabels property to True on user selection of contextmenu option "Show Markers"

xRadCartesianChart.Series(i).ShowLabels = True

I am able to see the labels at all datapoints on the chart as attached.

Now, I want to change the font-color of those labels to match the color of the chart series.

How can I achieve this?

Thanks,
Nitin 

2 Answers, 1 is accepted

Sort by
0
Nitin Nitin
Top achievements
Rank 1
answered on 29 Jul 2013, 06:26 AM
Hello Telerik,

Can you please reply to my question, if it is possible or not?

0
Accepted
Petar Kirov
Telerik team
answered on 30 Jul 2013, 02:39 PM
Hi Nitin,

All ChartSeries have a LabelDefinitions property which you can use to customize the series item labels. The ChartSeriesLabelDefinition class exposes a Template property, which you can use to specify how each label should be displayed. Here's an example:
<telerik:LineSeries>
  <telerik:LineSeries.LabelDefinitions>
      <telerik:ChartSeriesLabelDefinition>
          <telerik:ChartSeriesLabelDefinition.Template>
              <DataTemplate>
                 <TextBlock Text="{Binding Value}" Foreground="White"/>
              </DataTemplate>
          </telerik:ChartSeriesLabelDefinition.Template>
      </telerik:ChartSeriesLabelDefinition>
  </telerik:LineSeries.LabelDefinitions>
</telerik:LineSeries>
The DataContext of this DataTemplate is DataPoint (depending on type of series could be CategoricalDataPoint, RangeDataPoint, OhlcDataPoint, ScatterDataPoint, PolarDataPoint or PieDataPoint).

I hope this helps.
 
Regards,
Petar Kirov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
ChartView
Asked by
Nitin Nitin
Top achievements
Rank 1
Answers by
Nitin Nitin
Top achievements
Rank 1
Petar Kirov
Telerik team
Share this question
or