rich-flower-71648
12/19/2022, 6:47 PMbright-smartphone-11251
bright-smartphone-11251
<BarChart
data={myquery}
sort=false
/>
bright-smartphone-11251
rich-flower-71648
12/19/2022, 7:00 PMrich-flower-71648
12/19/2022, 7:00 PMrich-flower-71648
12/19/2022, 7:01 PMrich-flower-71648
12/19/2022, 7:01 PMrich-flower-71648
12/19/2022, 7:01 PMrich-flower-71648
12/19/2022, 7:02 PMbright-smartphone-11251
(also, how do I label my axes? so that the labels appear in the graph?Use the props:
xAxisTitle
, yAxisTitle
lemon-cricket-39335
12/19/2022, 7:04 PMbright-smartphone-11251
the trouble is I need to do a stacked bar chart of signups by month. I can group by the month, but then the ordering is off (dec appears before may of 2022)I don't fully follow - could you give example code / screenshot
lemon-cricket-39335
12/19/2022, 7:06 PMbright-smartphone-11251
rich-flower-71648
12/19/2022, 7:10 PMrich-flower-71648
12/19/2022, 7:10 PMbright-smartphone-11251
bright-smartphone-11251
bright-smartphone-11251
lemon-cricket-39335
12/19/2022, 7:12 PMrich-flower-71648
12/19/2022, 7:12 PMbright-smartphone-11251
rich-flower-71648
12/19/2022, 7:13 PMbright-smartphone-11251
rich-flower-71648
12/19/2022, 7:14 PMbright-smartphone-11251
rich-flower-71648
12/19/2022, 7:14 PMbright-smartphone-11251
bright-smartphone-11251
rich-flower-71648
12/19/2022, 7:18 PMrich-flower-71648
12/19/2022, 7:18 PMlemon-cricket-39335
12/19/2022, 7:19 PMlemon-cricket-39335
12/19/2022, 7:20 PMrich-flower-71648
12/19/2022, 7:21 PMbright-smartphone-11251
mydate as mydate_dmy
for example.bright-smartphone-11251
bright-smartphone-11251
mmm yyyy
is probably a common enough date format that we should add it to our built insrich-flower-71648
12/19/2022, 7:28 PMrich-flower-71648
12/19/2022, 7:28 PMbright-smartphone-11251
bright-smartphone-11251
rich-flower-71648
12/19/2022, 7:29 PMrich-flower-71648
12/19/2022, 7:29 PMrich-flower-71648
12/19/2022, 7:30 PMbright-smartphone-11251
bright-smartphone-11251
rich-flower-71648
12/19/2022, 7:40 PMrich-flower-71648
12/19/2022, 7:40 PMdate_trunc(MONTH, aa.CreatedOn) as joined_monthyear,
bright-smartphone-11251
rich-flower-71648
12/19/2022, 7:41 PMrich-flower-71648
12/19/2022, 7:41 PMrich-flower-71648
12/19/2022, 7:41 PMrich-flower-71648
12/19/2022, 7:41 PMbright-smartphone-11251
bright-smartphone-11251
rich-flower-71648
12/19/2022, 7:42 PMbright-smartphone-11251
rich-flower-71648
12/19/2022, 7:48 PMrich-flower-71648
12/19/2022, 7:48 PMbright-smartphone-11251
rich-flower-71648
12/19/2022, 8:40 PMsome-carpenter-73115
02/01/2024, 9:06 AM```sql cost_per_month
SELECT
year_month,
SUM(cost) AS month_cost,
month_cost - lag(month_cost) OVER (ORDER BY month_cost) difference_to_previous
FROM
(
SELECT
strftime(cost_date, '%Y-%m') as year_month,
bd.*
FROM billing_data bd
)
GROUP BY year_month
ORDER BY year_month
<DataTable data={cost_per_month} />
<BarChart
data={cost_per_month}
x=year_month
y=month_cost
yFmt='usd0'
title='Monthly Cost'
yAxisTitle='Cost',
xAxisTitle='Month'
sort=false
/>```bright-smartphone-11251
date_trunc('month', cost_date)
?bright-smartphone-11251
fmt
string
<DataTable data={sales}>
<Column id=month fmt="YYYY-MM"/>
<Column id=sales fmt='"$"#,##0'/>
</DataTable>
bright-smartphone-11251
some-carpenter-73115
02/01/2024, 2:12 PMsome-carpenter-73115
02/01/2024, 2:13 PMbright-smartphone-11251
bright-smartphone-11251
bright-smartphone-11251
2024-01-27
-> 2024-01-01
- it's still a real date at the endsome-carpenter-73115
02/01/2024, 2:16 PMbright-smartphone-11251