JQPlot - Online Legend

1

I'm creating some graphics using JQPlot, however I came across a difficult situation.

Test chart:

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

However, while I search (obviously, especially here on the stack) I found several ways to do it, but none worked.

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

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

Can anyone help me?

    
asked by anonymous 10.06.2015 / 16:54

1 answer

2

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

In the javascript declaration of Twig was missing 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 successfully importing JS, the caption was in the right format as below:

    
10.06.2015 / 17:10