def createDataSet():
  dataset = DefaultBoxAndWhiskerCategoryDataset()
  for i in range(0, 3):#Generate 3 series for each category
    for j in range(0,5):#Generate 5 Categories
      list = createValueList(0.0, 20.0, 20)
      dataset.add(list, "Series " + str(i), "Category " + str(j))#Add a list of value for 1 rowKey (Serie), 1 columnKey (Category)
  return dataset
Esempio n. 2
0
def box(data):
  """
  Creates a box and whiskers plot.

  *data* is a ``dict`` whose keys are category names and values are list of
  numeric values.
  """
  dataset  = DefaultBoxAndWhiskerCategoryDataset()
  for name, values in data.iteritems():    
    dataset.add(values, "", name);
  chart = ChartFactory.createBoxAndWhiskerChart("", "", "", dataset, True)
  return Chart(chart)