Search in sources :

Example 1 with ChartType

use of com.cubrid.cubridmanager.core.monstatistic.model.StatisticParamUtil.ChartType in project cubrid-manager by CUBRID.

the class MonitorStatisticChart method refreshChart.

public void refreshChart(List<StatisticData> statisticDataList) {
    this.statisticDataList = statisticDataList;
    if (chart == null) {
        return;
    }
    int oldDataStatus = isHasValidData ? 1 : 0;
    isHasValidData = false;
    ChartType oldType = chartType;
    XYDataset dataset = createDataset();
    XYPlot plot = chart.getXYPlot();
    int newDataStatus = isHasValidData ? 1 : 0;
    if (!isHasValidData) {
        if (oldDataStatus != newDataStatus) {
            setNoDataPlot(plot);
        }
        plot.setDataset(EMPTY_DATASET);
    } else {
        if (oldDataStatus != newDataStatus) {
            setDataPlot(plot);
        }
        if (chartType != oldType) {
            plot.getRangeAxis().setRange(rangMin, rangMax);
        }
        plot.setDataset(dataset);
    }
}
Also used : XYPlot(org.jfree.chart.plot.XYPlot) ChartType(com.cubrid.cubridmanager.core.monstatistic.model.StatisticParamUtil.ChartType) XYDataset(org.jfree.data.xy.XYDataset)

Aggregations

ChartType (com.cubrid.cubridmanager.core.monstatistic.model.StatisticParamUtil.ChartType)1 XYPlot (org.jfree.chart.plot.XYPlot)1 XYDataset (org.jfree.data.xy.XYDataset)1