Ejemplo n.º 1
0
 def createChart(self):
     dataset = XYSeriesCollection()
     for s in self.allSeries:
         dataset.addSeries(s)
     # title is None
     chart = ChartFactory.createXYBarChart( \
                 None, xlabel(), False, ylabel(), \
                 dataset, PlotOrientation.VERTICAL, \
                 True, True, False)
     return chart
Ejemplo n.º 2
0
 def createChart(self):
     dataset = XYSeriesCollection()
     for s in self.allSeries:
         dataset.addSeries(s)
     # title is None
     chart = ChartFactory.createXYBarChart( \
                 None, xlabel(), False, ylabel(), \
                 dataset, PlotOrientation.VERTICAL, \
                 True, True, False)
     return chart
Ejemplo n.º 3
0
def xy(data, name='', xlabel='', ylabel=''):
  """
  Creates a xy bar chart.         

  *data* is a list of (x,y) tuples
  """        
  series = XYSeries(name);
  for x,y in data:
    series.add(x,y)

  dataset =  XYSeriesCollection(series)
  chart = ChartFactory.createXYBarChart(None, xlabel, False, ylabel, dataset,
    PlotOrientation.VERTICAL, True, True, False)
  return Chart(chart)
Ejemplo n.º 4
0
def xy(data, name="", xlabel="", ylabel=""):
    """
  Creates a xy bar chart.         

  *data* is a list of (x,y) tuples
  """
    series = XYSeries(name)
    for x, y in data:
        series.add(x, y)

    dataset = XYSeriesCollection(series)
    if len(data) > 1:
        # hack to set interval width
        x0, x1 = data[0][0], data[1][0]
        dataset.setIntervalWidth(x1 - x0)

    chart = ChartFactory.createXYBarChart(
        None, xlabel, False, ylabel, dataset, PlotOrientation.VERTICAL, True, True, False
    )
    return Chart(chart)
Ejemplo n.º 5
0
def xy(data, name='', xlabel='', ylabel=''):
    """
  Creates a xy bar chart.         

  *data* is a list of (x,y) tuples
  """
    series = XYSeries(name)
    for x, y in data:
        series.add(x, y)

    dataset = XYSeriesCollection(series)
    if len(data) > 1:
        # hack to set interval width
        x0, x1 = data[0][0], data[1][0]
        dataset.setIntervalWidth(x1 - x0)

    chart = ChartFactory.createXYBarChart(None, xlabel, False, ylabel, dataset,
                                          PlotOrientation.VERTICAL, True, True,
                                          False)
    return Chart(chart)