Wednesday, October 17, 2012

Bar chart

Bar chart

Hi,

I am implementing a chart control which should have 2 bar series.

I created 2 bar series and getting displayed perfect on the screen one after other.

but my Issue is instead of showing one after another series, I want both the series to be overlapped. something like at a point a value of 1 series and just after it the value of second series.

the axis value can be different for both series.

I am using silverlight 4.

Please suggest me , how can I go ahead.

Answers & Comments...

Answer: 1

http://www.telerik.com/community/forums/aspnet-ajax/chart/overlap-bar-charts-bullet-graph.aspx

http://www.telerik.com/community/forums/silverlight/chart/bars-overlapping.aspx

http://www.telerik.com/community/forums/silverlight/charting-kit/overlapping-bars.aspx



Answer: 2

Thanks for your quick reply.

The links you have given above is related to telerik chart controls.

Is the same thing possible using the Silverlight 4's inbuilt chart controls?



Answer: 3

Hi vijay_sutaria,

Do you mean a stacked bar chart? You can find an example from toolkit control sampes, DataVisualization->Stacked Series.

http://www.silverlight.net/content/samples/sl4/toolkitcontrolsamples/run/default.html

Best Regards,



Answer: 4

Hi,

thanks for reply.

I have to display 2 series , both will be bar (or column). I want to display bar of both the series at same point side by side.

As of now, its showing second series after first series, what I want to is second series's one bar after first series's one bar, and same as for other bars available for both series.

But I think this will be a tough job, So I can go with Stacked bar chart. today I tried with this, but here also its same thing... One Series after other series. at a same point the value of both the series should display stacked, but its not.

I am always getting second series after ending of first series. This is what I dont want to show.

My xaml looks like below :

<toolkit:Chart  x:Name="BarChart" Width="900" Height="350">  	<toolkit:Chart.Axes>  		<toolkit:CategoryAxis Orientation="Y" Location="Left" >  			<toolkit:CategoryAxis.AxisLabelStyle>  				<Style TargetType="toolkit:AxisLabel">  					<Setter Property="StringFormat" Value="{}{0:MMM dd}"/>  				</Style>  			</toolkit:CategoryAxis.AxisLabelStyle>  			<toolkit:CategoryAxis.MajorTickMarkStyle>  				<Style TargetType="Line">  					<Setter Property="Stroke" Value="Black" />  					<Setter Property="StrokeThickness" Value="2" />  					<Setter Property="Y1" Value="0" />  					<Setter Property="Y2" Value="10" />  				</Style>  			</toolkit:CategoryAxis.MajorTickMarkStyle>  		</toolkit:CategoryAxis>  	</toolkit:Chart.Axes>    	<toolkit:StackedBarSeries>  		<toolkit:SeriesDefinition ItemsSource="{Binding ItemSource1}" DependentValuePath="Count" IndependentValuePath="EntryDate" Title="First"/>  		<toolkit:SeriesDefinition ItemsSource="{Binding ItemSource2}" DependentValuePath="Count" IndependentValuePath="EntryDate" Title="Second"/>  	</toolkit:StackedBarSeries>  </toolkit:Chart>  



Please guide me If I am doing any thing wrong here.





No comments:

Post a Comment

Send us your comment related to the topic mentioned on the blog