Umair Anwaar Umair Anwaar - 1 month ago 13
ASP.NET (C#) Question

How to add 2 series in Bar chart using crystal report visual studio 2013

I am using crystal report with Visual Studio 2013 and have to design report with bar chart.

I have consolidated verification report and have to show bar chart with 2 series.

I have data like this.

public class VerifiedCountData
{
public List<VerifiedCountData> GetDataList()
{
this.VerifiedCountList = new List<VerfiedCountList>();

this.VerifiedCountList.Add(new VerifiedCountData(new DateTime(2015,08,02),1,1));
this.VerifiedCountList.Add(new VerifiedCountData(new DateTime(2015,08,03),5,0));
this.VerifiedCountList.Add(new VerifiedCountData(new DateTime(2015,08,04),2,4));
this.VerifiedCountList.Add(new VerifiedCountData(new DateTime(2015,08,05),6,2));

return this.VerifiedCountList;
}
public VerifiedCountData(DateTime date, int yesCount, int noCount)
{
this.Date = date;
this.YesCount = yesCount;
this.NoCount = noCount;
}

public DateTime Date {get;set;}
public int YesCount {get;set;}
public int NoCount {get;set;}
public List<VerifiedCountData> VerifiedCountList {get;set;}

}


here is snap what I have to design in cystal report.
Please check this Image
https://www.dropbox.com/s/t9qjzcjxb80dugi/sample.png?dl=0

In Design of crystal report right click on report and then goto insert option and select chart.

In chart Expert Data tab layout is advance inside of data a drowp down is comming for 'On Change Of' I have added two fields one for YesCount and second NoCount and in Show value(s) I added Date field.
here is image is explain what i did

https://www.dropbox.com/s/siy99mb3092m396/sample1.png?dl=0

but when i run result is coming like this

dropbox.com/s/dbb6aac3pxqeh3w/sample.3png.png?dl=0

Thanks

Answer

Finally I have done this by changing the values in 'Chart Expert > Data(tab)'

Instead of this :

instead of this

To

its working right