How to style and color native stacked column bar chart in Mendix 9.24.5

0
I've tried to style and change the colors of the native stacked bar chart that comes standard with Mendix 9.24.5, but I can't seem to find a good example on how to do so, and all my efforts in trying to guess how to influence the colors of the stacked bar or the axis and their respective labels have been unsuccessful. First off, the documentation for this widget seems to be incorrect because the example window that shows the options looks totally different from the actual window (see added images below). Secondly, I tried to look into the JS files to see if I could get the structure this way and found something that looked like it showed the structure, but I can't seem to get it to work at all. I've tried every possible way that I could think of on how to use the structure I found to influence the colors, but with no results at all. I also tried to set the color or background color by class within the value settings screen. But this doesn't work either. I also tried to add the colors directly into these fields. But this didn't do anything as well. I spent hours searching the internet and the forum trying to find a proper comparable example, but I found none. So I'm kinda stuck.    So basically, there are two main issues that I need to solve: 1) I want to be able to influence the colors of the values that make up the stacked bars. (They need to match colors from the list above.) 2) Because of the possibility of negative results, the y-axis labels need to be displayed below the graph and not at the 0 line axis, where they currently disappear behind the bars.   I wonder if there is any good example of how to set these things up. All help will be greatly appreciated, so thanks in advance!   I also added some screenshots from my project and from the chart settings screens for refference.          
asked
1 answers
0

Hey there, I've recently made a video on this topic where I walk through how to customize colors of a chart Customize Charts in Mendix

Once you've taken a look a that, the specific bit of JSON you'll want to use will look something like the below snippet. You'll need to add that to the Custom layout section inside some curly brackets. Change the hex codes to your desired colors. 

 

Snippet:

    "colorway": [

        "#4c78a8",

        "#f58518",

        "#e45756",

        "#72b7b2",

        "#54a24b",

        "#eeca3b",

        "#b279a2",

        "#ff9da6",

        "#9d755d",

        "#bab0ac"

    ]

 

answered