<?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: Set a user-defined title to a custom R HTML visual in Custom Visuals Development Discussion</title>
    <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Set-a-user-defined-title-to-a-custom-R-HTML-visual/m-p/2032107#M3882</link>
    <description>&lt;P&gt;I managed to add a text input for setting a title and a dropdown list for setting a chart theme:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ggsettings.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/578279iADFA265DEC192C8C/image-size/large?v=v2&amp;amp;px=999" role="button" title="ggsettings.png" alt="ggsettings.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is achieved by modifying two files: the file&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;capabilities.json&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and the file&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;src/settings.ts&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in the folder created by&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;pbiviz&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Here is the file&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;capabilities.json&lt;/STRONG&gt;&lt;/EM&gt;. I modified the &lt;EM&gt;objects&lt;/EM&gt; node:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ggsettings_capabilitiesjson.png" style="width: 410px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/578283iCA9BF3A80DB07399/image-size/large?v=v2&amp;amp;px=999" role="button" title="ggsettings_capabilitiesjson.png" alt="ggsettings_capabilitiesjson.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And here is the TypeScript file&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;src/settings.ts:&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ggsettings_settingsts.png" style="width: 797px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/578289iD75215105D68C069/image-size/large?v=v2&amp;amp;px=999" role="button" title="ggsettings_settingsts.png" alt="ggsettings_settingsts.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then, in the file&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;script.r&lt;/STRONG&gt;&lt;/EM&gt;, the title set by the user and the theme he chooses are named&amp;nbsp;&lt;EM&gt;ggsettings_ChartTitle&lt;/EM&gt; and&amp;nbsp;&lt;EM&gt;ggsettings_ChartTheme&lt;/EM&gt; respectively. But they won't be available at the first creation of the chart, so we have to check for their existence in the R script. Here is the full script I used:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ggsettings_script.png" style="width: 749px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/578288i051E076428B1AEA5/image-size/large?v=v2&amp;amp;px=999" role="button" title="ggsettings_script.png" alt="ggsettings_script.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Aug 2021 11:16:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-08-23T11:16:15Z</dc:date>
    <item>
      <title>Set a user-defined title to a custom R HTML visual</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Set-a-user-defined-title-to-a-custom-R-HTML-visual/m-p/2013183#M3853</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I'm using &lt;STRONG&gt;pbiviz&lt;/STRONG&gt; to do some custom R HTML visuals. With &lt;STRONG&gt;capabilities.json&lt;/STRONG&gt;, I'm able to control the dataset(s) exported from Power BI to the the R script (their names and their display names). But is it possible to export say a string to use as a title of the graphic? (for example if I use &lt;STRONG&gt;ggplot&lt;/STRONG&gt; with &lt;STRONG&gt;ggtitle&lt;/STRONG&gt; followed by &lt;STRONG&gt;ggploty&lt;/STRONG&gt;). I mean a string that the user is able to choose.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 13:40:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Set-a-user-defined-title-to-a-custom-R-HTML-visual/m-p/2013183#M3853</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-12T13:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: Set a user-defined title to a custom R HTML visual</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Set-a-user-defined-title-to-a-custom-R-HTML-visual/m-p/2032107#M3882</link>
      <description>&lt;P&gt;I managed to add a text input for setting a title and a dropdown list for setting a chart theme:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ggsettings.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/578279iADFA265DEC192C8C/image-size/large?v=v2&amp;amp;px=999" role="button" title="ggsettings.png" alt="ggsettings.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is achieved by modifying two files: the file&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;capabilities.json&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and the file&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;src/settings.ts&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in the folder created by&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;pbiviz&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Here is the file&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;capabilities.json&lt;/STRONG&gt;&lt;/EM&gt;. I modified the &lt;EM&gt;objects&lt;/EM&gt; node:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ggsettings_capabilitiesjson.png" style="width: 410px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/578283iCA9BF3A80DB07399/image-size/large?v=v2&amp;amp;px=999" role="button" title="ggsettings_capabilitiesjson.png" alt="ggsettings_capabilitiesjson.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And here is the TypeScript file&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;src/settings.ts:&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ggsettings_settingsts.png" style="width: 797px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/578289iD75215105D68C069/image-size/large?v=v2&amp;amp;px=999" role="button" title="ggsettings_settingsts.png" alt="ggsettings_settingsts.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then, in the file&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;script.r&lt;/STRONG&gt;&lt;/EM&gt;, the title set by the user and the theme he chooses are named&amp;nbsp;&lt;EM&gt;ggsettings_ChartTitle&lt;/EM&gt; and&amp;nbsp;&lt;EM&gt;ggsettings_ChartTheme&lt;/EM&gt; respectively. But they won't be available at the first creation of the chart, so we have to check for their existence in the R script. Here is the full script I used:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ggsettings_script.png" style="width: 749px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/578288i051E076428B1AEA5/image-size/large?v=v2&amp;amp;px=999" role="button" title="ggsettings_script.png" alt="ggsettings_script.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 11:16:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Set-a-user-defined-title-to-a-custom-R-HTML-visual/m-p/2032107#M3882</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-23T11:16:15Z</dc:date>
    </item>
  </channel>
</rss>

