Forum Discussion

mcriv's avatar
mcriv
New Member
2 years ago
Solved

Microsoft Gantt, custom theme styling

I currently am attempting to create a custom theme that targets the Microsoft Gantt visual. I am generally using a Dark Theme and want to utlize my custom theme.json to make it easier for users to implement the visualization. 

 

Has anyone had any luck doing something like this? For instance, I want to change the background color of the Category Labels, and set axis colors and legend label colors by default. 

 

I can't seem to target the appropriate properties to make this happen. I appreciate any help anyone can give. 

  • In your custom theme.json file, define the properties you want to customize for the Gantt chart. For example, you can set the background color for category labels, axis colors, and legend label colors.

     

    {
    "name": "Custom Gantt Theme",
    "dataColors": [
    "#FF5733", // Data color 1
    "#0088FF" // Data color 2
    ],
    "visualStyles": {
    "*": {
    "categoryLabels": {
    "background": "#333", // Change the background color of category labels
    "color": "#FFF" // Change the text color of category labels
    },
    "axis": {
    "grid": {
    "color": "#888" // Change the axis grid color
    }
    },
    "legend": {
    "title": {
    "color": "#555" // Change the legend title color
    }
    }
    },
    "gantt": {
    // Customize Gantt chart-specific properties here
    }
    }
    }

     

    Keep in mind that not all visual properties may be customizable through themes. If there are specific properties that you cannot customize through themes, you may need to explore other options, such as using custom JavaScript or CSS to style the Gantt chart in Power BI further.

3 Replies

  • In your custom theme.json file, define the properties you want to customize for the Gantt chart. For example, you can set the background color for category labels, axis colors, and legend label colors.

     

    {
    "name": "Custom Gantt Theme",
    "dataColors": [
    "#FF5733", // Data color 1
    "#0088FF" // Data color 2
    ],
    "visualStyles": {
    "*": {
    "categoryLabels": {
    "background": "#333", // Change the background color of category labels
    "color": "#FFF" // Change the text color of category labels
    },
    "axis": {
    "grid": {
    "color": "#888" // Change the axis grid color
    }
    },
    "legend": {
    "title": {
    "color": "#555" // Change the legend title color
    }
    }
    },
    "gantt": {
    // Customize Gantt chart-specific properties here
    }
    }
    }

     

    Keep in mind that not all visual properties may be customizable through themes. If there are specific properties that you cannot customize through themes, you may need to explore other options, such as using custom JavaScript or CSS to style the Gantt chart in Power BI further.