File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
packages/react-charts/src/victory/components/ChartBar/examples Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -322,7 +322,7 @@ class Timeline extends React.Component {
322322 [
323323 { y0: new Date (' 2024-08-06T01:30:00' ), y: new Date (' 2024-08-07T02:30:00' ), severity: ' warn' },
324324 { y0: new Date (' 2024-08-08T07:30:00' ), y: new Date (' 2024-08-09T09:30:00' ), severity: ' warn' },
325- { y0: new Date (' 2024-08-09T05 :30:00' ), y: new Date (' 2024-08-10T20:00:00' ), severity: ' warn' },
325+ { y0: new Date (' 2024-08-09T11 :30:00' ), y: new Date (' 2024-08-10T20:00:00' ), severity: ' warn' },
326326 { y0: new Date (' 2024-08-12T10:00:00' ), y: new Date (' 2024-08-13T10:30:00' ), severity: ' warn' }
327327 ],
328328 [
@@ -394,7 +394,13 @@ class Timeline extends React.Component {
394394 containerComponent= {
395395 < ChartVoronoiContainer
396396 labelComponent= {
397- < ChartTooltip constrainToVisibleArea labelComponent= {< ChartLabel dx= {- 65 } textAnchor= " start" / > } / >
397+ < ChartTooltip
398+ constrainToVisibleArea
399+ dx= {({ x, x0 }) => - (x - x0) / 2 } // Position tooltip so pointer appears centered
400+ dy= {- 5 } // Position tooltip so pointer appears above bar
401+ labelComponent= {< ChartLabel dx= {- 68 } textAnchor= " start" / > }
402+ orientation= " top" // Mimic bullet chart tooltip orientation
403+ / >
398404 }
399405 labels= {({ datum }) =>
400406 ` Severity: ${ datum .severity } \n Start: ${ formatDate (new Date (datum .y0 ), true )} \n End: ${ formatDate (new Date (datum .y ), true )} `
You can’t perform that action at this time.
0 commit comments