{"performances":{"performances":[{"event_date":"18031231","id":67667,"event_id":27474,"work_id":3774,"title_clean":"The English Fleet in 1342","count":6,"genre_colour":"#0048ff","genre":"Comedy","source_genre":"Pantomime","source_genre_colour":"#ffe600","total_performances_for_work":48,"filtered_performances_for_work":6,"work":{"id":3774,"lsdb_id":null,"title":"The English Fleet in 1342","title_variant":null,"type_1":"mainpiece","type_2":null,"source_1":null,"source_2":null,"first_performed_date":null,"publication_date":"1803","notes":null,"created_at":"2023-05-29T12:22:27.000000Z","updated_at":"2024-12-16T13:08:15.000000Z","deleted_at":null,"genre_id":2,"performance_medium":"Musical","date_type":"Performed","genre":{"id":2,"label":"Comedy","description":null,"lod_type":null,"lod_uri":null,"created_at":"2023-06-22T10:30:16.000000Z","updated_at":"2023-06-22T10:30:16.000000Z"}}},{"event_date":"18031230","id":67665,"event_id":27473,"work_id":3757,"title_clean":"John Bull; or, An Englishman's Fire-side","count":2,"genre_colour":"#0048ff","genre":"Comedy","source_genre":"Pantomime","source_genre_colour":"#ffe600","total_performances_for_work":97,"filtered_performances_for_work":2,"work":{"id":3757,"lsdb_id":null,"title":"John Bull; or, An Englishman's Fire Side","title_variant":null,"type_1":"mainpiece","type_2":null,"source_1":null,"source_2":null,"first_performed_date":null,"publication_date":"1803","notes":null,"created_at":"2023-04-24T14:21:57.000000Z","updated_at":"2024-05-16T09:20:55.000000Z","deleted_at":null,"genre_id":2,"performance_medium":"Spoken Drama","date_type":"Performed","genre":{"id":2,"label":"Comedy","description":null,"lod_type":null,"lod_uri":null,"created_at":"2023-06-22T10:30:16.000000Z","updated_at":"2023-06-22T10:30:16.000000Z"}}},{"event_date":"18031226","id":67657,"event_id":27469,"work_id":2331,"title_clean":"The Suspicious Husband","count":1,"genre_colour":"#0048ff","genre":"Comedy","source_genre":"Pantomime","source_genre_colour":"#ffe600","total_performances_for_work":281,"filtered_performances_for_work":1,"work":{"id":2331,"lsdb_id":2331,"title":"The Suspicious Husband","title_variant":null,"type_1":"mainpiece","type_2":null,"source_1":null,"source_2":null,"first_performed_date":null,"publication_date":"1747","notes":null,"created_at":"2022-11-01T23:59:19.000000Z","updated_at":"2023-10-11T09:30:32.000000Z","deleted_at":null,"genre_id":2,"performance_medium":"Spoken Drama","date_type":"Performed","genre":{"id":2,"label":"Comedy","description":null,"lod_type":null,"lod_uri":null,"created_at":"2023-06-22T10:30:16.000000Z","updated_at":"2023-06-22T10:30:16.000000Z"}}},{"event_date":"18031227","id":67659,"event_id":27470,"work_id":927,"title_clean":"King Richard the Third","count":1,"genre_colour":"#bd6500","genre":"History","source_genre":"Pantomime","source_genre_colour":"#ffe600","total_performances_for_work":476,"filtered_performances_for_work":1,"work":{"id":927,"lsdb_id":927,"title":"Richard III","title_variant":null,"type_1":"mainpiece","type_2":null,"source_1":null,"source_2":null,"first_performed_date":null,"publication_date":"1592","notes":"1592-94","created_at":"2022-11-01T23:59:16.000000Z","updated_at":"2023-10-09T09:44:03.000000Z","deleted_at":null,"genre_id":5,"performance_medium":"Spoken Drama","date_type":"Performed","genre":{"id":5,"label":"History","description":null,"lod_type":null,"lod_uri":null,"created_at":"2023-06-22T10:30:52.000000Z","updated_at":"2023-06-22T10:30:52.000000Z"}}},{"event_date":"18031228","id":67661,"event_id":27471,"work_id":2882,"title_clean":"The Man of the World","count":1,"genre_colour":"#0048ff","genre":"Comedy","source_genre":"Pantomime","source_genre_colour":"#ffe600","total_performances_for_work":124,"filtered_performances_for_work":1,"work":{"id":2882,"lsdb_id":2882,"title":"The Man of the World","title_variant":null,"type_1":"mainpiece","type_2":null,"source_1":"The True-Born Scotsman","source_2":null,"first_performed_date":null,"publication_date":"1781","notes":null,"created_at":"2022-11-01T23:59:20.000000Z","updated_at":"2024-09-03T15:57:28.000000Z","deleted_at":null,"genre_id":2,"performance_medium":"Spoken Drama","date_type":"Performed","genre":{"id":2,"label":"Comedy","description":null,"lod_type":null,"lod_uri":null,"created_at":"2023-06-22T10:30:16.000000Z","updated_at":"2023-06-22T10:30:16.000000Z"}}},{"event_date":"18031229","id":67663,"event_id":27472,"work_id":655,"title_clean":"Romeo and Juliet","count":1,"genre_colour":"#ff0000","genre":"Tragedy","source_genre":"Pantomime","source_genre_colour":"#ffe600","total_performances_for_work":482,"filtered_performances_for_work":1,"work":{"id":655,"lsdb_id":655,"title":"Romeo and Juliet","title_variant":null,"type_1":"mainpiece","type_2":null,"source_1":null,"source_2":null,"first_performed_date":null,"publication_date":"1597","notes":null,"created_at":"2022-11-01T23:59:15.000000Z","updated_at":"2023-10-11T12:01:17.000000Z","deleted_at":null,"genre_id":13,"performance_medium":"Spoken Drama","date_type":"Published","genre":{"id":13,"label":"Tragedy","description":null,"lod_type":null,"lod_uri":null,"created_at":"2023-06-22T10:32:10.000000Z","updated_at":"2023-06-22T10:32:10.000000Z"}}},{"event_date":"18040109","id":67717,"event_id":27791,"work_id":1944,"title_clean":"The Provoked Husband","count":1,"genre_colour":"#0048ff","genre":"Comedy","source_genre":"Pantomime","source_genre_colour":"#ffe600","total_performances_for_work":410,"filtered_performances_for_work":1,"work":{"id":1944,"lsdb_id":1944,"title":"The Provoked Husband; or, A Journey to London","title_variant":null,"type_1":"mainpiece","type_2":null,"source_1":null,"source_2":null,"first_performed_date":null,"publication_date":"1728","notes":null,"created_at":"2022-11-01T23:59:18.000000Z","updated_at":"2024-10-25T14:29:05.000000Z","deleted_at":null,"genre_id":2,"performance_medium":"Spoken Drama","date_type":"Performed","genre":{"id":2,"label":"Comedy","description":null,"lod_type":null,"lod_uri":null,"created_at":"2023-06-22T10:30:16.000000Z","updated_at":"2023-06-22T10:30:16.000000Z"}}}],"total_performances":13,"covent_garden_performances":13,"drury_lane_performances":0,"date_ranged_total_performances":13,"date_ranged_covent_garden_performances":13,"date_ranged_drury_lane_performances":0,"from_year":1732,"to_year":1809},"genre_colour":"#ffe600","performances_html":"<div class=\"row\">\n    <h3>Performances<\/h3>\n\n    <div class=\"table-responsive\">\n        <table class=\"table mt-3 table-striped\">\n            <thead>\n\n\n                \n\n                <tr>\n                    <th><a class=\"sort\" data-order=\"asc\" id=\"sort-dates\"\n                            data-sort=\"event_date\">Dates <\/a><\/th>\n\n                    <th><a class=\"sort\" data-order=\"desc\"\n                            id=\"sort-theatre\" data-sort=\"theatre_name\">Theatre <\/a><\/th>\n\n                    <th style=\"white-space: nowrap\">Performances<\/th>\n                    <th><a class=\"sort\" data-order=\"desc\"\n                            id=\"sort-command\" data-sort=\"is_requested\">Requested <\/a><\/th>\n                    <th style=\"white-space: nowrap\"><a class=\"sort\"\n                            data-order=\"desc\"\n                            id=\"sort-command\" data-sort=\"is_command_performance\">Commands <\/a>\n                    <\/th>\n                    <th><a class=\"sort\" data-order=\"desc\"\n                            id=\"sort-benefit\" data-sort=\"is_benefit\">Benefit <\/a><\/th>\n                    <th><a class=\"sort\" data-order=\"desc\"\n                            id=\"sort-revenue\" data-sort=\"event_total_receipts\">Revenue <\/a><\/th>\n                    <th style=\"white-space: nowrap\"><a class=\"sort\"\n                            data-order=\"desc\"\n                            id=\"sort-type\" data-sort=\"percentage_portion_of_receipts\">Available\n                            Revenue %<\/a><\/th>\n                    <th style=\"white-space: nowrap\"><a class=\"sort\"\n                            data-order=\"desc\" id=\"sort-type\"\n                            data-sort=\"portion_of_capacity\">Capacity %<\/a><\/th>\n                    <\/th>\n                <\/tr>\n            <\/thead>\n            <tbody>\n                                                    \n                    <tr class=\"performance play-row\">\n                        <td style=\"white-space: nowrap\"><a\n                                href=\"https:\/\/data.theatronomics.com\/this-day\/1803-12-26?theatre=CG\">26 Dec 1803<\/a><\/td>\n                        <td class=\"text-nowrap\">Covent Garden<\/td>\n                        <td><i><a target=\"_blank\" href=\"\/plays\/2331\" title=\"More info on The Suspicious Husband\">The Suspicious Husband<\/a>, <a target=\"_blank\" href=\"\/plays\/3793\" title=\"More info on Harlequin's Races; or, Time Beats All\">Harlequin's Races; or, Time Beats All<\/a><\/i><\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\u00a3381 6d<\/td>\n                        <td>55%<\/td>\n                        <td>N\/A<\/td>\n                    <\/tr>\n                                    \n                    <tr class=\"performance play-row\">\n                        <td style=\"white-space: nowrap\"><a\n                                href=\"https:\/\/data.theatronomics.com\/this-day\/1803-12-27?theatre=CG\">27 Dec 1803<\/a><\/td>\n                        <td class=\"text-nowrap\">Covent Garden<\/td>\n                        <td><i><a target=\"_blank\" href=\"\/plays\/927\" title=\"More info on King Richard the Third\">King Richard the Third<\/a>, <a target=\"_blank\" href=\"\/plays\/3793\" title=\"More info on Harlequin's Races; or, Time Beats All\">Harlequin's Races; or, Time Beats All<\/a><\/i><\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\u00a3310 5s 6d<\/td>\n                        <td>60%<\/td>\n                        <td>N\/A<\/td>\n                    <\/tr>\n                                    \n                    <tr class=\"performance play-row\">\n                        <td style=\"white-space: nowrap\"><a\n                                href=\"https:\/\/data.theatronomics.com\/this-day\/1803-12-28?theatre=CG\">28 Dec 1803<\/a><\/td>\n                        <td class=\"text-nowrap\">Covent Garden<\/td>\n                        <td><i><a target=\"_blank\" href=\"\/plays\/2882\" title=\"More info on The Man of the World\">The Man of the World<\/a>, <a target=\"_blank\" href=\"\/plays\/3793\" title=\"More info on Harlequin's Races; or, Time Beats All\">Harlequin's Races; or, Time Beats All<\/a><\/i><\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\u00a3297 6s<\/td>\n                        <td>54%<\/td>\n                        <td>N\/A<\/td>\n                    <\/tr>\n                                    \n                    <tr class=\"performance play-row\">\n                        <td style=\"white-space: nowrap\"><a\n                                href=\"https:\/\/data.theatronomics.com\/this-day\/1803-12-29?theatre=CG\">29 Dec 1803<\/a><\/td>\n                        <td class=\"text-nowrap\">Covent Garden<\/td>\n                        <td><i><a target=\"_blank\" href=\"\/plays\/655\" title=\"More info on Romeo and Juliet\">Romeo and Juliet<\/a>, <a target=\"_blank\" href=\"\/plays\/3793\" title=\"More info on Harlequin's Races; or, Time Beats All\">Harlequin's Races; or, Time Beats All<\/a><\/i><\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\u00a3277 2s<\/td>\n                        <td>49%<\/td>\n                        <td>N\/A<\/td>\n                    <\/tr>\n                                    \n                    <tr class=\"performance play-row\">\n                        <td style=\"white-space: nowrap\"><a\n                                href=\"https:\/\/data.theatronomics.com\/this-day\/1803-12-30?theatre=CG\">30 Dec 1803<\/a><\/td>\n                        <td class=\"text-nowrap\">Covent Garden<\/td>\n                        <td><i><a target=\"_blank\" href=\"\/plays\/3757\" title=\"More info on John Bull; or, An Englishman's Fire-side\">John Bull; or, An Englishman's Fire-side<\/a>, <a target=\"_blank\" href=\"\/plays\/3793\" title=\"More info on Harlequin's Races; or, Time Beats All\">Harlequin's Races; or, Time Beats All<\/a><\/i><\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\u00a3294 1s<\/td>\n                        <td>62%<\/td>\n                        <td>N\/A<\/td>\n                    <\/tr>\n                                    \n                    <tr class=\"performance play-row\">\n                        <td style=\"white-space: nowrap\"><a\n                                href=\"https:\/\/data.theatronomics.com\/this-day\/1803-12-31?theatre=CG\">31 Dec 1803<\/a><\/td>\n                        <td class=\"text-nowrap\">Covent Garden<\/td>\n                        <td><i><a target=\"_blank\" href=\"\/plays\/3774\" title=\"More info on The English Fleet in 1342\">The English Fleet in 1342<\/a>, <a target=\"_blank\" href=\"\/plays\/3793\" title=\"More info on Harlequin's Races; or, Time Beats All\">Harlequin's Races; or, Time Beats All<\/a><\/i><\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\u00a3319 15s 6d<\/td>\n                        <td>63%<\/td>\n                        <td>N\/A<\/td>\n                    <\/tr>\n                                    \n                    <tr class=\"performance play-row\">\n                        <td style=\"white-space: nowrap\"><a\n                                href=\"https:\/\/data.theatronomics.com\/this-day\/1804-01-02?theatre=CG\">02 Jan 1804<\/a><\/td>\n                        <td class=\"text-nowrap\">Covent Garden<\/td>\n                        <td><i><a target=\"_blank\" href=\"\/plays\/3774\" title=\"More info on The English Fleet in 1342\">The English Fleet in 1342<\/a>, <a target=\"_blank\" href=\"\/plays\/3793\" title=\"More info on Harlequin's Races; or, Time Beats All\">Harlequin's Races; or, Time Beats All<\/a><\/i><\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\u00a3363 7s<\/td>\n                        <td>46%<\/td>\n                        <td>N\/A<\/td>\n                    <\/tr>\n                                    \n                    <tr class=\"performance play-row\">\n                        <td style=\"white-space: nowrap\"><a\n                                href=\"https:\/\/data.theatronomics.com\/this-day\/1804-01-03?theatre=CG\">03 Jan 1804<\/a><\/td>\n                        <td class=\"text-nowrap\">Covent Garden<\/td>\n                        <td><i><a target=\"_blank\" href=\"\/plays\/3774\" title=\"More info on The English Fleet in 1342\">The English Fleet in 1342<\/a>, <a target=\"_blank\" href=\"\/plays\/3793\" title=\"More info on Harlequin's Races; or, Time Beats All\">Harlequin's Races; or, Time Beats All<\/a><\/i><\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\u00a3336 19s<\/td>\n                        <td>47%<\/td>\n                        <td>N\/A<\/td>\n                    <\/tr>\n                                    \n                    <tr class=\"performance play-row\">\n                        <td style=\"white-space: nowrap\"><a\n                                href=\"https:\/\/data.theatronomics.com\/this-day\/1804-01-04?theatre=CG\">04 Jan 1804<\/a><\/td>\n                        <td class=\"text-nowrap\">Covent Garden<\/td>\n                        <td><i><a target=\"_blank\" href=\"\/plays\/3757\" title=\"More info on John Bull; or, An Englishman's Fire-Side\">John Bull; or, An Englishman's Fire-Side<\/a>, <a target=\"_blank\" href=\"\/plays\/3793\" title=\"More info on Harlequin's Races; or, Time Beats All\">Harlequin's Races; or, Time Beats All<\/a><\/i><\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\u00a3218 9s 6d<\/td>\n                        <td>34%<\/td>\n                        <td>N\/A<\/td>\n                    <\/tr>\n                                    \n                    <tr class=\"performance play-row\">\n                        <td style=\"white-space: nowrap\"><a\n                                href=\"https:\/\/data.theatronomics.com\/this-day\/1804-01-05?theatre=CG\">05 Jan 1804<\/a><\/td>\n                        <td class=\"text-nowrap\">Covent Garden<\/td>\n                        <td><i><a target=\"_blank\" href=\"\/plays\/3774\" title=\"More info on The English Fleet in 1342\">The English Fleet in 1342<\/a>, <a target=\"_blank\" href=\"\/plays\/3793\" title=\"More info on Harlequin's Races; or, Time Beats All\">Harlequin's Races; or, Time Beats All<\/a><\/i><\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\n                                                            No\n                                                    <\/td>\n                        <td>\u00a3226 6s<\/td>\n                        <td>45%<\/td>\n                        <td>N\/A<\/td>\n                    <\/tr>\n                            <\/tbody>\n        <\/table>\n\n        <nav class=\"d-flex justify-items-center justify-content-between\">\n        <div class=\"d-flex justify-content-between flex-fill d-sm-none\">\n            <ul class=\"pagination\">\n                \n                                    <li class=\"page-item disabled\" aria-disabled=\"true\">\n                        <span class=\"page-link\">&laquo; Previous<\/span>\n                    <\/li>\n                \n                \n                                    <li class=\"page-item\">\n                        <a class=\"page-link\" href=\"https:\/\/data.theatronomics.com\/api\/pairings?perPage=10&amp;workId=3793&amp;page=2\" rel=\"next\">Next &raquo;<\/a>\n                    <\/li>\n                            <\/ul>\n        <\/div>\n\n\n\n<div class=\"d-none flex-sm-fill d-sm-flex align-items-sm-center justify-content-sm-between\">\n    <div>\n        <p class=\"small text-muted\">\n            Showing\n            <span class=\"fw-semibold\">1<\/span>\n            to\n            <span class=\"fw-semibold\">10<\/span>\n            of\n            <span class=\"fw-semibold\">13<\/span>\n            results\n        <\/p>\n    <\/div>\n<\/div>\n\n\n    <div class=\"d-none flex-sm-fill d-sm-flex align-items-sm-center justify-content-sm-between\">\n        <div>\n            <p class=\"small text-muted\">\n                <span class=\"fw-semibold\">Items per page<\/span>\n            <\/p>\n        <\/div>\n    <\/div>\n    <div class=\"d-none flex-sm-fill d-sm-flex align-items-sm-center justify-content-sm-between\">\n        <ul id=\"perpage\" class=\"pagination\">\n            \n\n                        <li class=\"page-item  active \"><a\n                    href=\"https:\/\/data.theatronomics.com\/api\/pairings?perPage=10&workId=3793&amp;perPage=10\" class=\"page-link per-page-link\">10<\/a>\n            <\/li>\n            <li class=\"page-item \"><a\n                    href=\"https:\/\/data.theatronomics.com\/api\/pairings?perPage=10&workId=3793&amp;perPage=25\" class=\"page-link per-page-link\">25<\/a>\n            <\/li>\n            <li class=\"page-item \"><a\n                    href=\"https:\/\/data.theatronomics.com\/api\/pairings?perPage=10&workId=3793&amp;perPage=50\" class=\"page-link per-page-link\">50<\/a>\n            <\/li>\n            <li class=\"page-item \"><a\n                    href=\"https:\/\/data.theatronomics.com\/api\/pairings?perPage=10&workId=3793&amp;perPage=100\" class=\"page-link per-page-link\">100<\/a>\n            <\/li>\n        <\/ul>\n    <\/div>\n\n    <div>\n        <ul id=\"pagination\" class=\"pagination\">\n            \n                            <li class=\"page-item disabled\" aria-disabled=\"true\" aria-label=\"&laquo; Previous\">\n                    <span class=\"page-link\" aria-hidden=\"true\">&lsaquo;<\/span>\n                <\/li>\n            \n            \n                            \n                \n                \n                                                                                        <li class=\"page-item active\" aria-current=\"page\"><span\n                                    class=\"page-link\">1<\/span><\/li>\n                                                                                                <li class=\"page-item\"><a class=\"page-link\"\n                                    href=\"https:\/\/data.theatronomics.com\/api\/pairings?perPage=10&amp;workId=3793&amp;page=2\">2<\/a><\/li>\n                                                                        \n            \n                            <li class=\"page-item\">\n                    <a class=\"page-link\" href=\"https:\/\/data.theatronomics.com\/api\/pairings?perPage=10&amp;workId=3793&amp;page=2\" rel=\"next\"\n                        aria-label=\"Next &raquo;\">&rsaquo;<\/a>\n                <\/li>\n                    <\/ul>\n    <\/div>\n    <\/nav>\n\n        <div class=\"row\">\n            <div class=\"col p-0\">\n                <a href=\"\/api\/filters\/plays\/export\/?from=1732&amp;to=1809&amp;works[]=3793\" class=\"btn btn-primary download-plays-csv float-end\"\n                    style=\"background:#F26522; color: white !important;\">Download Export<\/a>\n            <\/div>\n        <\/div>\n\n    <\/div>\n<\/div>\n\n<div class=\"performances-receipts-graphs container mt-4\">\n    <!-- Include Chart.js -->\n\n<!-- Canvas for the chart -->\n<div class=\"chart-container\" style=\"position: relative; height:500px; width:100%\">\n    <canvas id=\"receiptsChart\"><\/canvas>\n<\/div>\n\n<script>\n\nfunction bootLineGraph(graphableReceiptsData) {\n    \/\/ Use passed data if available, otherwise fall back to page data\n    const graphable_receipts = graphableReceiptsData || {\"1803-1804\":{\"Covent Garden\":{\"formatted\":\"\\u00a33,648 18s 6d\",\"graphable\":3648.93}}};\n    \n    \/\/ Destroy existing chart if it exists\n    if (receiptsChart) {\n        receiptsChart.destroy();\n        receiptsChart = null;\n    }\n    \n    \/\/ If no data, return early\n    if (!graphable_receipts || Object.keys(graphable_receipts).length === 0) {\n        return;\n    }\n    \n    console.log(graphable_receipts);\n\n    \/\/ Prepare data structures for the chart\n    const years = Object.keys(graphable_receipts);\n    const theaters = new Set();\n    const theaterTotals = {};\n\n    \/\/ First pass: collect all theaters and calculate total flow per theater\n    years.forEach(year => {\n        Object.keys(graphable_receipts[year]).forEach(theater => {\n            theaters.add(theater);\n            if (!theaterTotals[theater]) {\n                theaterTotals[theater] = 0;\n            }\n            theaterTotals[theater] += graphable_receipts[year][theater].graphable;\n        });\n    });\n\n    \/\/ Sort theaters by total flow value (descending)\n    const sortedTheaters = Array.from(theaters).sort((a, b) => {\n        return theaterTotals[b] - theaterTotals[a];\n    });\n\n    \/\/ Prepare datasets for Chart.js\n    const datasets = [];\n    const colorPalette = [\n        'rgba(255, 99, 132, 0.7)',\n        'rgba(54, 162, 235, 0.7)',\n        'rgba(255, 206, 86, 0.7)',\n        'rgba(75, 192, 192, 0.7)',\n        'rgba(153, 102, 255, 0.7)',\n        'rgba(255, 159, 64, 0.7)'\n    ];\n\n    \/\/ Create a dataset for each theater in order of total flow\n    sortedTheaters.forEach((theater, index) => {\n        const data = years.map(year => {\n            if (graphable_receipts[year][theater]) {\n                return graphable_receipts[year][theater].graphable;\n            }\n            return 0;\n        });\n\n        datasets.push({\n            label: theater,\n            data: data,\n            backgroundColor: colorPalette[index % colorPalette.length],\n            borderColor: colorPalette[index % colorPalette.length].replace('0.7', '1.0'),\n            borderWidth: 1\n        });\n    });\n\n    \/\/ Create and render the chart\n    const ctx = document.getElementById('receiptsChart').getContext('2d');\n    receiptsChart = new Chart(ctx, {\n        type: 'bar',\n        data: {\n            labels: years,\n            datasets: datasets\n        },\n        options: {\n            responsive: true,\n            maintainAspectRatio: false,\n            plugins: {\n                title: {\n                    display: true,\n                    text: 'Theatre Receipts by Season'\n                },\n                tooltip: {\n                    callbacks: {\n                        label: function(context) {\n                            const year = context.label;\n                            const theater = context.dataset.label;\n                            const value = context.raw;\n\n                            if (value > 0 && graphable_receipts[year][theater]) {\n                                return `${theater}: ${graphable_receipts[year][theater].formatted}`;\n                            }\n                            return `${theater}: \u00a30`;\n                        }\n                    }\n                },\n                legend: {\n                    display: true,\n                    position: 'top',\n                }\n            },\n            scales: {\n                x: {\n                    title: {\n                        display: true,\n                        text: 'Season'\n                    },\n                    stacked: true\n                },\n                y: {\n                    title: {\n                        display: true,\n                        text: 'Receipts (\u00a3)'\n                    },\n                    stacked: true,\n                    beginAtZero: true\n                }\n            }\n        }\n    });\n\n    \/\/ Function to update chart based on year range\n    window.updateChart = function(startYear, endYear) {\n        \/\/ Filter years based on range\n        const filteredYears = years.filter(year => {\n            return year >= startYear && year <= endYear;\n        });\n\n        \/\/ Update each dataset with filtered data\n        datasets.forEach(dataset => {\n            const theater = dataset.label;\n            dataset.data = filteredYears.map(year => {\n                if (graphable_receipts[year][theater]) {\n                    return graphable_receipts[year][theater].graphable;\n                }\n                return 0;\n            });\n        });\n\n        \/\/ Update chart labels and redraw\n        receiptsChart.data.labels = filteredYears;\n        receiptsChart.update();\n    };\n}\n\ndocument.addEventListener('DOMContentLoaded', function() {\n    bootLineGraph({\"1803-1804\":{\"Covent Garden\":{\"formatted\":\"\\u00a33,648 18s 6d\",\"graphable\":3648.93}}});\n});\n<\/script>\n<\/div>\n","total_work_receipts":"\u00a33,648 18s 6d","export_link":"\/api\/filters\/plays\/export\/?from=1732&to=1809&works[]=3793","graphable_receipts":{"1803-1804":{"Covent Garden":{"formatted":"\u00a33,648 18s 6d","graphable":3648.93}}},"notes":"Pantomime entertainment. The overture and music composed by Mr Davy. In the course of the pantomime will be introduced some favourite pieces of scenic machinery from Harlequin and Oberon, and other popular entertainments. The pantomime and dances produced under the direction of Mr Bologna, jun. The scenery by Mr Philips, Mr Whitmore, Mr Hollogan, and assistants.","date_range_receipts_ratio":100,"from_year":1732,"to_year":1809,"date_ranged_total_work_receipts":"\u00a33,648 18s 6d","date_ranged_covent_garden_revenue":"\u00a33,648 18s 6d","date_ranged_drury_lane_revenue":"\u00a30","date_ranged_covent_garden_ratio":100,"date_ranged_drury_lane_ratio":0,"covent_garden_ratio":100,"drury_lane_ratio":0,"covent_garden_revenue":"\u00a33,648 18s 6d","drury_lane_revenue":"\u00a30","work_year":"1803","activity_people":[{"activity_full":{"id":15,"label":"Choreographer","slug":"choreographer","created_at":"2022-11-02T00:33:17.000000Z","updated_at":"2024-12-17T11:09:16.000000Z","description":"A designer of dances, or of the dance aspects of pantomimes."},"activity":"Choreographer","person":"Pietro Bologna","person_id":7150,"start_date":null,"start_date_year":null},{"activity_full":{"id":17,"label":"Composer","slug":"composer","created_at":"2022-11-02T00:33:17.000000Z","updated_at":"2024-12-17T11:07:15.000000Z","description":"A composer of music."},"activity":"Composer","person":"John Davy","person_id":17774,"start_date":null,"start_date_year":null}],"pairings":{"performances":[{"event_date":"18031231","id":67667,"event_id":27474,"work_id":3774,"title_clean":"The English Fleet in 1342","count":6,"genre_colour":"#0048ff","genre":"Comedy","source_genre":"Pantomime","source_genre_colour":"#ffe600","total_performances_for_work":48,"filtered_performances_for_work":6,"work":{"id":3774,"lsdb_id":null,"title":"The English Fleet in 1342","title_variant":null,"type_1":"mainpiece","type_2":null,"source_1":null,"source_2":null,"first_performed_date":null,"publication_date":"1803","notes":null,"created_at":"2023-05-29T12:22:27.000000Z","updated_at":"2024-12-16T13:08:15.000000Z","deleted_at":null,"genre_id":2,"performance_medium":"Musical","date_type":"Performed","genre":{"id":2,"label":"Comedy","description":null,"lod_type":null,"lod_uri":null,"created_at":"2023-06-22T10:30:16.000000Z","updated_at":"2023-06-22T10:30:16.000000Z"}}},{"event_date":"18031230","id":67665,"event_id":27473,"work_id":3757,"title_clean":"John Bull; or, An Englishman's Fire-side","count":2,"genre_colour":"#0048ff","genre":"Comedy","source_genre":"Pantomime","source_genre_colour":"#ffe600","total_performances_for_work":97,"filtered_performances_for_work":2,"work":{"id":3757,"lsdb_id":null,"title":"John Bull; or, An Englishman's Fire Side","title_variant":null,"type_1":"mainpiece","type_2":null,"source_1":null,"source_2":null,"first_performed_date":null,"publication_date":"1803","notes":null,"created_at":"2023-04-24T14:21:57.000000Z","updated_at":"2024-05-16T09:20:55.000000Z","deleted_at":null,"genre_id":2,"performance_medium":"Spoken Drama","date_type":"Performed","genre":{"id":2,"label":"Comedy","description":null,"lod_type":null,"lod_uri":null,"created_at":"2023-06-22T10:30:16.000000Z","updated_at":"2023-06-22T10:30:16.000000Z"}}},{"event_date":"18031226","id":67657,"event_id":27469,"work_id":2331,"title_clean":"The Suspicious Husband","count":1,"genre_colour":"#0048ff","genre":"Comedy","source_genre":"Pantomime","source_genre_colour":"#ffe600","total_performances_for_work":281,"filtered_performances_for_work":1,"work":{"id":2331,"lsdb_id":2331,"title":"The Suspicious Husband","title_variant":null,"type_1":"mainpiece","type_2":null,"source_1":null,"source_2":null,"first_performed_date":null,"publication_date":"1747","notes":null,"created_at":"2022-11-01T23:59:19.000000Z","updated_at":"2023-10-11T09:30:32.000000Z","deleted_at":null,"genre_id":2,"performance_medium":"Spoken Drama","date_type":"Performed","genre":{"id":2,"label":"Comedy","description":null,"lod_type":null,"lod_uri":null,"created_at":"2023-06-22T10:30:16.000000Z","updated_at":"2023-06-22T10:30:16.000000Z"}}},{"event_date":"18031227","id":67659,"event_id":27470,"work_id":927,"title_clean":"King Richard the Third","count":1,"genre_colour":"#bd6500","genre":"History","source_genre":"Pantomime","source_genre_colour":"#ffe600","total_performances_for_work":476,"filtered_performances_for_work":1,"work":{"id":927,"lsdb_id":927,"title":"Richard III","title_variant":null,"type_1":"mainpiece","type_2":null,"source_1":null,"source_2":null,"first_performed_date":null,"publication_date":"1592","notes":"1592-94","created_at":"2022-11-01T23:59:16.000000Z","updated_at":"2023-10-09T09:44:03.000000Z","deleted_at":null,"genre_id":5,"performance_medium":"Spoken Drama","date_type":"Performed","genre":{"id":5,"label":"History","description":null,"lod_type":null,"lod_uri":null,"created_at":"2023-06-22T10:30:52.000000Z","updated_at":"2023-06-22T10:30:52.000000Z"}}},{"event_date":"18031228","id":67661,"event_id":27471,"work_id":2882,"title_clean":"The Man of the World","count":1,"genre_colour":"#0048ff","genre":"Comedy","source_genre":"Pantomime","source_genre_colour":"#ffe600","total_performances_for_work":124,"filtered_performances_for_work":1,"work":{"id":2882,"lsdb_id":2882,"title":"The Man of the World","title_variant":null,"type_1":"mainpiece","type_2":null,"source_1":"The True-Born Scotsman","source_2":null,"first_performed_date":null,"publication_date":"1781","notes":null,"created_at":"2022-11-01T23:59:20.000000Z","updated_at":"2024-09-03T15:57:28.000000Z","deleted_at":null,"genre_id":2,"performance_medium":"Spoken Drama","date_type":"Performed","genre":{"id":2,"label":"Comedy","description":null,"lod_type":null,"lod_uri":null,"created_at":"2023-06-22T10:30:16.000000Z","updated_at":"2023-06-22T10:30:16.000000Z"}}},{"event_date":"18031229","id":67663,"event_id":27472,"work_id":655,"title_clean":"Romeo and Juliet","count":1,"genre_colour":"#ff0000","genre":"Tragedy","source_genre":"Pantomime","source_genre_colour":"#ffe600","total_performances_for_work":482,"filtered_performances_for_work":1,"work":{"id":655,"lsdb_id":655,"title":"Romeo and Juliet","title_variant":null,"type_1":"mainpiece","type_2":null,"source_1":null,"source_2":null,"first_performed_date":null,"publication_date":"1597","notes":null,"created_at":"2022-11-01T23:59:15.000000Z","updated_at":"2023-10-11T12:01:17.000000Z","deleted_at":null,"genre_id":13,"performance_medium":"Spoken Drama","date_type":"Published","genre":{"id":13,"label":"Tragedy","description":null,"lod_type":null,"lod_uri":null,"created_at":"2023-06-22T10:32:10.000000Z","updated_at":"2023-06-22T10:32:10.000000Z"}}},{"event_date":"18040109","id":67717,"event_id":27791,"work_id":1944,"title_clean":"The Provoked Husband","count":1,"genre_colour":"#0048ff","genre":"Comedy","source_genre":"Pantomime","source_genre_colour":"#ffe600","total_performances_for_work":410,"filtered_performances_for_work":1,"work":{"id":1944,"lsdb_id":1944,"title":"The Provoked Husband; or, A Journey to London","title_variant":null,"type_1":"mainpiece","type_2":null,"source_1":null,"source_2":null,"first_performed_date":null,"publication_date":"1728","notes":null,"created_at":"2022-11-01T23:59:18.000000Z","updated_at":"2024-10-25T14:29:05.000000Z","deleted_at":null,"genre_id":2,"performance_medium":"Spoken Drama","date_type":"Performed","genre":{"id":2,"label":"Comedy","description":null,"lod_type":null,"lod_uri":null,"created_at":"2023-06-22T10:30:16.000000Z","updated_at":"2023-06-22T10:30:16.000000Z"}}}],"total_performances":13,"covent_garden_performances":13,"drury_lane_performances":0,"date_ranged_total_performances":13,"date_ranged_covent_garden_performances":13,"date_ranged_drury_lane_performances":0,"from_year":1732,"to_year":1809},"performance_name":"Unknown Performance","theatres":[1,2],"this_genre_colour":"#ffe600","date_type":"Performed"}