TanyaS
TanyaS

Reputation: 13

jQuery Flot with multi yaxis and checkbox

Need help to set options for multiple y axes in Flot. This is the current graph: enter image description here

I want to apply these properties to the y axes:

$.plot("#placeholder", data, {
        xaxis: {
          tickDecimals: 0
        },
        yaxis: [{
          position: "left",
          min: 0,
          tickFormatter: function (val, axis) {
            return val + "v";
          },
        },{
          min: 0,
          position: "right",
          tickFormatter: function (val, axis) {
            return val + "M";
          },
        }]
});

But I do not understand why my code does not work here: Fiddle here

Upvotes: 1

Views: 363

Answers (1)

Raidri
Raidri

Reputation: 17550

The option for multiple axes is yaxes instead of yaxis. See this update fiddle and the documentation.

enter image description here

Upvotes: 1

Related Questions