xref: /webtrees/resources/views/modules/statistics-chart/custom.phtml (revision 9e3c2cf9009c4c2140f50ddfc80b91f2f82cdce5)
13aed5063SGreg Roach<?php
23aed5063SGreg Roach
363763244SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\AutoCompleteSurname;
4b6c326d8SGreg Roachuse Fisharebest\Webtrees\I18N;
57c2c99faSGreg Roachuse Fisharebest\Webtrees\Module\StatisticsChartModule;
67c2c99faSGreg Roachuse Fisharebest\Webtrees\Tree;
7b6c326d8SGreg Roachuse Fisharebest\Webtrees\View;
8c6266a77SGreg Roach
97c2c99faSGreg Roach/**
107c2c99faSGreg Roach * @var StatisticsChartModule $module
117c2c99faSGreg Roach * @var Tree                  $tree
127c2c99faSGreg Roach */
137c2c99faSGreg Roach
14b6c326d8SGreg Roach?>
15b6c326d8SGreg Roach
16b6c326d8SGreg Roach<div class="container pt-3">
17b6c326d8SGreg Roach    <h4 class="border-bottom p-2 mb-4">
18b6c326d8SGreg Roach        <?= I18N::translate('Create your own chart') ?>
19b6c326d8SGreg Roach    </h4>
20b6c326d8SGreg Roach
213aa29b97SGreg 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">
223aa29b97SGreg Roach        <?= csrf_field() ?>
233aa29b97SGreg Roach
24*9e3c2cf9SGreg 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>
98b6c326d8SGreg Roach                    <select id="z-axis-boundaries-periods" class="form-control" 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>
158b6c326d8SGreg Roach                        <select name="chart_type" class="form-control" 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
167*9e3c2cf9SGreg 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>
177b6c326d8SGreg Roach                        <select id="chart_shows" class="form-control" 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>
211b6c326d8SGreg Roach    </form>
212b6c326d8SGreg Roach
213b6c326d8SGreg Roach    <div id="custom-chart" class="wt-ajax-load">
214b6c326d8SGreg Roach        <!-- Not initially empty, to disable spinner -->
215b6c326d8SGreg Roach    </div>
216b6c326d8SGreg Roach</div>
217b6c326d8SGreg Roach
218b6c326d8SGreg Roach<?php View::push('javascript') ?>
219c6266a77SGreg Roach<script>
220c6266a77SGreg Roach    function statusDisable(sel) {
221c6266a77SGreg Roach        var cbox      = document.getElementById(sel);
222c6266a77SGreg Roach        cbox.checked  = false;
223c6266a77SGreg Roach        cbox.disabled = true;
224c6266a77SGreg Roach    }
225c6266a77SGreg Roach
226c6266a77SGreg Roach    function statusEnable(sel) {
227c6266a77SGreg Roach        var cbox      = document.getElementById(sel);
228c6266a77SGreg Roach        cbox.disabled = false;
229c6266a77SGreg Roach    }
230c6266a77SGreg Roach
231c6266a77SGreg Roach    function statusHide(sel) {
232c6266a77SGreg Roach        var box           = document.getElementById(sel);
233c6266a77SGreg Roach        box.style.display = "none";
234c6266a77SGreg Roach        var box_m         = document.getElementById(sel + "_m");
235c6266a77SGreg Roach        if (box_m) {
236c6266a77SGreg Roach            box_m.style.display = "none";
237c6266a77SGreg Roach        }
238c6266a77SGreg Roach        if (sel === "map_opt") {
239c6266a77SGreg Roach            var box_axes = document.getElementById("axes");
240c6266a77SGreg Roach            if (box_axes) {
241c6266a77SGreg Roach                box_axes.style.display = "";
242c6266a77SGreg Roach            }
243c6266a77SGreg Roach            var box_zyaxes = document.getElementById("zyaxes");
244c6266a77SGreg Roach            if (box_zyaxes) {
245c6266a77SGreg Roach                box_zyaxes.style.display = "";
246c6266a77SGreg Roach            }
247c6266a77SGreg Roach        }
248c6266a77SGreg Roach    }
249c6266a77SGreg Roach
250c6266a77SGreg Roach    function statusShow(sel) {
251c6266a77SGreg Roach        var box           = document.getElementById(sel);
252c6266a77SGreg Roach        box.style.display = "";
253c6266a77SGreg Roach        var box_m         = document.getElementById(sel + "_m");
254c6266a77SGreg Roach        if (box_m) {
255c6266a77SGreg Roach            box_m.style.display = "none";
256c6266a77SGreg Roach        }
257c6266a77SGreg Roach        if (sel === "map_opt") {
258c6266a77SGreg Roach            var box_axes = document.getElementById("axes");
259c6266a77SGreg Roach            if (box_axes) {
260c6266a77SGreg Roach                box_axes.style.display = "none";
261c6266a77SGreg Roach            }
262c6266a77SGreg Roach            var box_zyaxes = document.getElementById("zyaxes");
263c6266a77SGreg Roach            if (box_zyaxes) {
264c6266a77SGreg Roach                box_zyaxes.style.display = "none";
265c6266a77SGreg Roach            }
266c6266a77SGreg Roach        }
267c6266a77SGreg Roach    }
268c6266a77SGreg Roach
269c6266a77SGreg Roach    function statusChecked(sel) {
270c6266a77SGreg Roach        var cbox     = document.getElementById(sel);
271c6266a77SGreg Roach        cbox.checked = true;
272c6266a77SGreg Roach    }
273c6266a77SGreg Roach
274c6266a77SGreg Roach    function statusShowSurname(x) {
275c6266a77SGreg Roach        if (x.value === "surname_distribution_chart") {
276c6266a77SGreg Roach            document.getElementById("surname_opt").style.display = "";
277c6266a77SGreg Roach        } else if (x.value !== "surname_distribution_chart") {
278c6266a77SGreg Roach            document.getElementById("surname_opt").style.display = "none";
279c6266a77SGreg Roach        }
280c6266a77SGreg Roach    }
281c6266a77SGreg Roach
282c6266a77SGreg Roach    function loadCustomChart() {
283c6266a77SGreg Roach        $("#custom-chart").html("");
284c6266a77SGreg Roach        var form = $("#own-stats-form");
2853aa29b97SGreg Roach        jQuery.post(form.attr("action"), form.serialize())
286c6266a77SGreg Roach            .done(function (data) {
287c6266a77SGreg Roach                $("#custom-chart").html(data);
288c6266a77SGreg Roach            })
289c6266a77SGreg Roach            .fail(function (jqXHR, textStatus) {
290c6266a77SGreg Roach                // Server error?  Show something to get rid of the spinner.
291c6266a77SGreg Roach                $("#custom-chart").html(textStatus);
292c6266a77SGreg Roach            });
293c6266a77SGreg Roach        return false;
294c6266a77SGreg Roach    }
295b6c326d8SGreg Roach
296b6c326d8SGreg Roach    $("[name='x-as']").change(function () {
297b6c326d8SGreg Roach        var x_axis = document.querySelector("[name='x-as']:checked").value;
298b6c326d8SGreg Roach
299b6c326d8SGreg Roach        switch (x_axis) {
300b6c326d8SGreg Roach            case "<?= e($module::X_AXIS_BIRTH_MONTH) ?>":
301b6c326d8SGreg Roach            case "<?= e($module::X_AXIS_DEATH_MONTH) ?>":
302b6c326d8SGreg Roach            case "<?= e($module::X_AXIS_FIRST_CHILD_MONTH) ?>":
303b6c326d8SGreg Roach                statusEnable("z_sex");
304b6c326d8SGreg Roach                statusHide("x_years");
305b6c326d8SGreg Roach                statusHide("map_opt");
306b6c326d8SGreg Roach                break;
307b6c326d8SGreg Roach
308b6c326d8SGreg Roach            case "<?= e($module::X_AXIS_AGE_AT_DEATH) ?>":
309b6c326d8SGreg Roach                statusEnable("z_sex");
310b6c326d8SGreg Roach                statusShow("x_years");
311b6c326d8SGreg Roach                statusHide("map_opt");
312b6c326d8SGreg Roach                break;
313b6c326d8SGreg Roach
314b6c326d8SGreg Roach            case "<?= e($module::X_AXIS_AGE_AT_MARRIAGE) ?>":
315b6c326d8SGreg Roach            case "<?= e($module::X_AXIS_AGE_AT_FIRST_MARRIAGE) ?>":
316b6c326d8SGreg Roach                statusEnable("z_sex");
317b6c326d8SGreg Roach                statusHide("x_years");
318b6c326d8SGreg Roach                statusShow("x_years_m");
319b6c326d8SGreg Roach                statusHide("map_opt");
320b6c326d8SGreg Roach                break;
321b6c326d8SGreg Roach
322b6c326d8SGreg Roach            case "<?= e($module::X_AXIS_MARRIAGE_MONTH) ?>":
323b6c326d8SGreg Roach            case "<?= e($module::X_AXIS_FIRST_MARRIAGE_MONTH) ?>":
324c1df444aSGreg Roach            case "<?= e($module::X_AXIS_NUMBER_OF_CHILDREN) ?>":
325b6c326d8SGreg Roach                statusChecked("z_none");
326b6c326d8SGreg Roach                statusDisable("z_sex");
327b6c326d8SGreg Roach                statusHide("x_years");
328b6c326d8SGreg Roach                statusHide("map_opt");
329b6c326d8SGreg Roach                break;
330b6c326d8SGreg Roach
331b6c326d8SGreg Roach            case "<?= e($module::X_AXIS_INDIVIDUAL_MAP) ?>":
332b6c326d8SGreg Roach                statusHide("x_years");
333b6c326d8SGreg Roach                statusShow("map_opt");
334b6c326d8SGreg Roach                statusShow("chart_type");
335b6c326d8SGreg Roach                break;
336b6c326d8SGreg Roach
337b6c326d8SGreg Roach            case "<?= e($module::X_AXIS_BIRTH_MAP) ?>":
338b6c326d8SGreg Roach            case "<?= e($module::X_AXIS_MARRIAGE_MAP) ?>":
339b6c326d8SGreg Roach            case "<?= e($module::X_AXIS_DEATH_MAP) ?>":
34071378461SGreg Roach                statusHide("x_years");
34171378461SGreg Roach                statusShow("map_opt");
342b6c326d8SGreg Roach                statusHide("chart_type");
343b6c326d8SGreg Roach                statusHide("surname_opt");
344b6c326d8SGreg Roach                break;
345b6c326d8SGreg Roach        }
346b6c326d8SGreg Roach    });
347b6c326d8SGreg Roach
348b6c326d8SGreg Roach    $("#own-stats-form").on("submit", loadCustomChart);
34963763244SGreg Roach    webtrees.autocomplete('#SURN');
350c6266a77SGreg Roach</script>
351b6c326d8SGreg Roach<?php View::endpush() ?>
352