Monday, September 17, 2018

Recharts - Show dashed line

If you need to show dashed line for a line chart use the below code.

<Line type="linear" dataKey="trend" strokeDasharray="3 3"
stroke="#69C568" dot={{strokeDasharray: 'none'}} />


You need to add property strokeDasharray="3 3" to the <Line /> You can change the values if needed.

The legend dots will also be plotted as dotted lines. If you want to remove that use the dot prop.

dot={{strokeDasharray: 'none'}}

No comments:

Get Indian financial year based on date

This function lets you get the start and end date of Indian financial year based on given date. This can also be modified for US financia...