While writing the legend for a Kaplan-Meier curve, the details that are required include the general description, the number of patients or subjects at risk, the number of events, the median survival time or the survival probability at specific time points, and the confidence intervals for each curve. Additionally, it is important to label each curve with a clear and concise description of the group it represents, such as treatment and control groups or different subpopulations within the study. It is also important to include the time unit of the x-axis and any other relevant information about the study design or methodology that may be useful for interpreting the results. Overall, the legend should provide a clear and concise summary of the Kaplan-Meier curves and the key findings of the study.