Esempio n. 1
0
 public static JFreeChart createXYLineChart(string title, string xAxisLabel, string yAxisLabel, XYDataset dataset, PlotOrientation orientation, bool legend, bool tooltips, bool urls)
 {
   int num1 = tooltips ? 1 : 0;
   int num2 = urls ? 1 : 0;
   int num3 = legend ? 1 : 0;
   if (orientation == null)
   {
     string str = "Null 'orientation' argument.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new IllegalArgumentException(str);
   }
   else
   {
     NumberAxis numberAxis1 = new NumberAxis(xAxisLabel);
     numberAxis1.setAutoRangeIncludesZero(false);
     NumberAxis numberAxis2 = new NumberAxis(yAxisLabel);
     XYLineAndShapeRenderer andShapeRenderer = new XYLineAndShapeRenderer(true, false);
     XYPlot xyPlot = new XYPlot(dataset, (ValueAxis) numberAxis1, (ValueAxis) numberAxis2, (XYItemRenderer) andShapeRenderer);
     xyPlot.setOrientation(orientation);
     if (num1 != 0)
       andShapeRenderer.setBaseToolTipGenerator((XYToolTipGenerator) new StandardXYToolTipGenerator());
     if (num2 != 0)
       andShapeRenderer.setURLGenerator((XYURLGenerator) new StandardXYURLGenerator());
     JFreeChart.__\u003Cclinit\u003E();
     JFreeChart jfc = new JFreeChart(title, JFreeChart.__\u003C\u003EDEFAULT_TITLE_FONT, (Plot) xyPlot, num3 != 0);
     ChartFactory.currentTheme.apply(jfc);
     return jfc;
   }
 }
Esempio n. 2
0
 public XYBarDataset(XYDataset underlying, double barWidth)
 {
   XYBarDataset xyBarDataset = this;
   this.underlying = underlying;
   this.underlying.addChangeListener((DatasetChangeListener) this);
   this.barWidth = barWidth;
 }
Esempio n. 3
0
 public XYItemEntity(Shape area, XYDataset dataset, int series, int item, string toolTipText, string urlText)
   : base(area, toolTipText, urlText)
 {
   XYItemEntity xyItemEntity = this;
   this.dataset = dataset;
   this.series = series;
   this.item = item;
 }
 public static int[] findLiveItems(XYDataset dataset, int series, double xLow, double xHigh)
 {
   int num1 = RendererUtilities.findLiveItemsLowerBound(dataset, series, xLow, xHigh);
   int liveItemsUpperBound = RendererUtilities.findLiveItemsUpperBound(dataset, series, xLow, xHigh);
   if (num1 > liveItemsUpperBound)
     num1 = liveItemsUpperBound;
   int[] numArray = new int[2];
   int index1 = 0;
   int num2 = num1;
   numArray[index1] = num2;
   int index2 = 1;
   int num3 = liveItemsUpperBound;
   numArray[index2] = num3;
   return numArray;
 }
 public IntervalXYDelegate(XYDataset dataset, bool autoWidth)
 {
   int num = autoWidth ? 1 : 0;
   base.\u002Ector();
   IntervalXYDelegate intervalXyDelegate = this;
   if (dataset == null)
   {
     string str = "Null 'dataset' argument.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new IllegalArgumentException(str);
   }
   else
   {
     this.dataset = dataset;
     this.autoWidth = num != 0;
     this.intervalPositionFactor = 0.5;
     this.autoIntervalWidth = double.PositiveInfinity;
     this.fixedIntervalWidth = 1.0;
   }
 }
Esempio n. 6
0
 public static double[] getOLSRegression(XYDataset data, int series)
 {
   int itemCount = data.getItemCount(series);
   if (itemCount < 2)
   {
     string str = "Not enough data.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new IllegalArgumentException(str);
   }
   else
   {
     double num1 = 0.0;
     double num2 = 0.0;
     double num3 = 0.0;
     double num4 = 0.0;
     for (int i2 = 0; i2 < itemCount; ++i2)
     {
       double xvalue = data.getXValue(series, i2);
       double yvalue = data.getYValue(series, i2);
       num1 += xvalue;
       num2 += yvalue;
       double num5 = xvalue * xvalue;
       num3 += num5;
       double num6 = xvalue * yvalue;
       num4 += num6;
     }
     double num7 = num3 - num1 * num1 / (double) itemCount;
     double num8 = num4 - num1 * num2 / (double) itemCount;
     double num9 = num1 / (double) itemCount;
     double num10 = num2 / (double) itemCount;
     double[] numArray = new double[2]
     {
       0.0,
       num8 / num7
     };
     numArray[0] = num10 - numArray[1] * num9;
     return numArray;
   }
 }
 public override Range findRangeBounds(XYDataset dataset)
 {
   if (dataset == null)
     return (Range) null;
   if (this.renderAsPercentages)
     return new Range(0.0, 1.0);
   else
     return DatasetUtilities.findStackedRangeBounds((TableXYDataset) dataset);
 }
 public override XYItemRendererState initialise(Graphics2D g2, Rectangle2D dataArea, XYPlot plot, XYDataset data, PlotRenderingInfo info)
 {
   return (XYItemRendererState) new XYBarRenderer.XYBarRendererState((XYBarRenderer) this, info);
 }
Esempio n. 9
0
 public static double[] getPowerRegression(XYDataset data, int series)
 {
   int itemCount = data.getItemCount(series);
   if (itemCount < 2)
   {
     string str = "Not enough data.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new IllegalArgumentException(str);
   }
   else
   {
     double num1 = 0.0;
     double num2 = 0.0;
     double num3 = 0.0;
     double num4 = 0.0;
     for (int i2 = 0; i2 < itemCount; ++i2)
     {
       double num5 = Math.log(data.getXValue(series, i2));
       double num6 = Math.log(data.getYValue(series, i2));
       num1 += num5;
       num2 += num6;
       double num7 = num5 * num5;
       num3 += num7;
       double num8 = num5 * num6;
       num4 += num8;
     }
     double num9 = num3 - num1 * num1 / (double) itemCount;
     double num10 = num4 - num1 * num2 / (double) itemCount;
     double num11 = num1 / (double) itemCount;
     double num12 = num2 / (double) itemCount;
     double[] numArray = new double[2]
     {
       0.0,
       num10 / num9
     };
     numArray[0] = Math.pow(Math.exp(1.0), num12 - numArray[1] * num11);
     return numArray;
   }
 }
Esempio n. 10
0
 protected internal override void drawPrimaryLineAsPath(XYItemRendererState state, Graphics2D g2, XYPlot plot, XYDataset dataset, int pass, int series, int item, ValueAxis domainAxis, ValueAxis rangeAxis, Rectangle2D dataArea)
 {
   RectangleEdge domainAxisEdge = plot.getDomainAxisEdge();
   RectangleEdge rangeAxisEdge = plot.getRangeAxisEdge();
   double xvalue = dataset.getXValue(series, item);
   double yvalue = dataset.getYValue(series, item);
   double num1 = domainAxis.valueToJava2D(xvalue, dataArea, domainAxisEdge);
   double num2 = rangeAxis.valueToJava2D(yvalue, dataArea, rangeAxisEdge);
   if (!Double.isNaN(num1) && !Double.isNaN(num2))
   {
     XYSplineRenderer.ControlPoint controlPoint = new XYSplineRenderer.ControlPoint(this, plot.getOrientation() != PlotOrientation.__\u003C\u003EHORIZONTAL ? (float) num1 : (float) num2, plot.getOrientation() != PlotOrientation.__\u003C\u003EHORIZONTAL ? (float) num2 : (float) num1);
     if (!this.points.contains((object) controlPoint))
       this.points.add((object) controlPoint);
   }
   if (item != dataset.getItemCount(series) - 1)
     return;
   XYLineAndShapeRenderer.State state1 = (XYLineAndShapeRenderer.State) state;
   if (this.points.size() > 1)
   {
     XYSplineRenderer.ControlPoint controlPoint1 = (XYSplineRenderer.ControlPoint) this.points.get(0);
     ((Path2D.Float) state1.seriesPath).moveTo(controlPoint1.x, controlPoint1.y);
     if (this.points.size() == 2)
     {
       XYSplineRenderer.ControlPoint controlPoint2 = (XYSplineRenderer.ControlPoint) this.points.get(1);
       ((Path2D.Float) state1.seriesPath).lineTo(controlPoint2.x, controlPoint2.y);
     }
     else
     {
       int length = this.points.size();
       float[] numArray1 = new float[length];
       float[] numArray2 = new float[length];
       float[] numArray3 = new float[length];
       float[] numArray4 = new float[length];
       for (int index = 0; index < length; ++index)
       {
         XYSplineRenderer.ControlPoint controlPoint2 = (XYSplineRenderer.ControlPoint) this.points.get(index);
         numArray2[index] = controlPoint2.x;
         numArray1[index] = controlPoint2.y;
       }
       for (int index = 1; index <= length - 1; ++index)
         numArray4[index] = numArray2[index] - numArray2[index - 1];
       float[] numArray5 = new float[length - 1];
       float[] numArray6 = new float[length - 1];
       float[] numArray7 = new float[length - 1];
       for (int index = 1; index <= length - 2; ++index)
       {
         numArray6[index] = (numArray4[index] + numArray4[index + 1]) / 3f;
         numArray7[index] = numArray4[index + 1] / 6f;
         numArray5[index] = numArray4[index] / 6f;
         numArray3[index] = (numArray1[index + 1] - numArray1[index]) / numArray4[index + 1] - (numArray1[index] - numArray1[index - 1]) / numArray4[index];
       }
       this.solveTridiag(numArray5, numArray6, numArray7, numArray3, length - 2);
       float num3 = numArray2[0];
       float num4 = numArray1[0];
       ((Path2D.Float) state1.seriesPath).moveTo(num3, num4);
       for (int index1 = 1; index1 <= length - 1; ++index1)
       {
         for (int index2 = 1; index2 <= this.precision; ++index2)
         {
           float num5 = numArray4[index1] * (float) index2 / (float) this.precision;
           float num6 = numArray4[index1] - num5;
           float num7 = (((float) (-(double) numArray3[index1 - 1] / 6.0) * (num6 + numArray4[index1]) * num5 + numArray1[index1 - 1]) * num6 + ((float) (-(double) numArray3[index1] / 6.0) * (num5 + numArray4[index1]) * num6 + numArray1[index1]) * num5) / numArray4[index1];
           float num8 = numArray2[index1 - 1] + num5;
           ((Path2D.Float) state1.seriesPath).lineTo(num8, num7);
         }
       }
     }
     this.drawFirstPassShape(g2, pass, series, item, (Shape) state1.seriesPath);
   }
   this.points = new Vector();
 }
Esempio n. 11
0
 public virtual void setDataset(XYDataset dataset)
 {
   this.dataset = dataset;
 }
Esempio n. 12
0
 public XYPlot(XYDataset dataset, ValueAxis domainAxis, ValueAxis rangeAxis, XYItemRenderer renderer)
 {
   XYPlot xyPlot = this;
   this.quadrantOrigin = (Point2D) new Point2D.Double(0.0, 0.0);
   Paint[] paintArray = new Paint[4];
   int index1 = 0;
   // ISSUE: variable of the null type
   __Null local1 = null;
   paintArray[index1] = (Paint) local1;
   int index2 = 1;
   // ISSUE: variable of the null type
   __Null local2 = null;
   paintArray[index2] = (Paint) local2;
   int index3 = 2;
   // ISSUE: variable of the null type
   __Null local3 = null;
   paintArray[index3] = (Paint) local3;
   int index4 = 3;
   // ISSUE: variable of the null type
   __Null local4 = null;
   paintArray[index4] = (Paint) local4;
   this.quadrantPaint = paintArray;
   this.domainCrosshairLockedOnData = true;
   this.rangeCrosshairLockedOnData = true;
   this.datasetRenderingOrder = DatasetRenderingOrder.__\u003C\u003EREVERSE;
   this.seriesRenderingOrder = SeriesRenderingOrder.__\u003C\u003EREVERSE;
   this.orientation = PlotOrientation.__\u003C\u003EVERTICAL;
   this.weight = 1;
   this.axisOffset = RectangleInsets.__\u003C\u003EZERO_INSETS;
   this.domainAxes = new ObjectList();
   this.domainAxisLocations = new ObjectList();
   this.foregroundDomainMarkers = (Map) new HashMap();
   this.backgroundDomainMarkers = (Map) new HashMap();
   this.rangeAxes = new ObjectList();
   this.rangeAxisLocations = new ObjectList();
   this.foregroundRangeMarkers = (Map) new HashMap();
   this.backgroundRangeMarkers = (Map) new HashMap();
   this.datasets = new ObjectList();
   this.renderers = new ObjectList();
   this.datasetToDomainAxesMap = (Map) new TreeMap();
   this.datasetToRangeAxesMap = (Map) new TreeMap();
   this.annotations = (List) new ArrayList();
   this.datasets.set(0, (object) dataset);
   if (dataset != null)
     dataset.addChangeListener((DatasetChangeListener) this);
   this.renderers.set(0, (object) renderer);
   if (renderer != null)
   {
     renderer.setPlot(this);
     renderer.addChangeListener((RendererChangeListener) this);
   }
   this.domainAxes.set(0, (object) domainAxis);
   this.mapDatasetToDomainAxis(0, 0);
   if (domainAxis != null)
   {
     domainAxis.setPlot((Plot) this);
     domainAxis.addChangeListener((AxisChangeListener) this);
   }
   this.domainAxisLocations.set(0, (object) AxisLocation.__\u003C\u003EBOTTOM_OR_LEFT);
   this.rangeAxes.set(0, (object) rangeAxis);
   this.mapDatasetToRangeAxis(0, 0);
   if (rangeAxis != null)
   {
     rangeAxis.setPlot((Plot) this);
     rangeAxis.addChangeListener((AxisChangeListener) this);
   }
   this.rangeAxisLocations.set(0, (object) AxisLocation.__\u003C\u003EBOTTOM_OR_LEFT);
   this.configureDomainAxes();
   this.configureRangeAxes();
   this.domainGridlinesVisible = true;
   this.domainGridlineStroke = XYPlot.__\u003C\u003EDEFAULT_GRIDLINE_STROKE;
   this.domainGridlinePaint = XYPlot.__\u003C\u003EDEFAULT_GRIDLINE_PAINT;
   this.domainMinorGridlinesVisible = false;
   this.domainMinorGridlineStroke = XYPlot.__\u003C\u003EDEFAULT_GRIDLINE_STROKE;
   this.domainMinorGridlinePaint = (Paint) Color.white;
   this.domainZeroBaselineVisible = false;
   this.domainZeroBaselinePaint = (Paint) Color.black;
   this.domainZeroBaselineStroke = (Stroke) new BasicStroke(0.5f);
   this.rangeGridlinesVisible = true;
   this.rangeGridlineStroke = XYPlot.__\u003C\u003EDEFAULT_GRIDLINE_STROKE;
   this.rangeGridlinePaint = XYPlot.__\u003C\u003EDEFAULT_GRIDLINE_PAINT;
   this.rangeMinorGridlinesVisible = false;
   this.rangeMinorGridlineStroke = XYPlot.__\u003C\u003EDEFAULT_GRIDLINE_STROKE;
   this.rangeMinorGridlinePaint = (Paint) Color.white;
   this.rangeZeroBaselineVisible = false;
   this.rangeZeroBaselinePaint = (Paint) Color.black;
   this.rangeZeroBaselineStroke = (Stroke) new BasicStroke(0.5f);
   this.domainCrosshairVisible = false;
   this.domainCrosshairValue = 0.0;
   this.domainCrosshairStroke = XYPlot.__\u003C\u003EDEFAULT_CROSSHAIR_STROKE;
   this.domainCrosshairPaint = XYPlot.__\u003C\u003EDEFAULT_CROSSHAIR_PAINT;
   this.rangeCrosshairVisible = false;
   this.rangeCrosshairValue = 0.0;
   this.rangeCrosshairStroke = XYPlot.__\u003C\u003EDEFAULT_CROSSHAIR_STROKE;
   this.rangeCrosshairPaint = XYPlot.__\u003C\u003EDEFAULT_CROSSHAIR_PAINT;
 }
 public override XYItemRendererState initialise(Graphics2D g2, Rectangle2D dataArea, XYPlot plot, XYDataset dataset, PlotRenderingInfo info)
 {
   DeviationRenderer.State state = new DeviationRenderer.State(info);
   state.seriesPath = new GeneralPath();
   state.setProcessVisibleItemsOnly(false);
   return (XYItemRendererState) state;
 }
 public virtual void drawSeries(Graphics2D g2, Rectangle2D dataArea, PlotRenderingInfo info, PolarPlot plot, XYDataset dataset, int seriesIndex)
 {
   Polygon polygon = new Polygon();
   int itemCount = dataset.getItemCount(seriesIndex);
   for (int i2 = 0; i2 < itemCount; ++i2)
   {
     double xvalue = dataset.getXValue(seriesIndex, i2);
     double yvalue = dataset.getYValue(seriesIndex, i2);
     Point point = plot.translateValueThetaRadiusToJava2D(xvalue, yvalue, dataArea);
     polygon.addPoint((int) point.x, (int) point.y);
   }
   g2.setPaint(this.lookupSeriesPaint(seriesIndex));
   g2.setStroke(this.lookupSeriesStroke(seriesIndex));
   if (this.isSeriesFilled(seriesIndex))
   {
     Composite composite = g2.getComposite();
     g2.setComposite((Composite) AlphaComposite.getInstance(3, 0.5f));
     g2.fill((Shape) polygon);
     g2.setComposite(composite);
   }
   else
     g2.draw((Shape) polygon);
 }
Esempio n. 15
0
 public static XYDataset createMovingAverage(XYDataset source, string suffix, double period, double skip)
 {
   if (source == null)
   {
     string str = "Null source (XYDataset).";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new IllegalArgumentException(str);
   }
   else
   {
     XYSeriesCollection seriesCollection = new XYSeriesCollection();
     for (int index = 0; index < source.getSeriesCount(); ++index)
     {
       XYSeries movingAverage = MovingAverage.createMovingAverage(source, index, new StringBuffer().append((object) source.getSeriesKey(index)).append(suffix).toString(), period, skip);
       seriesCollection.addSeries(movingAverage);
     }
     return (XYDataset) seriesCollection;
   }
 }
Esempio n. 16
0
 public static XYDataset createMovingAverage(XYDataset source, string suffix, long period, long skip)
 {
   return MovingAverage.createMovingAverage(source, suffix, (double) period, (double) skip);
 }
Esempio n. 17
0
 public static XYSeries createMovingAverage(XYDataset source, int series, string name, double period, double skip)
 {
   if (source == null)
   {
     string str = "Null source (XYDataset).";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new IllegalArgumentException(str);
   }
   else if (period < 4.94065645841247E-324)
   {
     string str = "period must be positive.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new IllegalArgumentException(str);
   }
   else if (skip < 0.0)
   {
     string str = "skip must be >= 0.0.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new IllegalArgumentException(str);
   }
   else
   {
     XYSeries xySeries = new XYSeries((IComparable) name);
     if (source.getItemCount(series) > 0)
     {
       double num1 = source.getXValue(series, 0) + skip;
       int i2 = source.getItemCount(series) - 1;
       while (i2 >= 0)
       {
         double xvalue1 = source.getXValue(series, i2);
         if (xvalue1 >= num1)
         {
           int num2 = 0;
           double num3 = 0.0;
           double num4 = xvalue1 - period;
           int num5 = 0;
           int num6 = 0;
           while (num6 == 0)
           {
             if (i2 - num5 >= 0)
             {
               double xvalue2 = source.getXValue(series, i2 - num5);
               Number y = source.getY(series, i2 - num5);
               if (xvalue2 > num4)
               {
                 if (y != null)
                 {
                   num3 += y.doubleValue();
                   ++num2;
                 }
               }
               else
                 num6 = 1;
             }
             else
               num6 = 1;
             ++num5;
           }
           if (num2 > 0)
             xySeries.add(xvalue1, num3 / (double) num2);
           else
             xySeries.add(xvalue1, (Number) null);
         }
         i2 += -1;
       }
     }
     return xySeries;
   }
 }
 public IntervalXYDelegate(XYDataset dataset)
   : this(dataset, true)
 {
 }
 public override void drawItem(Graphics2D g2, XYItemRendererState state, Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, int series, int item, CrosshairState crosshairState, int pass)
 {
   if (!(dataset is IntervalXYDataset) || !(dataset is TableXYDataset))
   {
     string str1 = new StringBuffer().append("dataset (type ").append(Object.instancehelper_getClass((object) dataset).getName()).append(") has wrong type:").toString();
     int num = 0;
     if (!(StackedXYBarRenderer.class\u0024org\u0024jfree\u0024data\u0024xy\u0024IntervalXYDataset != null ? StackedXYBarRenderer.class\u0024org\u0024jfree\u0024data\u0024xy\u0024IntervalXYDataset : (StackedXYBarRenderer.class\u0024org\u0024jfree\u0024data\u0024xy\u0024IntervalXYDataset = StackedXYBarRenderer.class\u0024("org.jfree.data.xy.IntervalXYDataset"))).isAssignableFrom(Object.instancehelper_getClass((object) dataset)))
     {
       str1 = new StringBuffer().append(str1).append(" it is no IntervalXYDataset").toString();
       num = 1;
     }
     if (!(StackedXYBarRenderer.class\u0024org\u0024jfree\u0024data\u0024xy\u0024TableXYDataset != null ? StackedXYBarRenderer.class\u0024org\u0024jfree\u0024data\u0024xy\u0024TableXYDataset : (StackedXYBarRenderer.class\u0024org\u0024jfree\u0024data\u0024xy\u0024TableXYDataset = StackedXYBarRenderer.class\u0024("org.jfree.data.xy.TableXYDataset"))).isAssignableFrom(Object.instancehelper_getClass((object) dataset)))
     {
       if (num != 0)
         str1 = new StringBuffer().append(str1).append(" and").toString();
       str1 = new StringBuffer().append(str1).append(" it is no TableXYDataset").toString();
     }
     string str2 = str1;
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new IllegalArgumentException(str2);
   }
   else
   {
     IntervalXYDataset ntervalXyDataset = (IntervalXYDataset) dataset;
     double yvalue1 = ntervalXyDataset.getYValue(series, item);
     if (Double.isNaN(yvalue1))
       return;
     double num1 = 0.0;
     if (this.renderAsPercentages)
     {
       num1 = DatasetUtilities.calculateStackTotal((TableXYDataset) dataset, item);
       yvalue1 /= num1;
     }
     double d1 = 0.0;
     double d2 = 0.0;
     for (int i1 = 0; i1 < series; ++i1)
     {
       double yvalue2 = dataset.getYValue(i1, item);
       if (!Double.isNaN(yvalue2))
       {
         if (this.renderAsPercentages)
           yvalue2 /= num1;
         if (yvalue2 > 0.0)
           d1 += yvalue2;
         else
           d2 += yvalue2;
       }
     }
     RectangleEdge rangeAxisEdge = plot.getRangeAxisEdge();
     double num2;
     double num3;
     if (yvalue1 > 0.0)
     {
       num2 = rangeAxis.valueToJava2D(d1, dataArea, rangeAxisEdge);
       num3 = rangeAxis.valueToJava2D(d1 + yvalue1, dataArea, rangeAxisEdge);
     }
     else
     {
       num2 = rangeAxis.valueToJava2D(d2, dataArea, rangeAxisEdge);
       num3 = rangeAxis.valueToJava2D(d2 + yvalue1, dataArea, rangeAxisEdge);
     }
     RectangleEdge domainAxisEdge = plot.getDomainAxisEdge();
     double startXvalue = ntervalXyDataset.getStartXValue(series, item);
     if (Double.isNaN(startXvalue))
       return;
     double num4 = domainAxis.valueToJava2D(startXvalue, dataArea, domainAxisEdge);
     double endXvalue = ntervalXyDataset.getEndXValue(series, item);
     if (Double.isNaN(endXvalue))
       return;
     double num5 = domainAxis.valueToJava2D(endXvalue, dataArea, domainAxisEdge);
     double num6 = Math.max(1.0, Math.abs(num5 - num4));
     double num7 = Math.abs(num3 - num2);
     if (this.getMargin() > 0.0)
     {
       double num8 = num6 * this.getMargin();
       num6 -= num8;
       num4 += num8 / 2.0;
     }
     Rectangle2D.Double @double = (Rectangle2D.Double) null;
     PlotOrientation orientation = plot.getOrientation();
     if (orientation == PlotOrientation.__\u003C\u003EHORIZONTAL)
       @double = new Rectangle2D.Double(Math.min(num2, num3), num5, num7, num6);
     else if (orientation == PlotOrientation.__\u003C\u003EVERTICAL)
       @double = new Rectangle2D.Double(num4, Math.min(num2, num3), num6, num7);
     int num9 = yvalue1 > 0.0 ? 1 : 0;
     int num10 = rangeAxis.isInverted() ? 1 : 0;
     RectangleEdge re = orientation != PlotOrientation.__\u003C\u003EHORIZONTAL ? (num9 != 0 && num10 == 0 || num9 == 0 && num10 != 0 ? RectangleEdge.__\u003C\u003EBOTTOM : RectangleEdge.__\u003C\u003ETOP) : (num9 != 0 && num10 != 0 || num9 == 0 && num10 == 0 ? RectangleEdge.__\u003C\u003ERIGHT : RectangleEdge.__\u003C\u003ELEFT);
     if (pass == 0)
     {
       if (!this.getShadowsVisible())
         return;
       this.getBarPainter().paintBarShadow(g2, (XYBarRenderer) this, series, item, (RectangularShape) @double, re, false);
     }
     else if (pass == 1)
     {
       this.getBarPainter().paintBar(g2, (XYBarRenderer) this, series, item, (RectangularShape) @double, re);
       if (info == null)
         return;
       EntityCollection entityCollection = info.getOwner().getEntityCollection();
       if (entityCollection == null)
         return;
       this.addEntity(entityCollection, (Shape) @double, dataset, series, item, ((RectangularShape) @double).getCenterX(), ((RectangularShape) @double).getCenterY());
     }
     else
     {
       if (pass != 2 || !this.isItemLabelVisible(series, item))
         return;
       XYItemLabelGenerator itemLabelGenerator = this.getItemLabelGenerator(series, item);
       this.drawItemLabel(g2, dataset, series, item, plot, itemLabelGenerator, (Rectangle2D) @double, yvalue1 < 0.0);
     }
   }
 }
 public OverwriteDataSet(double[] x, double[] y, XYDataset delegateSet)
 {
   base.\u002Ector();
   CyclicXYItemRenderer.OverwriteDataSet overwriteDataSet = this;
   this.delegateSet = delegateSet;
   this.x = new Double[x.Length];
   this.y = new Double[y.Length];
   for (int index1 = 0; index1 < x.Length; ++index1)
   {
     Double[] doubleArray1 = this.x;
     int index2 = index1;
     Double.__\u003Cclinit\u003E();
     Double double1 = new Double(x[index1]);
     doubleArray1[index2] = double1;
     Double[] doubleArray2 = this.y;
     int index3 = index1;
     Double.__\u003Cclinit\u003E();
     Double double2 = new Double(y[index1]);
     doubleArray2[index3] = double2;
   }
 }
 public override Range findRangeBounds(XYDataset dataset)
 {
   return this.findRangeBounds(dataset, true);
 }
 public override void startSeriesPass(XYDataset dataset, int series, int firstItem, int lastItem, int pass, int passCount)
 {
   ((Path2D) this.seriesPath).reset();
   this.lastPointGood = false;
   base.startSeriesPass(dataset, series, firstItem, lastItem, pass, passCount);
 }
 public override void drawItem(Graphics2D g2, XYItemRendererState state, Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, int series, int item, CrosshairState crosshairState, int pass)
 {
   if (!this.getItemVisible(series, item))
     return;
   if (pass == 0)
   {
     IntervalXYDataset ntervalXyDataset = (IntervalXYDataset) dataset;
     DeviationRenderer.State state1 = (DeviationRenderer.State) state;
     double xvalue = ntervalXyDataset.getXValue(series, item);
     double startYvalue = ntervalXyDataset.getStartYValue(series, item);
     double endYvalue = ntervalXyDataset.getEndYValue(series, item);
     RectangleEdge domainAxisEdge = plot.getDomainAxisEdge();
     RectangleEdge rangeAxisEdge = plot.getRangeAxisEdge();
     double num1 = domainAxis.valueToJava2D(xvalue, dataArea, domainAxisEdge);
     double num2 = rangeAxis.valueToJava2D(startYvalue, dataArea, rangeAxisEdge);
     double num3 = rangeAxis.valueToJava2D(endYvalue, dataArea, rangeAxisEdge);
     PlotOrientation orientation = plot.getOrientation();
     if (orientation == PlotOrientation.__\u003C\u003EHORIZONTAL)
     {
       List list1 = state1.lowerCoordinates;
       double[] numArray1 = new double[2];
       int index1 = 0;
       double num4 = num2;
       numArray1[index1] = num4;
       int index2 = 1;
       double num5 = num1;
       numArray1[index2] = num5;
       list1.add((object) numArray1);
       List list2 = state1.upperCoordinates;
       double[] numArray2 = new double[2];
       int index3 = 0;
       double num6 = num3;
       numArray2[index3] = num6;
       int index4 = 1;
       double num7 = num1;
       numArray2[index4] = num7;
       list2.add((object) numArray2);
     }
     else if (orientation == PlotOrientation.__\u003C\u003EVERTICAL)
     {
       List list1 = state1.lowerCoordinates;
       double[] numArray1 = new double[2];
       int index1 = 0;
       double num4 = num1;
       numArray1[index1] = num4;
       int index2 = 1;
       double num5 = num2;
       numArray1[index2] = num5;
       list1.add((object) numArray1);
       List list2 = state1.upperCoordinates;
       double[] numArray2 = new double[2];
       int index3 = 0;
       double num6 = num1;
       numArray2[index3] = num6;
       int index4 = 1;
       double num7 = num3;
       numArray2[index4] = num7;
       list2.add((object) numArray2);
     }
     if (item == dataset.getItemCount(series) - 1)
     {
       Composite composite = g2.getComposite();
       g2.setComposite((Composite) AlphaComposite.getInstance(3, this.alpha));
       g2.setPaint(this.getItemFillPaint(series, item));
       GeneralPath generalPath = new GeneralPath();
       double[] numArray1 = (double[]) state1.lowerCoordinates.get(0);
       ((Path2D.Float) generalPath).moveTo((float) numArray1[0], (float) numArray1[1]);
       for (int index = 1; index < state1.lowerCoordinates.size(); ++index)
       {
         double[] numArray2 = (double[]) state1.lowerCoordinates.get(index);
         ((Path2D.Float) generalPath).lineTo((float) numArray2[0], (float) numArray2[1]);
       }
       int num4 = state1.upperCoordinates.size();
       double[] numArray3 = (double[]) state1.upperCoordinates.get(num4 - 1);
       ((Path2D.Float) generalPath).lineTo((float) numArray3[0], (float) numArray3[1]);
       int num5 = num4 - 2;
       while (num5 >= 0)
       {
         double[] numArray2 = (double[]) state1.upperCoordinates.get(num5);
         ((Path2D.Float) generalPath).lineTo((float) numArray2[0], (float) numArray2[1]);
         num5 += -1;
       }
       ((Path2D) generalPath).closePath();
       g2.fill((Shape) generalPath);
       g2.setComposite(composite);
       state1.lowerCoordinates.clear();
       state1.upperCoordinates.clear();
     }
   }
   if (this.isLinePass(pass))
   {
     if (item == 0)
     {
       DeviationRenderer.State state1 = (DeviationRenderer.State) state;
       ((Path2D) state1.seriesPath).reset();
       state1.setLastPointGood(false);
     }
     if (!this.getItemLineVisible(series, item))
       return;
     this.drawPrimaryLineAsPath(state, g2, plot, dataset, pass, series, item, domainAxis, rangeAxis, dataArea);
   }
   else
   {
     if (!this.isItemPass(pass))
       return;
     EntityCollection entities = (EntityCollection) null;
     if (info != null)
       entities = info.getOwner().getEntityCollection();
     this.drawSecondaryPass(g2, plot, dataset, pass, series, item, domainAxis, dataArea, rangeAxis, crosshairState, entities);
   }
 }
Esempio n. 24
0
 public static JFreeChart createTimeSeriesChart(string title, string timeAxisLabel, string valueAxisLabel, XYDataset dataset, bool legend, bool tooltips, bool urls)
 {
   int num1 = tooltips ? 1 : 0;
   int num2 = urls ? 1 : 0;
   int num3 = legend ? 1 : 0;
   DateAxis dateAxis = new DateAxis(timeAxisLabel);
   dateAxis.setLowerMargin(0.02);
   dateAxis.setUpperMargin(0.02);
   NumberAxis numberAxis = new NumberAxis(valueAxisLabel);
   numberAxis.setAutoRangeIncludesZero(false);
   XYPlot xyPlot = new XYPlot(dataset, (ValueAxis) dateAxis, (ValueAxis) numberAxis, (XYItemRenderer) null);
   StandardXYToolTipGenerator toolTipGenerator = (StandardXYToolTipGenerator) null;
   if (num1 != 0)
     toolTipGenerator = StandardXYToolTipGenerator.getTimeSeriesInstance();
   StandardXYURLGenerator standardXyurlGenerator = (StandardXYURLGenerator) null;
   if (num2 != 0)
     standardXyurlGenerator = new StandardXYURLGenerator();
   XYLineAndShapeRenderer andShapeRenderer = new XYLineAndShapeRenderer(true, false);
   andShapeRenderer.setBaseToolTipGenerator((XYToolTipGenerator) toolTipGenerator);
   andShapeRenderer.setURLGenerator((XYURLGenerator) standardXyurlGenerator);
   xyPlot.setRenderer((XYItemRenderer) andShapeRenderer);
   JFreeChart.__\u003Cclinit\u003E();
   JFreeChart jfc = new JFreeChart(title, JFreeChart.__\u003C\u003EDEFAULT_TITLE_FONT, (Plot) xyPlot, num3 != 0);
   ChartFactory.currentTheme.apply(jfc);
   return jfc;
 }
Esempio n. 25
0
 public static JFreeChart createPolarChart(string title, XYDataset dataset, bool legend, bool tooltips, bool urls)
 {
   int num = legend ? 1 : 0;
   PolarPlot polarPlot = new PolarPlot();
   polarPlot.setDataset(dataset);
   NumberAxis numberAxis = new NumberAxis();
   numberAxis.setAxisLineVisible(false);
   numberAxis.setTickMarksVisible(false);
   numberAxis.setTickLabelInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0));
   polarPlot.setAxis((ValueAxis) numberAxis);
   polarPlot.setRenderer((PolarItemRenderer) new DefaultPolarItemRenderer());
   JFreeChart.__\u003Cclinit\u003E();
   JFreeChart jfc = new JFreeChart(title, JFreeChart.__\u003C\u003EDEFAULT_TITLE_FONT, (Plot) polarPlot, num != 0);
   ChartFactory.currentTheme.apply(jfc);
   return jfc;
 }
 public virtual void startSeriesPass(XYDataset dataset, int series, int firstItem, int lastItem, int pass, int passCount)
 {
   this.firstItemIndex = firstItem;
   this.lastItemIndex = lastItem;
 }
Esempio n. 27
0
 public override XYItemRendererState initialise(Graphics2D g2, Rectangle2D dataArea, XYPlot plot, XYDataset data, PlotRenderingInfo info)
 {
   XYLineAndShapeRenderer.State state = (XYLineAndShapeRenderer.State) base.initialise(g2, dataArea, plot, data, info);
   state.setProcessVisibleItemsOnly(false);
   this.points = new Vector();
   this.setDrawSeriesLineAsPath(true);
   return (XYItemRendererState) state;
 }
 public virtual void endSeriesPass(XYDataset dataset, int series, int firstItem, int lastItem, int pass, int passCount)
 {
 }
Esempio n. 29
0
 public override void init()
 {
   ((Container) this).setLayout((LayoutManager) new BorderLayout());
   this.m_data = new XYSeries((IComparable) this.getFieldName());
   this.m_dataset = (XYDataset) new XYSeriesCollection(this.m_data);
   this.m_chartPanel = (JPanel) new ChartPanel(ChartFactory.createXYLineChart(this.getFieldName(), "Time (units)", "Data", this.m_dataset, PlotOrientation.__\u003C\u003EVERTICAL, false, true, false));
   ((JComponent) this.m_chartPanel).setPreferredSize(new Dimension(400, 300));
   ((JComponent) this.m_chartPanel).setBackground(((Component) this).getBackground());
   ((Container) this).add((Component) this.m_chartPanel, (object) "Center");
   ((JComponent) this).revalidate();
   ((Component) this).repaint();
 }
Esempio n. 30
0
 public static JFreeChart createXYStepChart(string title, string xAxisLabel, string yAxisLabel, XYDataset dataset, PlotOrientation orientation, bool legend, bool tooltips, bool urls)
 {
   int num1 = tooltips ? 1 : 0;
   int num2 = urls ? 1 : 0;
   int num3 = legend ? 1 : 0;
   if (orientation == null)
   {
     string str = "Null 'orientation' argument.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new IllegalArgumentException(str);
   }
   else
   {
     DateAxis dateAxis = new DateAxis(xAxisLabel);
     NumberAxis numberAxis = new NumberAxis(yAxisLabel);
     numberAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
     StandardXYToolTipGenerator toolTipGenerator = (StandardXYToolTipGenerator) null;
     if (num1 != 0)
       toolTipGenerator = new StandardXYToolTipGenerator();
     StandardXYURLGenerator standardXyurlGenerator = (StandardXYURLGenerator) null;
     if (num2 != 0)
       standardXyurlGenerator = new StandardXYURLGenerator();
     XYStepRenderer xyStepRenderer = new XYStepRenderer((XYToolTipGenerator) toolTipGenerator, (XYURLGenerator) standardXyurlGenerator);
     XYPlot xyPlot = new XYPlot(dataset, (ValueAxis) dateAxis, (ValueAxis) numberAxis, (XYItemRenderer) null);
     xyPlot.setRenderer((XYItemRenderer) xyStepRenderer);
     xyPlot.setOrientation(orientation);
     xyPlot.setDomainCrosshairVisible(false);
     xyPlot.setRangeCrosshairVisible(false);
     JFreeChart.__\u003Cclinit\u003E();
     JFreeChart jfc = new JFreeChart(title, JFreeChart.__\u003C\u003EDEFAULT_TITLE_FONT, (Plot) xyPlot, num3 != 0);
     ChartFactory.currentTheme.apply(jfc);
     return jfc;
   }
 }