Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Syndicate_Admin
Administrator
Administrator

Objeto visual personalizado basado en la asignación de asientos

¿Existe un objeto visual personalizado de Power BI basado en la asignación de asientos? por ejemplo:

timEalll_0-1666966984046.png

¿O hay algo similar a la captura de pantalla anterior?

A todos los colores se les asigna un asiento en una reunión anual de la empresa.

4 REPLIES 4
Syndicate_Admin
Administrator
Administrator

Conseguí que esto funcionara en el archivo adjunto simplemente modificando ligeramente la especificación Vega que publicaste. Tenga en cuenta que necesitaba agregar un campo "persona" en mi ejemplo para generar efectivamente una fila por puesto

d_gosbell_0-1667342364912.png

{
  "$schema": "https://vega.github.io/schema/vega/v5.json",
  "width": 550,
  "height": 300,
  "signals": [
    {
      "name": "dataLength",
      "update": "length(data('dataset'))"
    },
    {
      "name": "row0Radius",
      "value": 280
    },
    {
      "name": "row1Radius",
      "value": 260
    },
    {
      "name": "row2Radius",
      "value": 240
    },
    {
      "name": "row3Radius",
      "value": 220
    },
    {
      "name": "row4Radius",
      "value": 200
    },
    {
      "name": "row5Radius",
      "value": 180
    },
    {
      "name": "row6Radius",
      "value": 160
    },
    {
      "name": "row0Circ",
      "update": "PI*row0Radius"
    },
    {
      "name": "row1Circ",
      "update": "PI*row1Radius"
    },
    {
      "name": "row2Circ",
      "update": "PI*row2Radius"
    },
    {
      "name": "row3Circ",
      "update": "PI*row3Radius"
    },
    {
      "name": "row4Circ",
      "update": "PI*row4Radius"
    },
    {
      "name": "row5Circ",
      "update": "PI*row5Radius"
    },
    {
      "name": "row6Circ",
      "update": "PI*row6Radius"
    },
    {
      "name": "totalLength",
      "update": "row0Circ+row1Circ+row2Circ+row3Circ+row4Circ+row5Circ+row6Circ "
    }
  ],
  "data": [
    {
      "name": "dataset",
      "transform": [
        {
          "type": "project",
          "fields": ["Person", "Party"]
        },
        {
          "type": "window",
          "ops": ["row_number"],
          "fields": [null],
          "as": ["index"],
          "sort": {
            "field": "Party",
            "order": "descending"
          }
        }
      ]
    },
    {
      "name": "placement",
      "transform": [
        {
          "type": "sequence",
          "start": 1,
          "stop": {
            "signal": "dataLength+1"
          },
          "as": "index"
        },
        {
          "type": "formula",
          "as": "wholeCirc",
          "expr": "totalLength/dataLength"
        },
        {
          "type": "window",
          "ops": ["sum"],
          "fields": ["wholeCirc"],
          "as": ["cumWholeCirc"]
        },
        {
          "type": "formula",
          "as": "row",
          "expr": "datum.cumWholeCirc < ode="">

Esta es la especificación Vega actualizada (tenga en cuenta que debe cambiar la configuración en el objeto visual Deneb para usar el proveedor "Vega" en lugar del proveedor predeterminado "Vega-Lite")

Syndicate_Admin
Administrator
Administrator

Hola, ¿la visual necesita ser curvada? Puede haber una plantilla de gofre que será más fácil de usar. Si siempre hay la misma cantidad de puestos, puede haber una solución de código inferior, como usar el panel sinóptico, Pureviz o el diagrama de Visio

@KerKol @v-henryk-mstf quería que fuera curva pero si hay otra alternativa visual por favor compártela conmigo. Es el mismo número de asientos cada vez.

Syndicate_Admin
Administrator
Administrator

Quiero investigar y descubrí que Deneb declarativo personalizado visual se puede usar para lograr esto.
Sin embargo, he intentado usarlo pero no funcionó.
Encontré algo de código en JSON pero no sé nada sobre Deneb y JSON. ver más abajo

{
  "$schema": "https://vega.github.io/schema/vega/v5.json",
  "width": 550,
  "height": 300,
  "signals": [
    {"name": "dataLength", "update": "length(data('penguins'))"},
    {"name": "row0Radius", "value": 280},
    {"name": "row1Radius", "value": 260},
    {"name": "row2Radius", "value": 240},
    {"name": "row3Radius", "value": 220},
    {"name": "row4Radius", "value": 200},
    {"name": "row5Radius", "value": 180},
    {"name": "row6Radius", "value": 160},
    {"name": "row0Circ", "update": "PI*row0Radius"},
    {"name": "row1Circ", "update": "PI*row1Radius"},
    {"name": "row2Circ", "update": "PI*row2Radius"},
    {"name": "row3Circ", "update": "PI*row3Radius"},
    {"name": "row4Circ", "update": "PI*row4Radius"},
    {"name": "row5Circ", "update": "PI*row5Radius"},
    {"name": "row6Circ", "update": "PI*row6Radius"},
    {
      "name": "totalLength",
      "update": "row0Circ+row1Circ+row2Circ+row3Circ+row4Circ+row5Circ+row6Circ "
    }
  ],
  "data": [
    {
      "name": "penguins",
      "url": "data/penguins.json",
      "transform": [
        {"type": "project", "fields": ["Species", "Island"]},
        {
          "type": "window",
          "ops": ["row_number"],
          "fields": [null],
          "as": ["index"],
          "sort": {"field": "Island", "order": "ascending"}
        }
      ]
    },
    {
      "name": "placement",
      "transform": [
        {
          "type": "sequence",
          "start": 1,
          "stop": {"signal": "dataLength+1"},
          "as": "index"
        },
        {
          "type": "formula",
          "as": "wholeCirc",
          "expr": "totalLength/dataLength"
        },
        {
          "type": "window",
          "ops": ["sum"],
          "fields": ["wholeCirc"],
          "as": ["cumWholeCirc"]
        },
        {
          "type": "formula",
          "as": "row",
          "expr": "datum.cumWholeCirc < ode="">

This code was shared but I don't know how to reference my data and the column and measure I'm using.
My data is Poll and the field (Party ) and measure (Seat Allocated).
Please can someone help me out with the Deneb and code above to reference dataset and column and measure.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.