<?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 Custom Visual Area Chart problems in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Custom-Visual-Area-Chart-problems/m-p/2253511#M33601</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I'm pretty new creating custom visuals.&amp;nbsp;I try to create something like the following image, then I will add more elements&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CristinaD_0-1640253981786.png" style="width: 331px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/647867i0E7DC78719751A9A/image-dimensions/331x248?v=v2" width="331" height="248" role="button" title="CristinaD_0-1640253981786.png" alt="CristinaD_0-1640253981786.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;At the moment I'm trying to create the background areachart but I always get error at the same point.&amp;nbsp;I have followed the barchart tutorial and I have looked at the d3 documentation&amp;nbsp;but I can't solve it.&lt;BR /&gt;&lt;BR /&gt;At the time of creating a line or an area&amp;nbsp;it gives me an error. Below I put the code that I use for the barchart that works well:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;       this.barSelection = this.barContainer
            .selectAll('.bar')
            .data(viewModel.DataPoints);

        const barSelectionMerged = this.barSelection
            .enter()
            .append('rect')
            .merge(&amp;lt;any&amp;gt;this.barSelection)
            .classed('bar', true);

        barSelectionMerged
            .attr("x", (dataPoint: BarchartDataPoint) =&amp;gt; xScale(dataPoint.Category))
            .attr("y", (dataPoint: BarchartDataPoint) =&amp;gt; yScale(Number(dataPoint.Value)))
            .attr("width", xScale.bandwidth())
            .attr("height", (dataPoint: BarchartDataPoint) =&amp;gt; (plotArea.height -yScale(Number(dataPoint.Value))))
            .style("fill", (dataPoint: BarchartDataPoint) =&amp;gt; viewModel.BarColor);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;below the code that I use to create the areachart that does not work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;      this.barContainer.append("path")
            .datum(viewModel.DataPoints)
            .attr("fill", "#cce5df")
            .attr("stroke", "#69b3a2")
            .attr("stroke-width", 1.5)
            .attr("d", d3.area()
              .x((dataPoint: BarchartDataPoint) =&amp;gt; xScale(dataPoint.Category))
              .y0(y(0))
              .y1((dataPoint: BarchartDataPoint) =&amp;gt; yScale(Number(dataPoint.Value)))
             )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error is in the line &lt;STRONG&gt;.x&lt;/STRONG&gt; and the line &lt;STRONG&gt;.y1&amp;nbsp;&lt;/STRONG&gt;it tells me that the arguments are not of the expected type, I have tried it with several options but it does not seem to work for me.&lt;BR /&gt;I am using the following &lt;A href="http://I am using the following project, I am simply trying to change the lines of code mentioned above" target="_blank" rel="noopener"&gt;project&lt;/A&gt;&amp;nbsp;, I am simply trying to change the lines of code mentioned abovE:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Please I would appreciate if someone can help me thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Dec 2021 10:26:53 GMT</pubDate>
    <dc:creator>CristinaD</dc:creator>
    <dc:date>2021-12-23T10:26:53Z</dc:date>
    <item>
      <title>Custom Visual Area Chart problems</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Custom-Visual-Area-Chart-problems/m-p/2253511#M33601</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I'm pretty new creating custom visuals.&amp;nbsp;I try to create something like the following image, then I will add more elements&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CristinaD_0-1640253981786.png" style="width: 331px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/647867i0E7DC78719751A9A/image-dimensions/331x248?v=v2" width="331" height="248" role="button" title="CristinaD_0-1640253981786.png" alt="CristinaD_0-1640253981786.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;At the moment I'm trying to create the background areachart but I always get error at the same point.&amp;nbsp;I have followed the barchart tutorial and I have looked at the d3 documentation&amp;nbsp;but I can't solve it.&lt;BR /&gt;&lt;BR /&gt;At the time of creating a line or an area&amp;nbsp;it gives me an error. Below I put the code that I use for the barchart that works well:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;       this.barSelection = this.barContainer
            .selectAll('.bar')
            .data(viewModel.DataPoints);

        const barSelectionMerged = this.barSelection
            .enter()
            .append('rect')
            .merge(&amp;lt;any&amp;gt;this.barSelection)
            .classed('bar', true);

        barSelectionMerged
            .attr("x", (dataPoint: BarchartDataPoint) =&amp;gt; xScale(dataPoint.Category))
            .attr("y", (dataPoint: BarchartDataPoint) =&amp;gt; yScale(Number(dataPoint.Value)))
            .attr("width", xScale.bandwidth())
            .attr("height", (dataPoint: BarchartDataPoint) =&amp;gt; (plotArea.height -yScale(Number(dataPoint.Value))))
            .style("fill", (dataPoint: BarchartDataPoint) =&amp;gt; viewModel.BarColor);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;below the code that I use to create the areachart that does not work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;      this.barContainer.append("path")
            .datum(viewModel.DataPoints)
            .attr("fill", "#cce5df")
            .attr("stroke", "#69b3a2")
            .attr("stroke-width", 1.5)
            .attr("d", d3.area()
              .x((dataPoint: BarchartDataPoint) =&amp;gt; xScale(dataPoint.Category))
              .y0(y(0))
              .y1((dataPoint: BarchartDataPoint) =&amp;gt; yScale(Number(dataPoint.Value)))
             )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error is in the line &lt;STRONG&gt;.x&lt;/STRONG&gt; and the line &lt;STRONG&gt;.y1&amp;nbsp;&lt;/STRONG&gt;it tells me that the arguments are not of the expected type, I have tried it with several options but it does not seem to work for me.&lt;BR /&gt;I am using the following &lt;A href="http://I am using the following project, I am simply trying to change the lines of code mentioned above" target="_blank" rel="noopener"&gt;project&lt;/A&gt;&amp;nbsp;, I am simply trying to change the lines of code mentioned abovE:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Please I would appreciate if someone can help me thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Dec 2021 10:26:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Custom-Visual-Area-Chart-problems/m-p/2253511#M33601</guid>
      <dc:creator>CristinaD</dc:creator>
      <dc:date>2021-12-23T10:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Visual Area Chart problems</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Custom-Visual-Area-Chart-problems/m-p/2256179#M33621</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;HI&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/337767"&gt;@CristinaD&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;So you mean you totally not sure how to design an area chart? If that is the case, I'd like to suggest you find an area chart sample first. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Here are the links of a 'stacked area' chart and outdated power bi visual code project, you can take a look at them if helps:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="https://github.com/microsoft/powerbi-visuals-streamgraph" target="_blank"&gt;GitHub - microsoft/powerbi-visuals-streamgraph: A stacked area chart with smooth interpolation. Often used to display values over time.&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="https://github.com/lumeltech/PowerBI-visuals-core" target="_blank"&gt;GitHub - lumeltech/PowerBI-visuals-core: [DEPRECATED] This library contains the Power BI visuals such as the Bar chart, Column chart etc and the visual framework.&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;In addition, if you did not require so many effects, script-based visuals(e.g. R, Python)should be a better choice of custom visual graphic designs. They do not require you to familiar with 'typescript' codes and you can find a lot of code samples of them.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-r-visuals" target="_blank"&gt;Create Power BI visuals using R - Power BI | Microsoft Docs&amp;nbsp;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/visuals/create-r-based-power-bi-desktop" target="_blank"&gt;Create an R-powered Power BI visual - Power BI | Microsoft Docs&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-python-visuals" target="_blank"&gt;Create Power BI visuals using Python in Power BI Desktop - Power BI | Microsoft Docs&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Dec 2021 02:25:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Custom-Visual-Area-Chart-problems/m-p/2256179#M33621</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-27T02:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Visual Area Chart problems</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Custom-Visual-Area-Chart-problems/m-p/2256770#M33628</link>
      <description>&lt;P&gt;I have found the solution, it would be done as follows:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;            const area =  d3.area&amp;lt;{ Category: string; Value: number}&amp;gt;()
                .curve(d3.curveCardinal)
                .x(function(d){return xScale(d.Category);})
                .y0(yScale(0))
                .y1(function(d){return yScale(d.Value);});
                
            console.log(area);

            this.barContainer.append("path")
                .datum(viewModel.DataPoints)
                .attr("fill", viewModel.AreaColor)
                .attr("d", area);&lt;/LI-CODE&gt;&lt;P&gt;The declaration in area is the most important since it is where I have had the most problems&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;const&lt;/SPAN&gt; &lt;SPAN&gt;area&lt;/SPAN&gt;&lt;SPAN&gt; = &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;d3&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;area&lt;/SPAN&gt;&lt;STRONG&gt;&amp;lt;{ Category: string; Value: number&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;}&amp;gt;&lt;/STRONG&gt;()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 27 Dec 2021 10:33:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Custom-Visual-Area-Chart-problems/m-p/2256770#M33628</guid>
      <dc:creator>CristinaD</dc:creator>
      <dc:date>2021-12-27T10:33:34Z</dc:date>
    </item>
  </channel>
</rss>

