Skip to content

Commit

Permalink
add supplement
Browse files Browse the repository at this point in the history
  • Loading branch information
spatialthoughts committed Jul 4, 2023
1 parent 05a1a16 commit fa0c537
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
13 changes: 11 additions & 2 deletions docs/gee-charts.html
Original file line number Diff line number Diff line change
Expand Up @@ -2388,6 +2388,9 @@ <h2>Stacked Bar Chart</h2>
Regular vs. Stacked Bar Charts
</p>
</div>
<p><a
href="https://code.earthengine.google.co.in/?scriptPath=users%2Fujavalgandhi%2FGEE-Charts%3ASupplement%2FStacked_BarChart"
target="_blank">Open in Code Editor ↗</a></p>
<div class="sourceCode" id="cb26"><pre
class="sourceCode js"><code class="sourceCode javascript"><span id="cb26-1"><a href="#cb26-1" tabindex="-1"></a><span class="co">// Creating Stacked Bar Charts</span></span>
<span id="cb26-2"><a href="#cb26-2" tabindex="-1"></a></span>
Expand Down Expand Up @@ -2471,11 +2474,14 @@ <h2>Colored Bar Chart</h2>
palette - making it a very useful tool in interpretation of the spatial
and temporal aspects of the trend.</p>
<div class="figure" style="text-align: center">
<img src="images/gee_charts/colored_barchart.png" alt="Colored BarChart" width="75%" />
<img src="images/gee_charts/colored_barchart.png" alt="Colored Bar Chart" width="75%" />
<p class="caption">
Colored BarChart
Colored Bar Chart
</p>
</div>
<p><a
href="https://code.earthengine.google.co.in/?scriptPath=users%2Fujavalgandhi%2FGEE-Charts%3ASupplement%2FDataTable_Colored_Bars"
target="_blank">Open in Code Editor ↗</a></p>
<div class="sourceCode" id="cb27"><pre
class="sourceCode js"><code class="sourceCode javascript"><span id="cb27-1"><a href="#cb27-1" tabindex="-1"></a><span class="co">// Example script showing how to create a bar chart</span></span>
<span id="cb27-2"><a href="#cb27-2" tabindex="-1"></a><span class="co">// with each bar having a different color.</span></span>
Expand Down Expand Up @@ -2613,6 +2619,9 @@ <h2>Transect Chart</h2>
generate a FeatureCollection with latitude, longitude and DN values.
This can be then plotted to create a transect chart like below.</p>
<p><img src="images/gee_charts/transect.png" width="75%" style="display: block; margin: auto;" /></p>
<p><a
href="https://code.earthengine.google.co.in/?scriptPath=users%2Fujavalgandhi%2FGEE-Charts%3ASupplement%2FTransect_Chart"
target="_blank">Open in Code Editor ↗</a></p>
<div class="sourceCode" id="cb28"><pre
class="sourceCode js"><code class="sourceCode javascript"><span id="cb28-1"><a href="#cb28-1" tabindex="-1"></a><span class="kw">var</span> transect <span class="op">=</span> ee<span class="op">.</span><span class="at">Geometry</span><span class="op">.</span><span class="fu">LineString</span>([</span>
<span id="cb28-2"><a href="#cb28-2" tabindex="-1"></a> [<span class="fl">139.0</span><span class="op">,</span> <span class="fl">35.67</span>]<span class="op">,</span></span>
Expand Down
8 changes: 7 additions & 1 deletion gee-charts.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -552,17 +552,21 @@ You can use the `isStacked` option to `true` on charts of type *ColumnChart* or
knitr::include_graphics('images/gee_charts/stacked.png')
```

[Open in Code Editor &#8599;](https://code.earthengine.google.co.in/?scriptPath=users%2Fujavalgandhi%2FGEE-Charts%3ASupplement%2FStacked_BarChart){target="_blank"}

```{js eval=FALSE, code=readLines('code/gee_charts/Supplement/Stacked_BarChart')}
```

## Colored Bar Chart

It is possible to assign a different color to each bar of a bar chart. You neeed to create a DataTable with a column having a *style* role and define the color for each row. Here we create a chart that uses a unique color for each bar that representing the year of forest loss. The chart has a one-to-one correspondence with the map palette - making it a very useful tool in interpretation of the spatial and temporal aspects of the trend.

```{r echo=FALSE, fig.align='center', out.width='75%', fig.cap='Colored BarChart'}
```{r echo=FALSE, fig.align='center', out.width='75%', fig.cap='Colored Bar Chart'}
knitr::include_graphics('images/gee_charts/colored_barchart.png')
```

[Open in Code Editor &#8599;](https://code.earthengine.google.co.in/?scriptPath=users%2Fujavalgandhi%2FGEE-Charts%3ASupplement%2FDataTable_Colored_Bars){target="_blank"}

```{js eval=FALSE, code=readLines('code/gee_charts/Supplement/DataTable_Colored_Bars')}
```

Expand All @@ -574,6 +578,8 @@ You can sample values from an image along a line transect and generate a Feature
knitr::include_graphics('images/gee_charts/transect.png')
```

[Open in Code Editor &#8599;](https://code.earthengine.google.co.in/?scriptPath=users%2Fujavalgandhi%2FGEE-Charts%3ASupplement%2FTransect_Chart){target="_blank"}

```{js eval=FALSE, code=readLines('code/gee_charts/Supplement/Transect_Chart')}
```

Expand Down

0 comments on commit fa0c537

Please sign in to comment.