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

Creating legend names for the bar charts which is generated through expression

Hello All

I have bar chart which is having dynamic dimensions and which i have customized color combinations(which i did through colormix2 formula),,,

The problem here is qliksense wouldn't support if i generate the chart using expression in colors and legend section.

save1.png

Here i need legend names for:

Camp 4/11-4/23

Camp 4/18-4/30

Camp 4/25-5/07

But legend names should be dynamic,,because Camp Dates keeps changing,,is there any way to generate legend names.

Best Regards.

6 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Help me understand what are you trying to achieve.

  • From attached picture you want to:
    • remove Camp 4/18-4/30,Camp 4/25-5/07 etc and instead have a small ledgend describing a color

Would it be acceptable if you would have this legend on one of the bars? (for example nest to the values on bars?)

If yes, than we could use concat & dual functions and get the labels placed on top of biggest bars.

cheers

Lech

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Not applicable
Author

No i'm trying to say,i need legend labels to be displayed at bottom wrt to 3 campaigns(with specified color)

Not applicable
Author

Like we do in normal bar charts, we'll get automatically legend names if we use auto as a color, but here i have colored it through expressions.

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Sorry - my bad - i got it wrong...

Well,

I guess there is no way to achieve this using out of the box charts. Extensions may help you solve this, but i know it is not ideal..

regards

L.

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
OmarBenSalem

That's not automtically possible, but what I would suggest is creating a table:

As a dimension:

ValueList('yourperiod1','yourperiod2'..) //name your periods as you want

As measure:

='██████████'

as text expression,

sthing like this:

=if(ValueList('period1','period2')='period1',rgb(0,112,200),Red()) //choose your colours;

the result would be:

Capture.PNG

You can even use your period dimension: campaign.. as a dimension if you want to show colours of all your periods,

and as a text colour, if (compaign='camp04...',red(), if(...))

Hope this helps !

Not applicable
Author

Thank you,,,,