Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to plot trend #95

Open
karnamonkster opened this issue May 16, 2019 · 0 comments
Open

Unable to plot trend #95

karnamonkster opened this issue May 16, 2019 · 0 comments

Comments

@karnamonkster
Copy link

karnamonkster commented May 16, 2019

Hi,

I am trying to use your Multi Series Line Chart with Labels on Vega lite
My Configuration: ES/Kibana 6.4.3

Here is my configuration:

{
  "$schema": "https://vega.github.io/schema/vega-lite/v2.json",
  "data": {
    "url": {
      "%context%": true,
      "%timefield%": "cdate",
      "index": "index-*",
      "body": {
        "aggs": {
          "time_buckets": {
            "date_histogram": {
              "field": "cdate",
              "interval": {"%autointerval%": true},
              "extended_bounds": {
                "min": {"%timefilter%": "min"},
                "max": {"%timefilter%": "max"}
              },
              "min_doc_count": 0
            }
          }
        },
        "size": 1000
      }
    },
    "format": {"property": "aggregations.time_buckets.buckets"}
  },
  "width": 800,
  "height": 400,
  "layer": [
    {
      "encoding": {
        "x": {"field": "cdate", "type": "temporal"},
        "y": {"field": "cons", "type": "quantitative"},
        "color": {"field": "area", "type": "nominal"}
      },
      "layer": [
        {"mark": "line"},
        {
          "selection": {
            "label": {
              "type": "single",
              "nearest": true,
              "on": "mouseover",
              "encodings": ["x"],
              "empty": "none"
            }
          },
          "mark": "point",
          "encoding": {
            "opacity": {
              "condition": {"selection": "label", "value": 1},
              "value": 0
            }
          }
        }
      ]
    },
    {
      "transform": [{"filter": {"selection": "label"}}],
      "layer": [
        {
          "mark": {"type": "rule", "color": "gray"},
          "encoding": {"x": {"type": "temporal", "field": "cdate"}}
        },
        {
          "encoding": {
            "text": {"type": "quantitative", "field": "cons"},
            "x": {"type": "temporal", "field": "cdate"},
            "y": {"type": "quantitative", "field": "cons"}
          },
          "layer": [
            {
              "mark": {
                "type": "text",
                "stroke": "white",
                "strokeWidth": 2,
                "align": "left",
                "dx": 5,
                "dy": -5
              }
            },
            {
              "mark": {"type": "text", "align": "left", "dx": 5, "dy": -5},
              "encoding": {"fill": {"type": "nominal", "field": "area"}}
            }
          ]
        }
      ]
    }
  ]
}

However i do not see anything apart from the X & Y -axis. There are also no errors that i come across.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant