In [1]:
import pandas as pd
import highcharts_df
from datetime import date

In [17]:
df = pd.DataFrame.from_records([
    {
        "year": 2013,
        "peace_index": 8,
        "world_chocolate_consumption": 8
    },
    {
        "year": 2014,
        "peace_index": 6,
        "world_chocolate_consumption": 9
    },
    {
        "year": 2015,
        "peace_index": 7,
        "world_chocolate_consumption": 8
    },
    {
        "year": 2016,
        "peace_index": 4,
        "world_chocolate_consumption": 7
    },
    {
        "year": 2017,
        "peace_index": 3,
        "world_chocolate_consumption": 3
    },
    {
        "year": 2018,
        "peace_index": 2,
        "world_chocolate_consumption": 1
    },
    {
        "year": 2019,
        "peace_index": 2,
        "world_chocolate_consumption": 1
    },
    {
        "year": 2020,
        "peace_index": 1,
        "world_chocolate_consumption": 1
    },
    {
        "year": 2021,
        "peace_index": 5,
        "world_chocolate_consumption": 0
    },
    {
        "year": 2022,
        "peace_index": 6,
        "world_chocolate_consumption": 6
    },
])
highcharts_df.pplot_from_df(
    df.set_index('year'), 
    title="World Peace and Chocolate",
    subtitle='Peace never tasted so good',
    xlabel="",
    ylabel="index"
)


Out[17]:

In [ ]: