VMware Modern Apps Community
corey_r
Community Manager
Community Manager
Jump to solution

Logarithmic point plot via the API?

Struggling with this. I found out that a point-plot is called a "scatterplot" in the API docs, but I can't find the make-the-y-axis-log part. Help?

0 Kudos
1 Solution

Accepted Solutions
corey_r
Community Manager
Community Manager
Jump to solution

Ah. So sorry I missed the API part.

Well you can create the dashboard by passing the json to /api/dashboard .

In the chart properties if you set base=1 then that means its a linear axis and if you change it to 10 then it would be a log (base 10) axis an similarly you could use a binary log (ln)  if you'd like by setting the base to 2.

Here is a snippet from the dashboard.json

Linear:

      "charts": [

            {

              "name": "Linear",

              "sources": [

                {

                  "name": "agent-rate",

                  "query": "rate(ts(~agent.points.*.received))",

                  "disabled": null,

                  "scatterPlotSource": "X",

                  "querybuilderSerialization": null,

                  "querybuilderEnabled": false,

                  "secondaryAxis": null

                },

                {

                  "name": "memory",

                  "query": "ts(~agent.jvm.memory.heapUsed)",

                  "disabled": null,

                  "scatterPlotSource": "Y",

                  "querybuilderSerialization": null,

                  "querybuilderEnabled": false,

                  "secondaryAxis": null

                }

              ],

              "units": "",

              "base": 1,

                .

                .

                .

Logarithmic:

      "charts": [

            {

              "name": "Log base 10",

              "sources": [

                {

                  "name": "agent-rate",

                  "query": "rate(ts(~agent.points.*.received))",

                  "disabled": null,

                  "scatterPlotSource": "X",

                  "querybuilderSerialization": null,

                  "querybuilderEnabled": false,

                  "secondaryAxis": null

                },

                {

                  "name": "memory",

                  "query": "ts(~agent.jvm.memory.heapUsed)",

                  "disabled": null,

                  "scatterPlotSource": "Y",

                  "querybuilderSerialization": null,

                  "querybuilderEnabled": false,

                  "secondaryAxis": null

                }

              ],

              "units": "",

              "base": 10,

               .

               .

               .

Hope this answers your question

Salil D

View solution in original post

0 Kudos
4 Replies
corey_r
Community Manager
Community Manager
Jump to solution

Hi Jordi,

For a Scatter plot you can specify your X and Y axis query and then in the Axis tab of chart properties you should be able to switch to logarithmic axis if you want to

log-axis.png

Here is an example that uses log axis on the the scatter plot -> https://yammer.wavefront.com/u/jhTpYF8WMZ

Hope this helps.

Salil

0 Kudos
corey_r
Community Manager
Community Manager
Jump to solution

I mean via the API, not via the web interface.

0 Kudos
corey_r
Community Manager
Community Manager
Jump to solution

Ah. So sorry I missed the API part.

Well you can create the dashboard by passing the json to /api/dashboard .

In the chart properties if you set base=1 then that means its a linear axis and if you change it to 10 then it would be a log (base 10) axis an similarly you could use a binary log (ln)  if you'd like by setting the base to 2.

Here is a snippet from the dashboard.json

Linear:

      "charts": [

            {

              "name": "Linear",

              "sources": [

                {

                  "name": "agent-rate",

                  "query": "rate(ts(~agent.points.*.received))",

                  "disabled": null,

                  "scatterPlotSource": "X",

                  "querybuilderSerialization": null,

                  "querybuilderEnabled": false,

                  "secondaryAxis": null

                },

                {

                  "name": "memory",

                  "query": "ts(~agent.jvm.memory.heapUsed)",

                  "disabled": null,

                  "scatterPlotSource": "Y",

                  "querybuilderSerialization": null,

                  "querybuilderEnabled": false,

                  "secondaryAxis": null

                }

              ],

              "units": "",

              "base": 1,

                .

                .

                .

Logarithmic:

      "charts": [

            {

              "name": "Log base 10",

              "sources": [

                {

                  "name": "agent-rate",

                  "query": "rate(ts(~agent.points.*.received))",

                  "disabled": null,

                  "scatterPlotSource": "X",

                  "querybuilderSerialization": null,

                  "querybuilderEnabled": false,

                  "secondaryAxis": null

                },

                {

                  "name": "memory",

                  "query": "ts(~agent.jvm.memory.heapUsed)",

                  "disabled": null,

                  "scatterPlotSource": "Y",

                  "querybuilderSerialization": null,

                  "querybuilderEnabled": false,

                  "secondaryAxis": null

                }

              ],

              "units": "",

              "base": 10,

               .

               .

               .

Hope this answers your question

Salil D

0 Kudos
corey_r
Community Manager
Community Manager
Jump to solution

Thanks!

0 Kudos