1

I'm using primefaces 6.0 and tried to create line chart,its working fine. But i want to customize the color of valid interval.

my xhtml

<p:chart type="line" model="#{showChartMB.newModelAgr}" style="height:300px;width:350px;" />

method for chart:

private void createLineModelsAgr(int uid, List<Report> newRangeAgr) {
    newModelAgr = initLinearModelAgr(uid, newRangeAgr);
    newModelAgr.setExtender("chartExtender");
    newModelAgr.setTitle("Albumin/Globumin ratio");
    newModelAgr.setLegendPosition("e");
    org.primefaces.model.chart.Axis yAxis = newModelAgr.getAxis(AxisType.Y);
    yAxis.setMin(1);
    yAxis.setMax(4);
    yAxis.setLabel("Range");
    org.primefaces.model.chart.Axis xAxis = newModelAgr.getAxis(AxisType.X);
    xAxis.setMin(1);
    xAxis.setMax(10);
    newModelAgr.setAnimate(true);
    newModelAgr.setSeriesColors("#4bb2c5");
    xAxis.setLabel("Time -->");

}

Here i want to change the background color for range 2 to 3 along yAxis.

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
dpshkhnl
  • 86
  • 1
  • 6

0 Answers0