[[+content_image]]
D
D
Dmitry Morozov2017-02-21 11:57:21
MODX
Dmitry Morozov, 2017-02-21 11:57:21

Modx, jqPlot or how to output json so that modx doesn't think it's the name of a snippet?

I want to display a graph in a snippet using jqplot on the site. Accordingly, the chart data is indicated in json format

var line1=[['23-May-08', 578.55], ['20-Jun-08', 566.5], ['25-Jul-08', 480.88], ['22-Aug-08', 509.84],
      ['26-Sep-08', 454.13], ['24-Oct-08', 379.75], ['21-Nov-08', 303], ['26-Dec-08', 308.56],
      ['23-Jan-09', 299.14], ['20-Feb-09', 346.51], ['20-Mar-09', 325.99], ['24-Apr-09', 386.15]];

But modx rubs the line, because it thinks that this is a snippet because of double brackets. How can this be fixed?

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
D
display: block, 2017-02-21
@saytik

You can put a space between brackets.

var line1=[ ['23-May-08', 578.55], ['20-Jun-08', 566.5], ['25-Jul-08', 480.88], ['22-Aug-08', 509.84],
      ['26-Sep-08', 454.13], ['24-Oct-08', 379.75], ['21-Nov-08', 303], ['26-Dec-08', 308.56],
      ['23-Jan-09', 299.14], ['20-Feb-09', 346.51], ['20-Mar-09', 325.99], ['24-Apr-09', 386.15] ];

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question