<?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: Custom Visual Line Graph Not Rendering in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Custom-Visual-Line-Graph-Not-Rendering/m-p/369853#M11034</link>
    <description>&lt;P&gt;After implementing, I am getting the following error:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mtk1"&gt;Argument of type 'DataPoint' is not assignable to parameter of type 'DataPoint[]'.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="mtk1"&gt;Property 'length' is missing in type 'DataPoint'.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Mar 2018 14:38:33 GMT</pubDate>
    <dc:creator>ats1958</dc:creator>
    <dc:date>2018-03-05T14:38:33Z</dc:date>
    <item>
      <title>Custom Visual Line Graph Not Rendering</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Custom-Visual-Line-Graph-Not-Rendering/m-p/369207#M11005</link>
      <description>&lt;P&gt;The following code is compiling but isn't rendering anything. Any advice appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;PRE&gt;module powerbi.extensibility.visual {

    interface DataPoint {
            grade: number;
            minimum: number;
            maximum: number;
    };
    
    interface ViewModel {
        dataPoints: DataPoint[];
        maxValue: number;
        minValue: number;
        maxGrade: number;
    };
    
    export class Visual implements IVisual {
    
        private host: IVisualHost;
        private svg: d3.Selection&amp;lt;SVGElement&amp;gt;;
        private structureGroup: d3.Selection&amp;lt;SVGElement&amp;gt;;
        private yPadding: number = 0.1;
    
        

        constructor(options: VisualConstructorOptions) {
            this.host = options.host;
            d3.selectAll("svg").remove()
            this.svg = d3.select(options.element)
                .append("svg")
                .classed("vchart", true);
            this.structureGroup = this.svg.append("g")
                .classed("structure-group", true);
        }
    
        public update(options: VisualUpdateOptions) {
    
                let sample: DataPoint[] = [
                    {
                        grade: 1,
                        minimum: -0.2,
                        maximum: 0.2
                    },
                    {
                        grade: 2,
                        minimum: -0.25,
                        maximum: 0.25
                    },
                    {
                        grade: 3,
                        minimum: -0.3,
                        maximum: 0.3
                    },
                    {
                        grade: 4,
                        minimum: -0.35,
                        maximum: 0.35
                    },
                    {
                        grade: 5,
                        minimum: -0.35,
                        maximum: 0.35
                    },
                    {
                        grade: 6,
                        minimum: -0.4,
                        maximum: 0.4
                    },
                ];
    
                let viewModel: ViewModel = {
                    dataPoints: sample,
                    maxValue: d3.max(sample, x =&amp;gt; x.maximum),
                    minValue: d3.min(sample, x =&amp;gt; x.minimum),
                    maxGrade: d3.max(sample, x =&amp;gt; x.grade)
                };
    
                
    
                let width = options.viewport.width;
                let height = options.viewport.height;
    
                this.svg.attr({
                    width: width,
                    height: height,
                });
    
                let xScale = d3.scale.linear()
                    .domain([viewModel.minValue, viewModel.maxValue])
                    .range([0, width]);
    
                let yScale = d3.scale.linear()
                    .domain([1, viewModel.maxGrade])
                    .range([0, height]);
    
                var valueline = d3.svg.line&amp;lt;DataPoint&amp;gt;()
                    .x(function (d) { return xScale(d.minimum); })
                    .y(function (d) { return yScale(d.grade); })
    
                let minline = this.structureGroup
                    .selectAll(".minline")
                    .data(viewModel.dataPoints)
    
                minline.append("path")
                    .attr("class","minline")
                    .attr("d",function(d){ return valueline(sample); })
    
                minline.exit()
                    .remove();
    
        }
    
    }
}&lt;/PRE&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 03 Mar 2018 22:58:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Custom-Visual-Line-Graph-Not-Rendering/m-p/369207#M11005</guid>
      <dc:creator>ats1958</dc:creator>
      <dc:date>2018-03-03T22:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Visual Line Graph Not Rendering</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Custom-Visual-Line-Graph-Not-Rendering/m-p/369587#M11019</link>
      <description>&lt;P&gt;Looks like you should change&amp;nbsp;&lt;STRONG&gt;.attr("d",function(d){ return valueline(sample); })&lt;/STRONG&gt; to&amp;nbsp;&lt;STRONG&gt;.attr("d",function(d){ return valueline(d); }).&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please check this solution out and let us know if that works well?&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 08:16:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Custom-Visual-Line-Graph-Not-Rendering/m-p/369587#M11019</guid>
      <dc:creator>v-viig</dc:creator>
      <dc:date>2018-03-05T08:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Visual Line Graph Not Rendering</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Custom-Visual-Line-Graph-Not-Rendering/m-p/369853#M11034</link>
      <description>&lt;P&gt;After implementing, I am getting the following error:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mtk1"&gt;Argument of type 'DataPoint' is not assignable to parameter of type 'DataPoint[]'.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="mtk1"&gt;Property 'length' is missing in type 'DataPoint'.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 14:38:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Custom-Visual-Line-Graph-Not-Rendering/m-p/369853#M11034</guid>
      <dc:creator>ats1958</dc:creator>
      <dc:date>2018-03-05T14:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Visual Line Graph Not Rendering</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Custom-Visual-Line-Graph-Not-Rendering/m-p/370491#M11049</link>
      <description>&lt;P&gt;It seems you should use this code instead to render a line properly as a single svg path element:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;let minline = this.structureGroup
    .selectAll(".minline")
    .data([viewModel.dataPoints])

minline
    .enter()
    .append("path")
    .attr("class", "minline");

minline.attr("d", function (d) { return valueline(d); })

minline
    .exit()
    .remove();&lt;/PRE&gt;
&lt;P&gt;Please let us know if that works for your case.&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>Tue, 06 Mar 2018 09:51:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Custom-Visual-Line-Graph-Not-Rendering/m-p/370491#M11049</guid>
      <dc:creator>v-viig</dc:creator>
      <dc:date>2018-03-06T09:51:23Z</dc:date>
    </item>
  </channel>
</rss>

