Tm1-ui-chart-dbr tm1-color For Other Chart Types

Hi All

I see that the tm1-color statement in the tm1-ui-chart-dbr directive is applicable for line charts only. Any chance this can be extended to other charts, e.g. bar charts?

We have a bar chart with an ng-repeat and would like to color a specific label if it matches another variable (e.g. using an ng-if statement). But it looks like this can be done only on line charts?

Thanks
David

Hi @anz.fin.all.mailbox,

How did it go? Where you able to implement it?

Below is one of the ways you can go about it:

HTML:

<tm1-ui-chart tm1-chart-type="discreteBar" tm1-height="300" tm1-axis-label-x="Amount(s)" tm1-axis-label-y="" tm1-duration="2000" tm1-margin="{top: 10, right: 10, bottom: 45, left: 100}">
  <div ng-repeat="item in ['Jan','Feb','Mar'] track by $index">
    <tm1-ui-chart-dbr ng-if="item != 'Feb'" tm1-order-no="{{$index + 1}}" tm1-color="Gray" tm1-label="{{item}}" tm1-instance="dev" tm1-cube="Retail" tm1-elements="{{selections.Version}},{{selections.Year}},Jan,Local,{{selections.Region}},All Products by Category,Sales Amount"></tm1-ui-chart-dbr>                      
    <tm1-ui-chart-dbr ng-if="item == 'Feb'" tm1-order-no="{{$index + 1}}" tm1-color="Green" tm1-label="{{item}}" tm1-instance="dev" tm1-cube="Retail" tm1-elements="{{selections.Version}},2012,Jan,Local,{{selections.Region}},All Products by Category,Sales Amount"></tm1-ui-chart-dbr>                      
  </div>
</tm1-ui-chart>

Output:

image

Cheers!
Paul