Skip to content

Commit

Permalink
Linear charts & remove duplicate days buttons (#97110)
Browse files Browse the repository at this point in the history
* Make the charts linear
* Remove the X days buttons if X days is the same as whole campaign length
  • Loading branch information
j6ll authored Dec 5, 2024
1 parent edbbf0a commit 158fcb1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ export default function CampaignItemDetails( props: Props ) {
],
},
{
condition: activeDays >= 7,
condition: activeDays > 7,
controls: [
{
onClick: () => updateChartParams( ChartSourceDateRanges.LAST_7_DAYS ),
Expand All @@ -477,7 +477,7 @@ export default function CampaignItemDetails( props: Props ) {
],
},
{
condition: activeDays >= 14,
condition: activeDays > 14,
controls: [
{
onClick: () => updateChartParams( ChartSourceDateRanges.LAST_14_DAYS ),
Expand All @@ -487,7 +487,7 @@ export default function CampaignItemDetails( props: Props ) {
],
},
{
condition: activeDays >= 30,
condition: activeDays > 30,
controls: [
{
onClick: () => updateChartParams( ChartSourceDateRanges.LAST_30_DAYS ),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ const CampaignStatsLineChart = ( { data, source, resolution }: GraphProps ) => {
return gradient;
},
paths: ( u: uPlot, seriesIdx: number, idx0: number, idx1: number ) => {
const { spline } = uPlot.paths;
return spline?.()( u, seriesIdx, idx0, idx1 ) || null;
const { linear } = uPlot.paths;
return linear?.()( u, seriesIdx, idx0, idx1 ) || null;
},
points: {
show: false,
Expand Down

0 comments on commit 158fcb1

Please sign in to comment.