O'Reilly logo

PrimeFaces Beginner's Guide by K. Siva Prasad Reddy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – creating a Line chart

In this section, we will create a Line chart depicting the number of posts with PrimeFaces and jQuery tags from years 2009 to 2013.

  1. Create a Line chart with custom labels, axis angles, series colors, and enable zooming and animation.
    <p:lineChart value="#{chartController.chartModel}" 
      style="width: 450px; height: 300px;"
      title="Linear Chart" 
      legendPosition="nw" 
      xaxisLabel="Year" yaxisLabel="No. of Posts" 
      xaxisAngle="45" yaxisAngle="45"
      minY="0" maxY="1000"
      breakOnNull="true" zoom="true" animate="true"
      seriesColors="800000,006400"
      legendCols="2"/>
Time for action – creating a Line chart

What just happened?

Here, we have specified the labels and angles ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required