Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
具有矩阵数据映射的PowerBI自定义数据网格_Powerbi_Powerbi Custom Visuals - Fatal编程技术网

具有矩阵数据映射的PowerBI自定义数据网格

具有矩阵数据映射的PowerBI自定义数据网格,powerbi,powerbi-custom-visuals,Powerbi,Powerbi Custom Visuals,我创建了这个ag网格的定制可视化包装器,作为对定制可视化开发的第一次尝试/调查 目前只使用表数据映射(table data mapping),这并不允许仪表板开发人员控制ag grid提供的强大的行分组和数据透视。我在使用矩阵数据映射时遇到了一个难题,但是它显然是在没有考虑开放社区自定义可视化开发人员的情况下构建的,例如缺乏文档和类似以下内容的帖子: 有谁能推荐一个合适的资源来快速理解矩阵映射,这样我就可以将它映射成一些简单有用的东西供ag grid使用(以ag grid ColumnDef

我创建了这个ag网格的定制可视化包装器,作为对定制可视化开发的第一次尝试/调查

目前只使用表数据映射(table data mapping),这并不允许仪表板开发人员控制ag grid提供的强大的行分组和数据透视。我在使用矩阵数据映射时遇到了一个难题,但是它显然是在没有考虑开放社区自定义可视化开发人员的情况下构建的,例如缺乏文档和类似以下内容的帖子:

有谁能推荐一个合适的资源来快速理解矩阵映射,这样我就可以将它映射成一些简单有用的东西供ag grid使用(以ag grid ColumnDefs的形式)?或者是另一个矩阵数据映射自定义viz的开源示例,以及矩阵数据视图的javascript操作示例

如果添加网格(发布到gitlab中的dist文件夹中),那么应该会在网格本身中看到一个columns侧栏,它应该允许您使用网格轴,或者直接转到


(相关:我似乎也无法登录,在它之间有一个无限重定向,并且-尝试了所有浏览器、osx和windows-清除了两者上的所有cookie,关闭了任何AdBlock&不跟踪-任何建议?

以下是我编写的capabilities.json示例,用于将矩阵映射到Power Bi的四个输入(两个作为分组;两个作为度量):

}

{
"dataRoles": [
    {
        "name": "Series",
        "kind": "Grouping",
        "displayName": "Legend and Index",
        "displayNameKey": "Role_DisplayName_Legend"
    },
    {
        "name": "X",
        "kind": "Measure",
        "displayName": "X Axis",
        "displayNameKey": "Role_DisplayName_X"
    },
    {
        "name": "Y",
        "kind": "Measure",
        "displayName": "Y Axis",
        "displayNameKey": "Role_DisplayName_Y"
    },
    {
        "name": "Size",
        "kind": "Measure",
        "displayName": "Size",
        "displayNameKey": "Role_DisplayName_Size"
    },
    {
        "name": "Gradient",
        "kind": "Measure",
        "displayName": "Color saturation",
        "displayNameKey": "Role_DisplayName_Gradient"
    },
    {
        "name": "ColorFill",
        "kind": "Grouping",
        "displayName": "Customized Color",
        "displayNameKey": "Role_DisplayName_CustomizedColor"
    },
    {
        "name": "Shape",
        "kind": "Measure",
        "displayName": "Shape",
        "displayNameKey": "Role_DisplayName_Shape"
    },
    {
        "name": "Image",
        "kind": "Grouping",
        "displayName": "Image",
        "displayNameKey": "Role_DisplayName_Image"
    },  
    {
        "name": "Rotation",
        "kind": "Measure",
        "displayName": "Rotation",
        "displayNameKey": "Role_DisplayName_Rotation"
    },
    {
        "name": "Backdrop",
        "kind": "Grouping",
        "displayName": "Backdrop",
        "displayNameKey": "Role_DisplayName_Backdrop"
    },
    {
        "name": "X Start",
        "kind": "Measure",
        "displayName": "X Start",
        "displayNameKey": "Role_DisplayName_XStart"
    },
    {
        "name": "X End",
        "kind": "Measure",
        "displayName": "X End",
        "displayNameKey": "Role_DisplayName_XEnd"
    },
    {
        "name": "Y Start",
        "kind": "Measure",
        "displayName": "Y Start",
        "displayNameKey": "Role_DisplayName_YStart"
    },
    {
        "name": "Y End",
        "kind": "Measure",
        "displayName": "Y End",
        "displayNameKey": "Role_DisplayName_YEnd"
    }
],

"dataViewMappings": [{
        "conditions": [
            {
                "Series": { "max": 2 }, "X": { "max": 1 }, "Y": { "max": 1 }, "Size": { "max": 1 }, "Gradient": { "max": 1 }, "ColorFill": { "max": 0 },
                "Shape": { "max": 1 }, "Image": { "max": 0 }, "Rotation": { "max": 1 }, "Backdrop": { "max": 1 }, "XStart": { "max": 1 }, 
                "XEnd": { "max": 1 }, "YStart": { "max": 1 }, "YEnd": { "max": 1 } 
            },
            {   
                "Series": { "max": 2 }, "X": { "max": 1 }, "Y": { "max": 1 }, "Size": { "max": 1 }, "Gradient": { "max": 0 }, "ColorFill": { "max": 1 }, 
                "Shape": { "max": 1 }, "Image": { "max": 0 }, "Rotation": { "max": 1 }, "Backdrop": { "max": 1 }, "XStart": { "max": 1 }, 
                "End": { "max": 1 }, "YStart": { "max": 1 }, "YEnd": { "max": 1 } 
            },
            {   
                "Series": { "max": 2 }, "X": { "max": 1 }, "Y": { "max": 1 }, "Size": { "max": 1 }, "Gradient": { "max": 0 }, "ColorFill": { "max": 0 }, 
                "Shape": { "max": 0 }, "Image": { "max": 1 }, "Rotation": { "max": 1 }, "Backdrop": { "max": 1 }, "XStart": { "max": 1 }, 
                "XEnd": { "max": 1 }, "YStart": { "max": 1 }, "YEnd": { "max": 1 }
            },
            {
                "Series": { "max": 2 }, "X": { "max": 1 }, "Y": { "max": 1 }, "Size": { "max": 1 }, "Gradient": { "max": 0 }, "ColorFill": { "max": 1 },
                "Shape": { "max": 1 }, "Image": { "max": 0 }, "Rotation": { "max": 1 }, "Backdrop": { "max": 1 }, "XStart": { "max": 1 }, 
                "XEnd": { "max": 1 }, "YStart": { "max": 1 }, "YEnd": { "max": 1 }
            },
            {
                "Series": { "max": 2 }, "X": { "max": 1 }, "Y": { "max": 1 }, "Size": { "max": 1 }, "Gradient": { "max": 0 }, "ColorFill": { "max": 0 },
                "Shape": { "max": 0 }, "Image": { "max": 1 }, "Rotation": { "max": 1 }, "Backdrop": {"max": 1 }, "XStart": { "max": 1 },
                "XEnd": { "max": 1 }, "YStart": { "max": 1 }, "YEnd": { "max": 1 }
            }
        ],

        "matrix": {
            "rows": {
                "for": {
                    "in": "Series"
                },
                "dataReductionAlgorithm": {
                    "sample": {
                        "count": 70000
                    }
                }
            },
            "columns": {
                "for": {
                    "in": "Category"
                },
                "dataReductionAlgorithm": {
                    "top": {
                        "count": 3
                    }
                }
            },
            "values": {
                "select": [
                    {
                        "bind": {
                            "to": "X"
                        }
                    },
                    {
                        "bind": {
                            "to": "Y"
                        }
                    }
                ]
            },
            "sorting": {
                "implicit": {
                    "clauses": [
                        {
                            "role": "Series",
                            "direction": 1
                        }
                    ]
                }
            }
        }
    }],

"objects": {
    "dataPoint": {
        "displayName": "Data colors",
        "displayNameKey": "Visual_DataPoint",
        "properties": {
            "defaultColor": {
                "displayName": "Default color",
                "displayNameKey": "Visual_DefaultColor",
                "type": {
                    "fill": {
                        "solid": {
                            "color": true
                        }
                    }
                }
            },
            "showAllDataPoints": {
                "displayName": "Show all",
                "displayNameKey": "Visual_DataPoint_Show_All",
                "type": {
                    "bool": true
                }
            },
            "fill": {
                "displayName": "Fill",
                "displayNameKey": "Visual_Fill",
                "type": {
                    "fill": {
                        "solid": {
                            "color": true
                        }
                    }
                }
            },
            "fillRule": {
                "displayName": "Color saturation",
                "displayNameKey": "Visual_ColorSaturation",
                "type": {
                    "fillRule": {}
                },
                "rule": {
                    "inputRole": "Gradient",
                    "output": {
                        "property": "fill",
                        "selector": [
                            "Category"
                        ]
                    }
                }
            }
        }
    },
    "categoryAxis": {
        "displayName": "X-Axis",
        "displayNameKey": "Visual_XAxis",
        "properties": {
            "show": {
                "displayName": "Show",
                "displayNameKey": "Visual_Show",
                "type": {
                    "bool": true
                }
            },
            "start": {
                "displayName": "Start",
                "displayNameKey": "Visual_Axis_Start",
                "type": {
                    "numeric": true
                }
            },
            "end": {
                "displayName": "End",
                "displayNameKey": "Visual_Axis_End",
                "type": {
                    "numeric": true
                }
            },
            "showAxisTitle": {
                "displayName": "Title",
                "displayNameKey": "Visual_Axis_Title",
                "type": {
                    "bool": true
                }
            },
            "axisColor": {
                "displayName": "Color",
                "displayNameKey": "Visual_Axis_LabelColor",
                "type": {
                    "fill": {
                        "solid": {
                            "color": true
                        }
                    }
                }
            },
            "labelDisplayUnits": {
                "displayName": "Display units",
                "displayNameKey": "Visual_DisplayUnits",
                "type": {
                    "formatting": {
                        "labelDisplayUnits": true
                    }
                }
            }
        }
    },
    "valueAxis": {
        "displayName": "Y-Axis",
        "displayNameKey": "Visual_YAxis",
        "properties": {
            "show": {
                "displayName": "Show",
                "displayNameKey": "Visual_Show",
                "type": {
                    "bool": true
                }
            },
            "start": {
                "displayName": "Start",
                "displayNameKey": "Visual_Axis_Start",
                "type": {
                    "numeric": true
                }
            },
            "end": {
                "displayName": "End",
                "displayNameKey": "Visual_Axis_End",
                "type": {
                    "numeric": true
                }
            },
            "showAxisTitle": {
                "displayName": "Title",
                "displayNameKey": "Visual_Axis_Title",
                "type": {
                    "bool": true
                }
            },
            "axisColor": {
                "displayName": "Color",
                "displayNameKey": "Visual_Axis_LabelColor",
                "type": {
                    "fill": {
                        "solid": {
                            "color": true
                        }
                    }
                }
            },
            "labelDisplayUnits": {
                "displayName": "Display units",
                "displayNameKey": "Visual_DisplayUnits",
                "type": {
                    "formatting": {
                        "labelDisplayUnits": true
                    }
                }
            }
        }
    },
    "legend": {
        "displayName": "Legend",
        "displayNameKey": "Visual_Legend",
        "properties": {
            "show": {
                "displayName": "Show",
                "displayNameKey": "Visual_Show",
                "type": {
                    "bool": true
                }
            },
            "position": {
                "displayName": "Position",
                "displayNameKey": "Visual_LegendPosition",
                "description": "Select the location for the legend",
                "descriptionKey": "Visual_Description_LegendPosition",
                "type": {
                    "enumeration": [
                        {
                            "value": "Top",
                            "displayName": "Top",
                            "displayNameKey": "Visual_LegendPosition_Top"
                        },
                        {
                            "value": "Bottom",
                            "displayName": "Bottom",
                            "displayNameKey": "Visual_LegendPosition_Bottom"
                        },
                        {
                            "value": "Left",
                            "displayName": "Left",
                            "displayNameKey": "Visual_LegendPosition_Left"
                        },
                        {
                            "value": "Right",
                            "displayName": "Right",
                            "displayNameKey": "Visual_LegendPosition_Right"
                        },
                        {
                            "value": "TopCenter",
                            "displayName": "Top Center",
                            "displayNameKey": "Visual_LegendPosition_TopCenter"
                        },
                        {
                            "value": "BottomCenter",
                            "displayName": "Bottom Center",
                            "displayNameKey": "Visual_LegendPosition_BottomCenter"
                        },
                        {
                            "value": "LeftCenter",
                            "displayName": "Left Center",
                            "displayNameKey": "Visual_LegendPosition_LeftCenter"
                        },
                        {
                            "value": "RightCenter",
                            "displayName": "Right center",
                            "displayNameKey": "Visual_LegendPosition_RightCenter"
                        }
                    ]
                }
            },
            "showTitle": {
                "displayName": "Title",
                "displayNameKey": "Visual_LegendShowTitle",
                "description": "Display a title for legend symbols",
                "descriptionKey": "Visual_Description_LegendShowTitle",
                "type": {
                    "bool": true
                }
            },
            "titleText": {
                "displayName": "Legend Name",
                "displayNameKey": "Visual_LegendName",
                "description": "Title text",
                "descriptionKey": "Visual_Description_LegendName",
                "type": {
                    "text": true
                }
            },
            "labelColor": {
                "displayName": "Color",
                "displayNameKey": "Visual_LegendTitleColor",
                "type": {
                    "fill": {
                        "solid": {
                            "color": true
                        }
                    }
                }
            },
            "fontSize": {
                "displayName": "Text Size",
                "displayNameKey": "Visual_TextSize",
                "type": {
                    "formatting": {
                        "fontSize": true
                    }
                }
            }
        }
    },
    "categoryLabels": {
        "displayName": "Category labels",
        "displayNameKey": "Visual_CategoryLabels",
        "properties": {
            "show": {
                "displayName": "Show",
                "displayNameKey": "Visual_Show",
                "type": {
                    "bool": true
                }
            },
            "color": {
                "displayName": "Color",
                "displayNameKey": "Visual_LabelsFill",
                "type": {
                    "fill": {
                        "solid": {
                            "color": true
                        }
                    }
                }
            },
            "fontSize": {
                "displayName": "Text Size",
                "displayNameKey": "Visual_TextSize",
                "type": {
                    "formatting": {
                        "fontSize": true
                    }
                }
            }
        }
    },
    "fillPoint": {
        "displayName": "Fill point",
        "displayNameKey": "Visual_FillPoint",
        "properties": {
            "show": {
                "displayName": "Fill",
                "displayNameKey": "Visual_Fill",
                "type": {
                    "bool": true
                }
            }
        }
    },
    "backdrop": {
        "displayName": "Backdrop",
        "displayNameKey": "Visual_Backdrop",
        "properties": {
            "show": {
                "displayName": "Show",
                "displayNameKey": "Visual_Show",
                "type": {
                    "bool": true
                }
            },
            "url": {
                "displayName": "Image URL",
                "displayNameKey": "Visual_Backdrop_ImageURL",
                "type": {
                    "text": true
                }
            }
        }
    },
    "crosshair": {
        "displayName": "Crosshair",
        "displayNameKey": "Visual_Crosshair",
        "properties": {
            "show": {
                "displayName": "Crosshair",
                "displayNameKey": "Visual_Crosshair",
                "type": {
                    "bool": true
                }
            }
        }
    },
    "outline": {
        "displayName": "Outline",
        "displayNameKey": "Visual_Outline",
        "properties": {
            "show": {
                "displayName": "Outline",
                "displayNameKey": "Visual_Outline",
                "type": {
                    "bool": true
                }
            }
        }
    }
},
"supportsMultiVisualSelection": true