Package org.openhab.ui.chart

Examples of org.openhab.ui.chart.ChartProvider



    // If a persistence service is specified, find the provider
    String serviceName = req.getParameter("service");

    ChartProvider provider = getChartProviders().get(providerName);
    if (provider == null)
      throw new ServletException("Could not get chart provider.");

    // Set the content type to that provided by the chart provider
    res.setContentType("image/" + provider.getChartType());
    try {
      BufferedImage chart = provider.createChart(serviceName, null, timeBegin, timeEnd, height, width,
          req.getParameter("items"), req.getParameter("groups"));
      ImageIO.write(chart, provider.getChartType().toString(), res.getOutputStream());
    } catch (ItemNotFoundException e) {
      logger.debug("Item not found error while generating chart.");
    } catch (IllegalArgumentException e) {
      logger.debug("Illegal argument in chart: {}", e);
    }
View Full Code Here

TOP

Related Classes of org.openhab.ui.chart.ChartProvider

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.