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

PieChart data binding and culture problem

2 Answers 93 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Hubert
Top achievements
Rank 1
Hubert asked on 22 Aug 2012, 12:53 PM
Hi telerik team,

i have a problem setting the pie chart data via data binding correctly.

This is my class for binding:
internal class AssetsItemData
    {
        public double Value { get; set; }
        public string Color { get; set; }
        public bool IsExploded { get; set; }
        public string Text { get; set; }
    }

1. The pie chart explodes all parts. I tried bool and string representation for IsExploded.
How is the ExplodeField set correctly?

2. There's no TextField field.
Where can i set the text which is shown in the legend?

3. Tooltips and label data aren't rendered correctly, because i can not attach a culture to the chart.
How can i set the culture for a chart?

greetings,
Hubert

2 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 23 Aug 2012, 03:25 PM
Hello Hubert,

We are currently working on adding a field that will allow databinding the series name. You can monitor its progress in this PITS item. It is currently planned for the Q3 2012 release.

Regarding the ExplodeField functionality  - if you want to have a sector exploded use the string "true", otherwise use and empty string, e.g.:
protected DataTable GetData()
{
    DataTable tbl = new DataTable();
    tbl.Columns.Add(new DataColumn("data", typeof(decimal)));
    tbl.Columns.Add(new DataColumn("color", typeof(string)));
    tbl.Columns.Add(new DataColumn("name", typeof(string)));
    tbl.Columns.Add(new DataColumn("exploded", typeof(string)));
    tbl.Rows.Add(new object[] { 100, "#66FFCC", "First", "" });
    tbl.Rows.Add(new object[] { 200, "#FF66FF", "Second", "true" });
    tbl.Rows.Add(new object[] { 300, "#0099FF", "Third", "" });
    tbl.Rows.Add(new object[] { 400, "#BBBBBB", "Fourth", "" });
    return tbl;
}
I have logged the idea that you should be able to use the true/false boolean values in the PITS and you can vote, comment and follow it in this PITS item. I have also updated your Telerik points for this report.

Regarding localization - the chart basically shows data you have entered, it is not a localizable control that has its own tooltips or buttons that require localization. We are working on adding templates for the labels and tooltips which will enable you to show data from your datasource with the desired formats and from the desired columnds. The PITS item related to this is here. For the labels - the LbelsAppearance inner tag offers the DataField that you can use to get a column from the datasource with your desired content.


All the best,
Marin Bratanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Hubert
Top achievements
Rank 1
answered on 24 Aug 2012, 10:05 AM
Hello Marin,

thank you for your feedback.
I voted for all three PITS and looking forward for the Q3 release.

Greetings,
Hubert
Tags
Chart (HTML5)
Asked by
Hubert
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Hubert
Top achievements
Rank 1
Share this question
or