<?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 Colour Change when modify date slicer in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Colour-Change-when-modify-date-slicer/m-p/699323#M19495</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I created a custom visual in power BI that allowed to insert different types of chart in one plot. But when I insert the plot on the dashboard, I have some trouble with date slicer. I define a colour for ma data and I save it with:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;let view = dataView[0].categorical;
let categories = view.categories[0];
let objects = categories.objects;
let value = view.values;

for (let i = 0, len = Math.max(value.length); i &amp;lt; len; i++) {
	viewModel.dataPoints.push({
		category: &amp;lt;string&amp;gt;value[i].source.displayName,
		colour: objects &amp;amp;&amp;amp; objects[i] &amp;amp;&amp;amp; DataViewObjects.getFillColor(objects[i], {
			objectName: "colorSelector",
			propertyName: "fill"
		}, null),
		selectionId: this.host.createSelectionIdBuilder()
			.withCategory(categories, i)
			.createSelectionId(),
	});
}&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;But when I change the date slicer, &lt;FONT color="#000000"&gt;objects&lt;/FONT&gt; is null or undefined and colour is reset to default.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;There is a solution to always save the color in object when slicer is modify.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for yours help.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 24 May 2019 10:02:44 GMT</pubDate>
    <dc:creator>Star8Pam</dc:creator>
    <dc:date>2019-05-24T10:02:44Z</dc:date>
    <item>
      <title>Colour Change when modify date slicer</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Colour-Change-when-modify-date-slicer/m-p/699323#M19495</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I created a custom visual in power BI that allowed to insert different types of chart in one plot. But when I insert the plot on the dashboard, I have some trouble with date slicer. I define a colour for ma data and I save it with:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;let view = dataView[0].categorical;
let categories = view.categories[0];
let objects = categories.objects;
let value = view.values;

for (let i = 0, len = Math.max(value.length); i &amp;lt; len; i++) {
	viewModel.dataPoints.push({
		category: &amp;lt;string&amp;gt;value[i].source.displayName,
		colour: objects &amp;amp;&amp;amp; objects[i] &amp;amp;&amp;amp; DataViewObjects.getFillColor(objects[i], {
			objectName: "colorSelector",
			propertyName: "fill"
		}, null),
		selectionId: this.host.createSelectionIdBuilder()
			.withCategory(categories, i)
			.createSelectionId(),
	});
}&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;But when I change the date slicer, &lt;FONT color="#000000"&gt;objects&lt;/FONT&gt; is null or undefined and colour is reset to default.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;There is a solution to always save the color in object when slicer is modify.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for yours help.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2019 10:02:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Colour-Change-when-modify-date-slicer/m-p/699323#M19495</guid>
      <dc:creator>Star8Pam</dc:creator>
      <dc:date>2019-05-24T10:02:44Z</dc:date>
    </item>
  </channel>
</rss>

