Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📊 Rewrite of the New Dashboard Tab #1018

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
139 commits
Select commit Hold shift + click to select a range
b9385e6
Initial commit, added chart
ctyrrellnrel Jul 12, 2023
26fe4f9
Added two new components
ctyrrellnrel Jul 12, 2023
c05e071
Added view state to MetricsCard
ctyrrellnrel Jul 12, 2023
011b858
Added button to switch between components
ctyrrellnrel Jul 12, 2023
e36ba87
Added button and styling to MetricsCard
ctyrrellnrel Jul 12, 2023
4440e1d
Removing unnecessary code
ctyrrellnrel Jul 13, 2023
5ca9754
Added MetricsCard module to metrics.js
ctyrrellnrel Jul 19, 2023
f3af351
Merge branch 'aria_and_fall_2023_rewrite' of https://github.com/e-mis…
JGreenlee Aug 21, 2023
cb4c65c
remove unneeded code from old PR
JGreenlee Aug 21, 2023
ef8ce3c
move MetricDetails and MetricsCard to js/metrics
JGreenlee Aug 21, 2023
1bd3b62
use new MetricsTab instead of main-metrics
JGreenlee Aug 22, 2023
c24da18
new MetricsTab
JGreenlee Aug 22, 2023
7473855
add typings for metric data
JGreenlee Aug 22, 2023
8753162
reformat MetricsCard to work with new MetricsTab
JGreenlee Aug 22, 2023
12d17ce
fill out MetricDetails
JGreenlee Aug 22, 2023
52854c0
implement datepicker + agg metrics on new dashboard
JGreenlee Aug 23, 2023
5ebced8
adjust padding in MetricsCard
JGreenlee Aug 23, 2023
f32609e
MetricsCard fix typing of Props
JGreenlee Aug 23, 2023
470b4e0
add ActiveMinutesCard to new dashboard
JGreenlee Aug 23, 2023
f93ba1e
rename UserMetrics type to MetricsData
JGreenlee Aug 23, 2023
6026918
add @types/react to devDependencies
JGreenlee Aug 23, 2023
eb60ad5
refactor & memoize seconds to minutes calculation
JGreenlee Aug 23, 2023
18eafef
unify MetricDetails and MetricsCard
JGreenlee Aug 23, 2023
db06256
delete MetricDetails.tsx
JGreenlee Aug 23, 2023
9f46973
Merge branch 'aria_and_fall_2023_rewrite' of https://github.com/e-mis…
JGreenlee Aug 23, 2023
cf4f0e6
generalize format functions in useImperialConfig
JGreenlee Aug 24, 2023
964da4b
fix formatForDisplay
JGreenlee Aug 24, 2023
c417879
show units correctly on MetricsCards
JGreenlee Aug 24, 2023
7a3a6c6
support aggregate metrics on MetricsCard
JGreenlee Aug 24, 2023
b04aab7
fix MetricsCard not always updating details view
JGreenlee Aug 24, 2023
b6dfb4f
fix vertical scrolling on new Dashboard tab
JGreenlee Aug 24, 2023
d0763cd
use i18n for ActiveMinutesCard
JGreenlee Aug 24, 2023
d074cab
update BarChart for categorical data & flat inputs
JGreenlee Aug 24, 2023
6780dae
in MetricsCard, pass records to BarChart
JGreenlee Aug 24, 2023
4e7b054
styling tweaks and refactoring
JGreenlee Aug 24, 2023
8f8d229
add chart to ActiveMinutesCard
JGreenlee Aug 25, 2023
4aa123a
begin Carbon Footprint card
Aug 26, 2023
db5c005
BarChart: support stacked bars
JGreenlee Aug 28, 2023
23a479c
show date ranges for weeks on ActiveMinutesCard
JGreenlee Aug 28, 2023
c480d67
readable labels on new dashboard
JGreenlee Aug 28, 2023
9e40252
fix axis units on MetricsCard
JGreenlee Aug 28, 2023
fde2283
refactor new dashboard into Carousel
JGreenlee Aug 28, 2023
167e3d1
refactoring metrics card styles
JGreenlee Aug 28, 2023
76ebb17
more user metrics
Aug 28, 2023
8972b51
add percent change to carbon card
Aug 28, 2023
9c8e884
rough draft carbon chart
Aug 28, 2023
8839613
comment out "average speed" card
JGreenlee Aug 28, 2023
7643895
dashboard: initial load 15 days ago to yesterday
JGreenlee Aug 28, 2023
35cd467
add carbon goal lines
Aug 28, 2023
0fa637d
move %change to Card Title
Aug 29, 2023
f4179f3
flip bar chart to horizonal
Aug 29, 2023
3d0c910
clean up CarbonFootprintCard
Aug 29, 2023
c93961b
support split-line labels in horizontal BarChart
Aug 29, 2023
9e8aebc
i18n for CarbonFootprintCard
Aug 29, 2023
5aad944
add group metrics to chart
Aug 29, 2023
e6370c0
adjust styling of ChangeIdicator
Aug 29, 2023
258721c
prevent double negative
Aug 30, 2023
8151d7f
fix time ticks
Aug 30, 2023
4c44a00
patches to % change
Aug 30, 2023
8cc6d7f
eliminate create range function
Aug 30, 2023
9b128b7
show certain/uncertain and goal lines
Aug 30, 2023
8fc1c65
make ToggleSwitch more generic
JGreenlee Aug 31, 2023
c468478
move ToggleSwitch to /js/components
JGreenlee Aug 31, 2023
29a0ab1
match ToggleSwitch props to SegmentedButtonProps
JGreenlee Aug 31, 2023
d2a8dc5
revert extra functions in metricsHelper.ts
JGreenlee Aug 31, 2023
d9f478b
ActiveMinutesCard -> WeeklyActiveMinutesCard
JGreenlee Aug 31, 2023
4613f80
describe active minutes at bottom of card
JGreenlee Aug 31, 2023
8a605e0
add LineChart.tsx
JGreenlee Aug 31, 2023
2aea2e5
add DailyActiveMinutesCard to MetricsTab
JGreenlee Aug 31, 2023
691c206
BarChart: support positioning of lineAnnotations
JGreenlee Aug 31, 2023
41ba903
add weekly minutes goal, fix lone "0"
JGreenlee Aug 31, 2023
20b457a
allow gaps in daily active minutes line chart
JGreenlee Aug 31, 2023
6504bae
Merge remote-tracking branch 'origin/dashboard-rewrite' into dashboar…
Aug 31, 2023
bcc1010
color meter chart
Aug 31, 2023
71adf57
darken the guideline lines
Aug 31, 2023
950b163
forgotten color import
Aug 31, 2023
09d4711
add footnote
Aug 31, 2023
a9b311a
refactor BarChart
JGreenlee Sep 1, 2023
d48d333
Merge branch 'label_dashboard_profile_sept_2023' into dashboard-rewrite
JGreenlee Sep 5, 2023
0f4a4e9
add text to Carbon Card
Sep 5, 2023
15ed685
move carbon footprint text to dedicated card
Sep 6, 2023
1c3b532
shorten carbon chart labels
Sep 6, 2023
b377933
bars colored by mode
Sep 6, 2023
e2b6b99
remove extraneous commented code
JGreenlee Sep 7, 2023
4143bf0
refactor makeColorMap
JGreenlee Sep 7, 2023
e0c7d82
refactor modeColors
JGreenlee Sep 7, 2023
40a9b5e
slim the Carousel card margins
JGreenlee Sep 7, 2023
96ee1c6
decrease Y axis font size on BarChart
JGreenlee Sep 7, 2023
3335086
format CarbonTextCard as rows
JGreenlee Sep 7, 2023
50c5292
fix warnings in MetricsCard
JGreenlee Sep 7, 2023
3cb062a
remove colons from carbon categories
JGreenlee Sep 7, 2023
aad133e
style US decarbonization goals text as footnote
JGreenlee Sep 7, 2023
3ef6860
add footnote for "Unlabeled" uncertainty
JGreenlee Sep 7, 2023
ac59d00
make Carousel cards slightly wider
JGreenlee Sep 7, 2023
9976516
fix previous week bar value
Sep 7, 2023
e4cadd2
adjust color-by-mode on dashboard
JGreenlee Sep 8, 2023
4c1e967
Merge branch 'label_dashboard_profile_sept_2023' of https://github.co…
JGreenlee Sep 9, 2023
44d3185
refactor: rename BarChart to Chart
JGreenlee Sep 11, 2023
25a5f5a
big refactor of BarChart & LineChart
JGreenlee Sep 11, 2023
83aa958
add base mode colors to DailyActiveMinutesCard
JGreenlee Sep 11, 2023
7f73823
add subtitles to all dashboard cards
JGreenlee Sep 12, 2023
ca8edbe
change "Co2" to "CO₂"
JGreenlee Sep 12, 2023
6a353f8
fix name of CarbonTextCard
JGreenlee Sep 12, 2023
62ea9f4
add ActiveMinutesTableCard
JGreenlee Sep 12, 2023
17f401c
remove the old Dashboard tab
JGreenlee Sep 12, 2023
8ebc390
implement refresh() on MetricsTab
JGreenlee Sep 12, 2023
89e3d64
add CDC recommendations footnote
JGreenlee Sep 12, 2023
06f7b2d
i18n + add footnote markers on CarbonTextCard
JGreenlee Sep 12, 2023
72f6437
remove fake data that was used for testing
JGreenlee Sep 12, 2023
9208ec0
dashboard: use rich mode text, not readable label
JGreenlee Sep 12, 2023
7dbc343
remove old dashboard library nvd3
JGreenlee Sep 12, 2023
7d2b9dc
make space for annotation at top of chart
JGreenlee Sep 12, 2023
5fcc5d4
fix footprint calculations using baseModes
JGreenlee Sep 12, 2023
7d0eb81
adjust ChangeIndicator colors and text
JGreenlee Sep 12, 2023
92ad2ee
fix dateRange issue
JGreenlee Sep 12, 2023
a3b0c08
show Unlabeled as faint grey, last item in legend
JGreenlee Sep 14, 2023
b9e1416
re-order "Prev. week" before "Past week", refactor
JGreenlee Sep 14, 2023
0ecfa58
tweak ChangeIndicator style
JGreenlee Sep 14, 2023
54e6d8b
fix error sometimes if metrics is not defined yet
JGreenlee Sep 14, 2023
907737b
add 'meter' gradients to carbon graph
JGreenlee Sep 14, 2023
a3264e2
adjust carbon meter gradient
JGreenlee Sep 14, 2023
67111b8
refactor: remove darkenForBorder + fix
JGreenlee Sep 14, 2023
fe2dd55
fix segmentDaysByWeeks
JGreenlee Sep 15, 2023
f57603c
use custom labels
Sep 15, 2023
f9822c5
Merge branch 'dashboard-rewrite' of https://github.com/JGreenlee/e-mi…
Sep 15, 2023
388b5d7
carbon chart: fix border of green, 'low' emissions
JGreenlee Sep 15, 2023
44753f6
add slight borderRadius to Charts
JGreenlee Sep 15, 2023
9cad0ee
reorder goal lines + adjust colors
JGreenlee Sep 15, 2023
c2c656c
fix group text
Sep 15, 2023
dd126a7
only show metrics for whole weeks
Sep 15, 2023
de20d3b
"taxi" -> "worst case"
Sep 18, 2023
8f5fb89
remove calorie keys
Sep 18, 2023
edd8624
Merge remote-tracking branch 'upstream/label_dashboard_profile_sept_2…
Sep 19, 2023
ab26e18
Merge branch 'onboarding_routing_sept_2023' into dashboard-rewrite
JGreenlee Sep 25, 2023
da20511
Merge branch 'dashboard-rewrite' of https://github.com/JGreenlee/e-mi…
Sep 25, 2023
4cc97db
Merge upstream, resolved main.js
Sep 25, 2023
8c6bdb2
update comments about prev vs past week
Sep 25, 2023
752674b
not >= 7 day weeks, == 7 day weeks
Sep 25, 2023
bb4fdd0
update infinity behavior on changeIndicator
Sep 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions package.cordovabuild.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@
"angular": "1.6.7",
"angular-animate": "1.6.7",
"angular-local-storage": "^0.7.1",
"angular-nvd3": "^1.0.7",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woo! Will we be restoring the graph in the trip detail screen or adding new ones (using the new chart library) going forward?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The speed graph should be fairly easy to add because we made LineChart in such a way that it can be easily re-used.
If we want, we could display plenty of other interesting things there too.

"angular-sanitize": "1.6.7",
"angular-simple-logger": "^0.1.7",
"angular-translate": "^2.18.1",
Expand Down Expand Up @@ -158,7 +157,6 @@
"moment-timezone": "^0.5.43",
"ng-i18next": "^1.0.7",
"npm": "^9.6.3",
"nvd3": "^1.8.6",
"phonegap-plugin-barcodescanner": "git+https://github.com/phonegap/phonegap-plugin-barcodescanner#v8.1.0",
"prop-types": "^15.8.1",
"react": "^18.2.*",
Expand Down
2 changes: 0 additions & 2 deletions package.serve.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
"angular": "1.6.7",
"angular-animate": "1.6.7",
"angular-local-storage": "^0.7.1",
"angular-nvd3": "^1.0.7",
"angular-sanitize": "1.6.7",
"angular-simple-logger": "^0.1.7",
"angular-translate": "^2.18.1",
Expand Down Expand Up @@ -83,7 +82,6 @@
"moment-timezone": "^0.5.43",
"ng-i18next": "^1.0.7",
"npm": "^9.6.3",
"nvd3": "^1.8.6",
"prop-types": "^15.8.1",
"react": "^18.2.*",
"react-chartjs-2": "^5.2.0",
Expand Down
12 changes: 0 additions & 12 deletions www/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
max-height: 50px;
}

/* nvd3 styles */
@import 'nvd3/build/nv.d3.css';

.fill-container {
display: block;
position: relative;
Expand Down Expand Up @@ -746,15 +743,6 @@ timestamp-badge[light-bg] {
padding: 5% 10%;
}

svg {
display: block;
}
#chart, #chart svg {
margin-right: 10px;
}
.nvd3, nv-noData {
font-weight: 300 !important;
}
.metric-datepicker {
/*height: 33px;*/
display: flex; /* establish flex container */
Expand Down
49 changes: 26 additions & 23 deletions www/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,11 @@
"less-than": " less than ",
"less": " less ",
"week-before": "vs. week before",
"this-week": "this week",
"pick-a-date": "Pick a date",
"trips": "trips",
"hours": "hours",
"minutes": "minutes",
"custom": "Custom"
},

Expand Down Expand Up @@ -142,42 +144,43 @@
"no-travel-hint": "To see more, change the filters above or go record some travel!"
},

"user-gender": "Gender",
"gender-male": "Male",
"gender-female": "Female",
"user-height": "Height",
"user-weight": "Weight",
"user-age": "Age",

"main-metrics":{
"dashboard": "Dashboard",
"summary": "My Summary",
"chart": "Chart",
"change-data": "Change dates:",
"distance": "My Distance",
"trips": "My Trips",
"duration": "My Duration",
"distance": "Distance",
"trips": "Trips",
"duration": "Duration",
"fav-mode": "My Favorite Mode",
"speed": "My Speed",
"footprint": "My Footprint",
"estimated-emissions": "Estimated CO₂ emissions",
"how-it-compares": "Ballpark comparisons",
"optimal": "Optimal (perfect mode choice for all my trips):",
"average": "Average for group:",
"avoided": "CO₂ avoided (vs. all 'taxi'):",
"optimal": "Optimal (perfect mode choice for all my trips)",
"average": "Group Avg.",
"worst-case": "Worse Case",
"label-to-squish": "Label trips to collapse the range into a single number",
"range-uncertain-footnote": "²Due to the uncertainty of unlabeled trips, estimates may fall anywhere within the shown range. Label more trips for richer estimates.",
"lastweek": "My last week value:",
"us-2030-goal": "US 2030 Goal Estimate:",
"us-2050-goal": "US 2050 Goal Estimate:",
"calories": "My Calories",
"calibrate": "Calibrate",
"us-2030-goal": "2030 Guideline¹",
"us-2050-goal": "2050 Guideline¹",
"us-goals-footnote": "¹Guidelines based on US decarbonization goals, scaled to per-capita travel-related emissions.",
"past-week" : "Past Week",
"prev-week" : "Prev. Week",
"no-summary-data": "No summary data",
"mean-speed": "My Average Speed",
"equals-cookies_one": "Equals at least {{count}} homemade chocolate chip cookie",
"equals-cookies_other": "Equals at least {{count}} homemade chocolate chip cookies",
"equals-icecream_one": "Equals at least {{count}} half cup vanilla ice cream",
"equals-icecream_other": "Equals at least {{count}} half cups vanilla ice cream",
"equals-bananas_one": "Equals at least {{count}} banana",
"equals-bananas_other": "Equals at least {{count}} bananas"
"user-totals": "My Totals",
"group-totals": "Group Totals",
"active-minutes": "Active Minutes",
"weekly-active-minutes": "Weekly minutes of active travel",
"daily-active-minutes": "Daily minutes of active travel",
"active-minutes-table": "Table of active minutes metrics",
"weekly-goal": "Weekly Goal³",
"weekly-goal-footnote": "³Weekly goal based on CDC recommendation of 150 minutes of moderate activity per week.",
"labeled": "Labeled",
"unlabeled": "Unlabeled²",
"footprint-label": "Footprint (kg CO₂)"
},

"main-inf-scroll" : {
Expand Down
1 change: 0 additions & 1 deletion www/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import './js/survey/enketo/infinite_scroll_filters.js';
import './js/survey/enketo/enketo-trip-button.js';
import './js/survey/enketo/enketo-demographics.js';
import './js/survey/enketo/enketo-add-note-button.js';
import './js/metrics.js';
JGreenlee marked this conversation as resolved.
Show resolved Hide resolved
import './js/control/general-settings.js';
import './js/control/emailService.js';
import './js/control/uploadService.js';
Expand Down
3 changes: 2 additions & 1 deletion www/js/appTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ const AppTheme = {
level4: '#e0f0ff', // lch(94% 50 250)
level5: '#d6ebff', // lch(92% 50 250)
},
success: '#38872e', // lch(50% 55 135)
success: '#00a665', // lch(60% 55 155)
warn: '#f8cf53', //lch(85% 65 85)
danger: '#f23934' // lch(55% 85 35)
},
roundness: 5,
Expand Down
206 changes: 16 additions & 190 deletions www/js/components/BarChart.tsx
Original file line number Diff line number Diff line change
@@ -1,201 +1,27 @@
import React from "react";
import Chart, { Props as ChartProps } from "./Chart";
import { useTheme } from "react-native-paper";
import { getGradient } from "./charting";

import React, { useRef, useState } from 'react';
import { array, string, bool } from 'prop-types';
import { angularize } from '../angular-react-helper';
import { View } from 'react-native';
import { useTheme } from 'react-native-paper';
import { Chart, CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend, TimeScale } from 'chart.js';
import { Bar } from 'react-chartjs-2';
import Annotation, { AnnotationOptions } from 'chartjs-plugin-annotation';

Chart.register(
CategoryScale,
LinearScale,
TimeScale,
BarElement,
Title,
Tooltip,
Legend,
Annotation,
);

const BarChart = ({ chartData, axisTitle, lineAnnotations=null, isHorizontal=false }) => {
type Props = Omit<ChartProps, 'type'> & {
meter?: {high: number, middle: number, dash_key: string},
}
const BarChart = ({ meter, ...rest }: Props) => {

const { colors } = useTheme();
const [ numVisibleDatasets, setNumVisibleDatasets ] = useState(1);

const barChartRef = useRef<Chart>(null);

const defaultPalette = [
'#c95465', // red oklch(60% 0.15 14)
'#4a71b1', // blue oklch(55% 0.11 260)
'#d2824e', // orange oklch(68% 0.12 52)
'#856b5d', // brown oklch(55% 0.04 50)
'#59894f', // green oklch(58% 0.1 140)
'#e0cc55', // yellow oklch(84% 0.14 100)
'#b273ac', // purple oklch(64% 0.11 330)
'#f09da6', // pink oklch(78% 0.1 12)
'#b3aca8', // grey oklch(75% 0.01 55)
'#80afad', // teal oklch(72% 0.05 192)
]

const indexAxis = isHorizontal ? 'y' : 'x';

function getChartHeight() {
/* when horizontal charts have more data, they should get taller
so they don't look squished */
if (isHorizontal) {
// 'ideal' chart height is based on the number of datasets and number of unique index values
const uniqueIndexVals = [];
chartData.forEach(e => e.records.forEach(r => {
if (!uniqueIndexVals.includes(r[indexAxis])) uniqueIndexVals.push(r[indexAxis]);
}));
const numIndexVals = uniqueIndexVals.length;
const idealChartHeight = numVisibleDatasets * numIndexVals * 8;

/* each index val should be at least 20px tall for visibility,
and the graph itself should be at least 250px tall */
const minChartHeight = Math.max(numIndexVals * 20, 250);

// return whichever is greater
return { height: Math.max(idealChartHeight, minChartHeight) };
if (meter) {
rest.getColorForChartEl = (chart, dataset, ctx, colorFor) => {
const darkenDegree = colorFor == 'border' ? 0.25 : 0;
const alpha = colorFor == 'border' ? 1 : 0;
return getGradient(chart, meter, dataset, ctx, alpha, darkenDegree);
}
// vertical charts will just match the parent container
return { height: '100%' };
rest.borderWidth = 3;
}

return (
<View style={[getChartHeight(), {padding: 12}]}>
<Bar ref={barChartRef}
data={{
datasets: chartData.map((d, i) => ({
label: d.label,
data: d.records,
// cycle through the default palette, repeat if necessary
backgroundColor: defaultPalette[i % defaultPalette.length],
}))
}}
options={{
indexAxis: indexAxis,
responsive: true,
maintainAspectRatio: false,
resizeDelay: 1,
scales: {
...(isHorizontal ? {
y: {
offset: true,
type: 'time',
adapters: {
date: { zone: 'utc' },
},
time: {
unit: 'day',
tooltipFormat: 'DDD', // Luxon "localized date with full month": e.g. August 6, 2014
},
beforeUpdate: (axis) => {
setNumVisibleDatasets(axis.chart.getVisibleDatasetCount())
},
reverse: true,
},
x: {
title: { display: true, text: axisTitle },
},
} : {
x: {
offset: true,
type: 'time',
adapters: {
date: { zone: 'utc' },
},
time: {
unit: 'day',
tooltipFormat: 'DDD', // Luxon "localized date with full month": e.g. August 6, 2014
},
},
y: {
title: { display: true, text: axisTitle },
},
}),
},
plugins: {
...(lineAnnotations?.length > 0 && {
annotation: {
annotations: lineAnnotations.map((a, i) => ({
type: 'line',
label: {
display: true,
padding: { x: 3, y: 1 },
borderRadius: 0,
backgroundColor: 'rgba(0,0,0,.7)',
color: 'rgba(255,255,255,1)',
font: { size: 10 },
position: 'start',
content: a.label,
},
...(isHorizontal ? { xMin: a.value, xMax: a.value }
: { yMin: a.value, yMax: a.value }),
borderColor: colors.onBackground,
borderWidth: 2,
borderDash: [3, 3],
} satisfies AnnotationOptions)),
}
}),
}
}} />
</View>
)
<Chart type="bar" {...rest} />
);
}

BarChart.propTypes = {
chartData: array,
axisTitle: string,
lineAnnotations: array,
isHorizontal: bool,
};

angularize(BarChart, 'BarChart', 'emission.main.barchart');
export default BarChart;

// const sampleAnnotations = [
// { value: 35, label: 'Target1' },
// { value: 65, label: 'Target2' },
// ];

// const sampleChartData = [
// {
// label: 'Primary',
// records: [
// { x: moment('2023-06-20'), y: 20 },
// { x: moment('2023-06-21'), y: 30 },
// { x: moment('2023-06-23'), y: 80 },
// { x: moment('2023-06-24'), y: 40 },
// ],
// },
// {
// label: 'Secondary',
// records: [
// { x: moment('2023-06-21'), y: 10 },
// { x: moment('2023-06-22'), y: 50 },
// { x: moment('2023-06-23'), y: 30 },
// { x: moment('2023-06-25'), y: 40 },
// ],
// },
// {
// label: 'Tertiary',
// records: [
// { x: moment('2023-06-20'), y: 30 },
// { x: moment('2023-06-22'), y: 40 },
// { x: moment('2023-06-24'), y: 10 },
// { x: moment('2023-06-25'), y: 60 },
// ],
// },
// {
// label: 'Quaternary',
// records: [
// { x: moment('2023-06-22'), y: 10 },
// { x: moment('2023-06-23'), y: 20 },
// { x: moment('2023-06-24'), y: 30 },
// { x: moment('2023-06-25'), y: 40 },
// ],
// },
// ];
Loading