Pierre-Alexandre Montiel
08/22/2024, 2:35 PMJulius Kos
08/22/2024, 3:00 PMPierre-Alexandre Montiel
08/23/2024, 8:31 AMreturn (
<Card _className_="flex flex-col items-center text-center">
<CardContent _className_="flex-1 flex justify-between items-center pb-0">
<div _style_={{ flex: 0.3, paddingRight: '10px', height: '120px', display: 'flex', alignItems: 'flex-start' }}>
<InsightView _insight_={Md.Insights.RankV2} _filters_={filters} /> {/* Filters are manually applied, so we don't pass them here */}
</div>
<div _style_={{ ...chartContainerStyle, flex: 0.7 }}>
<ResponsiveContainer _width_="100%" _height_="100%">
<LineChart
_data_={chartData}
_margin_={{right: 100, left: 100, bottom: 40 }} // Adjusted margins
>
<CartesianGrid _vertical_={false} _horizontal_={false} />
<XAxis
_dataKey_="month"
_tickLine_={false}
_axisLine_={false}
_tickMargin_={8}
_tickFormatter_={(_value_) => {
const date = new Date(value); // Convert the value to a Date object
return date.toLocaleDateString('en-US', { month: 'short'}); // Format as "Jan 2024"
}}
/>
<Tooltip _content_={<CustomTooltip _active_={undefined} _payload_={undefined} _label_={undefined} />} />
<Line
_dataKey_="actual"
_type_="natural"
_stroke_={chartConfig.actual.color}
_strokeWidth_={2}
_dot_={true}
>
{/* <LabelList
position="top"
offset={12}
className="fill-foreground"
fontSize={12}
/> */}
</Line>
<Line
_dataKey_="previous"
_type_="natural"
_stroke_={chartConfig.previous.color}
_strokeWidth_={2}
_dot_={true}
>
{/* <LabelList
position="top"
offset={12}
className="fill-foreground"
fontSize={12}
/> */}
</Line>
</LineChart>
</ResponsiveContainer>
</div>
</CardContent>
</Card>
);
}; Here my line chart is filtered by the global filters in the dashboard level but thoses filters doesnt not apply on the InsightView. There is a way to pass them to the insightview to have something uniform ?Radek Novacek
08/26/2024, 2:46 PM