@@ -46,7 +46,9 @@ class MyTooltipLabel extends React.PureComponent<ChartLabelProps> {
4646 }
4747}
4848
49- class MyTooltipLegendLabel extends React . PureComponent < ChartLegendLabelProps > {
49+ class MyTooltipLegendLabel extends React . PureComponent <
50+ ChartLegendLabelProps & { styleOverride ?: ChartLegendLabelProps [ "style" ] }
51+ > {
5052 public render ( ) {
5153 const dx =
5254 typeof this . props . dx === "number"
@@ -58,7 +60,7 @@ class MyTooltipLegendLabel extends React.PureComponent<ChartLegendLabelProps> {
5860 < ChartLegendTooltipLabel
5961 { ...this . props }
6062 dx = { ( ( dx || 0 ) * BaseChart . legendLabelStyle . fontSize ) / 14 }
61- style = { BaseChart . legendLabelStyle }
63+ style = { this . props . styleOverride || BaseChart . legendLabelStyle }
6264 legendLabelComponent = { < MyTooltipLabel /> }
6365 />
6466 )
@@ -71,7 +73,7 @@ class MyTooltipContent extends React.PureComponent<ChartLegendTooltipContentProp
7173 < ChartLegendTooltipContent
7274 { ...this . props }
7375 labelComponent = { < MyTooltipLegendLabel /> }
74- titleComponent = { < ChartLabel style = { BaseChart . legendTitleStyle } /> }
76+ titleComponent = { < MyTooltipLegendLabel styleOverride = { BaseChart . legendTitleStyle } /> }
7577 />
7678 )
7779 }
@@ -353,10 +355,10 @@ export default class BaseChart extends React.PureComponent<Props> {
353355
354356 /** @return the `legendData` model for `<ChartLegendTooltip/>` */
355357 private getLegendData ( chart : BaseChartProps ) : ChartLegendTooltipProps [ "legendData" ] {
356- return chart . series . map ( ( { data, stroke, fill } ) => ( {
358+ return chart . series . map ( ( { data, stroke, fill, impl } ) => ( {
357359 childName : data [ 0 ] . name ,
358360 name : data [ 0 ] . name ?. replace ( / ^ \S + \s * / , "" ) ,
359- symbol : { fill : fill || stroke } ,
361+ symbol : { fill : fill || stroke , type : impl === "ChartDashedLine" ? "dash" : undefined } ,
360362 } ) )
361363 }
362364
@@ -389,6 +391,8 @@ export default class BaseChart extends React.PureComponent<Props> {
389391 domain = { chart . domain }
390392 containerComponent = {
391393 < CursorVoronoiContainer
394+ mouseFollowTooltips
395+ voronoiDimension = "x"
392396 labels = { this . getTooltipLabels . bind ( this , formatMap ) }
393397 labelComponent = {
394398 < ChartLegendTooltip
@@ -399,8 +403,6 @@ export default class BaseChart extends React.PureComponent<Props> {
399403 title = { ( datum : any ) => `${ new Date ( datum . x + this . props . timeRange . min ) . toLocaleString ( ) } ` }
400404 />
401405 }
402- mouseFollowTooltips
403- voronoiPadding = { 20 }
404406 />
405407 }
406408 >
0 commit comments