0

I build chart in visualforce and embedded to page section in standard Page layout with scroll bar enable properties. It works fine in if page section is load in Show Section mode, and it works when we click the arrow Hide/Show Section without refreshing the page.It will not work if page is load is Hide section.However it only happen in Internet Explorer, it works fine in Chrome.I am not sure is it Salesforce bug or it 's something wrong with the code.

The working chart.Load in Show section mode. It works fine if Page load in Show Section mode

Not working.In order to replicate this, click Hide Section, Refrech the page then click Show Section. Not working.In order to replicate this, click Hide Section, Refrech the page then click Show Section.

Visualforce Page:

<apex:page standardController="Opportunity" extensions="Opportunity_Chart_Comp_Ctrl" showHeader="false" sidebar="false" >
   <c:Opportunity_Strength_Comp oppIdParam="{!opportunity.Id}" />
</apex:page>

Visualforce component

<apex:component controller="Opportunity_Chart_Comp_Ctrl" allowDML="true">
<apex:attribute name="oppIdParam"  type="Id" description="opportunity id value" assignTo="{!oppId}"/>
 <apex:pageBlockSectionItem >-->
<apex:chart height="350px" width="500px" legend="true" data="{!data}"   >
    <apex:legend position="left" font="10px Helvetica" spacing="1"/>
     <apex:axis type="Radial" position="radial"  steps="2" minimum="0" maximum="10" >
        <apex:chartLabel />
    </apex:axis>
    <apex:radarSeries xField="name" yField="data1" title="{!lstTitle[0]}" tips="true" opacity="0.4" markerType="circle" rendered="{!lstIsRender[0]}" />
    <apex:radarSeries xField="name" yField="data2" title="{!lstTitle[1]}" tips="true" opacity="0.4" markerType="circle" rendered="{!lstIsRender[1]}" />
     </apex:chart>
</apex:component>
  • I want to add, today Sfdc support reply to me that it is maybe something wrong my code.So I went to tutorial developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/… and copy paste exactly except I have to put standard controller ='Opportunity' and the pie chart in tutorial also not render correctly. – unidha Jul 18 '17 at 3:43
0

From the screen shot, it looks to me like the chart may be checking the size of the area it is in when it is first rendered (so it can scale down to suit) and with the section collapsed that size is zero (at least in IE).

Not sure how to fix; one thing to try is adding a fixed size div around the chart:

<div style="height: 350px; width: 500px;">
    <apex:chart ...
</div>
| improve this answer | |
  • I tried, it does'nt work. – unidha Jul 13 '17 at 9:51
  • @unidha Assuming apex:chart is emitting svg elements this may be the problem github.com/karlhorky/gray/issues/40. – Keith C Jul 13 '17 at 10:46
  • Thanks for the link but i m not quite understand what the forum discuss.If this related display to none I assume it referring to Page Section which is standard feature when we setup page section in page layout. How I am going to solve it? – unidha Jul 14 '17 at 7:17
  • @unidha Arguably it is a Salesforce bug confined to IE (because IE behaves differently to other browsers in this case). Difficult to work-around: simplest would be to always start with the section open to avoid the problem. – Keith C Jul 14 '17 at 8:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.