import pandas as pd
from bokeh.palettes import Spectral4
from bokeh.plotting import figure, output_file, show
data = pd.read_csv(‘data.csv’, encoding=’latin1′)

p = figure(plot_width=800, plot_height=400, x_axis_type=”datetime”)
p.title.text = ‘Analytical Chemical Result (Fake Data) of MW-001 | Fort JW AFB, Site 005’

pceData = data.loc[(data[“Well_ID”]==”AR-1″) & (data[“Analyte”]==”Tetrachloroethylene”)]
tceData = data.loc[(data[“Well_ID”]==”AR-1″) & (data[“Analyte”]==”Trichloroethylene”)]
benzData = data.loc[(data[“Well_ID”]==”AR-1″) & (data[“Analyte”]==”Benzene”)]

for data, name, color in zip([pceData, tceData, benzData], [“Tetrachloroethylene”, “Trichloroethylene”, “Benzene”], Spectral4):
df = pd.DataFrame(data)
df[‘date’] = pd.to_datetime(df[‘SDate’])
p.line(df[‘date’], df[‘Result’], line_width=2, color=color, alpha=0.8, muted_color=color, muted_alpha=0.2, legend=name)

p.legend.location = “top_left”
p.legend.click_policy=”mute”

output_file(“interactive_bokeh.html”, title=”interactive_bokeh.py example”)

show(p)