Annotated Chart
This chart allows users to interactively change their data across a timeline. In the frontend, users can click inside the chart to display a modal with options to add a point or two to the timeline, as well as add an annotation for that point.
The chart requires a separate dataset for each series to plot, and it needs the y-field-name specified for each of them. All datasets must have the same name for the x-field and for the annotations field. The x-field values must be of type Date or convertible to it, the y-field must be integers, and the annotation field values must be strings.
The modal that appears includes a slider to select the value that the user wants to add. This can be configured with the slider_config
parameter, where the max
value can be defined, and also the defaultValue
. Labels can be added to the slider values using the slider_marks
parameter.
The Method To Use
The method is s.plt.annotated_chart()
It must contain the following input variables:
Accepts the following input variables as optional:
Examples
An example on how to use it would be:
When clicking in the chart the modal appears like so:
It lets the user select a date range and the value of the point. Also it lets the user write an annotation in the bottom text field.
If we use the following values:
The result in the chart is:
Last updated