xref: /webtrees/resources/views/modules/statistics-chart/custom.phtml (revision 10e0649788c8d7d4974d81c048ca2b225df8f22e)
13aed5063SGreg Roach<?php
23aed5063SGreg Roach
3*10e06497SGreg Roachdeclare(strict_types=1);
4*10e06497SGreg Roach
563763244SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\AutoCompleteSurname;
6b6c326d8SGreg Roachuse Fisharebest\Webtrees\I18N;
77c2c99faSGreg Roachuse Fisharebest\Webtrees\Module\StatisticsChartModule;
87c2c99faSGreg Roachuse Fisharebest\Webtrees\Tree;
9b6c326d8SGreg Roachuse Fisharebest\Webtrees\View;
10c6266a77SGreg Roach
117c2c99faSGreg Roach/**
127c2c99faSGreg Roach * @var StatisticsChartModule $module
137c2c99faSGreg Roach * @var Tree                  $tree
147c2c99faSGreg Roach */
157c2c99faSGreg Roach
16b6c326d8SGreg Roach?>
17b6c326d8SGreg Roach
18b6c326d8SGreg Roach<div class="container pt-3">
19b6c326d8SGreg Roach    <h4 class="border-bottom p-2 mb-4">
20b6c326d8SGreg Roach        <?= I18N::translate('Create your own chart') ?>
21b6c326d8SGreg Roach    </h4>
22b6c326d8SGreg Roach
233aa29b97SGreg Roach    <form method="post" action="<?= e(route('module', ['module' => $module->name(), 'action' => 'CustomChart', 'tree' => $tree->name()])) ?>" id="own-stats-form" class="wt-page-options wt-page-options-statistics">
249e3c2cf9SGreg Roach        <div class="row mb-3">
25b6c326d8SGreg Roach            <div class="col-sm-2 wt-page-options-label">
26b6c326d8SGreg Roach                <?= I18N::translate('Chart type') ?>
27b6c326d8SGreg Roach            </div>
28b6c326d8SGreg Roach
29b6c326d8SGreg Roach            <div class="col-sm-4 wt-page-options-value">
30b6c326d8SGreg Roach                <fieldset>
31b6c326d8SGreg Roach                    <legend><?= I18N::translate('Individual') ?></legend>
32b6c326d8SGreg Roach
3371378461SGreg Roach                    <?= view('components/radios', [
3471378461SGreg Roach                        'name' => 'x-as', 'selected' => $module::X_AXIS_BIRTH_MONTH, 'options' => [
35b6c326d8SGreg Roach                            $module::X_AXIS_BIRTH_MONTH           => I18N::translate('Month of birth'),
36b6c326d8SGreg Roach                            $module::X_AXIS_DEATH_MONTH           => I18N::translate('Month of death'),
37b6c326d8SGreg Roach                            $module::X_AXIS_FIRST_CHILD_MONTH     => I18N::translate('Month of birth of first child in a relation'),
38b6c326d8SGreg Roach                            $module::X_AXIS_AGE_AT_DEATH          => I18N::translate('Average age at death'),
39b6c326d8SGreg Roach                            $module::X_AXIS_AGE_AT_MARRIAGE       => I18N::translate('Age in year of marriage'),
40b6c326d8SGreg Roach                            $module::X_AXIS_AGE_AT_FIRST_MARRIAGE => I18N::translate('Age in year of first marriage'),
41b6c326d8SGreg Roach
4271378461SGreg Roach                        ],
4371378461SGreg Roach                    ]) ?>
44b6c326d8SGreg Roach                </fieldset>
45b6c326d8SGreg Roach
46b6c326d8SGreg Roach                <fieldset>
47b6c326d8SGreg Roach                    <legend><?= I18N::translate('Family') ?></legend>
48b6c326d8SGreg Roach
4971378461SGreg Roach                    <?= view('components/radios', [
5071378461SGreg Roach                        'name' => 'x-as', 'selected' => $module::X_AXIS_BIRTH_MONTH, 'options' => [
51b6c326d8SGreg Roach                            $module::X_AXIS_MARRIAGE_MONTH       => I18N::translate('Month of marriage'),
52b6c326d8SGreg Roach                            $module::X_AXIS_FIRST_MARRIAGE_MONTH => I18N::translate('Month of first marriage'),
53b6c326d8SGreg Roach                            $module::X_AXIS_NUMBER_OF_CHILDREN   => I18N::translate('Number of children'),
54b6c326d8SGreg Roach
5571378461SGreg Roach                        ],
5671378461SGreg Roach                    ]) ?>
57b6c326d8SGreg Roach                </fieldset>
58b6c326d8SGreg Roach
59b6c326d8SGreg Roach                <fieldset>
60b6c326d8SGreg Roach                    <legend><?= I18N::translate('Map') ?></legend>
61b6c326d8SGreg Roach
6271378461SGreg Roach                    <?= view('components/radios', [
6371378461SGreg Roach                        'name' => 'x-as', 'selected' => $module::X_AXIS_BIRTH_MONTH, 'options' => [
64b6c326d8SGreg Roach                            $module::X_AXIS_INDIVIDUAL_MAP => I18N::translate('Individuals'),
65b6c326d8SGreg Roach                            $module::X_AXIS_BIRTH_MAP      => I18N::translate('Births'),
66b6c326d8SGreg Roach                            $module::X_AXIS_MARRIAGE_MAP   => I18N::translate('Marriages'),
67b6c326d8SGreg Roach                            $module::X_AXIS_DEATH_MAP      => I18N::translate('Deaths'),
6871378461SGreg Roach                        ],
6971378461SGreg Roach                    ]) ?>
70b6c326d8SGreg Roach                </fieldset>
71b6c326d8SGreg Roach            </div>
72b6c326d8SGreg Roach
73b6c326d8SGreg Roach            <div class="col-sm-2 wt-page-options-label">
74b6c326d8SGreg Roach                <?= I18N::translate('Details') ?>
75b6c326d8SGreg Roach            </div>
76b6c326d8SGreg Roach
77b6c326d8SGreg Roach            <div class="col-sm-4 wt-page-options-value">
78b6c326d8SGreg Roach                <fieldset id="axes">
79b6c326d8SGreg Roach                    <legend><?= I18N::translate('Categories') ?></legend>
80b6c326d8SGreg Roach
81b6c326d8SGreg Roach                    <label>
82b6c326d8SGreg Roach                        <input type="radio" id="z_none" name="z-as" value="<?= $module::Z_AXIS_ALL ?>" onclick="statusDisable('z-axis-boundaries-periods');">
83b6c326d8SGreg Roach                        <?= I18N::translate('none') ?>
84b6c326d8SGreg Roach                    </label>
85b6c326d8SGreg Roach                    <br>
86b6c326d8SGreg Roach                    <label>
87b6c326d8SGreg Roach                        <input type="radio" id="z_sex" name="z-as" value="<?= $module::Z_AXIS_SEX ?>" onclick="statusDisable('z-axis-boundaries-periods');">
88b6c326d8SGreg Roach                        <?= I18N::translate('gender') ?>
89b6c326d8SGreg Roach                    </label>
90b6c326d8SGreg Roach                    <br>
91b6c326d8SGreg Roach                    <label>
92b6c326d8SGreg Roach                        <input type="radio" id="z_time" name="z-as" value="<?= $module::Z_AXIS_TIME ?>" checked onclick="statusEnable('z-axis-boundaries-periods');">
93b6c326d8SGreg Roach                        <?= I18N::translate('date periods') ?>
94b6c326d8SGreg Roach                    </label>
95315eb316SGreg Roach                    <label for="z-axis-boundaries-periods" class="visually-hidden">
96b6c326d8SGreg Roach                        <?= I18N::translate('Date range') ?>
97b6c326d8SGreg Roach                    </label>
984b9213b3SGreg Roach                    <select id="z-axis-boundaries-periods" class="form-select" name="z-axis-boundaries-periods">
99b6c326d8SGreg Roach                        <option value="1700,1750,1800,1850,1900,1950,2000" selected>
100b6c326d8SGreg Roach                            <?= /* I18N: from 1700 interval 50 years */
101b6c326d8SGreg Roach                            I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 50, I18N::digits(1700), I18N::number(50)) ?>
102b6c326d8SGreg Roach                        </option>
103b6c326d8SGreg Roach                        <option value="1800,1840,1880,1920,1950,1970,2000">
104b6c326d8SGreg Roach                            <?= I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 40, I18N::digits(1800), I18N::number(40)) ?>
105b6c326d8SGreg Roach                        </option>
106b6c326d8SGreg Roach                        <option value="1800,1850,1900,1950,2000">
107b6c326d8SGreg Roach                            <?= I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 50, I18N::digits(1800), I18N::number(50)) ?>
108b6c326d8SGreg Roach                        </option>
109b6c326d8SGreg Roach                        <option value="1900,1920,1940,1960,1980,1990,2000">
110b6c326d8SGreg Roach                            <?= I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 20, I18N::digits(1900), I18N::number(20)) ?>
111b6c326d8SGreg Roach                        </option>
112b6c326d8SGreg Roach                        <option value="1900,1925,1950,1975,2000">
113b6c326d8SGreg Roach                            <?= I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 25, I18N::digits(1900), I18N::number(25)) ?>
114b6c326d8SGreg Roach                        </option>
115b6c326d8SGreg Roach                        <option value="1940,1950,1960,1970,1980,1990,2000">
116b6c326d8SGreg Roach                            <?= I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 10, I18N::digits(1940), I18N::number(10)) ?>
117b6c326d8SGreg Roach                        </option>
118b6c326d8SGreg Roach                    </select>
119b6c326d8SGreg Roach                </fieldset>
120b6c326d8SGreg Roach
121b6c326d8SGreg Roach                <fieldset id="zyaxes">
122b6c326d8SGreg Roach                    <legend><?= I18N::translate('Results') ?></legend>
123b6c326d8SGreg Roach
124b6c326d8SGreg Roach                    <label>
125b6c326d8SGreg Roach                        <input type="radio" name="y-as" value="<?= $module::Y_AXIS_NUMBERS ?>" checked>
126b6c326d8SGreg Roach                        <?= I18N::translate('numbers') ?>
127b6c326d8SGreg Roach                    </label>
128b6c326d8SGreg Roach                    <br>
129b6c326d8SGreg Roach                    <label>
130b6c326d8SGreg Roach                        <input type="radio" name="y-as" value="<?= $module::Y_AXIS_PERCENT ?>">
131b6c326d8SGreg Roach                        <?= I18N::translate('percentage') ?>
132b6c326d8SGreg Roach                    </label>
133b6c326d8SGreg Roach                </fieldset>
134b6c326d8SGreg Roach
135b6c326d8SGreg Roach                <fieldset id="x_years" style="display:none;">
136b6c326d8SGreg Roach                    <legend><?= I18N::translate('Age interval') ?></legend>
137b6c326d8SGreg Roach
138315eb316SGreg Roach                    <label for="x-axis-boundaries-ages" class="visually-hidden">
139b6c326d8SGreg Roach                        <?= I18N::translate('Age interval') ?>
140b6c326d8SGreg Roach                    </label>
141c9e11c2aSGreg Roach                    <?= view('components/select', ['name' => 'x-axis-boundaries-ages', 'selected' => '1,5,10,20,30,40,50,60,70,80,90,100', 'options' => ['1,5,10,20,30,40,50,60,70,80,90,100' => I18N::plural('%s year', '%s years', 10, I18N::number(10)), '5,20,40,60,75,80,85,90' => I18N::plural('%s year', '%s years', 20, I18N::number(20)), '10,25,50,75,100' => I18N::plural('%s year', '%s years', 25, I18N::number(25))]]) ?>
142b6c326d8SGreg Roach                </fieldset>
143b6c326d8SGreg Roach
144b6c326d8SGreg Roach                <fieldset id="x_years_m" style="display:none;">
145b6c326d8SGreg Roach                    <legend><?= I18N::translate('Age interval') ?></legend>
146b6c326d8SGreg Roach
147315eb316SGreg Roach                    <label for="x-axis-boundaries-ages_m" class="visually-hidden">
148b6c326d8SGreg Roach                        <?= I18N::translate('Select the desired age interval') ?>
149b6c326d8SGreg Roach                    </label>
150c9e11c2aSGreg Roach                    <?= view('components/select', ['name' => 'x-axis-boundaries-ages_m', 'selected' => '16,18,20,22,24,26,28,30,32,35,40,50', 'options' => ['16,18,20,22,24,26,28,30,32,35,40,50' => I18N::plural('%s year', '%s years', 2, I18N::number(2)), '20,25,30,35,40,45,50' => I18N::plural('%s year', '%s years', 5, I18N::number(5))]]) ?>
151b6c326d8SGreg Roach                </fieldset>
152b6c326d8SGreg Roach
153b6c326d8SGreg Roach                <div id="map_opt" style="display:none;">
154b6c326d8SGreg Roach                    <fieldset id="chart_type">
155b6c326d8SGreg Roach                        <legend><?= I18N::translate('Chart type') ?></legend>
156b6c326d8SGreg Roach
157315eb316SGreg Roach                        <label for="chart_type" class="visually-hidden"><?= I18N::translate('Chart type') ?></label>
1584b9213b3SGreg Roach                        <select name="chart_type" class="form-select" onchange="statusShowSurname(this);">
159b6c326d8SGreg Roach                            <option value="indi_distribution_chart" selected>
160b6c326d8SGreg Roach                                <?= I18N::translate('Individuals') ?>
161b6c326d8SGreg Roach                            </option>
162b6c326d8SGreg Roach                            <option value="surname_distribution_chart">
163b6c326d8SGreg Roach                                <?= I18N::translate('Surnames') ?>
164b6c326d8SGreg Roach                            </option>
165b6c326d8SGreg Roach                        </select>
166b6c326d8SGreg Roach
1679e3c2cf9SGreg Roach                        <div id="surname_opt" class="mb-3 d-none;">
168b6c326d8SGreg Roach                            <label for="SURN"><?= I18N::translate('Surname') ?></label>
169d4786c66SGreg Roach                            <input data-wt-autocomplete-url="<?= e(route(AutoCompleteSurname::class, ['tree' => $tree->name()])) ?>" autocomplete="off" class="form-control" type="text" id="SURN" name="SURN">
170b6c326d8SGreg Roach                        </div>
171b6c326d8SGreg Roach                    </fieldset>
172b6c326d8SGreg Roach
173b6c326d8SGreg Roach                    <fieldset>
174b6c326d8SGreg Roach                        <legend id="label-area"><?= I18N::translate('Geographic area') ?></legend>
175b6c326d8SGreg Roach
176315eb316SGreg Roach                        <label for="chart_shows" class="visually-hidden"><?= I18N::translate('Geographic area') ?></label>
1774b9213b3SGreg Roach                        <select id="chart_shows" class="form-select" name="chart_shows">
178b6c326d8SGreg Roach                            <option value="world" selected>
179b6c326d8SGreg Roach                                <?= I18N::translate('World') ?>
180b6c326d8SGreg Roach                            </option>
181b6c326d8SGreg Roach                            <option value="150">
182b6c326d8SGreg Roach                                <?= I18N::translate('Europe') ?>
183b6c326d8SGreg Roach                            </option>
184b6c326d8SGreg Roach                            <option value="021">
185b6c326d8SGreg Roach                                <?= I18N::translate('Northern America') ?>
186b6c326d8SGreg Roach                            </option>
187b6c326d8SGreg Roach                            <option value="005">
188b6c326d8SGreg Roach                                <?= I18N::translate('South America') ?>
189b6c326d8SGreg Roach                            </option>
190b6c326d8SGreg Roach                            <option value="142">
191b6c326d8SGreg Roach                                <?= I18N::translate('Asia') ?>
192b6c326d8SGreg Roach                            </option>
193b6c326d8SGreg Roach                            <option value="145">
194b6c326d8SGreg Roach                                <?= I18N::translate('Middle East') ?>
195b6c326d8SGreg Roach                            </option>
196b6c326d8SGreg Roach                            <option value="002">
197b6c326d8SGreg Roach                                <?= I18N::translate('Africa') ?>
198b6c326d8SGreg Roach                            </option>
199b6c326d8SGreg Roach                        </select>
200b6c326d8SGreg Roach                    </fieldset>
201b6c326d8SGreg Roach                </div>
202b6c326d8SGreg Roach            </div>
203b6c326d8SGreg Roach        </div>
204b6c326d8SGreg Roach
205b6c326d8SGreg Roach        <p>
206b6c326d8SGreg Roach            <button type="submit" class="btn btn-primary">
207b6c326d8SGreg Roach                <?= view('icons/save') ?>
208b6c326d8SGreg Roach                <?= I18N::translate('show the chart') ?>
209b6c326d8SGreg Roach            </button>
210b6c326d8SGreg Roach        </p>
21181443e3cSGreg Roach
21281443e3cSGreg Roach        <?= csrf_field() ?>
213b6c326d8SGreg Roach    </form>
214b6c326d8SGreg Roach
215b6c326d8SGreg Roach    <div id="custom-chart" class="wt-ajax-load">
216b6c326d8SGreg Roach        <!-- Not initially empty, to disable spinner -->
217b6c326d8SGreg Roach    </div>
218b6c326d8SGreg Roach</div>
219b6c326d8SGreg Roach
220b6c326d8SGreg Roach<?php View::push('javascript') ?>
221c6266a77SGreg Roach<script>
222c6266a77SGreg Roach    function statusDisable(sel) {
223c6266a77SGreg Roach        var cbox      = document.getElementById(sel);
224c6266a77SGreg Roach        cbox.checked  = false;
225c6266a77SGreg Roach        cbox.disabled = true;
226c6266a77SGreg Roach    }
227c6266a77SGreg Roach
228c6266a77SGreg Roach    function statusEnable(sel) {
229c6266a77SGreg Roach        var cbox      = document.getElementById(sel);
230c6266a77SGreg Roach        cbox.disabled = false;
231c6266a77SGreg Roach    }
232c6266a77SGreg Roach
233c6266a77SGreg Roach    function statusHide(sel) {
234c6266a77SGreg Roach        var box           = document.getElementById(sel);
235c6266a77SGreg Roach        box.style.display = "none";
236c6266a77SGreg Roach        var box_m         = document.getElementById(sel + "_m");
237c6266a77SGreg Roach        if (box_m) {
238c6266a77SGreg Roach            box_m.style.display = "none";
239c6266a77SGreg Roach        }
240c6266a77SGreg Roach        if (sel === "map_opt") {
241c6266a77SGreg Roach            var box_axes = document.getElementById("axes");
242c6266a77SGreg Roach            if (box_axes) {
243c6266a77SGreg Roach                box_axes.style.display = "";
244c6266a77SGreg Roach            }
245c6266a77SGreg Roach            var box_zyaxes = document.getElementById("zyaxes");
246c6266a77SGreg Roach            if (box_zyaxes) {
247c6266a77SGreg Roach                box_zyaxes.style.display = "";
248c6266a77SGreg Roach            }
249c6266a77SGreg Roach        }
250c6266a77SGreg Roach    }
251c6266a77SGreg Roach
252c6266a77SGreg Roach    function statusShow(sel) {
253c6266a77SGreg Roach        var box           = document.getElementById(sel);
254c6266a77SGreg Roach        box.style.display = "";
255c6266a77SGreg Roach        var box_m         = document.getElementById(sel + "_m");
256c6266a77SGreg Roach        if (box_m) {
257c6266a77SGreg Roach            box_m.style.display = "none";
258c6266a77SGreg Roach        }
259c6266a77SGreg Roach        if (sel === "map_opt") {
260c6266a77SGreg Roach            var box_axes = document.getElementById("axes");
261c6266a77SGreg Roach            if (box_axes) {
262c6266a77SGreg Roach                box_axes.style.display = "none";
263c6266a77SGreg Roach            }
264c6266a77SGreg Roach            var box_zyaxes = document.getElementById("zyaxes");
265c6266a77SGreg Roach            if (box_zyaxes) {
266c6266a77SGreg Roach                box_zyaxes.style.display = "none";
267c6266a77SGreg Roach            }
268c6266a77SGreg Roach        }
269c6266a77SGreg Roach    }
270c6266a77SGreg Roach
271c6266a77SGreg Roach    function statusChecked(sel) {
272c6266a77SGreg Roach        var cbox     = document.getElementById(sel);
273c6266a77SGreg Roach        cbox.checked = true;
274c6266a77SGreg Roach    }
275c6266a77SGreg Roach
276c6266a77SGreg Roach    function statusShowSurname(x) {
277c6266a77SGreg Roach        if (x.value === "surname_distribution_chart") {
278c6266a77SGreg Roach            document.getElementById("surname_opt").style.display = "";
279c6266a77SGreg Roach        } else if (x.value !== "surname_distribution_chart") {
280c6266a77SGreg Roach            document.getElementById("surname_opt").style.display = "none";
281c6266a77SGreg Roach        }
282c6266a77SGreg Roach    }
283c6266a77SGreg Roach
284c6266a77SGreg Roach    function loadCustomChart() {
285c6266a77SGreg Roach        $("#custom-chart").html("");
286c6266a77SGreg Roach        var form = $("#own-stats-form");
2873aa29b97SGreg Roach        jQuery.post(form.attr("action"), form.serialize())
288c6266a77SGreg Roach            .done(function (data) {
289c6266a77SGreg Roach                $("#custom-chart").html(data);
290c6266a77SGreg Roach            })
291c6266a77SGreg Roach            .fail(function (jqXHR, textStatus) {
292c6266a77SGreg Roach                // Server error?  Show something to get rid of the spinner.
293c6266a77SGreg Roach                $("#custom-chart").html(textStatus);
294c6266a77SGreg Roach            });
295c6266a77SGreg Roach        return false;
296c6266a77SGreg Roach    }
297b6c326d8SGreg Roach
298b6c326d8SGreg Roach    $("[name='x-as']").change(function () {
299b6c326d8SGreg Roach        var x_axis = document.querySelector("[name='x-as']:checked").value;
300b6c326d8SGreg Roach
301b6c326d8SGreg Roach        switch (x_axis) {
302b6c326d8SGreg Roach            case "<?= e($module::X_AXIS_BIRTH_MONTH) ?>":
303b6c326d8SGreg Roach            case "<?= e($module::X_AXIS_DEATH_MONTH) ?>":
304b6c326d8SGreg Roach            case "<?= e($module::X_AXIS_FIRST_CHILD_MONTH) ?>":
305b6c326d8SGreg Roach                statusEnable("z_sex");
306b6c326d8SGreg Roach                statusHide("x_years");
307b6c326d8SGreg Roach                statusHide("map_opt");
308b6c326d8SGreg Roach                break;
309b6c326d8SGreg Roach
310b6c326d8SGreg Roach            case "<?= e($module::X_AXIS_AGE_AT_DEATH) ?>":
311b6c326d8SGreg Roach                statusEnable("z_sex");
312b6c326d8SGreg Roach                statusShow("x_years");
313b6c326d8SGreg Roach                statusHide("map_opt");
314b6c326d8SGreg Roach                break;
315b6c326d8SGreg Roach
316b6c326d8SGreg Roach            case "<?= e($module::X_AXIS_AGE_AT_MARRIAGE) ?>":
317b6c326d8SGreg Roach            case "<?= e($module::X_AXIS_AGE_AT_FIRST_MARRIAGE) ?>":
318b6c326d8SGreg Roach                statusEnable("z_sex");
319b6c326d8SGreg Roach                statusHide("x_years");
320b6c326d8SGreg Roach                statusShow("x_years_m");
321b6c326d8SGreg Roach                statusHide("map_opt");
322b6c326d8SGreg Roach                break;
323b6c326d8SGreg Roach
324b6c326d8SGreg Roach            case "<?= e($module::X_AXIS_MARRIAGE_MONTH) ?>":
325b6c326d8SGreg Roach            case "<?= e($module::X_AXIS_FIRST_MARRIAGE_MONTH) ?>":
326c1df444aSGreg Roach            case "<?= e($module::X_AXIS_NUMBER_OF_CHILDREN) ?>":
327b6c326d8SGreg Roach                statusChecked("z_none");
328b6c326d8SGreg Roach                statusDisable("z_sex");
329b6c326d8SGreg Roach                statusHide("x_years");
330b6c326d8SGreg Roach                statusHide("map_opt");
331b6c326d8SGreg Roach                break;
332b6c326d8SGreg Roach
333b6c326d8SGreg Roach            case "<?= e($module::X_AXIS_INDIVIDUAL_MAP) ?>":
334b6c326d8SGreg Roach                statusHide("x_years");
335b6c326d8SGreg Roach                statusShow("map_opt");
336b6c326d8SGreg Roach                statusShow("chart_type");
337b6c326d8SGreg Roach                break;
338b6c326d8SGreg Roach
339b6c326d8SGreg Roach            case "<?= e($module::X_AXIS_BIRTH_MAP) ?>":
340b6c326d8SGreg Roach            case "<?= e($module::X_AXIS_MARRIAGE_MAP) ?>":
341b6c326d8SGreg Roach            case "<?= e($module::X_AXIS_DEATH_MAP) ?>":
34271378461SGreg Roach                statusHide("x_years");
34371378461SGreg Roach                statusShow("map_opt");
344b6c326d8SGreg Roach                statusHide("chart_type");
345b6c326d8SGreg Roach                statusHide("surname_opt");
346b6c326d8SGreg Roach                break;
347b6c326d8SGreg Roach        }
348b6c326d8SGreg Roach    });
349b6c326d8SGreg Roach
350b6c326d8SGreg Roach    $("#own-stats-form").on("submit", loadCustomChart);
35163763244SGreg Roach    webtrees.autocomplete('#SURN');
352c6266a77SGreg Roach</script>
353b6c326d8SGreg Roach<?php View::endpush() ?>
354