@@ -231,48 +231,53 @@ Hello World, and Basic Usage
231
231
232
232
.. code-block :: python
233
233
234
+ # from a primitive array, using keyword arguments
235
+ my_chart = Chart(data = [[1 , 23 ], [2 , 34 ], [3 , 45 ]],
236
+ series_type = ' line' )
237
+
238
+ # from a primitive array, using the .from_array() method
239
+ my_chart = Chart.from_array([[1 , 23 ], [2 , 34 ], [3 , 45 ]],
240
+ series_type = ' line' )
241
+
242
+ # from a Numpy ndarray, using keyword arguments
243
+ my_chart = Chart(data = numpy_array, series_type = ' line' )
244
+
245
+ # from a Numpy ndarray, using the .from_array() method
246
+ my_chart = Chart.from_array(data = numpy_array, series_type = ' line' )
247
+
234
248
# from a JavaScript file
235
- my_chart = highcharts. Chart.from_js_literal(' my_js_literal.js' )
249
+ my_chart = Chart.from_js_literal(' my_js_literal.js' )
236
250
237
251
# from a JSON file
238
- my_chart = highcharts. Chart.from_json(' my_json.json' )
252
+ my_chart = Chart.from_json(' my_json.json' )
239
253
240
254
# from a Python dict
241
- my_chart = highcharts. Chart.from_dict(my_dict_obj)
255
+ my_chart = Chart.from_dict(my_dict_obj)
242
256
243
257
# from a Pandas dataframe
244
- my_chart = highcharts.Chart.from_pandas(df,
245
- property_map = {
246
- ' x' : ' transactionDate' ,
247
- ' y' : ' invoiceAmt' ,
248
- ' id' : ' id'
249
- },
250
- series_type = ' line' )
258
+ my_chart = Chart.from_pandas(df)
251
259
252
260
# from a PySpark dataframe
253
- my_chart = highcharts. Chart.from_pyspark(df,
254
- property_map = {
255
- ' x' : ' transactionDate' ,
256
- ' y' : ' invoiceAmt' ,
257
- ' id' : ' id'
258
- },
259
- series_type = ' line' )
261
+ my_chart = Chart.from_pyspark(df,
262
+ property_map = {
263
+ ' x' : ' transactionDate' ,
264
+ ' y' : ' invoiceAmt' ,
265
+ ' id' : ' id'
266
+ },
267
+ series_type = ' line' )
260
268
261
269
# from a CSV
262
- my_chart = highcharts.Chart.from_csv(' /some_file_location/filename.csv'
263
- column_property_map = {
264
- ' x' : 0 ,
265
- ' y' : 4 ,
266
- ' id' : 14
267
- },
268
- series_type = ' line' )
270
+ my_chart = Chart.from_csv(' /some_file_location/filename.csv' )
269
271
270
272
# from a HighchartsOptions configuration object
271
- my_chart = highcharts. Chart.from_options(my_options)
273
+ my_chart = Chart.from_options(my_options)
272
274
273
- # from a Series configuration
274
- my_chart = highcharts. Chart.from_series( my_series)
275
+ # from a Series configuration, using keyword arguments
276
+ my_chart = Chart( series = my_series)
275
277
278
+ # from a Series configuration, using .from_series()
279
+ my_chart = Chart.from_series(my_series)
280
+
276
281
277
282
3. Configure Global Settings (optional)
278
283
=============================================
@@ -300,9 +305,10 @@ Hello World, and Basic Usage
300
305
301
306
.. code-block :: python
302
307
303
- from highcharts_stock .options.title import Title
304
- from highcharts_stock .options.credits import Credits
308
+ from highcharts_core .options.title import Title
309
+ from highcharts_core .options.credits import Credits
305
310
311
+ # EXAMPLE 1.
306
312
# Using dicts
307
313
my_chart.title = {
308
314
' align' : ' center'
@@ -313,7 +319,7 @@ Hello World, and Basic Usage
313
319
314
320
my_chart.credits = {
315
321
' enabled' : True ,
316
- ' href' : ' https://www.highcharts .com/' ,
322
+ ' href' : ' https://www.highchartspython .com/' ,
317
323
' position' : {
318
324
' align' : ' center' ,
319
325
' vertical_align' : ' bottom' ,
@@ -328,14 +334,19 @@ Hello World, and Basic Usage
328
334
' text' : ' Chris Modzelewski'
329
335
}
330
336
337
+ # EXAMPLE 2.
331
338
# Using direct objects
332
- from highcharts_stock .options.title import Title
333
- from highcharts_stock .options.credits import Credits
339
+ from highcharts_core .options.title import Title
340
+ from highcharts_core .options.credits import Credits
334
341
335
- my_title = Title(text = ' The Title for My Chart' , floating = True , align = ' center' )
342
+ my_title = Title(text = ' The Title for My Chart' ,
343
+ floating = True ,
344
+ align = ' center' )
336
345
my_chart.options.title = my_title
337
346
338
- my_credits = Credits(text = ' Chris Modzelewski' , enabled = True , href = ' https://www.highcharts.com' )
347
+ my_credits = Credits(text = ' Chris Modzelewski' ,
348
+ enabled = True ,
349
+ href = ' https://www.highchartspython.com' )
339
350
my_chart.options.credits = my_credits
340
351
341
352
@@ -378,6 +389,13 @@ that will render the chart wherever it is you want it to go:
378
389
my_image_bytes = my_chart.download_chart(filename = ' my_target_file.png' ,
379
390
format = ' png' )
380
391
392
+ 8. Render Your Chart in a Jupyter Notebook
393
+ ===============================================
394
+
395
+ .. code-block :: python
396
+
397
+ my_chart.display()
398
+
381
399
--------------
382
400
383
401
***********************
0 commit comments