JFreeChart разных цветов в разных регионах для одного и того же dataSeries

ВJFreeChart Я пытаюсь раскрасить разные области линейной диаграммы / кривой XY на основеy значение. Я переопределяюXYLineAndShapeRenderer& APOS; sgetItemPaint(int row, int col)однако я не уверен, как он справляется с окраской линии междуxтак как это только становитсяitemPaint наx (целочисленные значения).

final XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer() {
    @Override

    @Override
    public Paint getItemPaint(int row, int col) {
        System.out.println(col+","+dataset.getY(row, col));
        double y=dataset.getYValue(row, col);
        if(y<=3)return ColorUtil.hex2Rgb("#7DD2F7");
        if(y<=4)return ColorUtil.hex2Rgb("#9BCB3B");
        if(y<=5)return ColorUtil.hex2Rgb("#FFF100");
        if(y<=6)return ColorUtil.hex2Rgb("#FAA419");
        if(y<=10)return ColorUtil.hex2Rgb("#ED1B24");

        //getPlot().getDataset(col).
        return super.getItemPaint(row,col);
    }
}

Ответы на вопрос(1)

Ваш ответ на вопрос