Skip to end of banner
Go to start of banner

Chart from JSON

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

We've encountered an issue exporting this macro. Please try exporting this page again later.

In order to generate a chart report from a JSON file you have to :

  1. Write the JSON file with the chart configuration.

    {
        "type""line",
        "data": {
            "datasets": [{
                "data": [205010075250],
                "label""Left dataset",
                "fill" true,
                "backgroundColor" "rgba(66, 182, 244, 0.2)",
                "borderColor" "#42b6f4",
                "yAxisID""left-y-axis"
            }, {
                "data": [0.10.51.02.01.50],
                "label""Right dataset",
                "fill" true,
                "backgroundColor" "rgba(244, 65, 86, 0.2)",
                "borderColor" "#f44156",
                "yAxisID""right-y-axis"
            }],
            "labels": ["Jan""Feb""Mar""Apr""May""Jun"]
        },
        "options": {
            "scales": {
                "yAxes": [{
                    "id""left-y-axis",
                    "type""linear",
                    "position""left"
                }, {
                    "id""right-y-axis",
                    "type""linear",
                    "position""right"
                }]
            }
        }
    }

  2. Write the SIL script which reads the JSON file.

    string json = readFromTextFile("multipleAxes.json");
    SILReportingChart chart = fromJson(json);
     
    return chart;

The generated report:

  • No labels