旧版折线图Legacy line charts

Azure Databricks 具有三种类型的折线图:Line 以及旧版图表 Line (v2) 和 Line (v1) 。Azure Databricks has three types of line charts: Line and legacy charts Line (v2) and Line (v1).

折线图比较Line chart comparison

Line 具有自定义绘图选项:设置 Y 轴范围、显示或隐藏标记以及将对数标尺应用到 Y 轴和支持一组丰富的客户端交互的内置工具栏。Line has custom plot options: setting a Y-axis range, showing or hiding markers, and applying log scale to the Y-axis and a built-in toolbar that supports a rich set of client-side interactions.

此外,Line、Line (v2) 和 Line (v1) 图表以不同的方式处理时序数据 :In addition, Line , Line (v2) , and Line (v1) charts treat time-series data in different ways:

Line 和 Line (v2)Line and Line (v2) Line (v1)Line (v1)
支持日期和时间戳。Date and timestamp are supported.

Line (v2) 将日期格式设置为本地时间。Line (v2) formats a date to local time.
日期和时间戳被视为文本。Date and timestamp are treated as text.
键只能是日期、时间戳或数字。Key can only be date, timestamp, or number. 键可以是任何类型。Key can be of any type.
X 轴是排序的:X-axis is ordered:

* 日期、时间戳和数字的自然线性排序。* Natural, linear ordering of date, timestamp, and number.
* 时间间隔显示为图表上的间隔。* Gaps in time appear as gaps on the chart.
X 轴是分类的:X-axis is categorical:

* 除非数据已排序,否则不排序。* Not ordered unless the data is ordered.
* 图表中不显示时间间隔。* Gaps in time do not appear on the chart.

从旧版折线图类型迁移到 LineMigrate to Line from legacy line chart types

若要从 Line (v1) 或 Line (v2) 迁移到 Line :To migrate to Line from Line (v1) or Line (v2) :

  1. 单击条形图图表按钮旁边的向下按钮,然后选择“Line”。Click Button Down next to the bar chart Chart Button and select Line.

    图表类型Chart types

  2. 对于 Line (v1) 图表,如果键列不是日期、时间戳或数字,则必须按以下笔记本中所示将列显式分析为日期、时间戳或数字。For a Line (v1) chart, if the key column is not a date, timestamp, or number, you must parse the column to a date, timestamp, or number explicitly as demonstrated in the following notebook.

时间戳转换笔记本Timestamp conversion notebook

获取笔记本Get notebook

使用旧版折线图Use legacy line charts

若要使用旧版图表,请从“旧版图表”下拉菜单中进行选择。To use legacy line charts, select them from the Legacy Charts drop-down menu.

旧版图表类型Legacy chart types