How to get dashed lines in ORG CHART?

58 views
Skip to first unread message

Pedro Souza

unread,
Mar 6, 2020, 4:43:10 PM3/6/20
to Google Visualization API
Hi, I need to use dashed lines for some rows, not all. I tried using options, but it didn't do anything...

      google.charts.load('current', {packages:["orgchart"]});
      google.charts.setOnLoadCallback(drawChart);

      function drawChart() {
        var data = new google.visualization.DataTable();
        data.addColumn('string', 'Name');
        data.addColumn('string', 'Manager');
        data.addColumn('string', 'ToolTip');

        // For each orgchart box, provide the name, manager, and tooltip to show.
        data.addRows([
          [{'v':'Mike', 'f':'Mike<div style="color:red; font-style:italic">President</div>'},
           '', 'The President'],
          [{'v':'Jim', 'f':'Jim<div style="color:red; font-style:italic">Vice President</div>'},
           'Mike', 'VP'],
          ['Alice', 'Mike', ''],
          ['Bob', 'Jim', 'Bob Sponge'],
          ['Carol', 'Bob', '']
        ]);
   var options = {
          series: {
            0: { lineDashStyle: [1, 1] },
            1: { lineDashStyle: [2, 2] }
          },
    
        };
        // Create the chart.
        var chart = new google.visualization.OrgChart(document.getElementById('chart_div'));
        // Draw the chart, setting the allowHtml option to true for the tooltips.
        chart.draw(data, options, {'allowHtml':true});
      }


Cleciana Alves de Oliveira Rangel

unread,
Mar 6, 2020, 4:49:00 PM3/6/20
to google-visua...@googlegroups.com

Boa tarde, Pedro!

Is there anything I can do to help you?

I will be immensely grateful for your help.

I don't know the value of your help, but if there is a price, I'm willing to pay, because I don't want to lose my job in the sector I'm in..




Atenciosamente,




--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/c778e743-d778-40bb-9c69-1e731d598fc2%40googlegroups.com.

BACSWebMaster

unread,
Jun 24, 2020, 2:29:54 AM6/24/20
to Google Visualization API
Hi 
Use this line:

           data.setRowProperty(3, 'style', 'border:4px dashed red');

You'll have to do it for each box that you want a dashed line. Row count is left to right from the top.


On Saturday, March 7, 2020 at 8:43:10 AM UTC+11, Pedro Souza wrote:
Hi, I need to use dashed lines for some rows, not all. I tried using options, but it didn't do anything...

      google.charts.load('current', {packages:["orgchart"]});
      google.charts.setOnLoadCallback(drawChart);

      function drawChart() {
        var data = new google.visualization.DataTable();
        data.addColumn('string', 'Name');
        data.addColumn('string', 'Manager');
        data.addColumn('string', 'ToolTip');

        // For each orgchart box, provide the name, manager, and tooltip to show.
        data.addRows([
          [{'v':'Mike', 'f':'Mike<div style="color:red; font-style:italic">President</div>'},
           '', 'The President'],
          [{'v':'Jim', 'f':'Jim<div style="color:red; font-style:italic">Vice President</div>'},
           'Mike', 'VP'],
          ['Alice', 'Mike', ''],
          ['Bob', 'Jim', 'Bob Sponge'],
          ['Carol', 'Bob', '']
        ]);
                   data.setRowProperty(3, 'style', 'border:4px dashed red');
Reply all
Reply to author
Forward
0 new messages