I understood the problem and i am at last mile ,giving the modified code this plots all the Y axis value with reference to the X axis .Now it is perfectly fine.
Only one problem ,the X axis label is not coming ,what needs to be changed to get the X axis label here .If the X axis label is coming then everything will be alright.
what should be text=datalistFg, ? to get right X axis labels.
import pandas as pd
from io import StringIO
import requests
import pandas as pd
import numpy as np
from bs4 import BeautifulSoup
from nsepy import get_history
import plotly
plotly.__version__
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
import plotly.graph_objs as go
init_notebook_mode(connected=True)
#import plotly.plotly as py
from datetime import date
from datetime import datetime
datalist = pd.read_table(r'D:\pml\1065025170_20180808062710.tab',sep='\t') #sep=\s+|\t+
datalistFg=pd.value_counts(datalist['Function group'].values, sort=True)
datalistRp=pd.value_counts(datalist['Responsible person'].values, sort=True)
datalist1 = datalist.groupby('Function group').nunique()
#print(datalist1)
#graphing place
otrace1 =go.Bar(
#x=stock_opt_pe.index
x=datalist['Function group'].nunique(),
y=datalist['Function group'].value_counts(),
text=datalistFg,
textposition = 'auto',
#xaxis-type (enumerated: “-” | “linear” | “log” | “date” | “category” )
#xaxis-type (enumerated: “-” | “linear” | “log” | “date” | “category” )
#name='Function Group Vx RespPerson',
#orientation = 'v',
#marker = dict(
#color = 'rgba(224, 224, 224, 0.6)',
#line = dict(
#color = 'rgba(246, 250, 206, 1.0)',
#color = 'rgb(60, 60, 60)',
#width = 0)
#)
)
odata = [otrace1]
olayout = go.Layout(
title = "TESTING",
xaxis=dict(
tickangle=35,
showticklabels=True,
type='category',
title='Function group',
tickmode='linear'),
barmode="stack"
)
fig = dict(data=odata, layout=olayout)
#fig = dict(data=odata)
iplot(fig, filename = 'D:/python/test/Test-{}.html'.format("Testing"))
plot(fig,show_link = True, filename = 'D:/python/test/test_{}.html'.format("Testing"))