You need to sign in to do that
Don't have an account?
vijaymind
apex:chart reRedner issue
Hi All,
I am having an issue with apex:chart reRendering, it does not work, each and every varible value getting set as expected but data does not display inside chart even data is there in controller.
Please help me out, development has been stuck. I have read many blogs but solution.
I am having an issue with apex:chart reRendering, it does not work, each and every varible value getting set as expected but data does not display inside chart even data is there in controller.
Please help me out, development has been stuck. I have read many blogs but solution.
Thanks for attentions
Below is the code
<apex:outputPanel layout="block" styleclass="boxScroll" style=" border:1px solid black; height:200px;">
<table width="100%" border="0">
<tr>
<td><apex:commandButton value="Open Vs Close" style="background:lightblue;" action="{!chartDisplayOpenVsClose}" id="OpenVsCloseBtnID"/></td>
<td><apex:commandButton value="Engineers Performance" action="{!chartDisplayEngPerformance}" id="EnginnerID"/><!--reRender="outputPanelIdNew"--></td>
<td><apex:commandButton value="Target Actual Vs Achievement" action="{!chartDisplayTargetVsActual}" id="TargetActualID"/> <!--reRender="outputPanelIdNew"--></td>
</tr>
<tr>
<td colspan="3">
<apex:outputpanel layout="block" style="width:220px;Height:160px;">
<apex:outputPanel id="outputPanelIdNew">
<c:Chart chartName="{!chartType}"/>
</apex:outputPanel>
</apex:outputpanel>
</td>
</tr>
</table>
</apex:outputPanel>
Controller methods.
public void chartDisplayOpenVsClose(){
chartType = 'OpenVsClose';
}
public void chartDisplayEngPerformance(){
chartType = 'EngPerformance';
}
public void chartDisplayTargetVsActual(){
chartType = 'TargetVsActual';
}
Component -
<apex:component controller="clsDashboardForService"> <apex:attribute name="chartName" type="string" description="Test"/> On Component - {!chartName} <apex:chart height="160" width="400" data="{!ChartOpenvsClose}" resizable="true" rendered="{!if(chartName='OpenVsClose',true,false)}"> <apex:axis type="Numeric" position="left" fields="count" title="Count"/> <apex:axis type="Category" position="bottom" fields="status" title="Case Status" grid="true"/> <apex:barSeries orientation="vertical" axis="bottom" xField="status" yField="count"/> </apex:chart> <apex:chart height="160" width="400" data="{!ChartEngineersPerformance}" resizable="true" rendered="{!if(chartName='EngPerformance',true,false)}"> <apex:axis type="Numeric" position="bottom" fields="overAllRating" title="Rating" maximum="10" minimum="0"/> <apex:axis type="Category" position="left" fields="engineerName" title="Engineers" grid="true"/> <apex:barSeries orientation="horizontal" axis="bottom" xField="overAllRating" yField="engineerName"/> </apex:chart> <apex:chart height="160" width="400" data="{!ChartTargetAcVsAch}" resizable="true" rendered="{!if(chartName='TargetVsActual',true,false)}"> <apex:axis type="Numeric" position="left" fields="totalAmount" title="Amount"/> <apex:axis type="Category" position="bottom" fields="ActualOrTarget" title="Target Vs Actual" grid="true"/> <apex:barSeries orientation="vertical" axis="bottom" xField="ActualOrTarget" yField="totalAmount"/> </apex:chart> </apex:component>
When I am cliking on butttons this highlighted {!chartName} values is getting change to (OpenVsClose/EngPerformance/ChartTargetAcVsAch) but still no data visible in chart even data exist into controller.
Thanks
Vijay