packages/charts/react-charts/stories/src/LineChart/LineChartBestPractices.md
Padding on the left and right of the chart is determined by the x-axis labels - it should start and end at or nearly at the first and last tick mark. The minimum padding is 8px.
Use a line graph to visualize data sets over a period of time for an individual or group of items. The number of lines (data sets) depend on the attributes selected during the report creation.
The line graph thickness will vary depending on the number of data sets and data increments.
Event annotations are used to highlight events and annotate them using messages. Annotations are represented by vertical line markers to mark the date and callouts to represent the message. Events can be added by using eventAnnotationProps prop. Each event contains a date, event message and event details callout callback onRenderCard
A line chart can have gaps/breaks in between. This is to represent missing data. The gaps can also be replaced with dashed or dotted lines for specific scenarios, say to represent low confidence predictions for a time series forecast graph. Gaps can be added by using gaps prop. A gap is denoted by startIndex and endIndex datapoints in the line. A line will be drawn till the startIndex and skipped for endIndex - startIndex number of datapoints. A line can have as many gaps as possible.
Each line in the chart can contain a 2 px border for better highlighting of the line when there are multiple items in the chart. The border will have color of the background theme. Lines will be highlighted in order of their appearance in legends. Line border is a highly suggested style that you should apply to make multiple lines more distinguishable from each other. Use lineBorderWidth prop present inside lineOptions to enable it.
We use a path-based rendering technique to show datasets with large number of points (greater than 1k). Using this technique datasets with over 10k points can be rendered with high performance. Enable this rendering method by setting the optimizeLargeData prop to true. Refer to the performance section to know more about our performance benchmarks.
Line chart provides a bunch of props to enable custom accessibility messages. Use xAxisCalloutAccessibilityData and callOutAccessibilityData to configure x axis and y axis accessibility messages, respectively.
The chart axes support 2 ways of localization.
dateLocalizeOptions for date axis to define target localization. Refer the Javascript localization guide for usage.timeFormatLocale prop. Refer to the Custom Locale Date Axis example in line chart for sample usage.For instructions on how to create date objects to be passed as data points in the chart, see Creating Date Objects For Chart Data | FluentUI Charting Contrib Docsite