Example #1
0
def make_bar_graph(title, labels, values, chart_names):
    try:
        bar_graph = BarGraph(title, labels, values, chart_names)
        bar_graph.give_graph()
    except (ValueError, IndexError):
        print("Incorrect arguments in bar graph")
    else:
        print("Bar Graph Made!")
Example #2
0
 def get_bar_graph(self, title, labels, values, chart_names):
     try:
         bar_graph = BarGraph(title, labels, values, chart_names)
         bar_graph.give_graph()
     except (ValueError, IndexError):
         print("Incorrect arguments in bar graph")
         return False
     else:
         print("Bar Graph Made!")
         return True
 def test_bar_names(self):
     bar_graph = BarGraph('bar title', ['one', 'two'], [1, 2],
                          ['chart name 1', 'chart name 2'])
     self.assertEqual(bar_graph.test_names(),
                      ['chart name 1', 'chart name 2'])
 def test_bar_build(self):
     bar_graph = BarGraph('bar title', ['one', 'two'], [1, 2],
                          ['chart name 1', 'chart name 2'])
     self.assertTrue(bar_graph.give_graph())
Example #5
0
 def barGraph(self, location):
     return BarGraph(
         DataHandler().getDataPoints(location, self.selectedTopic),
         self.selectedTopic, location)