title: How to create dynamic column chart in excel using java poi or jfree jar
body: <p>i need to create a dynamic column chart in excel report compare with 2 columns values(sale and margin) based on selected dates. already i am generating excel report using poi's WriteableWork object. but i need to generate the charts dynamically.</p>
  
  <p>this method is to create excel report</p>
  
  <pre><code>public String excelReport() throws ParseException, IOException {
  try {
      ByteArrayOutputStream bos = new ByteArrayOutputStream();
      WritableWorkbook w = Workbook.createWorkbook(bos);
      WritableSheet sheet = w.createSheet("Page 1", 0);
      // Create Filename
      String filenameDate = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
      attachmentName = "attachment; filename=\"test".xls\"" ;
  
              int headerCol = 0;
              addBoldCell(sheet, headerCol++, 0, "Date");
              addBoldCell(sheet, headerCol++, 0,"Sale");
              addBoldCell(sheet, headerCol++, 0,"Margin");
       int row = 1;
       int col = 0;
               addNumberCell(sheet, col++, row, date);
               addNumberCell(sheet, col++, row, 20000);
           addNumberCell(sheet, col++, row, 500); 
  
      w.write();
      w.close();
      bufferSize = bos.size();
      fileInputStream = new ByteArrayInputStream(bos.toByteArray());
  
  } catch (Exception e) {
      log.warn("Error creating an Excel file.", e);
  } finally {
      if (out != null) {
          out.close();
          }
      }
  }
  return SUCCESS;
  }
  </code></pre>
  
  <p>In struts.xml</p>
  
  <pre><code>&lt;action name="excelReport" method="excelReport" class="com.test.action.ReportAction"&gt;
          &lt;result name="success" type="stream"&gt;
              &lt;param name="contentType"&gt;application/vnd.ms-excel&lt;/param&gt;
              &lt;param name="contentDisposition"&gt;${attachmentName}&lt;/param&gt;
              &lt;param name="inputName"&gt;fileInputStream&lt;/param&gt;
              &lt;param name="bufferSize"&gt;${bufferSize}&lt;/param&gt;
          &lt;/result&gt;
      &lt;/action&gt;
  </code></pre>
  
  <p>Excel Report i am getting succesfully, i want chart for this excel values like below sample chart</p>
  
  <p><a href="https://i.stack.imgur.com/2RlDS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2RlDS.png" alt="enter image description here"></a></p>
  
  <p>i tried with some poi and jfree samples but not getting solution.</p>