Create two python charting functions using google chart api
$25 USD
Complété
Publié il y a environ 7 ans
$25 USD
Payé lors de la livraison
I need two python functions created. Each function will render data provided to it in a chart format. Please read below for information about each function. I would like to use the Google Chart API, unless there is a better one to make the charts visually better.
Function1: Piechart
This function will create a pie chart image using the colors provided in data. The chart will be saved as a png to the filepath provided. If legend is true, the image will provide a legend showing what colors equate to what name. If overlay is true, each pie section will have the numeric count overlayed over the slice.
IMPORTANT NOTE: The data must stay in order as it is in the list
Input: ChartTitle (string), Data (list of dictionaries, see below), Outputfile(string, filepath), Legend=True,Overlay=True, Size=(height,width)#inches
Data structure:
data = [{'Name':'Critical',
'Count':10,
'Color':'Red'},#this is the color of the pie section
{'Name':'High',
'Count':6,
'Color':'Orange'},
{'Name':'Medium',
'Count':0,
'Color':'Yellow'},
{'Name':'Low',
'Count':7,
'Color':'Green'},
{'Name':'Info',
'Count':2,
'Color':'Blue'},
]
Fuction 2: Barchart
This function will create a bar chart image using the colors provided in data.
Input: ChartTitle (string), Data (list of dictionaries, see below),Barcolor='Blue', Outputfile(string, filepath),Overlay=True,Size=(height,width)#inches
data = [{'Name':'Item1',
'Count':10,},
{'Name':'Item2',
'Count':6,},
{'Name':'Item3',
'Count':0,},
{'Name':'Item4',
'Count':7,},
{'Name':'Item5',
'Count':2,},
]