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
janujanu 

How to put a label on top of each bar in bar chart?

In a visualforce barchart, we need to be able to put a label on top of each bar which reads the peakvalue of that particular bar

Boman@imtBoman@imt

Not sure VF built-in charting can do it. But, with Google Charting you can use the chm and chd params.

janujanu

Thanks Boman !!!

 

My actual requirement is :

 

I have an apex class from which I am getting the data using List  to the VF page, and i could see the result,

but have to get the label at the top of the bar

WilmerWilmer
I found the solution in another post. It is necessary to use the chartLabel tag inside the barSeries code block.

Here is the sample code for the solution.
<apex:barSeries title="Areas" orientation="vertical" axis="left"
			            xField="name" yField="data1" tips="true">
       <apex:chartTips height="20" width="120"/>
       <apex:chartLabel field="data1" display="outside" orientation="vertical"/>
</apex:barSeries>