@@ -30,7 +30,7 @@ import { pivotAnalyticsData } from "@/utils/analytics";
3030import { CustomTooltipForFlagUageMetrics } from "@/utils/chart" ;
3131import { AnalyticsContentSkeleton } from "./analytics-content-skeleton" ;
3232
33- type FlagSummary = { flagKey : string ; total : number } ;
33+ type FlagSummary = { flag_key : string ; total : number } ;
3434
3535type FlagUsageMetricsProps = {
3636 data : FlagUsageData ;
@@ -79,7 +79,18 @@ export function FlagUsageMetrics({
7979 if ( variationChartData . length === 0 ) {
8080 return [ ] ;
8181 }
82- return Object . keys ( variationChartData [ 0 ] ) . filter ( ( k ) => k !== "date" ) ;
82+
83+ const keys = new Set < string > ( ) ;
84+
85+ for ( const day of variationChartData ) {
86+ for ( const key of Object . keys ( day ) ) {
87+ if ( key !== "date" ) {
88+ keys . add ( key ) ;
89+ }
90+ }
91+ }
92+
93+ return Array . from ( keys ) ;
8394 } , [ variationChartData ] ) ;
8495
8596 if ( isLoading ) {
@@ -94,7 +105,7 @@ export function FlagUsageMetrics({
94105 const topFlagsKeys = data . flagDistribution
95106 . sort ( ( a , b ) => ( Number ( b . total ) || 0 ) - ( Number ( a . total ) || 0 ) )
96107 . slice ( 0 , 5 )
97- . map ( ( f ) => f . flagKey ) ;
108+ . map ( ( f ) => f . flag_key ) ;
98109
99110 const chartTitle =
100111 ! selectedFlagKey || selectedFlagKey === "project-wide"
@@ -169,8 +180,8 @@ export function FlagUsageMetrics({
169180 Project-Wide Aggregate
170181 </ SelectItem >
171182 { allFlags . map ( ( flag ) => (
172- < SelectItem key = { flag . flagKey } value = { flag . flagKey } >
173- { flag . flagKey }
183+ < SelectItem key = { flag . flag_key } value = { flag . flag_key } >
184+ { flag . flag_key }
174185 </ SelectItem >
175186 ) ) }
176187 </ SelectContent >
@@ -188,8 +199,9 @@ export function FlagUsageMetrics({
188199 < Legend />
189200 { variationKeys . map ( ( key , index ) => (
190201 < Line
202+ connectNulls
191203 dataKey = { key }
192- dot = { false }
204+ dot = { true }
193205 key = { key }
194206 name = { key }
195207 stroke = { CHART_LINE_COLORS [ index % CHART_LINE_COLORS . length ] }
@@ -215,8 +227,9 @@ export function FlagUsageMetrics({
215227 < Legend />
216228 { topFlagsKeys . map ( ( key , index ) => (
217229 < Line
230+ connectNulls
218231 dataKey = { key }
219- dot = { false }
232+ dot = { true }
220233 key = { key }
221234 stroke = { CHART_LINE_COLORS [ index % CHART_LINE_COLORS . length ] }
222235 type = "monotone"
0 commit comments