click-tracking
11 months ago
date-picker
5 months ago
email
9 months ago
examiner
11 months ago
icons
6 months ago
integrations
11 months ago
interrupt
11 months ago
journeys
6 months ago
notices
6 months ago
overview
6 months ago
partials
5 months ago
settings
5 months ago
tables
6 months ago
campaign-builder.blade.php
11 months ago
chart.blade.php
11 months ago
debug.blade.php
11 months ago
plugin-group-options.blade.php
11 months ago
quick-stat-loading.blade.php
11 months ago
quick-stat.blade.php
5 months ago
quick-stats.blade.php
11 months ago
real-time.blade.php
6 months ago
support.blade.php
6 months ago
updates.blade.php
6 months ago
woocommerce-order-meta-box.blade.php
6 months ago
chart.blade.php
72 lines
| 1 | @php /** @var \IAWP\Chart $chart */ @endphp |
| 2 | @php /** @var \IAWP\Statistics\Intervals\Interval[] $intervals */ @endphp |
| 3 | @php /** @var \IAWP\Statistics\Intervals\Interval $current_interval */ @endphp |
| 4 | @php /** @var array $stimulus_values */ @endphp |
| 5 | @php /** @var array $available_datasets */ @endphp |
| 6 | @php /** @var string $primary_chart_metric_id */ @endphp |
| 7 | @php /** @var ?string $secondary_chart_metric_id */ @endphp |
| 8 | |
| 9 | <div class="chart-container"> |
| 10 | <div class="chart-inner" |
| 11 | data-testid="chart" |
| 12 | data-controller="chart" |
| 13 | <?php foreach($stimulus_values as $key => $value) : ?> |
| 14 | data-chart-<?php echo esc_attr($key); ?>-value="<?php echo is_array($value) ? esc_attr($chart->encode_json($value)) : esc_attr($value); ?>" |
| 15 | <?php endforeach; ?> |
| 16 | > |
| 17 | <div class="legend-container"> |
| 18 | <div class="legend" style="display: none;"></div> |
| 19 | <?php if (!$chart->is_preview()) : ?> |
| 20 | <div class="primary-metric-select-container metric-select-container"> |
| 21 | <select id="primary-metric-select" |
| 22 | data-chart-target="primaryMetricSelect" |
| 23 | data-action="chart#changePrimaryMetric" |
| 24 | > |
| 25 | <?php foreach($available_datasets as $group) : ?> |
| 26 | <optgroup label="<?php echo esc_attr($group['name']); ?>"> |
| 27 | <?php foreach($group['items'] as $item) : ?> |
| 28 | <option value="<?php echo esc_attr($item['id']); ?>" <?php selected($primary_chart_metric_id, $item['id'], true); ?> <?php echo $secondary_chart_metric_id === $item['id'] ? 'disabled' : ''; ?>> |
| 29 | <?php echo esc_html($item['name']); ?> |
| 30 | </option> |
| 31 | <?php endforeach; ?> |
| 32 | </optgroup> |
| 33 | <?php endforeach; ?> |
| 34 | </select> |
| 35 | </div> |
| 36 | |
| 37 | <div class="secondary-metric-select-container metric-select-container"> |
| 38 | <select id="secondary-metric-select" |
| 39 | data-chart-target="secondaryMetricSelect" |
| 40 | data-action="chart#changeSecondaryMetric" |
| 41 | > |
| 42 | <option value="no_comparison" <?php selected(is_null($secondary_chart_metric_id)); ?>><?php esc_html_e('No Comparison', 'independent-analytics'); ?></option> |
| 43 | <?php foreach($available_datasets as $group) : ?> |
| 44 | <optgroup label="<?php echo esc_attr($group['name']); ?>"> |
| 45 | <?php foreach($group['items'] as $item) : ?> |
| 46 | <option value="<?php echo esc_attr($item['id']); ?>" <?php selected($secondary_chart_metric_id, $item['id'], true); ?> <?php echo $primary_chart_metric_id === $item['id'] ? 'disabled' : ''; ?>> |
| 47 | <?php echo esc_html($item['name']); ?> |
| 48 | </option> |
| 49 | <?php endforeach; ?> |
| 50 | </optgroup> |
| 51 | <?php endforeach; ?> |
| 52 | </select> |
| 53 | </div> |
| 54 | |
| 55 | <select class="adaptive-select-width" data-chart-target="adaptiveWidthSelect"> |
| 56 | <option></option> |
| 57 | </select> |
| 58 | |
| 59 | <select id="chart-interval-select" class="chart-interval-select" |
| 60 | data-controller="chart-interval" |
| 61 | data-action="chart-interval#setChartInterval"> |
| 62 | <?php foreach($intervals as $interval) :?> |
| 63 | <option value="<?php echo esc_attr($interval->id()); ?>" <?php selected($interval->equals($current_interval)); ?>> |
| 64 | <?php echo esc_html($interval->label()); ?> |
| 65 | </option> |
| 66 | <?php endforeach; ?> |
| 67 | </select> |
| 68 | <?php endif; ?> |
| 69 | </div> |
| 70 | <canvas id="independent-analytics-chart" data-chart-target="canvas"></canvas> |
| 71 | </div> |
| 72 | </div> |