def ayuthaya():
    """ """
    list_date, list_do, list_ec, list_temp, ave_do_ayuthaya, ave_ec_ayuthaya, ave_temp_ayuthaya = riverside_ayuthaya.data_split()
    list_mean_ec_in_aday = average_per_day(list_ec, list_date)

    #created HTML
    output_file = open('Chart mean EC in a day of Ayuthaya.html', 'w')
    chart = lineChart(name="lineChart Ayuthaya E.C.", width = 1244)
    xdata = range(1, 32)
    ydata4 = list_mean_ec_in_aday[:31]
    ydata5 = list_mean_ec_in_aday[31:62]
    ydata6 = list_mean_ec_in_aday[62:]

    chart.add_serie(y=ydata4, x=xdata, name='ก.ค.')
    chart.add_serie(y=ydata5, x=xdata, name='ส.ค.')
    chart.add_serie(y=ydata6, x=xdata, name='ก.ย.')
    chart.buildhtml()
    output_file.write(chart.htmlcontent)
    # close Html file
    output_file.close()
import riverside_ayuthaya
import riverside_bangsai
import riverside_chainat
import riverside_dowkanong
import riverside_nakhonsawan
import riverside_pamok
import riverside_samlae
from nvd3 import discreteBarChart

list_date, list_do, list_ec, list_temp, ave_do_ayuthaya, ave_ec_ayuthaya, ave_temp_ayuthaya = riverside_ayuthaya.data_split()
list_date, list_do, list_ec, list_temp, ave_do_bangsai, ave_ec_bangsai, ave_temp_bangsai = riverside_bangsai.data_split()
list_date, list_do, list_ec, list_temp, ave_do_chainat, ave_ec_chainat, ave_temp_chainat = riverside_chainat.data_split()
list_date, list_do, list_ec, list_temp, ave_do_dowkanong, ave_ec_dowkanong, ave_temp_dowkanong = riverside_dowkanong.data_split()
list_date, list_do, list_ec, list_temp, ave_do_nakhonsawan, ave_ec_nakhonsawan, ave_temp_nakhonsawan = riverside_nakhonsawan.data_split()
list_date, list_do, list_ec, list_temp, ave_do_pamok, ave_ec_pamok, ave_temp_pamok = riverside_pamok.data_split()
list_date, list_do, list_ec, list_temp, ave_do_samlae, ave_ec_samlae, ave_temp_samlae = riverside_samlae.data_split()
#print(ave_do_ayuthaya, ave_do_bangsai, ave_do_chainat, ave_do_dowkanong, ave_do_nakhonsawan, ave_do_pamok, ave_do_samlae)
all_ave_do = [ave_do_ayuthaya, ave_do_bangsai, ave_do_chainat, ave_do_dowkanong, ave_do_nakhonsawan, ave_do_pamok, ave_do_samlae]
all_ave_ec = [ave_ec_ayuthaya, ave_ec_bangsai, ave_ec_chainat, ave_ec_dowkanong, ave_ec_nakhonsawan, ave_ec_pamok, ave_ec_samlae]
all_ave_temp = [ave_temp_ayuthaya, ave_temp_bangsai, ave_temp_chainat, ave_temp_dowkanong, ave_temp_nakhonsawan, ave_temp_pamok, ave_temp_samlae]

#created HTML
def ave_do_chart():
    output_file = open('ave_do_chart.html', 'w')
    chart = discreteBarChart(name='discreteBarChart of average D.O.', width=1244)

    xdata = ["Ayuthaya", "Bangsai", "Chainat", "Dowkanong", "Nakhonsawan", "Pamok", "Samlea"]
    ydata = all_ave_do

    extra_serie = {"tooltip": {"y_start": "", "y_end": "m/L"}}
    chart.add_serie(y=ydata, x=xdata, name='D.O.', extra=extra_serie)