InventoryChartDataModel unconfirmed = createInventoryDataModel(inventory,								  UNCONFIRMED_LEGEND);   ChartDataModel dm = new InventoryShortfallChartDataModel(actual, requested, unconfirmed); ChartDataView chartDataView = new ChartDataView(); chartDataView.setDataSource(dm); chart.setDataView(viewIndex, chartDataView); viewIndex++; dataViews.put(chartDataView, dm); int tmp = chartDataView.getNumSeries(); if (tmp == 0) {  System.out.println("InventoryChart no shortfalls"); } for (int ii = 0; ii < tmp; ii++) { ChartDataViewSeries series = chartDataView.getSeries(ii); String lbl = series.getLabel();   if (lbl.equals(InventoryShortfallChartDataModel.DUE_OUT_SHORTFALL_LABEL)) {  setSeriesColor(series, new Color(0,204,0));  series.getStyle().setSymbolSize(0); series.getStyle().setLineWidth(2);    } else if (lbl.equals(InventoryShortfallChartDataModel.UNCONFIRMED_DUE_IN_SHORTFALL_LABEL)) {  setSeriesColor(series, new Color(204,51,255));   series.getStyle().setLineWidth(4); series.getStyle().setSymbolSize(0);  } else if (lbl.equals(InventoryShortfallChartDataModel.CONFIRMED_DUE_IN_SHORTFALL_LABEL)) { setSeriesColor(series, Color.cyan); series.getStyle().setSymbolSize(0); series.getStyle().setLineWidth(2); } else if (lbl.equals(InventoryShortfallChartDataModel.PROJECTED_DUE_OUT_SHORTFALL_LABEL)) { setSeriesColor(series, new Color(255,51,0)); series.getStyle().setSymbolSize(0); series.getStyle().setLineWidth(2); } else { System.err.println("InventoryChart shortfall series with unrecongized label <"+lbl+">"); }  } removeableViews.add(chartDataView);
computeAndInitializeShortfall(inventory,actual,requested);
    private void initializeTotalInventoryChart(String title, UISimpleInventory inventory) {	Vector scheduleTypes;	// if no on hand schedule, then don't plot an inventory graph	if (inventory.getNamedSchedule(UISimpleNamedSchedule.ON_HAND) == null) {	    JOptionPane.showMessageDialog(null, "No data received",					  "No data received",					  JOptionPane.ERROR_MESSAGE);	    return;	}	// Title and chart	title = "Inventory of " + inventory.getAssetName() + " at " + title;	setChartTitle(title);	equalizeInventorySchedule(inventory);     	// On Hand	// MWD Remove	//scheduleTypes = new Vector(1);	//scheduleTypes.addElement(UISimpleNamedSchedule.ON_HAND);	InventoryChartDataModel chartDataModel = createInventoryDataModel(inventory, 									  INVENTORY_LEGEND);	ChartDataView icv = addView(chart, JCChart.BAR, chartDataModel);	((JCBarChartFormat)icv.getChartFormat()).setClusterWidth(100);	icv.setOutlineColor(colorTable.get(UISimpleNamedSchedule.ON_HAND));	// Requested	// MWD Remove	//scheduleTypes = new Vector(3);	//scheduleTypes.addElement(UISimpleNamedSchedule.REQUESTED_DUE_IN);	//scheduleTypes.addElement(UISimpleNamedSchedule.REQUESTED_DUE_OUT);	//scheduleTypes.addElement(UISimpleNamedSchedule.PROJECTED_REQUESTED_DUE_OUT);	InventoryChartDataModel requested = createInventoryDataModel(inventory, 								     REQUESTED_INVENTORY_LEGEND);	addView(chart, JCChart.BAR, requested);	// Actual	// MWD Remove	//scheduleTypes = new Vector(3);	//scheduleTypes.add(UISimpleNamedSchedule.DUE_IN);	//scheduleTypes.add(UISimpleNamedSchedule.DUE_OUT);	//scheduleTypes.add(UISimpleNamedSchedule.PROJECTED_DUE_OUT);	InventoryChartDataModel actual = createInventoryDataModel(inventory, 								  ACTUAL_INVENTORY_LEGEND);	addView(chart, JCChart.BAR, actual);	// do not add to chart separatly - only used to calc shortfall	// MWD Remove	//scheduleTypes = new Vector(1);	//scheduleTypes.add(UISimpleNamedSchedule.UNCONFIRMED_DUE_IN);	InventoryChartDataModel unconfirmed = createInventoryDataModel(inventory,								  UNCONFIRMED_LEGEND);	// Shortfalls	ChartDataModel dm = 	    new InventoryShortfallChartDataModel(actual, requested, unconfirmed);	ChartDataView chartDataView = new ChartDataView();	chartDataView.setDataSource(dm);	chart.setDataView(viewIndex, chartDataView);	viewIndex++;	dataViews.put(chartDataView, dm);	int tmp = chartDataView.getNumSeries();	if (tmp == 0) {	    // print no shortfalls	     System.out.println("InventoryChart no shortfalls");	}	for (int ii = 0; ii < tmp; ii++) {	 ChartDataViewSeries series = chartDataView.getSeries(ii);	 String lbl = series.getLabel();	 // MWD any orig colors settings are the first commented out ones.	 // Changed to be more in line with the colors of requested and actuals.	 if (lbl.equals(InventoryShortfallChartDataModel.DUE_OUT_SHORTFALL_LABEL)) {	     //setSeriesColor(series, Color.magenta);	     setSeriesColor(series, new Color(0,204,0));	     series.getStyle().setSymbolSize(0);	     series.getStyle().setLineWidth(2);	     //    JCLineStyle line_style = new JCLineStyle(2,  Color.magenta, JCLineStyle.LONG_DASH);	     //    series.getStyle().setLineStyle(line_style);	     //    series.getStyle().setSymbolShape(JCSymbolStyle.CROSS);	 } else if (lbl.equals(InventoryShortfallChartDataModel.UNCONFIRMED_DUE_IN_SHORTFALL_LABEL)) {	     //setSeriesColor(series, new Color(255, 95, 0));	     setSeriesColor(series, new Color(204,51,255));// 	     JCLineStyle line_style = new JCLineStyle(4,  new Color(255, 95, 0), JCLineStyle.SHORT_DASH);// 	     series.getStyle().setLineStyle(line_style);	     series.getStyle().setLineWidth(4);	     series.getStyle().setSymbolSize(0);	     // series.getStyle().setSymbolShape(JCSymbolStyle.DOT);	 } else if (lbl.equals(InventoryShortfallChartDataModel.CONFIRMED_DUE_IN_SHORTFALL_LABEL)) {	     setSeriesColor(series, Color.cyan);	     series.getStyle().setSymbolSize(0);	     series.getStyle().setLineWidth(2);	 } else if (lbl.equals(InventoryShortfallChartDataModel.PROJECTED_DUE_OUT_SHORTFALL_LABEL)) {	     setSeriesColor(series, new Color(255,51,0));	     series.getStyle().setSymbolSize(0);	     series.getStyle().setLineWidth(2);	 } else {	     System.err.println("InventoryChart shortfall series with unrecongized label <"+lbl+">");	 }	 	}	removeableViews.add(chartDataView);    }