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

How to set width of rectangle from code behind

1 Answer 62 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Maheep
Top achievements
Rank 1
Maheep asked on 06 Dec 2010, 09:42 AM

I am using following code to generate a Bar chart.

 

var

 

 

seriesMapping = new SeriesMapping
{
    SeriesDefinition =
new BarSeriesDefinition
    {
        ShowItemLabels =
false
    }
};

 

 

 

 

var timeMapping = new ItemMapping
{
    DataPointMember =
DataPointMember.XValue,
    FieldName =
"Time",
    FieldType =
typeof(DateTime);
};

 

 

 

var pointMapping = new ItemMapping
{
    DataPointMember =
DataPointMember.YValue,
    FieldName =
"Point",
    FieldType =
typeof(double),
};

 

seriesMapping.ItemMappings.Add(timeMapping);
seriesMapping.ItemMappings.Add(pointMapping);

Chart1.SeriesMappings.Add(seriesMapping);



I want to set width of rectangle drawn for a Bar to "2". How can I do this from code behind; not using style?

1 Answer, 1 is accepted

Sort by
0
Maheep
Top achievements
Rank 1
answered on 06 Dec 2010, 01:15 PM
Ok. Got the answer. I had to change Fill value in Style from default templateBinding value to a fill color and it worked.
Tags
Chart
Asked by
Maheep
Top achievements
Rank 1
Answers by
Maheep
Top achievements
Rank 1
Share this question
or