What happens is if I set a minX and maxX and a height, well a combination of those things makes primefaces use some algorithm to determine what numbers should be displayed on the X and Y axis. The problem is if you don't set the chart up exactly correct, the numbers being displayed end up having 5 decimal places. Is there any fix for this? Even when you hover over the markers the data that is displayed is the data I entered with trailing zeros, and it looks really weird.
At the very least in the future there should be something like incrementX and incrementY. And the numbers inside of the chart should always display what was inputed into it...
Code: Select all
<p:lineChart id="linear" value="#{myChartModelBean.chartModel}" legendPosition="e"
title="Linear Chart" minY="0" maxY="7" minX="0" style="height:400px"/>
public CartesianChartModel getChartModel() {
myModel = new CartesianChartModel();
LineChartSeries chartSeries= new LineChartSeries();
chartSeries.set(1, 2);
chartSeries.set(2, 1);
chartSeries.set(3, 3);
chartSeries.set(4, 6);
chartSeries.set(5, 8);
myModel .addSeries(chartSeries);
return myModel ;
}