Package org.sonar.api.charts

Examples of org.sonar.api.charts.ChartParameters


public class DistributionBarChartTest extends AbstractChartTest {

  @Test
  public void simpleSample() throws IOException {
    DistributionBarChart chart = new DistributionBarChart();
    BufferedImage image = chart.generateImage(new ChartParameters("v=0%3D5%3B1%3D22%3B2%3D2"));
    assertChartSizeGreaterThan(image, 1000);
    saveChart(image, "DistributionBarChartTest/simpleSample.png");
  }
View Full Code Here


  @Test
  public void addXSuffix() throws IOException {
    DistributionBarChart chart = new DistributionBarChart();
    // should suffix x labels with +
    BufferedImage image = chart.generateImage(new ChartParameters("v=0%3D5%3B1%3D22%3B2%3D2&xsuf=%2B"));
    assertChartSizeGreaterThan(image, 1000);
    saveChart(image, "DistributionBarChartTest/addXSuffix.png");
  }
View Full Code Here

  @Test
  public void addYSuffix() throws IOException {
    DistributionBarChart chart = new DistributionBarChart();
    // should suffix y labels with %
    BufferedImage image = chart.generateImage(new ChartParameters("v=0%3D5%3B1%3D22%3B2%3D2&ysuf=%25"));
    assertChartSizeGreaterThan(image, 1000);
    saveChart(image, "DistributionBarChartTest/addYSuffix.png");
  }
View Full Code Here

  }

  @Test
  public void manySeries() throws IOException {
    DistributionBarChart chart = new DistributionBarChart();
    BufferedImage image = chart.generateImage(new ChartParameters("v=0%3D5%3B1%3D22%3B2%3D2|0%3D7%3B1%3D15%3B2%3D4"));
    assertChartSizeGreaterThan(image, 1000);
    saveChart(image, "DistributionBarChartTest/manySeries.png");
  }
View Full Code Here

  @Test
  public void manySeriesIncludingAnEmptySerie() throws IOException {
    DistributionBarChart chart = new DistributionBarChart();
    // the third serie should not have the second default color, but the third one !
    BufferedImage image = chart.generateImage(new ChartParameters("v=0%3D5%3B1%3D22%3B2%3D2||0%3D7%3B1%3D15%3B2%3D4"));
    assertChartSizeGreaterThan(image, 1000);
    saveChart(image, "DistributionBarChartTest/manySeriesIncludingAnEmptySerie.png");
  }
View Full Code Here

  }

  @Test
  public void overridenSize() throws IOException {
    DistributionBarChart chart = new DistributionBarChart();
    BufferedImage image = chart.generateImage(new ChartParameters("v=0%3D5%3B1%3D22%3B2%3D2|0%3D7%3B1%3D15%3B2%3D4&w=500&h=200"));
    assertChartSizeGreaterThan(image, 1000);
    saveChart(image, "DistributionBarChartTest/overridenSize.png");
  }
View Full Code Here

  }

  @Test
  public void changeColor() throws IOException {
    DistributionBarChart chart = new DistributionBarChart();
    BufferedImage image = chart.generateImage(new ChartParameters("v=0%3D5%3B1%3D22%3B2%3D2&c=777777&bgc=777777"));
    assertChartSizeGreaterThan(image, 1000);
    saveChart(image, "DistributionBarChartTest/changeColor.png");
  }
View Full Code Here

  }

  @Test
  public void smallSize() throws IOException {
    DistributionBarChart chart = new DistributionBarChart();
    BufferedImage image = chart.generateImage(new ChartParameters("v=0%3D5%3B1%3D22%3B2%3D2%3B4%3D22%3B5%3D22%3B6%3D22&c=777777&w=120&h=80&fs=8"));
    assertChartSizeGreaterThan(image, 500);
    saveChart(image, "DistributionBarChartTest/smallSize.png");
  }
View Full Code Here

public class DistributionAreaChartTest extends AbstractChartTest {

  @Test
  public void oneSerie() throws IOException {
    DistributionAreaChart chart = new DistributionAreaChart();
    BufferedImage image = chart.generateImage(new ChartParameters("v=0%3D5%3B1%3D22%3B2%3D2"));
    assertChartSizeGreaterThan(image, 1000);
    saveChart(image, "DistributionAreaChartTest/oneSerie.png");
  }
View Full Code Here

  }

  @Test
  public void manySeries() throws IOException {
    DistributionAreaChart chart = new DistributionAreaChart();
    BufferedImage image = chart.generateImage(new ChartParameters("v=0%3D5%3B1%3D22%3B2%3D2|0%3D7%3B1%3D15%3B2%3D4"));
    assertChartSizeGreaterThan(image, 1000);
    saveChart(image, "DistributionAreaChartTest/manySeries.png");
  }
View Full Code Here

TOP

Related Classes of org.sonar.api.charts.ChartParameters

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.