示例#1
0
 public JFreeChart(string title, Font titleFont, Plot plot, bool createLegend)
 {
   int num = createLegend ? 1 : 0;
   base.\u002Ector();
   JFreeChart jfreeChart = this;
   this.backgroundImageAlignment = 15;
   this.backgroundImageAlpha = 0.5f;
   if (plot == null)
   {
     string str = "Null 'plot' argument.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new NullPointerException(str);
   }
   else
   {
     this.progressListeners = new EventListenerList();
     this.changeListeners = new EventListenerList();
     this.notify = true;
     RenderingHints.__\u003Cclinit\u003E();
     this.renderingHints = new RenderingHints((RenderingHints.Key) RenderingHints.KEY_ANTIALIASING, (object) RenderingHints.VALUE_ANTIALIAS_ON);
     this.borderVisible = false;
     this.borderStroke = (Stroke) new BasicStroke(1f);
     this.borderPaint = (Paint) Color.black;
     this.padding = RectangleInsets.__\u003C\u003EZERO_INSETS;
     this.plot = plot;
     plot.addChangeListener((PlotChangeListener) this);
     this.subtitles = (List) new ArrayList();
     if (num != 0)
     {
       LegendTitle.__\u003Cclinit\u003E();
       LegendTitle legendTitle = new LegendTitle((LegendItemSource) this.plot);
       legendTitle.setMargin(new RectangleInsets(1.0, 1.0, 1.0, 1.0));
       legendTitle.setFrame((BlockFrame) new LineBorder());
       legendTitle.setBackgroundPaint((Paint) Color.white);
       legendTitle.setPosition(RectangleEdge.__\u003C\u003EBOTTOM);
       this.subtitles.add((object) legendTitle);
       legendTitle.addChangeListener((TitleChangeListener) this);
     }
     if (title != null)
     {
       if (titleFont == null)
         titleFont = JFreeChart.__\u003C\u003EDEFAULT_TITLE_FONT;
       this.title = new TextTitle(title, titleFont);
       this.title.addChangeListener((TitleChangeListener) this);
     }
     this.backgroundPaint = JFreeChart.__\u003C\u003EDEFAULT_BACKGROUND_PAINT;
     this.backgroundImage = JFreeChart.__\u003C\u003EDEFAULT_BACKGROUND_IMAGE;
     this.backgroundImageAlignment = 15;
     this.backgroundImageAlpha = 0.5f;
   }
 }
 public DefaultTitleEditor([In] Title obj0)
 {
   base.\u002Ector();
   DefaultTitleEditor defaultTitleEditor = this;
   TextTitle textTitle1;
   if (obj0 != null)
   {
     textTitle1 = (TextTitle) obj0;
   }
   else
   {
     TextTitle.__\u003Cclinit\u003E();
     textTitle1 = new TextTitle(DefaultTitleEditor.localizationResources.getString("Title"));
   }
   TextTitle textTitle2 = textTitle1;
   this.showTitle = obj0 != null;
   this.titleFont = textTitle2.getFont();
   JTextField.__\u003Cclinit\u003E();
   this.titleField = new JTextField(textTitle2.getText());
   PaintSample.__\u003Cclinit\u003E();
   this.titlePaint = new PaintSample(textTitle2.getPaint());
   ((Container) this).setLayout((LayoutManager) new BorderLayout());
   JPanel.__\u003Cclinit\u003E();
   JPanel jpanel1 = new JPanel((LayoutManager) new BorderLayout());
   ((JComponent) jpanel1).setBorder((Border) BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), DefaultTitleEditor.localizationResources.getString("General")));
   JPanel.__\u003Cclinit\u003E();
   JPanel jpanel2 = new JPanel((LayoutManager) new LCBLayout(4));
   ((JComponent) jpanel2).setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
   JPanel jpanel3 = jpanel2;
   JLabel.__\u003Cclinit\u003E();
   JLabel jlabel1 = new JLabel(DefaultTitleEditor.localizationResources.getString("Show_Title"));
   ((Container) jpanel3).add((Component) jlabel1);
   this.showTitleCheckBox = new JCheckBox();
   ((AbstractButton) this.showTitleCheckBox).setSelected(this.showTitle);
   ((AbstractButton) this.showTitleCheckBox).setActionCommand("ShowTitle");
   ((AbstractButton) this.showTitleCheckBox).addActionListener((ActionListener) this);
   ((Container) jpanel2).add((Component) new JPanel());
   ((Container) jpanel2).add((Component) this.showTitleCheckBox);
   JLabel.__\u003Cclinit\u003E();
   JLabel jlabel2 = new JLabel(DefaultTitleEditor.localizationResources.getString("Text"));
   ((Container) jpanel2).add((Component) jlabel2);
   ((Container) jpanel2).add((Component) this.titleField);
   ((Container) jpanel2).add((Component) new JPanel());
   JLabel.__\u003Cclinit\u003E();
   JLabel jlabel3 = new JLabel(DefaultTitleEditor.localizationResources.getString("Font"));
   FontDisplayField.__\u003Cclinit\u003E();
   this.fontfield = (JTextField) new FontDisplayField(this.titleFont);
   JButton.__\u003Cclinit\u003E();
   this.selectFontButton = new JButton(DefaultTitleEditor.localizationResources.getString("Select..."));
   ((AbstractButton) this.selectFontButton).setActionCommand("SelectFont");
   ((AbstractButton) this.selectFontButton).addActionListener((ActionListener) this);
   ((Container) jpanel2).add((Component) jlabel3);
   ((Container) jpanel2).add((Component) this.fontfield);
   ((Container) jpanel2).add((Component) this.selectFontButton);
   JLabel.__\u003Cclinit\u003E();
   JLabel jlabel4 = new JLabel(DefaultTitleEditor.localizationResources.getString("Color"));
   JButton.__\u003Cclinit\u003E();
   this.selectPaintButton = new JButton(DefaultTitleEditor.localizationResources.getString("Select..."));
   ((AbstractButton) this.selectPaintButton).setActionCommand("SelectPaint");
   ((AbstractButton) this.selectPaintButton).addActionListener((ActionListener) this);
   ((Container) jpanel2).add((Component) jlabel4);
   ((Container) jpanel2).add((Component) this.titlePaint);
   ((Container) jpanel2).add((Component) this.selectPaintButton);
   this.enableOrDisableControls();
   ((Container) jpanel1).add((Component) jpanel2);
   ((Container) this).add((Component) jpanel1, (object) "North");
 }
示例#3
0
 public static JFreeChart createMultiplePieChart3D(string title, CategoryDataset dataset, TableOrder order, bool legend, bool tooltips, bool urls)
 {
   int num1 = tooltips ? 1 : 0;
   int num2 = urls ? 1 : 0;
   int num3 = legend ? 1 : 0;
   if (order == null)
   {
     string str = "Null 'order' argument.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new IllegalArgumentException(str);
   }
   else
   {
     MultiplePiePlot multiplePiePlot = new MultiplePiePlot(dataset);
     multiplePiePlot.setDataExtractOrder(order);
     multiplePiePlot.setBackgroundPaint((Paint) null);
     multiplePiePlot.setOutlineStroke((Stroke) null);
     JFreeChart.__\u003Cclinit\u003E();
     JFreeChart pieChart = new JFreeChart((Plot) new PiePlot3D((PieDataset) null));
     TextTitle.__\u003Cclinit\u003E();
     TextTitle title1 = new TextTitle("Series Title", new Font("SansSerif", 1, 12));
     title1.setPosition(RectangleEdge.__\u003C\u003EBOTTOM);
     pieChart.setTitle(title1);
     pieChart.removeLegend();
     pieChart.setBackgroundPaint((Paint) null);
     multiplePiePlot.setPieChart(pieChart);
     if (num1 != 0)
     {
       StandardPieToolTipGenerator toolTipGenerator = new StandardPieToolTipGenerator();
       ((PiePlot) multiplePiePlot.getPieChart().getPlot()).setToolTipGenerator((PieToolTipGenerator) toolTipGenerator);
     }
     if (num2 != 0)
     {
       StandardPieURLGenerator standardPieUrlGenerator = new StandardPieURLGenerator();
       ((PiePlot) multiplePiePlot.getPieChart().getPlot()).setURLGenerator((PieURLGenerator) standardPieUrlGenerator);
     }
     JFreeChart.__\u003Cclinit\u003E();
     JFreeChart jfc = new JFreeChart(title, JFreeChart.__\u003C\u003EDEFAULT_TITLE_FONT, (Plot) multiplePiePlot, num3 != 0);
     ChartFactory.currentTheme.apply(jfc);
     return jfc;
   }
 }
 public virtual void setTitleProperties([In] JFreeChart obj0)
 {
   if (this.showTitle)
   {
     TextTitle title = obj0.getTitle();
     if (title == null)
     {
       title = new TextTitle();
       obj0.setTitle(title);
     }
     title.setText(this.getTitleText());
     title.setFont(this.getTitleFont());
     title.setPaint(this.getTitlePaint());
   }
   else
     obj0.setTitle((TextTitle) null);
 }
示例#5
0
 public static JFreeChart createPieChart(string title, PieDataset dataset, PieDataset previousDataset, int percentDiffForMaxScale, bool greenForIncrease, bool legend, bool tooltips, bool urls, bool subTitle, bool showDifference)
 {
   int num1 = tooltips ? 1 : 0;
   int num2 = urls ? 1 : 0;
   int num3 = showDifference ? 1 : 0;
   int num4 = greenForIncrease ? 1 : 0;
   int num5 = legend ? 1 : 0;
   int num6 = subTitle ? 1 : 0;
   PiePlot piePlot = new PiePlot(dataset);
   piePlot.setLabelGenerator((PieSectionLabelGenerator) new StandardPieSectionLabelGenerator());
   piePlot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0));
   if (num1 != 0)
     piePlot.setToolTipGenerator((PieToolTipGenerator) new StandardPieToolTipGenerator());
   if (num2 != 0)
     piePlot.setURLGenerator((PieURLGenerator) new StandardPieURLGenerator());
   List keys = dataset.getKeys();
   DefaultPieDataset defaultPieDataset = (DefaultPieDataset) null;
   if (num3 != 0)
     defaultPieDataset = new DefaultPieDataset();
   double num7 = (double) byte.MaxValue / (double) percentDiffForMaxScale;
   Iterator iterator = keys.iterator();
   while (iterator.hasNext())
   {
     IComparable comparable = (IComparable) iterator.next();
     Number number1 = dataset.getValue(comparable);
     Number number2 = previousDataset.getValue(comparable);
     if (number2 == null)
     {
       if (num4 != 0)
         piePlot.setSectionPaint(comparable, (Paint) Color.green);
       else
         piePlot.setSectionPaint(comparable, (Paint) Color.red);
       if (num3 != 0)
         defaultPieDataset.setValue((IComparable) new StringBuffer().append((object) comparable).append(" (+100%)").toString(), number1);
     }
     else
     {
       double num8 = (number1.doubleValue() / number2.doubleValue() - 1.0) * 100.0;
       double num9 = Math.abs(num8) < (double) percentDiffForMaxScale ? Math.abs(num8) * num7 : (double) byte.MaxValue;
       if (num4 != 0 && number1.doubleValue() > number2.doubleValue() || num4 == 0 && number1.doubleValue() < number2.doubleValue())
         piePlot.setSectionPaint(comparable, (Paint) new Color(0, ByteCodeHelper.d2i(num9), 0));
       else
         piePlot.setSectionPaint(comparable, (Paint) new Color(ByteCodeHelper.d2i(num9), 0, 0));
       if (num3 != 0)
         defaultPieDataset.setValue((IComparable) new StringBuffer().append((object) comparable).append(" (").append(num8 < 0.0 ? "" : "+").append(NumberFormat.getPercentInstance().format(num8 / 100.0)).append(")").toString(), number1);
     }
   }
   if (num3 != 0)
     piePlot.setDataset((PieDataset) defaultPieDataset);
   JFreeChart.__\u003Cclinit\u003E();
   JFreeChart jfc = new JFreeChart(title, JFreeChart.__\u003C\u003EDEFAULT_TITLE_FONT, (Plot) piePlot, num5 != 0);
   if (num6 != 0)
   {
     TextTitle.__\u003Cclinit\u003E();
     TextTitle textTitle = new TextTitle(new StringBuffer().append("Bright ").append(num4 == 0 ? "green" : "red").append("=change >=-").append(percentDiffForMaxScale).append("%, Bright ").append(num4 != 0 ? "green" : "red").append("=change >=+").append(percentDiffForMaxScale).append("%").toString(), new Font("SansSerif", 0, 10));
     jfc.addSubtitle((Title) textTitle);
   }
   ChartFactory.currentTheme.apply(jfc);
   return jfc;
 }