package io.gisbi.chart.charts.impl.others;

import io.gisbi.chart.charts.impl.DefaultChartHandler;
import io.gisbi.chart.charts.impl.YoyChartHandler;
import io.gisbi.extensions.view.dto.AxisFormatResult;
import io.gisbi.extensions.view.dto.ChartAxis;
import io.gisbi.extensions.view.dto.ChartViewDTO;
import lombok.Getter;
import org.springframework.stereotype.Component;

@Component
public class RadarHandler extends YoyChartHandler {
    @Getter
    private String type = "radar";

    @Override
    public AxisFormatResult formatAxis(ChartViewDTO view) {
        var result = super.formatAxis(view);
        var yAxis = result.getAxisMap().get(ChartAxis.yAxis);
        yAxis.addAll(view.getExtLabel());
        yAxis.addAll(view.getExtTooltip());
        result.getAxisMap().put(ChartAxis.extLabel, view.getExtLabel());
        result.getAxisMap().put(ChartAxis.extTooltip, view.getExtTooltip());
        return result;
    }
}
