<?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 Creating a bar chart visual with Static Data. in Custom Visuals Development Discussion</title>
    <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Set-y-axis-max-height-and-min-height-with-R-based-bar-graph/m-p/432793#M1102</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi guys&lt;/SPAN&gt;&lt;SPAN class="lia-search-match-lithium"&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;I'm trying to create&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="lia-search-match-lithium"&gt;a&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;R based&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="lia-search-match-lithium"&gt;bar&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="lia-search-match-lithium"&gt;chart&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;power Bi&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="lia-search-match-lithium"&gt;visual&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;for practicing custom&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="lia-search-match-lithium"&gt;visual&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;creation. I want to create an input field in the Format of Power Bi that defines the max and min heights of the Y axis.&amp;nbsp;I saw a lot of examples but I didn't get enough inspiration.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have successfully created an input area in capabilities.json. I have set related parameters in setting.ts. I also set the x and y axes in the script.r file and made them a bar graph, but I can't achieve the maximum and minimum height of the y axis with my code.&amp;nbsp;Can someone help?&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;"yAxis": {
      "displayName": "Y-Axis",
      "displayNameKey": "Visual_YAxis",
      "properties": {
        "show": {
          "displayName": "Show",
          "displayNameKey": "Visual_Show",
          "type": {
            "bool": true
          }
        },
        
        "dynamicScaling": {
          "displayName": "Scaled",
          "displayNameKey": "Dynamic_Scaling",
          "type": {
            "bool": true
          }
        },
        "yscalemaxin":{
          "displayName": "Maximum Height",
          "displayNameKey": "dynymax",
          "type": {
            "numeric": true
          }
        },
        
        "yscaleminin":{
          "displayName": "Minimum Height",
          "displayNameKey": "dynymin",
          "type": {
            "numeric": true
          }
        }
        
      }
    }&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;source('./r_files/flatten_HTML.r')

############### Library Declarations ###############
libraryRequireInstall("ggplot2");
libraryRequireInstall("plotly");
libraryRequireInstall("htmlwidgets");
####################################################

################### Actual code ####################
dataFrame &amp;lt;- data.frame(Axis, Values[[1]]);
dynamicScaling = TRUE;

if(exists("yAxis_dynamicScaling")){
	dynamicScaling = as.logical(yAxis_dynamicScaling);
}


if(dynamicScaling){
yscaleminin = 0
yscalemaxin = Inf	
if(exists("yAxis_yscaleminin")){
		yscaleminin = as.numeric(yAxis_yscaleminin)
		
		yscalemininValue = yAxis_yscaleminin

		yscalemininValue = round(max(min(yscalemininValue,1e+6),0))
	}else{
		yscalemininValue = 0; #if user does not enter a value then the y-axis start at 0
	}

if(exists("yAxis_yscalemaxin")){
		yscalemaxin = as.numeric(yAxis_yscalemaxin)
		
		yscalemaxinValue = yAxis_yscalemaxin

		yscalemaxinValue = round(max(min(yscalemaxinValue,10000),0))
	}else{
		yscalemaxinValue = Inf; #if user does not enter a value into y-axis end, the y-axis end at infinity
	}


			yscales &amp;lt;- c(-Inf, yscalemaxinValue, yscalemaxinValue, Inf)
			scale &amp;lt;- c(yscalemaxinValue,yscalemaxinValue)[findInterval(dataFrame[[2]], vec=yscales)]
			
			p &amp;lt;- plot_ly(Values,
    
				x = dataFrame[[1]],
				y = dataFrame[[2]],
				type = "bar",
				marker = list(yscales = scale)

				
			);
			}else{ #No dynamic scaling
		p &amp;lt;- plot_ly(Values,
		x = dataFrame[[1]],
		y = dataFrame[[2]],
		type = "bar",
		
	);

			
}

####################################################

############# Create and save widget ###############
#p = ggplotly(p);
internalSaveWidget(p, 'out.html');
####################################################&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Jun 2018 15:35:37 GMT</pubDate>
    <dc:creator>Iceroom</dc:creator>
    <dc:date>2018-06-05T15:35:37Z</dc:date>
    <item>
      <title>Set y-axis 'max height' and 'min height' with R based bar graph visual</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Set-y-axis-max-height-and-min-height-with-R-based-bar-graph/m-p/432792#M1097</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi guys&lt;/SPAN&gt;&lt;SPAN class="lia-search-match-lithium"&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;I'm trying to create&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="lia-search-match-lithium"&gt;a&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;R based&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="lia-search-match-lithium"&gt;bar&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="lia-search-match-lithium"&gt;chart&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;power Bi&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="lia-search-match-lithium"&gt;visual&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;for practicing custom&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="lia-search-match-lithium"&gt;visual&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;creation. I want to create an input field in the Format of Power Bi that defines the max and min heights of the Y axis.&amp;nbsp;I saw a lot of examples but I didn't get enough inspiration.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have successfully created an input area in capabilities.json. I have set related parameters in setting.ts. I also set the x and y axes in the script.r file and made them a bar graph, but I can't achieve the maximum and minimum height of the y axis with my code. I tried to use ylim but it does not work. Can someone help?&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;"yAxis": {
      "displayName": "Y-Axis",
      "displayNameKey": "Visual_YAxis",
      "properties": {
        "show": {
          "displayName": "Show",
          "displayNameKey": "Visual_Show",
          "type": {
            "bool": true
          }
        },
        
        "dynamicScaling": {
          "displayName": "Scaled",
          "displayNameKey": "Dynamic_Scaling",
          "type": {
            "bool": true
          }
        },
        "yscalemaxin":{
          "displayName": "Maximum Height",
          "displayNameKey": "dynymax",
          "type": {
            "numeric": true
          }
        },
        
        "yscaleminin":{
          "displayName": "Minimum Height",
          "displayNameKey": "dynymin",
          "type": {
            "numeric": true
          }
        }
        
      }
    }&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;source('./r_files/flatten_HTML.r')

############### Library Declarations ###############
libraryRequireInstall("ggplot2");
libraryRequireInstall("plotly");
libraryRequireInstall("htmlwidgets");
####################################################

################### Actual code ####################
dataFrame &amp;lt;- data.frame(Axis, Values[[1]]);
dynamicScaling = TRUE;

if(exists("yAxis_dynamicScaling")){
	dynamicScaling = as.logical(yAxis_dynamicScaling);
}


if(dynamicScaling){
yscaleminin = 0
yscalemaxin = Inf	
if(exists("yAxis_yscaleminin")){
		yscaleminin = as.numeric(yAxis_yscaleminin)
		
		yscalemininValue = yAxis_yscaleminin

		yscalemininValue = round(max(min(yscalemininValue,1e+6),0))
	}else{
		yscalemininValue = 0; #if user does not enter a value then the y-axis start at 0
	}

if(exists("yAxis_yscalemaxin")){
		yscalemaxin = as.numeric(yAxis_yscalemaxin)
		
		yscalemaxinValue = yAxis_yscalemaxin

		yscalemaxinValue = round(max(min(yscalemaxinValue,10000),0))
	}else{
		yscalemaxinValue = Inf; #if user does not enter a value into y-axis end, the y-axis end at infinity
	}


			yscales &amp;lt;- c(-Inf, yscalemaxinValue, yscalemaxinValue, Inf)
			scale &amp;lt;- c(yscalemaxinValue,yscalemaxinValue)[findInterval(dataFrame[[2]], vec=yscales)]
			
			p &amp;lt;- plot_ly(Values,
    
				x = dataFrame[[1]],
				y = dataFrame[[2]],
				type = "bar",
				marker = list(yscales = scale)

				
			);
			}else{ #No dynamic scaling
		p &amp;lt;- plot_ly(Values,
		x = dataFrame[[1]],
		y = dataFrame[[2]],
		type = "bar",
		
	);

			
}

####################################################

############# Create and save widget ###############
#p = ggplotly(p);
internalSaveWidget(p, 'out.html');
####################################################&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jun 2018 15:37:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Set-y-axis-max-height-and-min-height-with-R-based-bar-graph/m-p/432792#M1097</guid>
      <dc:creator>Iceroom</dc:creator>
      <dc:date>2018-06-05T15:37:02Z</dc:date>
    </item>
    <item>
      <title>Creating a bar chart visual with Static Data.</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Set-y-axis-max-height-and-min-height-with-R-based-bar-graph/m-p/432793#M1102</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi guys&lt;/SPAN&gt;&lt;SPAN class="lia-search-match-lithium"&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;I'm trying to create&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="lia-search-match-lithium"&gt;a&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;R based&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="lia-search-match-lithium"&gt;bar&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="lia-search-match-lithium"&gt;chart&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;power Bi&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="lia-search-match-lithium"&gt;visual&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;for practicing custom&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="lia-search-match-lithium"&gt;visual&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;creation. I want to create an input field in the Format of Power Bi that defines the max and min heights of the Y axis.&amp;nbsp;I saw a lot of examples but I didn't get enough inspiration.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have successfully created an input area in capabilities.json. I have set related parameters in setting.ts. I also set the x and y axes in the script.r file and made them a bar graph, but I can't achieve the maximum and minimum height of the y axis with my code.&amp;nbsp;Can someone help?&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;"yAxis": {
      "displayName": "Y-Axis",
      "displayNameKey": "Visual_YAxis",
      "properties": {
        "show": {
          "displayName": "Show",
          "displayNameKey": "Visual_Show",
          "type": {
            "bool": true
          }
        },
        
        "dynamicScaling": {
          "displayName": "Scaled",
          "displayNameKey": "Dynamic_Scaling",
          "type": {
            "bool": true
          }
        },
        "yscalemaxin":{
          "displayName": "Maximum Height",
          "displayNameKey": "dynymax",
          "type": {
            "numeric": true
          }
        },
        
        "yscaleminin":{
          "displayName": "Minimum Height",
          "displayNameKey": "dynymin",
          "type": {
            "numeric": true
          }
        }
        
      }
    }&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;source('./r_files/flatten_HTML.r')

############### Library Declarations ###############
libraryRequireInstall("ggplot2");
libraryRequireInstall("plotly");
libraryRequireInstall("htmlwidgets");
####################################################

################### Actual code ####################
dataFrame &amp;lt;- data.frame(Axis, Values[[1]]);
dynamicScaling = TRUE;

if(exists("yAxis_dynamicScaling")){
	dynamicScaling = as.logical(yAxis_dynamicScaling);
}


if(dynamicScaling){
yscaleminin = 0
yscalemaxin = Inf	
if(exists("yAxis_yscaleminin")){
		yscaleminin = as.numeric(yAxis_yscaleminin)
		
		yscalemininValue = yAxis_yscaleminin

		yscalemininValue = round(max(min(yscalemininValue,1e+6),0))
	}else{
		yscalemininValue = 0; #if user does not enter a value then the y-axis start at 0
	}

if(exists("yAxis_yscalemaxin")){
		yscalemaxin = as.numeric(yAxis_yscalemaxin)
		
		yscalemaxinValue = yAxis_yscalemaxin

		yscalemaxinValue = round(max(min(yscalemaxinValue,10000),0))
	}else{
		yscalemaxinValue = Inf; #if user does not enter a value into y-axis end, the y-axis end at infinity
	}


			yscales &amp;lt;- c(-Inf, yscalemaxinValue, yscalemaxinValue, Inf)
			scale &amp;lt;- c(yscalemaxinValue,yscalemaxinValue)[findInterval(dataFrame[[2]], vec=yscales)]
			
			p &amp;lt;- plot_ly(Values,
    
				x = dataFrame[[1]],
				y = dataFrame[[2]],
				type = "bar",
				marker = list(yscales = scale)

				
			);
			}else{ #No dynamic scaling
		p &amp;lt;- plot_ly(Values,
		x = dataFrame[[1]],
		y = dataFrame[[2]],
		type = "bar",
		
	);

			
}

####################################################

############# Create and save widget ###############
#p = ggplotly(p);
internalSaveWidget(p, 'out.html');
####################################################&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jun 2018 15:35:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Set-y-axis-max-height-and-min-height-with-R-based-bar-graph/m-p/432793#M1102</guid>
      <dc:creator>Iceroom</dc:creator>
      <dc:date>2018-06-05T15:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Set y-axis 'max height' and 'min height' with R based bar graph visual</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Set-y-axis-max-height-and-min-height-with-R-based-bar-graph/m-p/433300#M1101</link>
      <description>&lt;P&gt;We'd recommend to use lower case for all of settings. In other words, please rename yAxis to yaxis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please let us know if such workaround works well on your side.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt; color: #333333;"&gt;Ignat Vilesov,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt; color: #333333;"&gt;Software Engineer&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt; color: #333333;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt; color: #333333;"&gt;Microsoft Power BI Custom Visuals&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;A href="mailto:pbicvsupport@microsoft.com" target="_blank"&gt;&lt;SPAN&gt;pbicvsupport@microsoft.com&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 07:27:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Set-y-axis-max-height-and-min-height-with-R-based-bar-graph/m-p/433300#M1101</guid>
      <dc:creator>v-viig</dc:creator>
      <dc:date>2018-06-06T07:27:47Z</dc:date>
    </item>
  </channel>
</rss>

