Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

156
Visualizações
Google Material line chart getChartLayoutInterface() is missing, how to add images to dataline?

I have google material Line chart and need to get X and Y position of some datapoint in layout for add image to graph area... But web page in browser says:

chart.getChartLayoutInterface is not a function

I found, there is no method getChartLayoutInterface() in Google Material graphs available. If I switch this code to "classic graph" code (comment/uncomment) in code, that my example works...

There is my code:

var container = document.getElementById('chart_div');
var chart = new google.charts.Line(container);

    //If I Uncomment this line, google uses old "Classic" line graphs and that works...
    //var chart = new google.visualization.LineChart(container);

    google.visualization.events.addListener(chart, 'ready', function () {

    var layout = chart.getChartLayoutInterface();

        var xPos = layout.getXLocation(data.getValue(210, 0));
        var yPos = layout.getYLocation(data.getValue(210, 2));

        var GameEvent = container.appendChild(document.createElement('img'));

        GameEvent.src = '/nuke.png';
        GameEvent.style.top = (yPos -0) + 'px';
        GameEvent.style.left = (xPos) + 'px';
      }

    );

But I need to use material graphs (it works better on google chromecast as renderer).

Can you have any solution for me?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda