Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _get_graph(chart_type):
if chart_type == Encoding.chart_type_scatter:
graph = ScatterGraph()
elif chart_type == Encoding.chart_type_line:
graph = LineGraph()
elif chart_type == Encoding.chart_type_area:
graph = AreaGraph()
elif chart_type == Encoding.chart_type_bar:
graph = BarGraph()
elif chart_type == Encoding.chart_type_pie:
graph = PieGraph()
elif chart_type == Encoding.chart_type_table:
graph = DataGraph()
else:
raise ValueError("Cannot display chart of type {}".format(chart_type))
return graph