You need to sign in to do that
Don't have an account?
Dynamic titles in VF Charts
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>
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},{!titleString3}"/>
and you'll a corresponding title value in the legend for each series that contains the contents of titleString1, titleString2 and titleString3.
All Answers
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},{!titleString3}"/>
and you'll a corresponding title value in the legend for each series that contains the contents of titleString1, titleString2 and titleString3.
Can you just help me on below requirement of VF Chart.
Based on the data, If i click on each row of First Table, It has to show Line & bar Chart.
Thank you in advance