I have a dataframe that I want to plot in a column chart. The dataframe shows percentages in decimal points (such as 0.9994400) and I would like to show them on my chart as 99.944%.
I've tried to change the axis of the chart multiple times, but the values always round up to 100%. How can I get the axis and hover numbers to show the decimal points?
For example, the first data point should show 99.944%, but it shows 100%.
My dataframe: df_uptime_percentage
| Name | Percentage |
|---|---|
| API 1 | 0.9994400 |
| API 2 | 0.999914 |
| API 3 | 0.999913 |
| API 4 | 0.999925 |
| API 5 | 0.999461 |
My plot script:
cf.go_offline()
fig = df_uptime_percentage.iplot(kind='bar',
yTitle='Percent Uptime',
xTitle='API Endpoint',
asFigure = True)
fig.update_layout(yaxis_tickformat = '%')
fig.update_layout(hovermode="x unified")
fig.iplot()
My imported libraries:
import time
from dateutil.relativedelta import relativedelta
import math
import requests
import re
import json
import pandas as pd
import cufflinks as cf
from plotly.offline import download_plotlyjs, init_notebook_mode, iplot
from plotly.graph_objs import *
init_notebook_mode()
%matplotlib inline

