function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jerrymoljerrymol 

Visualforce chart: <Apex:barSeries>, highlightColor is not working..

Hi ,

 

 

I am using a barseries in my page, and i want to reset the highlightColor and highlightStroke color of the bar.

 

I tried it with using the below syntax:

 

  <apex:barSeries orientation="vertical" axis="bottom" xField="month" yField="average" title="Avg SLA" highlight="true" highlightStroke="rgb(206,222,29)" highlightColor="rgb(206,222,29)" />

 

But it is not working,still it is using the default color.

 

Any one experienced the same problem? Please help me with this.. Urgent..

Sonam_SFDCSonam_SFDC

 

Hi,

I see by definition - the doc says the color should be entered in HTML-style (http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_barSeries.htm) For example, #00F,#0F0,#F00
Can you please try specifying the color in this format and see if it works.

 

jerrymoljerrymol

Hi,

 

Even i tried with Hexadecimal values for color as below:

<apex:barSeries orientation="vertical" axis="bottom" xField="month" yField="average" title="Avg SLA" highlight="true" highlightLineWidth="1" highlightColor="#F00" highlightStroke="#F00"/>

 

 But it is not working.

 

I think as per the documentation of barSeries, we should give 'A string that specifies the HTML-style color' for highlightStroke and highlightColor properties. Not hexadecimal values as we give to ColorSet property.

But i don't know how to give string value for HTML style color. Even i tried with giving 'Red' And 'Orange' (String representation of color), but it is not working..

 

Can anyone help with me this..

Shiva Ramesh @ xcdhrShiva Ramesh @ xcdhr

Hi

 

You should use HTML color codes. USe following link: http://html-color-codes.info/

 

you should give value like this 

highlightColor="#5CB52F"
jerrymoljerrymol

Hi,

 

I have already tried this, but it doesn't works.

 

 <apex:barSeries orientation="vertical" axis="bottom" xField="month" yField="average" title="Avg SLA" highlight="true" highlightLineWidth="1" highlightColor="#FF0000" highlightStroke="#FF0000"/>

 

Still it is taking the default color for highlight bar...(see the below snap shot)

 

 

any other way..???

Shiva Ramesh @ xcdhrShiva Ramesh @ xcdhr

Use colorset attribute

<apex:barSeries title="Data1" orientation="vertical" axis="right"  xField="name" yField="data1,data2,data3" colorSet="red">
jerrymoljerrymol

I want to reset the highlight color of bar when we put mouse over it(i.e, highlightColor property), not the fill color of bars...

 

Shiva Ramesh @ xcdhrShiva Ramesh @ xcdhr

Could you please post your full page code

jerrymoljerrymol
<apex:page controller="OppsChartController" showHeader="false" sidebar="false">
    <apex:sectionHeader title="Opportunity Analysis for 2011"/>
    <apex:chart height="380" width="700" data="{!oppDataWithMonthNames}" theme="Green">
        <apex:legend position="right"/>
        <apex:axis type="Numeric" position="left" fields="monthlyRev"
            title="Revenue ($)"/>
        <apex:axis type="Category" position="bottom" fields="month"
            title="Month of the Year">
            <apex:chartLabel rotate="315"/>
        </apex:axis>
        <apex:barSeries title="Monthly Sales" orientation="vertical" axis="left"
            xField="month" yField="monthlyRev" highlight="true" highlightLineWidth="1" highlightColor="#5CB52F" highlightStroke="#FF0000">
            <apex:chartTips height="20" width="120"/>
        </apex:barSeries>
        <apex:axis type="Numeric" position="right" fields="noOfClosedOpps"
            title="Opportunities Closed" grid="true"/>
      
    </apex:chart>
</apex:page>