function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jawad Rehman01Jawad Rehman01 

Need Help in bar graph

I need to create chart using visualforce. I want to create the following graph;

User-added image 

I used the beloe example in the link to obtained the graph but problem is that titles and fields are dynamics as the date ranges
are between two dates. i.e. From:1/2/2016 To: 28/03/2016. The titles will be dynamic of dates found in SOQL query.
http://salesforce.stackexchange.com/questions/38557/bar-graph-with-multiple-data-points

In below examples the fields are data1,data2,and data2 and also the titles are fixed which are 'Acme', 'Berlitz', 'Concorde' but my case the titles will be date range and count will be the no of leads crated on specific date on basis of owner.
Best Answer chosen by Jawad Rehman01
pconpcon
I think what you are trying to do may not be really possible unless you have a finite number of dates that you will be returning.  For example if you are always returning 6 dates then you can use the information from the stackexchange link (changing stacked to false).  However if you have n number of dates, then you will need to have n number of fields on the Item object and you would put n number of fields in your stackFields list.  Unfortunately, it does not look like the apex:chart supports stacking and having dynamic multiple fields.

All Answers

pconpcon
I think what you are trying to do may not be really possible unless you have a finite number of dates that you will be returning.  For example if you are always returning 6 dates then you can use the information from the stackexchange link (changing stacked to false).  However if you have n number of dates, then you will need to have n number of fields on the Item object and you would put n number of fields in your stackFields list.  Unfortunately, it does not look like the apex:chart supports stacking and having dynamic multiple fields.
This was selected as the best answer
Jawad Rehman01Jawad Rehman01
Sir, I have one more question then how it is achived in salesforce charts. The figure i have shown in question is generated using salesforce dashboard charts. 
pconpcon
I don't know how it is generated in the dashboard charts.  I can tell you that they are not using the Visualforce components to generate the chart.  They have a lot more control over the charting engine since they control everything from the data generation to the display.
Jawad Rehman01Jawad Rehman01
Ok!! Thanks