# Unrecognized scale name: "child\_layer\_0\_y" error for facet dual charts

**URL:** <https://discuss.elastic.co/t/unrecognized-scale-name-child-layer-0-y-error-for-facet-dual-charts/263117>\
**Category:** Kibana\
**Created:** [February 3, 2021, 12:25pm UTC](https://discuss.elastic.co/t/unrecognized-scale-name-child-layer-0-y-error-for-facet-dual-charts/263117 "2021-02-03T12:25:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pranusha119](https://avatars.discourse-cdn.com/v4/letter/p/47e85d/32.png) [@Pranusha119](https://discuss.elastic.co/u/Pranusha119)\
**Post date:** [February 3, 2021, 12:25pm UTC](https://discuss.elastic.co/t/unrecognized-scale-name-child-layer-0-y-error-for-facet-dual-charts/263117/1 "2021-02-03T12:25:14Z")

</div>

```auto
{
    "$schema": "https://vega.github.io/schema/vega-lite/v4.json",
    "data":{
        "url": "data/cars.json"
    },
    "facet":{
        "column": {
            "field":"Origin",
            "type": "nominal"
        }
    },
    "spec":{
        "layer": [
            {
                "mark": {
                    "type": "bar",
                    "clip": true,
                    "tooltip": true
                },
                "encoding": {
                    
                    "x": {
                        "field": "Cylinders",
                        "type": "ordinal"
                    },
                    "y": {
                        "field": "Acceleration",
                        "type": "quantitative",
                        "aggregate":"average",
                        "axis": {
                            "title": "Acceleration",
                            "orient": "left"
                        }
                    },
                    "color": {
                        "field": "Cylinders",
                        "type": "nominal",
                        "legend":null
                    }
                }
            },
            {
                "mark": {
                    "type": "line",
                    "clip": true,
                    "color":"#ffde25",
                    "tooltip": true
                },
                "encoding": {
                    "x": {
                        "field": "Cylinders",
                        "type": "ordinal"
                    },
                    "y": {
                        "field": "Weight_in_lbs",
                        "type": "quantitative",
                        "aggregate":"average",
                        "axis": {
                            "title": "Weight (lbs)",
                            "orient": "right"
                        }
                    }
                    
                }
            }
        ],
        "resolve": {
            "scale": {"y": "independent"}
        }
    }
    

}

```

output :

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/e/4e27f321b29812a870e04cb3b5634fc42f464000.png)

```auto
{
    "$schema": "https://vega.github.io/schema/vega-lite/v4.json",
    "data":{
        "url": "data/cars.json"
    },
    "facet":{
        "column": {
            "field":"Origin",
            "type": "nominal"
        }
    },
    "spec":{
        "layer": [
            {
                "mark": {
                    "type": "bar",
                    "clip": true,
                    "tooltip": true
                },
                "encoding": {
                    
                    "x": {
                        "field": "Cylinders",
                        "type": "ordinal"
                    },
                    "y": {
                        "field": "Acceleration",
                        "type": "quantitative",
                        "aggregate":"average",
                        "axis": {
                            "title": "Acceleration",
                            "orient": "left"
                        }
                    },
                    "color": {
                        "field": "Cylinders",
                        "type": "nominal",
                        "legend":null
                    }
                }
            },
            {
                "mark": {
                    "type": "line",
                    "clip": true,
                    "color":"#ffde25",
                    "tooltip": true
                },
                "encoding": {
                    "x": {
                        "field": "Cylinders",
                        "type": "ordinal"
                    },
                    "y": {
                        "field": "Weight_in_lbs",
                        "type": "quantitative",
                        "aggregate":"average",
                        "axis": {
                            "title": "Weight (lbs)",
                            "orient": "right"
                        }
                    }
                    
                }
            }
        ],
        "resolve": {
            "scale": {"y": "independent"}
        }
    },
    "resolve": {
        "scale": {"y": "shared"},
        "axis": {"y": "independent"}
    }

}

```

if we add one more resolve, it gives this output

![image](https://us1.discourse-cdn.com/elastic/original/3X/8/d/8d0e37de9fba1340ca152fd1c04e99e38d4e7c2c.png)

I want to have both the Y axes shared for all 3 graphs, instead of having 2 individual Y axis for each graph. May I know how to do it ?

---

<div class="post-metadata">

**Author:** ![Patrick\_Mueller](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patrick_mueller/32/109425_2.png) [@Patrick\_Mueller](https://discuss.elastic.co/u/Patrick_Mueller)\
**Post date:** [February 22, 2021, 1:59pm UTC](https://discuss.elastic.co/t/unrecognized-scale-name-child-layer-0-y-error-for-facet-dual-charts/263117/2 "2021-02-22T13:59:31Z")

</div>

This seems like a pure vega-lite question, and is perhaps best answered in vega community forum - sorry, I'm not familiar with where those might be.

Guessing though, that this involves making scale/axis resolve/shared differently that you currently have at the end of your sample:

```auto
        "resolve": {
            "scale": {"y": "independent"}
        }
    },
    "resolve": {
        "scale": {"y": "shared"},
        "axis": {"y": "independent"}
    }

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 22, 2021, 1:59pm UTC](https://discuss.elastic.co/t/unrecognized-scale-name-child-layer-0-y-error-for-facet-dual-charts/263117/3 "2021-03-22T13:59:40Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
