python-highcharts icon indicating copy to clipboard operation
python-highcharts copied to clipboard

Raise "KeyError: 'settingsFile'" on plotasyn

Open petroniocandido opened this issue 10 years ago • 2 comments

Hello,

I'm tryng to run this code, on the ipython notebook, using python 2.7.9 on a Ubuntu 14.04 :

options = dict(height=400, title=dict(text='My first chart!')) inline_chart = charts.plotasync(dict(data=[0], name='My series'), options=options, stock=True, show='inline', save='stocks', display=True) inline_chart.show()

And then show this error:


KeyError Traceback (most recent call last) in () 3 Gaussiana.novaInstancia()] 4 ,20,5,0.0001) ----> 5 melhor = busca.buscar(x) 6 melhor.plot(x) 7 print(melhor)

in buscar(self, x) 62 #plt.show() 63 options = dict(height=400, title=dict(text='My first chart!')) ---> 64 inline_chart = charts.plotasync(dict(data=[0], name='My series'), options=options, stock=True, show='inline', save='stocks', display=True) 65 inline_chart.show() 66

/usr/local/lib/python2.7/dist-packages/charts/plot.pyc in plotasync(series, options, type, height, save, stock, show, display, purge, live) 202 live=json.dumps(live), 203 url=json.dumps(address), --> 204 save=json.dumps(False) 205 ) 206

/usr/lib/python2.7/string.pyc in substitute(_args, *_kws) 174 raise ValueError('Unrecognized named group in pattern', 175 self.pattern) --> 176 return self.pattern.sub(convert, self.template) 177 178 def safe_substitute(_args, *_kws):

/usr/lib/python2.7/string.pyc in convert(mo) 164 named = mo.group('named') or mo.group('braced') 165 if named is not None: --> 166 val = mapping[named] 167 # We use this idiom instead of str() because the latter will 168 # fail if val is a Unicode containing non-ASCII characters.

KeyError: 'settingsFile'

thanks!!! :-)

petroniocandido avatar Sep 10 '15 14:09 petroniocandido

I'm stuck on this one too! Any ideas?

drjmcauliffe avatar Feb 09 '16 00:02 drjmcauliffe

the issue is that charts/index-async.html has a line var settingsFile = $#settingsFile and the Template.substitute() call is unhappy about not being able to perform this substitution. deleting (not merely commenting) that line allows one to get past this. I'm unclear on what the intended behavior is here.

nparrish42 avatar Jul 12 '18 10:07 nparrish42