title: AWS Cloudwatch dashboard widgets with stacked graph
body: <p>I have created AWS Cloudwatch dashboard. a graph has been created from cloudwatch insight query from lambda logs</p>
  <p>The insight query on lambda logs is :filter @type = &quot;REPORT&quot; | stats sum(@billedDuration) as billedDuration, count(@requestId) as requestCount by bin(1d) | sort by @billedDuration desc</p>
  <p>We are using a stacked graph with 2 variables in the y-axis : billedDuration and requestCount.
  The graph looks something like: <a href="https://i.stack.imgur.com/L3TY9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L3TY9.png" alt="enter image description here" /></a></p>
  <p>but if we have 2 separate y-axis (on right and left), it should look something like:
  <a href="https://i.stack.imgur.com/cXtOT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cXtOT.png" alt="enter image description here" /></a></p>
  <p>How to generate a graph with 2 y-axis values? I have been referring to this documentation: <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Dashboard-Body-Structure.html#CloudWatch-Dashboard-Properties-YAxis-Properties-Format" rel="nofollow noreferrer">https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Dashboard-Body-Structure.html#CloudWatch-Dashboard-Properties-YAxis-Properties-Format</a>. This talks about having 2 values for y-axis for the metrics. is this applicable for dashboard graphs generated using insight query as well? I tried adding y-axis values. my Json for this dashboard item is pasted bellow. I added &quot;legend&quot;{&quot;position&quot;:&quot;bottom&quot;} even that is also not working</p>
  <pre><code>{
              &quot;height&quot;: 6,
              &quot;width&quot;: 12,
              &quot;y&quot;: 59,
              &quot;x&quot;: 12,
              &quot;type&quot;: &quot;log&quot;,
              &quot;properties&quot;: {
                  &quot;query&quot;: &quot;SOURCE '/aws/lambda/vm-managed-dev-bot3-chatbot-lambda' | SOURCE '/aws/dev-bot3/lexv2/vm-managed-directbill-chatbot-log-group' | filter @type = \&quot;REPORT\&quot; | stats sum(@billedDuration) as billedDuration, count(@requestId) as requestCount by bin(1d) | sort by @billedDuration desc&quot;,
                  &quot;region&quot;: &quot;us-east-1&quot;,
                  &quot;title&quot;: &quot;Bill Duration Vs Request Count [Lambda]&quot;,
                  &quot;view&quot;: &quot;timeSeries&quot;,
                  &quot;stacked&quot;: true,
                  &quot;legend&quot;: {
                      &quot;position&quot;: &quot;bottom&quot;
                  },
                  &quot;left&quot;: {
                      &quot;min&quot;: 0
                  },
                  &quot;right&quot; : {
                      &quot;min&quot;: 0
                  }
              }
          }
  </code></pre>