Package org.sonar.api.charts

Examples of org.sonar.api.charts.Chart


    if (isDeprecatedChart(request)) {
      deprecatedDoGet(request, response);

    } else {
      ChartFactory chartFactory = Platform.getInstance().getContainer().getComponentByType(ChartFactory.class);
      Chart chart = chartFactory.getChart(request.getParameter("ck"));
      if (chart != null) {
        BufferedImage image = chart.generateImage(getParams(request));
        OutputStream out = response.getOutputStream();
        try {
          response.setContentType("image/png");
          exportAsPNG(image, out);

        } catch (Exception e) {
          LOG.error("Generating chart " + chart.getClass().getName(), e);

        } finally {
          out.close();
        }
      }
View Full Code Here


public class ChartFactoryTest {

  @Test
  public void shouldFindChartsFromPlugins() {
    ChartFactory factory = new ChartFactory(new Chart[]{new FakeChart()});
    Chart chart = factory.getChart("fake");
    assertEquals(chart.getClass(), FakeChart.class);

    assertNull(factory.getChart("unknown"));
  }
View Full Code Here

TOP

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

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.