<?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 Using D3 for a gauge in Custom Visuals Development Discussion</title>
    <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-D3-for-a-gauge/m-p/618066#M1764</link>
    <description>&lt;P&gt;Is there a way to put this D3 visual&amp;nbsp;&lt;A title="link" href="https://c3js.org/samples/chart_gauge.html" target="_blank"&gt;https://c3js.org/samples/chart_gauge.html&lt;/A&gt;&amp;nbsp;or this one&amp;nbsp;&lt;A href="http://bl.ocks.org/msqr/3202712" target="_blank"&gt;http://bl.ocks.org/msqr/3202712&lt;/A&gt;&lt;/P&gt;&lt;P&gt;into PowerBI? I've just inserted the JS Code inside de D3.JS Visual but it shows just a blank space...&lt;/P&gt;&lt;P&gt;Here is the code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;var chart = c3.generate({
    data: {
        columns: [
            ['data', 91.4]
        ],
        type: 'gauge',
        onclick: function (d, i) { console.log("onclick", d, i); },
        onmouseover: function (d, i) { console.log("onmouseover", d, i); },
        onmouseout: function (d, i) { console.log("onmouseout", d, i); }
    },
    gauge: {
//        label: {
//            format: function(value, ratio) {
//                return value;
//            },
//            show: false // to turn off the min/max labels.
//        },
//    min: 0, // 0 is default, //can handle negative min e.g. vacuum / voltage / current flow / rate of change
//    max: 100, // 100 is default
//    units: ' %',
//    width: 39 // for adjusting arc thickness
    },
    color: {
        pattern: ['#FF0000', '#F97600', '#F6C600', '#60B044'], // the three color levels for the percentage values.
        threshold: {
//            unit: 'value', // percentage is default
//            max: 200, // 100 is default
            values: [30, 60, 90, 100]
        }
    },
    size: {
        height: 180
    }
});

setTimeout(function () {
    chart.load({
        columns: [['data', 10]]
    });
}, 1000);

setTimeout(function () {
    chart.load({
        columns: [['data', 50]]
    });
}, 2000);

setTimeout(function () {
    chart.load({
        columns: [['data', 70]]
    });
}, 3000);

setTimeout(function () {
    chart.load({
        columns: [['data', 0]]
    });
}, 4000);

setTimeout(function () {
    chart.load({
        columns: [['data', 100]]
    });
}, 5000);&lt;/PRE&gt;&lt;P&gt;Any help is much appreciated!&lt;/P&gt;</description>
    <pubDate>Wed, 06 Feb 2019 17:48:19 GMT</pubDate>
    <dc:creator>remaster</dc:creator>
    <dc:date>2019-02-06T17:48:19Z</dc:date>
    <item>
      <title>Using D3 for a gauge</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-D3-for-a-gauge/m-p/618066#M1764</link>
      <description>&lt;P&gt;Is there a way to put this D3 visual&amp;nbsp;&lt;A title="link" href="https://c3js.org/samples/chart_gauge.html" target="_blank"&gt;https://c3js.org/samples/chart_gauge.html&lt;/A&gt;&amp;nbsp;or this one&amp;nbsp;&lt;A href="http://bl.ocks.org/msqr/3202712" target="_blank"&gt;http://bl.ocks.org/msqr/3202712&lt;/A&gt;&lt;/P&gt;&lt;P&gt;into PowerBI? I've just inserted the JS Code inside de D3.JS Visual but it shows just a blank space...&lt;/P&gt;&lt;P&gt;Here is the code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;var chart = c3.generate({
    data: {
        columns: [
            ['data', 91.4]
        ],
        type: 'gauge',
        onclick: function (d, i) { console.log("onclick", d, i); },
        onmouseover: function (d, i) { console.log("onmouseover", d, i); },
        onmouseout: function (d, i) { console.log("onmouseout", d, i); }
    },
    gauge: {
//        label: {
//            format: function(value, ratio) {
//                return value;
//            },
//            show: false // to turn off the min/max labels.
//        },
//    min: 0, // 0 is default, //can handle negative min e.g. vacuum / voltage / current flow / rate of change
//    max: 100, // 100 is default
//    units: ' %',
//    width: 39 // for adjusting arc thickness
    },
    color: {
        pattern: ['#FF0000', '#F97600', '#F6C600', '#60B044'], // the three color levels for the percentage values.
        threshold: {
//            unit: 'value', // percentage is default
//            max: 200, // 100 is default
            values: [30, 60, 90, 100]
        }
    },
    size: {
        height: 180
    }
});

setTimeout(function () {
    chart.load({
        columns: [['data', 10]]
    });
}, 1000);

setTimeout(function () {
    chart.load({
        columns: [['data', 50]]
    });
}, 2000);

setTimeout(function () {
    chart.load({
        columns: [['data', 70]]
    });
}, 3000);

setTimeout(function () {
    chart.load({
        columns: [['data', 0]]
    });
}, 4000);

setTimeout(function () {
    chart.load({
        columns: [['data', 100]]
    });
}, 5000);&lt;/PRE&gt;&lt;P&gt;Any help is much appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 17:48:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-D3-for-a-gauge/m-p/618066#M1764</guid>
      <dc:creator>remaster</dc:creator>
      <dc:date>2019-02-06T17:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using D3 for a gauge</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-D3-for-a-gauge/m-p/618465#M1766</link>
      <description>&lt;P&gt;Code sample you show uses C3 library.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;D3.JS visual supports only D3.js. Pleae use the second example you have shown.&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;pbicvsupport@microsoft.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 07:24:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-D3-for-a-gauge/m-p/618465#M1766</guid>
      <dc:creator>v-viig</dc:creator>
      <dc:date>2019-02-07T07:24:30Z</dc:date>
    </item>
  </channel>
</rss>

