Skip to Content

Design Studio Chart fixed colour definition

Hello,

I`m using a chart (column - stacked) and defined the colours of the bars in the "additional properties".

There are three legend items:

3 Months -> should be always GREEN

6 Months -> should be always GREY

> 6 Months -> should be always RED

Now the challenge: The chart is steered from a filterpanel, and, if there is a constellation which outputs only 1 or 2 legend items, the colours are in a mess thrown (please see attachement)

Is it possible to get a fixed colour definition?

Thanks in advance

Sabrina

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

10 Answers

  • Nov 15, 2016 at 01:26 PM
    Add comment
    10|10000 characters needed characters exceeded

  • Nov 15, 2016 at 02:02 PM

    Hello Tammy,

    I`m using the Infochart component.

    I has supposed that it will be possible with CSS (I read the other posts to that subject but couldn`t find this special question) but have no experience with it...

    Add comment
    10|10000 characters needed characters exceeded

    • Reading other posts, the CSS won't work if you select additional properties as it will generate the HTML at runtime. I'll try to keep thinking of some options.

      Another related suggestion - after having taken the free OpenSAP course on Semantic Notation for BI - colors like this are not the best way to convey information - see https://open.sap.com/courses/ibcs1-tl/ - it is worth checking out.

  • Nov 15, 2016 at 01:41 PM

    Have you tried CSS?

    Are you using the Infochart or the standard "Chart" component?

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 15, 2016 at 02:28 PM

    Hi,

    As per your requirement, I have created Some POC, Please find the below screen shot,

    1. Set your default colors in "Additional Properties"

    2. I'm displaying month wise data in Stacked Column chart,

    3. Using Dimension Filter, I'm selecting single or multiple months, now i can able to see 3 legends with data.

    let me know if you need any clarification in it.

    Regards,

    Vidhya.V

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 15, 2016 at 02:57 PM

    Hi Vidhya,

    what happens if you select "May", can you please try this? It seems there is no "Monthly Difference" in May.

    I suppose that this will work also with the right colours in your example because the order will be the same (YTD, PYTD, Monthly Difference).

    My Problem is that I have some other dimensions in the filter panel which are not shown in the chart, but influences the result (please see my attachment).

    Best Regards,

    Sabrina

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 16, 2016 at 02:02 PM

    Hi,

    For "May" Month, Please find the attached,

    may.png

    Using "DS_1.removeDimension("Key Figures"); and DS_1.moveDimensionToColumns("Key Figures");" , we can remove or move the unwanted dimensions from your data source at runtime.

    Regards,

    Vidhya.C

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Vidhya,

      Sabina's issue relates to the colour changes that result when the legend items are filtered, not filtering of the axis category dimension. Taking your examples above, if the legend items are filtered such that say, only YTD SIB and PYTD SIB are included, then the legend colours will no longer correspond to the original colours. Can you suggest a possible solution for this? I haven't found a practical approach using CSS.

      Regards,

      Mustafa.

  • Nov 17, 2016 at 02:05 AM

    Hi Sabrina,

    Unfortunately, the issue you have identified is a known limitation of the Design Studio chart. The colour of legend items (data series) is assigned based on the sequence of the item and not the specific item itself. As a result, if filtering results in a subset of the total legend items being displayed, the sequence changes and so do the colours.

    It is not possible to override the colours with CSS because the dynamically generated HTML does not include any tags that explicitly identify a particular data series. One workaround might be to create CSS classes for each possible filter combination and apply accordingly but this really is not practical. I suggest you consider one of the partner charting components available from the Analytics Extensions Directory.

    Regards,

    Mustafa.

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 17, 2016 at 09:58 AM

    Hi Mustafa,

    Thanks a lot for your valuable inputs.

    Regards,

    Vidhya.V

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 05, 2016 at 10:24 AM

    Thanks a lot for all your valuable inputs!

    We have now found a "workaround" that is working fine in our use case :-)

    Maybe it is helpful for someone else:

    1. Create 3 separate columns in the database: "3 Months" and "6 Months" and ">6 Months". Value 1 (true) or 0 (false) so each row in the 3 columns has an entry

    -> before: 1 column with the entries "3 Months" or "6 Months" or ">6 Months"

    2. Declare the 3 columns in the database as "Measure"

    3. Set your default colors in Design Studio / "Additional Properties" and they will be always shown in the right order / with the right colours independently of what your filters / output is in the diagram.

    Regards,

    Sabrina

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 05, 2016 at 10:25 AM

    excample that is working now:

    cusersdda97vfdesktopscreenshotslegend-colour.jpg

    Add comment
    10|10000 characters needed characters exceeded