Hi Shilong,
The issue with Bars alignment occurs because you created 3 Series with single Bar in each. When the ChartArea is populated with 3 series for example, RadChart makes each Bar with Width = 1/3 of the space between each two Major Tickpoints. This way the three Bar items (from the three series) which have XAxis=1 will be positioned accordingly.
What I can suggest is that you create single DataSerie with 3 items instead of 3 DataSeries with 1 item. To make them colored differently just set the
LegendDisplayMode property of the SeriesDefinition to
DataPointLabel and set LegendLabel for each of the DataPoints as shown in our
help topic.
Here is how you can achieve this declaratively:
<
control:RadChart
x:Name
=
"chart"
>
<
control:RadChart.DefaultView
>
<
chart:ChartDefaultView
>
<!--ChartArea-->
<
chart:ChartDefaultView.ChartArea
>
<
chart:ChartArea
LegendName
=
"CustomLegend"
>
<
chart:ChartArea.DataSeries
>
<
chart:DataSeries
LegendLabel
=
"Store Sales"
>
<
chart:DataSeries.Definition
>
<
chart:BarSeriesDefinition
LegendDisplayMode
=
"DataPointLabel"
/>
</
chart:DataSeries.Definition
>
<
chart:DataPoint
YValue
=
"15"
LegendLabel
=
"Telerik"
/>
<
chart:DataPoint
YValue
=
"5"
LegendLabel
=
"Microsoft"
/>
<
chart:DataPoint
YValue
=
"11"
LegendLabel
=
"Others"
/>
</
chart:DataSeries
>
</
chart:ChartArea.DataSeries
>
</
chart:ChartArea
>
</
chart:ChartDefaultView.ChartArea
>
<!--ChartLegend-->
<
chart:ChartDefaultView.ChartLegend
>
<
chart:ChartLegend
x:Name
=
"CustomLegend"
/>
</
chart:ChartDefaultView.ChartLegend
>
<!--ChartTitle-->
<
chart:ChartDefaultView.ChartTitle
>
<
chart:ChartTitle
Content
=
"Sales Summary"
/>
</
chart:ChartDefaultView.ChartTitle
>
</
chart:ChartDefaultView
>
</
control:RadChart.DefaultView
>
</
control:RadChart
>
Kind regards,
Evgenia
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and
book your seat for a walk through all the exciting stuff we ship with the new release!