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

Setting Series label backgorund color same as series color

1 Answer 142 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Prashant
Top achievements
Rank 1
Prashant asked on 24 Feb 2014, 07:49 PM
Hi,

We are trying to create the Pie chart:

I have few queries about it:

1) We want to set Series Label background color
same as series color. Is it possible with Kendo Chart?

2) I want to set the Series Label text from the
value of one of the Property ( say LabelText) of data which I am binding to chart.
Is it possible? How can I do that?

3) Change the color of line joining the series and series
label, same as that of series color

Please see the sample chart which we are drawing
in Silverlight using Telerik Radchart.

Regards,
Prashant gham

1 Answer, 1 is accepted

Sort by
0
Iliana Nikolova
Telerik team
answered on 25 Feb 2014, 12:57 PM
Hi Prashant,

Straight to the questions:
  1. In order to achieve this you should use series.labels.background as a function. For example:
    $("#chart").kendoChart({
      //....
      series: [{
        type: "pie",
        //....
        labels: {
           visible: true,
           background: function(e){
              return e.series.color;
           }
        }
      }]
    });
  2. This can be achieved using series.labels.template - you could reach the original data through the dataItem:
    $("#chart").kendoChart({
      //....
      series: [{
        type: "pie",
        //....
        labels: {
           visible: true,
           template:  "#= dataItem.someField #"}
        }
      }]
    });
  3. This requirement is not supported and there is no a suitable workaround I can suggest.

Regards,
Iliana Nikolova
Telerik
Tags
Charts
Asked by
Prashant
Top achievements
Rank 1
Answers by
Iliana Nikolova
Telerik team
Share this question
or