org.jfree.chart.ChartColor Java Examples

The following examples show how to use org.jfree.chart.ChartColor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: KafkaFT.java    From flink-perf with Apache License 2.0 5 votes vote down vote up
private static void addKillEvent(XYPlot xyplot, long pos) {
	ValueMarker vm = new ValueMarker(pos);
	vm.setPaint(ChartColor.VERY_DARK_GREEN);
	vm.setLabelOffset(new RectangleInsets(10.0D, 1.0D, 1.0D, 1.0D));
	vm.setLabel("Container Kill Event");
	vm.setStroke(new BasicStroke(2));
	xyplot.addDomainMarker(vm);
}
 
Example #2
Source File: KafkaFT.java    From flink-perf with Apache License 2.0 5 votes vote down vote up
private static void addIllegalEvent(XYPlot xyplot, long pos) {
	ValueMarker vm = new ValueMarker(pos);
	vm.setPaint(ChartColor.LIGHT_YELLOW);
	vm.setLabelOffset(new RectangleInsets(10.0D, 1.0D, 1.0D, 1.0D));
	vm.setLabel("Illegal State");
	vm.setStroke(new BasicStroke(2));
	xyplot.addDomainMarker(vm);
}
 
Example #3
Source File: KafkaFT.java    From flink-perf with Apache License 2.0 5 votes vote down vote up
private static JFreeChart createChart(XYDataset xydataset) {
	JFreeChart jfreechart = ChartFactory.createTimeSeriesChart("Flink Exactly-Once on Kafka with YARN Chaos Monkey", "Date", "Value", xydataset, true, true, false);
	XYPlot xyplot = (XYPlot) jfreechart.getPlot();

	XYLineAndShapeRenderer r0 = (XYLineAndShapeRenderer) xyplot.getRenderer(0);

	// draw data points as points
	r0.setSeriesShapesVisible(2, true);
	r0.setSeriesLinesVisible(2, true);
	// order elements as assed
	xyplot.setSeriesRenderingOrder(SeriesRenderingOrder.FORWARD);

	DateAxis dateaxis = (DateAxis) xyplot.getDomainAxis();

	Number first = xydataset.getX(0, 0);
	Minute minute = new Minute(new Date((Long)first));
	System.out.println("first = "+first);
	RelativeDateFormat relativedateformat = new RelativeDateFormat(minute.getFirstMillisecond());
	relativedateformat.setSecondFormatter(new DecimalFormat("00"));
	dateaxis.setDateFormatOverride(relativedateformat);


	//dateaxis.setDateFormatOverride(new SimpleDateFormat("mm:ss"));
	ValueAxis valueaxis = xyplot.getRangeAxis();
	valueaxis.setAutoRangeMinimumSize(1.0D);
	valueaxis.setLabel("Elements/Core");

	xyplot.getRenderer().setSeriesPaint(2, ChartColor.DARK_MAGENTA);
	return jfreechart;
}
 
Example #4
Source File: EIsotopePatternChartTheme.java    From mzmine3 with GNU General Public License v2.0 4 votes vote down vote up
public void initialize() {
  // Fonts
  this.setExtraLargeFont(new Font("Arial", Font.BOLD, 16));
  this.setLargeFont(new Font("Arial", Font.BOLD, 11));
  this.setRegularFont(new Font("Arial", Font.PLAIN, 11));
  this.setSmallFont(new Font("Arial", Font.PLAIN, 11));

  // paints
  this.setTitlePaint(Color.black);
  this.setSubtitlePaint(Color.black);
  this.setLegendItemPaint(Color.black);
  this.setPlotOutlinePaint(Color.black);
  this.setBaselinePaint(Color.black);
  this.setCrosshairPaint(Color.black);
  this.setLabelLinkPaint(Color.black);
  this.setTickLabelPaint(Color.black);
  this.setAxisLabelPaint(Color.black);
  this.setShadowPaint(Color.black);
  this.setItemLabelPaint(Color.black);

  this.setLegendBackgroundPaint(Color.white);
  this.setChartBackgroundPaint(Color.white);
  this.setPlotBackgroundPaint(Color.white);

  Paint[] colors = new Paint[] {Color.BLACK, new Color(0xFF, 0x55, 0x55),
      new Color(0x55, 0x55, 0xFF), new Color(0x55, 0xFF, 0x55), new Color(0xFF, 0xFF, 0x55),
      new Color(0xFF, 0x55, 0xFF), new Color(0x55, 0xFF, 0xFF), Color.pink, Color.gray,
      ChartColor.DARK_RED, ChartColor.DARK_BLUE, ChartColor.DARK_GREEN, ChartColor.DARK_YELLOW,
      ChartColor.DARK_MAGENTA, ChartColor.DARK_CYAN, Color.darkGray, ChartColor.LIGHT_RED,
      ChartColor.LIGHT_BLUE, ChartColor.LIGHT_GREEN, ChartColor.LIGHT_YELLOW,
      ChartColor.LIGHT_MAGENTA, ChartColor.LIGHT_CYAN, Color.lightGray, ChartColor.VERY_DARK_RED,
      ChartColor.VERY_DARK_BLUE, ChartColor.VERY_DARK_GREEN, ChartColor.VERY_DARK_YELLOW,
      ChartColor.VERY_DARK_MAGENTA, ChartColor.VERY_DARK_CYAN, ChartColor.VERY_LIGHT_RED,
      ChartColor.VERY_LIGHT_BLUE, ChartColor.VERY_LIGHT_GREEN, ChartColor.VERY_LIGHT_YELLOW,
      ChartColor.VERY_LIGHT_MAGENTA, ChartColor.VERY_LIGHT_CYAN};

  this.setDrawingSupplier(
      new DefaultDrawingSupplier(colors, DefaultDrawingSupplier.DEFAULT_FILL_PAINT_SEQUENCE,
          DefaultDrawingSupplier.DEFAULT_OUTLINE_PAINT_SEQUENCE,
          DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE,
          DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE,
          DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE));

  this.setRangeGridlinePaint(Color.GRAY);
  this.setDomainGridlinePaint(Color.GRAY);

  this.setAxisLinePaint(Color.black);
}
 
Example #5
Source File: ChartThemeFactory.java    From mzmine3 with GNU General Public License v2.0 4 votes vote down vote up
public static EStandardChartTheme createBlackNWhiteTheme() {
  EStandardChartTheme theme = new EStandardChartTheme(THEME.BNW_PRINT, "BnW");
  // Fonts
  theme.setExtraLargeFont(new Font("Arial", Font.BOLD, 16));
  theme.setLargeFont(new Font("Arial", Font.BOLD, 11));
  theme.setRegularFont(new Font("Arial", Font.PLAIN, 11));
  theme.setSmallFont(new Font("Arial", Font.PLAIN, 11));

  // Paints
  theme.setTitlePaint(Color.black);
  theme.setSubtitlePaint(Color.black);
  theme.setLegendItemPaint(Color.black);
  theme.setPlotOutlinePaint(Color.black);
  theme.setBaselinePaint(Color.black);
  theme.setCrosshairPaint(Color.black);
  theme.setLabelLinkPaint(Color.black);
  theme.setTickLabelPaint(Color.black);
  theme.setAxisLabelPaint(Color.black);
  theme.setShadowPaint(Color.black);
  theme.setItemLabelPaint(Color.black);

  theme.setLegendBackgroundPaint(Color.white);
  theme.setChartBackgroundPaint(Color.white);
  theme.setPlotBackgroundPaint(Color.white);

  // paint sequence: add black
  Paint[] colors = new Paint[] {Color.BLACK, new Color(0xFF, 0x55, 0x55),
      new Color(0x55, 0x55, 0xFF), new Color(0x55, 0xFF, 0x55), new Color(0xFF, 0xFF, 0x55),
      new Color(0xFF, 0x55, 0xFF), new Color(0x55, 0xFF, 0xFF), Color.pink, Color.gray,
      ChartColor.DARK_RED, ChartColor.DARK_BLUE, ChartColor.DARK_GREEN, ChartColor.DARK_YELLOW,
      ChartColor.DARK_MAGENTA, ChartColor.DARK_CYAN, Color.darkGray, ChartColor.LIGHT_RED,
      ChartColor.LIGHT_BLUE, ChartColor.LIGHT_GREEN, ChartColor.LIGHT_YELLOW,
      ChartColor.LIGHT_MAGENTA, ChartColor.LIGHT_CYAN, Color.lightGray, ChartColor.VERY_DARK_RED,
      ChartColor.VERY_DARK_BLUE, ChartColor.VERY_DARK_GREEN, ChartColor.VERY_DARK_YELLOW,
      ChartColor.VERY_DARK_MAGENTA, ChartColor.VERY_DARK_CYAN, ChartColor.VERY_LIGHT_RED,
      ChartColor.VERY_LIGHT_BLUE, ChartColor.VERY_LIGHT_GREEN, ChartColor.VERY_LIGHT_YELLOW,
      ChartColor.VERY_LIGHT_MAGENTA, ChartColor.VERY_LIGHT_CYAN};

  theme.setDrawingSupplier(
      new DefaultDrawingSupplier(colors, DefaultDrawingSupplier.DEFAULT_FILL_PAINT_SEQUENCE,
          DefaultDrawingSupplier.DEFAULT_OUTLINE_PAINT_SEQUENCE,
          DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE,
          DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE,
          DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE));
  theme.setErrorIndicatorPaint(Color.black);
  theme.setGridBandPaint(new Color(255, 255, 255, 20));
  theme.setGridBandAlternatePaint(new Color(255, 255, 255, 40));

  // axis
  Color transp = new Color(0, 0, 0, 200);
  theme.setRangeGridlinePaint(transp);
  theme.setDomainGridlinePaint(transp);

  theme.setAxisLinePaint(Color.black);

  // axis offset
  theme.setAxisOffset(new RectangleInsets(0, 0, 0, 0));

  return theme;
}
 
Example #6
Source File: ChartThemeFactory.java    From old-mzmine3 with GNU General Public License v2.0 4 votes vote down vote up
public static EStandardChartTheme createBlackNWhiteTheme() {
  EStandardChartTheme theme = new EStandardChartTheme(THEME.BNW_PRINT, "BnW");
  // Fonts
  theme.setExtraLargeFont(new Font("Arial", Font.BOLD, 16));
  theme.setLargeFont(new Font("Arial", Font.BOLD, 11));
  theme.setRegularFont(new Font("Arial", Font.PLAIN, 11));
  theme.setSmallFont(new Font("Arial", Font.PLAIN, 11));

  // Paints
  theme.setTitlePaint(Color.black);
  theme.setSubtitlePaint(Color.black);
  theme.setLegendItemPaint(Color.black);
  theme.setPlotOutlinePaint(Color.black);
  theme.setBaselinePaint(Color.black);
  theme.setCrosshairPaint(Color.black);
  theme.setLabelLinkPaint(Color.black);
  theme.setTickLabelPaint(Color.black);
  theme.setAxisLabelPaint(Color.black);
  theme.setShadowPaint(Color.black);
  theme.setItemLabelPaint(Color.black);

  theme.setLegendBackgroundPaint(Color.white);
  theme.setChartBackgroundPaint(Color.white);
  theme.setPlotBackgroundPaint(Color.white);

  // paint sequence: add black
  Paint[] colors = new Paint[] {Color.BLACK, new Color(0xFF, 0x55, 0x55),
      new Color(0x55, 0x55, 0xFF), new Color(0x55, 0xFF, 0x55), new Color(0xFF, 0xFF, 0x55),
      new Color(0xFF, 0x55, 0xFF), new Color(0x55, 0xFF, 0xFF), Color.pink, Color.gray,
      ChartColor.DARK_RED, ChartColor.DARK_BLUE, ChartColor.DARK_GREEN, ChartColor.DARK_YELLOW,
      ChartColor.DARK_MAGENTA, ChartColor.DARK_CYAN, Color.darkGray, ChartColor.LIGHT_RED,
      ChartColor.LIGHT_BLUE, ChartColor.LIGHT_GREEN, ChartColor.LIGHT_YELLOW,
      ChartColor.LIGHT_MAGENTA, ChartColor.LIGHT_CYAN, Color.lightGray, ChartColor.VERY_DARK_RED,
      ChartColor.VERY_DARK_BLUE, ChartColor.VERY_DARK_GREEN, ChartColor.VERY_DARK_YELLOW,
      ChartColor.VERY_DARK_MAGENTA, ChartColor.VERY_DARK_CYAN, ChartColor.VERY_LIGHT_RED,
      ChartColor.VERY_LIGHT_BLUE, ChartColor.VERY_LIGHT_GREEN, ChartColor.VERY_LIGHT_YELLOW,
      ChartColor.VERY_LIGHT_MAGENTA, ChartColor.VERY_LIGHT_CYAN};

  theme.setDrawingSupplier(
      new DefaultDrawingSupplier(colors, DefaultDrawingSupplier.DEFAULT_FILL_PAINT_SEQUENCE,
          DefaultDrawingSupplier.DEFAULT_OUTLINE_PAINT_SEQUENCE,
          DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE,
          DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE,
          DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE));
  theme.setErrorIndicatorPaint(Color.black);
  theme.setGridBandPaint(new Color(255, 255, 255, 20));
  theme.setGridBandAlternatePaint(new Color(255, 255, 255, 40));

  // axis
  Color transp = new Color(0, 0, 0, 200);
  theme.setRangeGridlinePaint(transp);
  theme.setDomainGridlinePaint(transp);

  theme.setAxisLinePaint(Color.black);

  // axis offset
  theme.setAxisOffset(new RectangleInsets(0, 0, 0, 0));

  return theme;
}
 
Example #7
Source File: EIsotopePatternChartTheme.java    From mzmine2 with GNU General Public License v2.0 4 votes vote down vote up
public void initialize() {
  // Fonts
  this.setExtraLargeFont(new Font("Arial", Font.BOLD, 16));
  this.setLargeFont(new Font("Arial", Font.BOLD, 11));
  this.setRegularFont(new Font("Arial", Font.PLAIN, 11));
  this.setSmallFont(new Font("Arial", Font.PLAIN, 11));

  // paints
  this.setTitlePaint(Color.black);
  this.setSubtitlePaint(Color.black);
  this.setLegendItemPaint(Color.black);
  this.setPlotOutlinePaint(Color.black);
  this.setBaselinePaint(Color.black);
  this.setCrosshairPaint(Color.black);
  this.setLabelLinkPaint(Color.black);
  this.setTickLabelPaint(Color.black);
  this.setAxisLabelPaint(Color.black);
  this.setShadowPaint(Color.black);
  this.setItemLabelPaint(Color.black);

  this.setLegendBackgroundPaint(Color.white);
  this.setChartBackgroundPaint(Color.white);
  this.setPlotBackgroundPaint(Color.white);

  Paint[] colors = new Paint[] {Color.BLACK, new Color(0xFF, 0x55, 0x55),
      new Color(0x55, 0x55, 0xFF), new Color(0x55, 0xFF, 0x55), new Color(0xFF, 0xFF, 0x55),
      new Color(0xFF, 0x55, 0xFF), new Color(0x55, 0xFF, 0xFF), Color.pink, Color.gray,
      ChartColor.DARK_RED, ChartColor.DARK_BLUE, ChartColor.DARK_GREEN, ChartColor.DARK_YELLOW,
      ChartColor.DARK_MAGENTA, ChartColor.DARK_CYAN, Color.darkGray, ChartColor.LIGHT_RED,
      ChartColor.LIGHT_BLUE, ChartColor.LIGHT_GREEN, ChartColor.LIGHT_YELLOW,
      ChartColor.LIGHT_MAGENTA, ChartColor.LIGHT_CYAN, Color.lightGray, ChartColor.VERY_DARK_RED,
      ChartColor.VERY_DARK_BLUE, ChartColor.VERY_DARK_GREEN, ChartColor.VERY_DARK_YELLOW,
      ChartColor.VERY_DARK_MAGENTA, ChartColor.VERY_DARK_CYAN, ChartColor.VERY_LIGHT_RED,
      ChartColor.VERY_LIGHT_BLUE, ChartColor.VERY_LIGHT_GREEN, ChartColor.VERY_LIGHT_YELLOW,
      ChartColor.VERY_LIGHT_MAGENTA, ChartColor.VERY_LIGHT_CYAN};

  this.setDrawingSupplier(
      new DefaultDrawingSupplier(colors, DefaultDrawingSupplier.DEFAULT_FILL_PAINT_SEQUENCE,
          DefaultDrawingSupplier.DEFAULT_OUTLINE_PAINT_SEQUENCE,
          DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE,
          DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE,
          DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE));

  this.setRangeGridlinePaint(Color.GRAY);
  this.setDomainGridlinePaint(Color.GRAY);

  this.setAxisLinePaint(Color.black);
}
 
Example #8
Source File: ChartThemeFactory.java    From mzmine2 with GNU General Public License v2.0 4 votes vote down vote up
public static EStandardChartTheme createBlackNWhiteTheme() {
  EStandardChartTheme theme = new EStandardChartTheme(THEME.BNW_PRINT, "BnW");
  // Fonts
  theme.setExtraLargeFont(new Font("Arial", Font.BOLD, 16));
  theme.setLargeFont(new Font("Arial", Font.BOLD, 11));
  theme.setRegularFont(new Font("Arial", Font.PLAIN, 11));
  theme.setSmallFont(new Font("Arial", Font.PLAIN, 11));

  // Paints
  theme.setTitlePaint(Color.black);
  theme.setSubtitlePaint(Color.black);
  theme.setLegendItemPaint(Color.black);
  theme.setPlotOutlinePaint(Color.black);
  theme.setBaselinePaint(Color.black);
  theme.setCrosshairPaint(Color.black);
  theme.setLabelLinkPaint(Color.black);
  theme.setTickLabelPaint(Color.black);
  theme.setAxisLabelPaint(Color.black);
  theme.setShadowPaint(Color.black);
  theme.setItemLabelPaint(Color.black);

  theme.setLegendBackgroundPaint(Color.white);
  theme.setChartBackgroundPaint(Color.white);
  theme.setPlotBackgroundPaint(Color.white);

  // paint sequence: add black
  Paint[] colors = new Paint[] {Color.BLACK, new Color(0xFF, 0x55, 0x55),
      new Color(0x55, 0x55, 0xFF), new Color(0x55, 0xFF, 0x55), new Color(0xFF, 0xFF, 0x55),
      new Color(0xFF, 0x55, 0xFF), new Color(0x55, 0xFF, 0xFF), Color.pink, Color.gray,
      ChartColor.DARK_RED, ChartColor.DARK_BLUE, ChartColor.DARK_GREEN, ChartColor.DARK_YELLOW,
      ChartColor.DARK_MAGENTA, ChartColor.DARK_CYAN, Color.darkGray, ChartColor.LIGHT_RED,
      ChartColor.LIGHT_BLUE, ChartColor.LIGHT_GREEN, ChartColor.LIGHT_YELLOW,
      ChartColor.LIGHT_MAGENTA, ChartColor.LIGHT_CYAN, Color.lightGray, ChartColor.VERY_DARK_RED,
      ChartColor.VERY_DARK_BLUE, ChartColor.VERY_DARK_GREEN, ChartColor.VERY_DARK_YELLOW,
      ChartColor.VERY_DARK_MAGENTA, ChartColor.VERY_DARK_CYAN, ChartColor.VERY_LIGHT_RED,
      ChartColor.VERY_LIGHT_BLUE, ChartColor.VERY_LIGHT_GREEN, ChartColor.VERY_LIGHT_YELLOW,
      ChartColor.VERY_LIGHT_MAGENTA, ChartColor.VERY_LIGHT_CYAN};

  theme.setDrawingSupplier(
      new DefaultDrawingSupplier(colors, DefaultDrawingSupplier.DEFAULT_FILL_PAINT_SEQUENCE,
          DefaultDrawingSupplier.DEFAULT_OUTLINE_PAINT_SEQUENCE,
          DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE,
          DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE,
          DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE));
  theme.setErrorIndicatorPaint(Color.black);
  theme.setGridBandPaint(new Color(255, 255, 255, 20));
  theme.setGridBandAlternatePaint(new Color(255, 255, 255, 40));

  // axis
  Color transp = new Color(0, 0, 0, 200);
  theme.setRangeGridlinePaint(transp);
  theme.setDomainGridlinePaint(transp);

  theme.setAxisLinePaint(Color.black);

  // axis offset
  theme.setAxisOffset(new RectangleInsets(0, 0, 0, 0));

  return theme;
}