Jqplot - Online caption

Asked

Viewed 201 times

1

I’m creating some graphics using Jqplot, but I came across a difficult situation.

Test graph: Gráfico de teste

As you can see the caption is in vertical sequence and I would like to place it in horizontal sequence.

However, while researching (obviously mainly here in the stack) I found several ways to do it, however, none of it worked.

  var optLegend = {
    renderer: $.jqplot.EnhancedLegendRenderer,
    show:true, 
    placement: 'outsideGrid', 
    rendererOptions: {
      numberRows: 1,
      numberColumns: 3
    }, 

This is the definition code of the current legend, but I did not get the desired result.

Can someone help me?

  • Post the rest of the code, html, css etc.

  • Thank you Israel, really the fault was elsewhere. In the case of importing the jqplot plugin.

1 answer

2

Answering the question, I found after investigating the code that my fault was not in JS but in Twig.

In the Twig javascript statement it was missing to import jqplot.enhancedLegendRenderer.min.js', as below:

{% block javascript %}
  {% javascripts 
    '@AppBundle/Resources/public/js/util/jqplot/jquery.jqplot.min.js'
    '@AppBundle/Resources/public/js/util/jqplot/plugins/jqplot.barRenderer.min.js'
    '@AppBundle/Resources/public/js/util/jqplot/plugins/jqplot.pointLabels.min.js'
    '@AppBundle/Resources/public/js/util/jqplot/plugins/jqplot.categoryAxisRenderer.min.js'
    '@AppBundle/Resources/public/js/util/jqplot/plugins/jqplot.enhancedLegendRenderer.min.js'
    '@AppBundle/Resources/public/js/teste/teste.js' output='js/teste/teste.js' %}
    <script type="text/javascript" src="{{ asset_url }}"></script>
  {% endjavascripts %}
{% endblock %}

After making the correct JS import, the caption was in the right format, as below:

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.