title: Pivoted data with ggplot lines and stacked bars
body: <p>Consider the following chart:</p>
  <pre><code>library(lubridate)
  library(dplyr)
  col1 &lt;- col2 &lt;- col3 &lt;- c(1:5)
  col4 &lt;- c(11:15)
  date &lt;- as_date(&quot;2022-07-27&quot;)+0:4
  data &lt;- data.frame(date, col1, col2, col3, col4) %&gt;% pivot_longer(all_of(c(&quot;col1&quot;, &quot;col2&quot;, &quot;col3&quot;, &quot;col4&quot;)))
  
  p1 &lt;- ggplot(data, aes(fill=name, y=`value`, x=`date`)) +
    geom_bar(position=&quot;stack&quot;, stat=&quot;identity&quot;) +
    ylab(&quot;MCHF&quot;)+
    ggtitle(&quot;mytitle&quot;)+
    theme(legend.position=&quot;bottom&quot;,
          legend.key.size = grid::unit(0.1, &quot;inch&quot;),
            legend.key.width = grid::unit(0.1, &quot;inch&quot;))+
    ggplot2::guides(fill=ggplot2::guide_legend(ncol=3))
  p1
  </code></pre>
  <p><a href="https://i.stack.imgur.com/XiTzE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XiTzE.png" alt="plot1" /></a></p>
  <p>How can I have <code>col4</code> plotted as a line instead of being part of the stacked bar chart? Ideally I'd like to keep it in the legend.</p>