generate chart from HTML tables. filter and sort the table data