Skip to main content
February 13, 2023
Question

Two y-axis for the same plot

  • February 13, 2023
  • 2 replies
  • 0 views

Hi! 

Is there any way to have 2 different y-axis for the same plot? May be a plugin?

For example: one y for gdp, one y for population, while they have in common x (year).

2 replies

stefanhelzle0001
Brainy
February 14, 2023

Did you try the Google charts plugin?

February 23, 2023

I tried to use it and as it seems, I'm supposed to use googleScatterChartField(), which doesn't give me labels for the axis, and isn't showing the second y values. Here is the code:

a!localVariables(
  local!colData: {{ type: "number",id: "Age",rowDataKey: "Age"},
  {type: "number",id: "Weight",rowDataKey: "Weight"},
  { type: "number", id: "Height", rowDataKey: "Height"}},
  local!rowData: {{Age: 28, Weight: 43, Height: 10}, 
  {Age: 9, Weight: 39, Height: 20}, {Age: 2, Weight: 52, Height: 30}, 
  {Age: 20, Weight: 72, Height: 35}},
{
  googleScatterChartField(
    label: "Chart",
    validations:"val",
    chartColumnData: local!colData,
    chartRowData: local!rowData
  )
}
)

and here is the screen: