@@ -212,49 +212,53 @@ Hello World, and Basic Usage
212212
213213 .. code-block :: python
214214
215+ # from a primitive array, using keyword arguments
216+ my_chart = Chart(data = [[1 , 23 ], [2 , 34 ], [3 , 45 ]],
217+ series_type = ' line' )
218+
219+ # from a primitive array, using the .from_array() method
220+ my_chart = Chart.from_array([[1 , 23 ], [2 , 34 ], [3 , 45 ]],
221+ series_type = ' line' )
222+
223+ # from a Numpy ndarray, using keyword arguments
224+ my_chart = Chart(data = numpy_array, series_type = ' line' )
225+
226+ # from a Numpy ndarray, using the .from_array() method
227+ my_chart = Chart.from_array(data = numpy_array, series_type = ' line' )
228+
215229 # from a JavaScript file
216- my_chart = highcharts. Chart.from_js_literal(' my_js_literal.js' )
230+ my_chart = Chart.from_js_literal(' my_js_literal.js' )
217231
218232 # from a JSON file
219- my_chart = highcharts. Chart.from_json(' my_json.json' )
233+ my_chart = Chart.from_json(' my_json.json' )
220234
221235 # from a Python dict
222- my_chart = highcharts. Chart.from_dict(my_dict_obj)
236+ my_chart = Chart.from_dict(my_dict_obj)
223237
224238 # from a Pandas dataframe
225- my_chart = highcharts.Chart.from_pandas(df,
226- property_map = {
227- ' x' : ' transactionDate' ,
228- ' y' : ' invoiceAmt' ,
229- ' id' : ' id'
230- },
231- series_type = ' line' )
239+ my_chart = Chart.from_pandas(df)
232240
233241 # from a PySpark dataframe
234- my_chart = highcharts. Chart.from_pyspark(df,
235- property_map = {
236- ' x' : ' transactionDate' ,
237- ' y' : ' invoiceAmt' ,
238- ' id' : ' id'
239- },
240- series_type = ' line' )
242+ my_chart = Chart.from_pyspark(df,
243+ property_map = {
244+ ' x' : ' transactionDate' ,
245+ ' y' : ' invoiceAmt' ,
246+ ' id' : ' id'
247+ },
248+ series_type = ' line' )
241249
242250 # from a CSV
243- my_chart = highcharts.Chart.from_csv(' /some_file_location/filename.csv'
244- column_property_map = {
245- ' x' : 0 ,
246- ' y' : 4 ,
247- ' id' : 14
248- },
249- series_type = ' line' )
251+ my_chart = Chart.from_csv(' /some_file_location/filename.csv' )
250252
251253 # from a HighchartsOptions configuration object
252- my_chart = highcharts.Chart.from_options(my_options)
253-
254- # from a Series configuration
255- my_chart = highcharts.Chart.from_series(my_series)
254+ my_chart = Chart.from_options(my_options)
256255
256+ # from a Series configuration, using keyword arguments
257+ my_chart = Chart(series = my_series)
257258
259+ # from a Series configuration, using .from_series()
260+ my_chart = Chart.from_series(my_series)
261+
258262 3. Configure Global Settings (optional)
259263=============================================
260264
@@ -284,6 +288,7 @@ Hello World, and Basic Usage
284288 from highcharts_core.options.title import Title
285289 from highcharts_core.options.credits import Credits
286290
291+ # EXAMPLE 1.
287292 # Using dicts
288293 my_chart.title = {
289294 ' align' : ' center'
@@ -294,7 +299,7 @@ Hello World, and Basic Usage
294299
295300 my_chart.credits = {
296301 ' enabled' : True ,
297- ' href' : ' https://www.highcharts .com/' ,
302+ ' href' : ' https://www.highchartspython .com/' ,
298303 ' position' : {
299304 ' align' : ' center' ,
300305 ' vertical_align' : ' bottom' ,
@@ -309,17 +314,21 @@ Hello World, and Basic Usage
309314 ' text' : ' Chris Modzelewski'
310315 }
311316
317+ # EXAMPLE 2.
312318 # Using direct objects
313319 from highcharts_core.options.title import Title
314320 from highcharts_core.options.credits import Credits
315321
316- my_title = Title(text = ' The Title for My Chart' , floating = True , align = ' center' )
322+ my_title = Title(text = ' The Title for My Chart' ,
323+ floating = True ,
324+ align = ' center' )
317325 my_chart.options.title = my_title
318326
319- my_credits = Credits(text = ' Chris Modzelewski' , enabled = True , href = ' https://www.highcharts.com' )
327+ my_credits = Credits(text = ' Chris Modzelewski' ,
328+ enabled = True ,
329+ href = ' https://www.highchartspython.com' )
320330 my_chart.options.credits = my_credits
321331
322-
323332 5. Generate the JavaScript Code for Your Chart
324333=================================================
325334
@@ -328,9 +337,11 @@ that will render the chart wherever it is you want it to go:
328337
329338 .. code-block :: python
330339
340+ # EXAMPLE 1.
331341 # as a string
332342 js_as_str = my_chart.to_js_literal()
333343
344+ # EXAMPLE 2.
334345 # to a file (and as a string)
335346 js_as_str = my_chart.to_js_literal(filename = ' my_target_file.js' )
336347
@@ -359,6 +370,14 @@ that will render the chart wherever it is you want it to go:
359370 my_image_bytes = my_chart.download_chart(filename = ' my_target_file.png' ,
360371 format = ' png' )
361372
373+
374+ 8. Render Your Chart in a Jupyter Notebook
375+ ===============================================
376+
377+ .. code-block :: python
378+
379+ my_chart.display()
380+
362381--------------
363382
364383***********************
0 commit comments