protected internal virtual void drawInterval(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, IntervalCategoryDataset dataset, int row, int column) { int visibleSeriesIndex = state.getVisibleSeriesIndex(row); if (visibleSeriesIndex < 0) return; int num1 = state.getVisibleSeriesCount() < 0 ? this.getRowCount() : state.getVisibleSeriesCount(); int columnCount = this.getColumnCount(); PlotOrientation orientation = plot.getOrientation(); double num2 = 0.0; double num3 = 0.0; RectangleEdge domainAxisEdge = plot.getDomainAxisEdge(); RectangleEdge rangeAxisEdge = plot.getRangeAxisEdge(); Number endValue = dataset.getEndValue(row, column); if (endValue == null) return; double num4 = rangeAxis.valueToJava2D(endValue.doubleValue(), dataArea, rangeAxisEdge); Number startValue = dataset.getStartValue(row, column); if (startValue == null) return; double num5 = rangeAxis.valueToJava2D(startValue.doubleValue(), dataArea, rangeAxisEdge); if (num5 < num4) { double num6 = num5; num5 = num4; num4 = num6; } double num7 = state.getBarWidth(); double num8 = Math.abs(num5 - num4); RectangleEdge re = RectangleEdge.__\u003C\u003ELEFT; if (orientation == PlotOrientation.__\u003C\u003EHORIZONTAL) { double categoryStart = domainAxis.getCategoryStart(column, this.getColumnCount(), dataArea, domainAxisEdge); if (num1 > 1) { double num6 = ((RectangularShape) dataArea).getHeight() * this.getItemMargin() / (double) (columnCount * (num1 - 1)); num3 = categoryStart + (double) visibleSeriesIndex * (state.getBarWidth() + num6); } else num3 = categoryStart + (double) visibleSeriesIndex * state.getBarWidth(); num2 = num4; num8 = state.getBarWidth(); num7 = Math.abs(num5 - num4); re = RectangleEdge.__\u003C\u003ELEFT; } else if (orientation == PlotOrientation.__\u003C\u003EVERTICAL) { double categoryStart = domainAxis.getCategoryStart(column, this.getColumnCount(), dataArea, domainAxisEdge); if (num1 > 1) { double num6 = ((RectangularShape) dataArea).getWidth() * this.getItemMargin() / (double) (columnCount * (num1 - 1)); num2 = categoryStart + (double) visibleSeriesIndex * (state.getBarWidth() + num6); } else num2 = categoryStart + (double) visibleSeriesIndex * state.getBarWidth(); num3 = num4; re = RectangleEdge.__\u003C\u003EBOTTOM; } Rectangle2D.Double @double = new Rectangle2D.Double(num2, num3, num7, num8); BarPainter barPainter = this.getBarPainter(); if (this.getShadowsVisible()) barPainter.paintBarShadow(g2, (BarRenderer) this, row, column, (RectangularShape) @double, re, false); this.getBarPainter().paintBar(g2, (BarRenderer) this, row, column, (RectangularShape) @double, re); CategoryItemLabelGenerator itemLabelGenerator = this.getItemLabelGenerator(row, column); if (itemLabelGenerator != null && this.isItemLabelVisible(row, column)) this.drawItemLabel(g2, (CategoryDataset) dataset, row, column, plot, itemLabelGenerator, (Rectangle2D) @double, false); EntityCollection entityCollection = state.getEntityCollection(); if (entityCollection == null) return; this.addItemEntity(entityCollection, (CategoryDataset) dataset, row, column, (Shape) @double); }
public static JFreeChart createGanttChart(string title, string categoryAxisLabel, string dateAxisLabel, IntervalCategoryDataset dataset, bool legend, bool tooltips, bool urls) { int num1 = tooltips ? 1 : 0; int num2 = urls ? 1 : 0; int num3 = legend ? 1 : 0; CategoryAxis domainAxis = new CategoryAxis(categoryAxisLabel); DateAxis dateAxis = new DateAxis(dateAxisLabel); GanttRenderer ganttRenderer = new GanttRenderer(); if (num1 != 0) ganttRenderer.setBaseToolTipGenerator((CategoryToolTipGenerator) new IntervalCategoryToolTipGenerator("{3} - {4}", DateFormat.getDateInstance())); if (num2 != 0) ganttRenderer.setBaseItemURLGenerator((CategoryURLGenerator) new StandardCategoryURLGenerator()); CategoryPlot categoryPlot = new CategoryPlot((CategoryDataset) dataset, domainAxis, (ValueAxis) dateAxis, (CategoryItemRenderer) ganttRenderer); categoryPlot.setOrientation(PlotOrientation.__\u003C\u003EHORIZONTAL); JFreeChart.__\u003Cclinit\u003E(); JFreeChart jfc = new JFreeChart(title, JFreeChart.__\u003C\u003EDEFAULT_TITLE_FONT, (Plot) categoryPlot, num3 != 0); ChartFactory.currentTheme.apply(jfc); return jfc; }