<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Calculated color for pie chart legends in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculated-color-for-pie-chart-legends/m-p/496093#M185516</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you're out of luck. The legend doesn't accept a calculated color, only fixed colors. Perhaps you can set it with a macro. There's an example in the api guide:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub SetLegendColors&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set Graph = ActiveDocument.Sheets("Main").CreateBarChart&lt;/P&gt;&lt;P&gt;Graph.AddDimension "Product"&lt;/P&gt;&lt;P&gt;Graph.AddDimension "Region"&lt;/P&gt;&lt;P&gt;Graph.AddExpression "sum(Sales)"&lt;/P&gt;&lt;P&gt;set p = Graph.GetProperties&lt;/P&gt;&lt;P&gt;set leg = p.ChartProperties.Legend&lt;/P&gt;&lt;P&gt;leg.BgColor.PrimaryCol.IsCalculated = false&lt;/P&gt;&lt;P&gt;leg.BgColor.PrimaryCol.Col = RGB(255,0,0)&amp;nbsp;&amp;nbsp; 'red&lt;/P&gt;&lt;P&gt;leg.TextColor.PrimaryCol.IsCalculated = false&lt;/P&gt;&lt;P&gt;leg.TextColor.PrimaryCol.Col = RGB(0,255,0)&amp;nbsp;&amp;nbsp;&amp;nbsp; 'green&lt;/P&gt;&lt;P&gt;Graph.SetProperties p&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Jul 2013 13:23:31 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2013-07-18T13:23:31Z</dc:date>
    <item>
      <title>Calculated color for pie chart legends</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-color-for-pie-chart-legends/m-p/496090#M185513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using QlikView 11.2 SR 1.. I would like to show calculated color to legends displayed in pie chart... it seems that QlikView does not recognize calculated font color and always uses the last applied Fixed font color..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am changing the font color settings in &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Properties --&amp;gt; Presentation --&amp;gt; Settings --&amp;gt; Font --&amp;gt; Color&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jul 2013 12:56:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-color-for-pie-chart-legends/m-p/496090#M185513</guid>
      <dc:creator />
      <dc:date>2013-07-18T12:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated color for pie chart legends</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-color-for-pie-chart-legends/m-p/496091#M185514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can't assign font colors to individual categories in the legend. All the text in the legend will have the same color.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you can do is create a fake legend from a straight table. See &lt;A _jive_internal="true" href="https://community.qlik.com/message/293470#293470"&gt;here&lt;/A&gt; for an example. You can click on the + in front of the dimension and choose Text Color and specify an expression to assign colors to the dimension values. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jul 2013 13:08:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-color-for-pie-chart-legends/m-p/496091#M185514</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-07-18T13:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated color for pie chart legends</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-color-for-pie-chart-legends/m-p/496092#M185515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;well.. i am not looking for assigning differnet font color to individual legend in pie chart..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have a variable as - vChartFontColor - which is modified based on some selections... and i would like to use this calculated color for all the legends in pie chart..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so for example, if select blue, all legend colors should be blue.. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jul 2013 13:16:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-color-for-pie-chart-legends/m-p/496092#M185515</guid>
      <dc:creator />
      <dc:date>2013-07-18T13:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated color for pie chart legends</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-color-for-pie-chart-legends/m-p/496093#M185516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you're out of luck. The legend doesn't accept a calculated color, only fixed colors. Perhaps you can set it with a macro. There's an example in the api guide:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub SetLegendColors&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set Graph = ActiveDocument.Sheets("Main").CreateBarChart&lt;/P&gt;&lt;P&gt;Graph.AddDimension "Product"&lt;/P&gt;&lt;P&gt;Graph.AddDimension "Region"&lt;/P&gt;&lt;P&gt;Graph.AddExpression "sum(Sales)"&lt;/P&gt;&lt;P&gt;set p = Graph.GetProperties&lt;/P&gt;&lt;P&gt;set leg = p.ChartProperties.Legend&lt;/P&gt;&lt;P&gt;leg.BgColor.PrimaryCol.IsCalculated = false&lt;/P&gt;&lt;P&gt;leg.BgColor.PrimaryCol.Col = RGB(255,0,0)&amp;nbsp;&amp;nbsp; 'red&lt;/P&gt;&lt;P&gt;leg.TextColor.PrimaryCol.IsCalculated = false&lt;/P&gt;&lt;P&gt;leg.TextColor.PrimaryCol.Col = RGB(0,255,0)&amp;nbsp;&amp;nbsp;&amp;nbsp; 'green&lt;/P&gt;&lt;P&gt;Graph.SetProperties p&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jul 2013 13:23:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-color-for-pie-chart-legends/m-p/496093#M185516</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-07-18T13:23:31Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated color for pie chart legends</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-color-for-pie-chart-legends/m-p/496094#M185517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks Gysbert..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried using below macro.. but it fails at the line which is marked in bold... how do I evaluate the variable varVal to color object so that it can be assigned to PrimaryCol.Col ?!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub SetLegendColors&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set Graph = ActiveDocument.GetSheetObject("CH167")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set p = Graph.GetProperties&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set leg = p.ChartProperties.Legend&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set v = ActiveDocument.GetVariable("vChartFontColor")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; varVal = v.GetContent.String&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; msgbox(varVal)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; leg.TextColor.PrimaryCol.Col = varVal&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Graph.SetProperties p&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jul 2013 19:34:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-color-for-pie-chart-legends/m-p/496094#M185517</guid>
      <dc:creator />
      <dc:date>2013-07-18T19:34:36Z</dc:date>
    </item>
  </channel>
</rss>

