Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Visualforce Development
- :
- Dynamic titles in VF Charts
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Dynamic titles in VF Charts
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-28-2012 07:22 AM
I'm able to create a Visuaforce bar chart that's either stacked or grouped with multiple series similar to the example below. However, I'm trying to figure out how to make the series title a little more dynamic so it could be data driven. Any suggestions on how to make that happen?
<apex:chart data="{!data}" height="400" width="500">
<apex:legend position="left"/>
<apex:axis type="Numeric" position="left" title="Closed Won" grid="true"
fields="data1,data2,data3" dashSize="2">
<apex:chartLabel/>
</apex:axis>
<apex:axis type="Category" position="bottom" fields="name" title="Stacked Bars">
<apex:chartLabel rotate="315"/>
</apex:axis>
<apex:barSeries orientation="vertical" axis="left" stacked="true"
xField="name" yField="data1,data2,data3" title="MacDonald,Promas,Worle"/>
</apex:chart>
Solved! Go to Solution.
Re: Dynamic titles in VF Charts
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-02-2013 09:47 AM
I found a solution for this and it was surprisingly simple. While you can't use the following:
<apex:barSeries orientation="vertical" axis="left" stacked="true" xField="name" yField="data1,data2,data3" title="{!titleString}"/>
where titleString contains a comma separated list of values, you can use
<apex:barSeries orientation="vertical" axis="left" stacked="true" xField="name" yField="data1,data2,data3" title="{!titleString1},{!titleString2},{!titleStri
and you'll a corresponding title value in the legend for each series that contains the contents of titleString1, titleString2 and titleString3.

