anchor.diff:      .selectAll("text")
       .data(data)
       .join("text")
  -      .attr("fill", d => (x(d.value) - x(0)) > 70 ? "white" : "steelblue" )
  +      .attr("fill",  d => (x(d.value) - x(0)) > 70 ? "white" : (d.ods !== undefined ? "" : "#5392cb") )
  +      .attr("class", d => (x(d.value) - x(0)) < 70 ? (d.ods !== undefined ? "ods-" + d.ods : "") : "")
         .attr("x", d => (x(d.value) - x(0)) > 70 ? x(0) + 80 : x(d.value) + 60)
         .attr("y", d => y(d.key) + y.bandwidth() / 2)
         .attr("dy", "0.35em")
  
positive.code: 
    let xAxis = g => g
        .attr("transform", `translate(0,${margin.top})`)
        .call(d3.axisTop(x).ticks(4).tickFormat(d => d > 0 ? format(d) : d))
        .call(g => g.select(".domain").remove());
  
    let yAxis = g => g
  
negative.code:   <div class="tabs m_v_2">
      <ul role="tablist" aria-label="Consulta los ODS">
        <li role="presentation" class="active">
          <a data-remote="true" href="" data-show="ods">Por ODS</a>
        </li>
        <li role="presentation" class="">
          <a data-remote="true" href="" data-show="program">Por Programa</a>
        </li>
      </ul>
    </div>
  
    <% for i in ["01","02","03","04","05","07","08","09","10","11","13","15","16","17"] %>
      <div class="m_v_2 card-container" data-target="ods">
        <div class="card-inner-side"><%= image_tag('ods/goals_icons-individual-rgb-' + i + '.png') %></div>
        <div class="card-inner-content p_2" id="chart-ods-<%= i.to_i %>">
          <%= i %>
        </div>
      </div>
    <% end %>
  
    <% for i in ["01","02","03","04","05","06", "07","08","09","10","11","12","13","14","15","16","17"] %>
      <div class="m_v_2 card-container" data-target="program">
        <div class="card-inner-side" id="card-<%= i.to_i %>"><h2></h2> <span></span></div>
        <div class="card-inner-content p_2" id="chart-program-<%= i.to_i %>">
        </div>
      </div>
    <% end %>
  
  
    <h2 class="with_description">Resumen</h2>
  
    <div id="table"></div>
  </div>
  
  <style>
  .ods-1  { fill: #e72433; background-color: #e72433; color: #fff; }
  .ods-2  { fill: #d19f35; background-color: #d19f35; color: #fff; }
  .ods-3  { fill: #349a4b; background-color: #349a4b; color: #fff; }
  .ods-4  { fill: #bf2436; background-color: #bf2436; color: #fff; }
  .ods-5  { fill: #eb4332; background-color: #eb4332; color: #fff; }
  .ods-7  { fill: #fbb62e; background-color: #fbb62e; color: #fff; }
  .ods-8  { fill: #8c1c39; background-color: #8c1c39; color: #fff; }
  .ods-9  { fill: #ef6e30; background-color: #ef6e30; color: #fff; }
  .ods-10 { fill: #dd2284; background-color: #dd2284; color: #fff; }
  .ods-11 { fill: #f69d35; background-color: #f69d35; color: #fff; }
  .ods-13 { fill: #4b7640; background-color: #4b7640; color: #fff; }
  .ods-15 { fill: #48ae4e; background-color: #48ae4e; color: #fff; }
  .ods-16 { fill: #0d5689; background-color: #0d5689; color: #fff; }
  .ods-17 { fill: #1a3767; background-color: #1a3767; color: #fff; }
  .ods-18 { fill: #72a9da; background-color: #72a9da; color: #fff; } // TOTAL column
  </style>
  
  
  <script src="https://d3js.org/d3.v5.min.js"></script>
  <script type="text/javascript">
  function round(value, decimals) {
    return Number(Math.round(value+'e'+decimals)+'e-'+decimals);
  }
  
  function format(value){
    value = parseFloat(value);
    if(value > 1000000) {
      return round(value / 1000000, 2).toLocaleString() + " M€";
    } else {
      return round(value, 2).toLocaleString() + " €";
    }
  }
  
  function barChart(id, data) {
    let margin = {top: 20, right: 80, bottom: 30, left: 290};
    let height = data.length * 25 + margin.top + margin.bottom;
  
    let bodySelection = d3.select(`#${id}`)
    bodySelection.html('')
    let parentWidth = d3.select('[data-target="ods"]').node().offsetWidth;
    let svg = bodySelection.append("svg").attr("width", parentWidth - 260).attr("height", height),
      width = +svg.attr("width") - margin.left - margin.right
  
    let x = d3.scaleLinear()
        .domain([0, d3.max(data, d => d.value)])
        .range([margin.left, margin.left + width - margin.right]);
  
    let y = d3.scaleBand()
        .domain(data.map(d => d.key))
  