磁贴可视化Tile visualizations

磁贴适用于在工作簿中呈现摘要数据。Tiles are a useful way to present summary data in workbooks. 下图显示了磁贴的常见用例,应用级别摘要位于详细网格的顶部。The image below shows a common use case of tiles with app level summary on top of a detailed grid.

磁贴摘要视图的屏幕截图Screenshot of tile summary view

工作簿磁贴支持显示标题、副标题、大文本、图标、基于指标的渐变、缩微折线图/条形图、页脚等。Workbook tiles support showing a title, subtitle, large text, icons, metric based gradients, spark line/bars, footer, etc.

添加磁贴Adding a tile

  1. 单击“编辑”工具栏项,将工作簿切换到编辑模式。Switch the workbook to edit mode by clicking on the Edit toolbar item.

  2. 依次选择“添加”、“添加查询”,将日志查询控件添加到工作簿。Select Add then Add query to add a log query control to the workbook.

  3. 选择“日志”作为查询类型,并选择资源类型(例如 Application Insights)以及目标资源。Select the query type as Log, resource type (for example, Application Insights) and the resources to target.

  4. 使用查询编辑器输入用于分析的 KQL。Use the Query editor to enter the KQL for your analysis.

    requests
    | summarize Requests = count() by appName, name
    | top 7 by Requests desc
    
  5. 将“大小”设置为“完整”。Set Size to Full.

  6. 将可视化效果设置为“磁贴”。Set the visualization to Tiles.

  7. 选择“磁贴设置”按钮以打开“设置”窗格。Select the Tile Settings button to open the settings pane.

    1. 在“标题”中,设置:In Title, set:
      • 使用列:nameUse column: name.
    2. 在“左侧”中,设置:In Left, set:
      • 使用列:RequestsUse column: Requests.
      • 列呈现器:Big NumberColumn renderer: Big Number.
      • 调色板:Green to RedColor palette: Green to Red
      • 最小值:0Minimum value: 0.
    3. 在“底部”中,设置:In Bottom, set:
      • 使用列:appNameUse column: appName.
  8. 选择窗格底部的“保存并关闭”按钮。Select the Save and Close button at the bottom of the pane.

屏幕截图,其中的磁贴摘要视图包含上述查询和磁贴设置。Screenshot of tile summary view with above query and  tile settings.

读取模式下的磁贴:The tiles in read mode:

读取模式下的磁贴摘要视图的屏幕截图。Screenshot of tile summary view in read mode.

磁贴中的 Spark 行Spark lines in tiles

  1. 单击“编辑”工具栏项,将工作簿切换到编辑模式。Switch the workbook to edit mode by clicking on the Edit toolbar item.

  2. 添加一个名为 TimeRange 的时间范围参数。Add a time range parameter called TimeRange.

    1. 依次选择“添加”、“添加参数”。Select Add and then Add parameters.
    2. 在参数控件中,选择“添加参数”。In the parameter control, select Add Parameter.
    3. 在“参数名称”字段中输入 TimeRange,然后选择 Time range picker 作为“参数类型”。Enter TimeRange in the Parameter name field and choose Time range picker for Parameter type.
    4. 选择窗格顶部的“保存”,然后在参数控件中选择“完成编辑”。Select Save at the top of the pane and then select Done Editing in the parameter control.
  3. 依次选择“添加”、“添加查询”,以便在参数控件下方添加日志查询控件。Select Add then Add query to add a log query control below the parameter control.

  4. 选择“日志”作为查询类型,并选择资源类型(例如 Application Insights)以及目标资源。Select the query type as Log, resource type (for example, Application Insights) and the resources to target.

  5. 使用查询编辑器输入用于分析的 KQL。Use the Query editor to enter the KQL for your analysis.

    let topRequests = requests
    | summarize Requests = count() by appName, name
    | top 7 by Requests desc;
    let topRequestNames = topRequests | project name;
    requests
    | where name in (topRequestNames)
    | make-series Trend = count() default = 0 on timestamp from {TimeRange:start} to {TimeRange:end} step {TimeRange:grain} by name
    | join (topRequests) on name
    | project-away name1, timestamp
    
  6. 选择“运行查询”。Select Run Query. (请确保在运行查询之前将 TimeRange 设置为所选的值。)(Make sure to set TimeRange to a value of your choosing before running the query.)

  7. 将可视化效果设置为“磁贴”。Set the Visualization to "Tiles".

  8. 将“大小”设置为“完整”。Set the Size to "Full".

  9. 选择“磁贴设置”。Select Tile Settings.

    1. 在“磁贴”中,设置:In Tile, set:
      • 使用列:nameUse column: name.
    2. 在“子磁贴”中,设置:In Subtile, set:
      • 使用列:appNAmeUse column: appNAme.
    3. 在“左侧”中,设置:In Left, set:
      • 使用列:RequestsUse column:Requests.
      • 列呈现器:Big NumberColumn renderer: Big Number.
      • 调色板:Green to RedColor palette: Green to Red.
      • 最小值:0Minimum value: 0.
    4. 在“底部”中,设置:In Bottom, set:
      • 使用列:TrendUse column:Trend.
      • 列呈现器:Spark lineColumn renderer: Spark line.
      • 调色板:Green to RedColor palette: Green to Red.
      • 最小值:0Minimum value: 0.
  10. 选择窗格底部的“保存并关闭”。Select Save and Close at the bottom of the pane.

包含 spark 行的磁贴可视化效果的屏幕截图

磁贴大小Tile sizes

创建者可以选择在磁贴设置中设置磁贴宽度。The author has an option to set the tile width in the tile settings.

  • fixed(默认值)fixed (default)

    磁贴的默认行为是相同的固定宽度(大约为 160 像素宽)加上磁贴周围的空间。The default behavior of tiles is to be the same fixed width, approx. 160 pixels wide, plus the space around the tiles.

    显示固定宽度磁贴的屏幕截图

  • auto

    每个标题都会根据其内容缩小或增大,但磁贴被限制为磁贴视图(无水平滚动)的宽度。Each title will shrink or grow to fit their contents however, the tiles are limited to the width of the tiles' view (no horizontal scrolling).

    显示自动宽度磁贴的屏幕截图

  • full size

    每个标题将始终为磁贴视图的整个宽度,每行一个标题。Each title will always be the full width of the tiles' view, one title per line.

    显示完整大小宽度磁贴的屏幕截图

后续步骤Next steps