com.save.bi.MaintenanceSummaryLineChart.java Source code

Java tutorial

Introduction

Here is the source code for com.save.bi.MaintenanceSummaryLineChart.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.save.bi;

import com.save.bi.serviceprovider.MRSummaryServiceImpl;
import com.save.common.CommonButton;
import com.save.common.CommonComboBox;
import com.save.main.service.MRSummaryService;
import com.save.model.MaintenanceReimbursement;
import com.vaadin.ui.Button;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.VerticalLayout;
import org.jfree.chart.JFreeChart;
import org.jfree.data.category.DefaultCategoryDataset;

/**
 *
 * @author jetdario
 */
public class MaintenanceSummaryLineChart extends VerticalLayout {

    MRSummaryService mrss = new MRSummaryServiceImpl();

    public MaintenanceSummaryLineChart() {
        setSizeFull();

        HorizontalLayout h = new HorizontalLayout();
        h.setWidth("100%");
        h.setSpacing(true);

        ComboBox area = CommonComboBox.areas();
        area.setCaption(null);
        area.setInputPrompt("Select an Area.. ");
        area.setWidth("100px");
        h.addComponent(area);

        ComboBox year = CommonComboBox.yearList();
        year.setInputPrompt("Select a Year.. ");
        year.setWidth("100px");
        h.addComponent(year);

        Button button = new CommonButton("Generate Line Chart");
        button.setWidthUndefined();
        h.addComponent(button);
        h.setExpandRatio(button, 3);

        addComponent(h);
    }

    //    JFreeChart maintenanceLineChart(int year){
    //        DefaultCategoryDataset dataset = new DefaultCategoryDataset();
    //        for(int i = 1; i < 13; i++){
    //            dataset.
    //        }
    //    }
}