You need to sign in to do that
Don't have an account?
apex:chart rendered=true not working properly.
Hi,
Overview:
I'm displaying the chart if there are values to plot on it for each year. Otherwise, a message is displayed as no data.
Issue:
Chart is re rendered properly when there are values to plot for selected year. Also, when there are no values to plot, appropriate message is displayed and chart is hidden. Now once I select the year which has values to plot, chart section is rendered to true but the chart doesn't show up in the screen. Just blank page comes up.
Below is the page code,
<apex:page controller="PaymentGraphController" sidebar="false">
<apex:form >
<apex:pageBlock id="PB" >
<apex:chart height="400" width="700" data="{!paymentDataList}" rendered="{!showData}">
<apex:legend position="right"/>
<apex:axis type="Numeric" position="left" fields="NumberOfPayments"
title="Payments(Count)" grid="true"/>
<apex:axis type="Numeric" position="right" fields="totalAmount"
title="Total Amount"/>
<apex:axis type="Category" position="bottom" fields="Calendarmonth"
title="Month of the Year">
</apex:axis>
<apex:lineSeries title="Proceeds" axis="left" xField="Calendarmonth" yField="NumberOfPayments"
markerType="cross" markerSize="4" markerFill="#FF0000"/>
<apex:lineSeries title="Closed-Lost" axis="right" xField="Calendarmonth" yField="totalAmount"
markerType="circle" markerSize="4" markerFill="#8E35EF" />
</apex:chart>
<apex:outputLabel rendered="{!(!showData)}"><b>No payment for {!year}</b></apex:outputLabel>
<apex:outputLabel value="Payment Year: "></apex:outputLabel>
<apex:selectList value="{!year}" size="1" >
<apex:selectOptions value="{!Years}"/>
<apex:actionSupport event="onchange" rerender="PB" action="{!refreshByYear}"/>
</apex:selectList>
</apex:pageBlock>
</apex:form>
</apex:page>
Am I missing something here? Please suggest some workaround.
Thanks.