Add demo functions
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
||||
<title>Chart.js API · GitBook</title>
|
||||
<title>Chart.js API · Chart.js documentation</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="description" content="">
|
||||
<meta name="generator" content="GitBook 3.2.2">
|
||||
@@ -195,7 +195,20 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3.2" data-path="../general/interactions/">
|
||||
<li class="chapter " data-level="1.3.2" data-path="../general/device-pixel-ratio.html">
|
||||
|
||||
<a href="../general/device-pixel-ratio.html">
|
||||
|
||||
|
||||
Pixel Ratio
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3.3" data-path="../general/interactions/">
|
||||
|
||||
<a href="../general/interactions/">
|
||||
|
||||
@@ -209,7 +222,7 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.3.2.1" data-path="../general/interactions/events.html">
|
||||
<li class="chapter " data-level="1.3.3.1" data-path="../general/interactions/events.html">
|
||||
|
||||
<a href="../general/interactions/events.html">
|
||||
|
||||
@@ -222,7 +235,7 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3.2.2" data-path="../general/interactions/modes.html">
|
||||
<li class="chapter " data-level="1.3.3.2" data-path="../general/interactions/modes.html">
|
||||
|
||||
<a href="../general/interactions/modes.html">
|
||||
|
||||
@@ -240,7 +253,7 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3.3" data-path="../general/options.html">
|
||||
<li class="chapter " data-level="1.3.4" data-path="../general/options.html">
|
||||
|
||||
<a href="../general/options.html">
|
||||
|
||||
@@ -253,7 +266,7 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3.4" data-path="../general/colors.html">
|
||||
<li class="chapter " data-level="1.3.5" data-path="../general/colors.html">
|
||||
|
||||
<a href="../general/colors.html">
|
||||
|
||||
@@ -266,7 +279,7 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3.5" data-path="../general/fonts.html">
|
||||
<li class="chapter " data-level="1.3.6" data-path="../general/fonts.html">
|
||||
|
||||
<a href="../general/fonts.html">
|
||||
|
||||
@@ -950,9 +963,9 @@ myLineChart.clear();
|
||||
</code></pre>
|
||||
<p>To get an item that was clicked on, <code>getElementAtEvent</code> can be used.</p>
|
||||
<pre><code class="lang-javascript"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">clickHandler</span>(<span class="hljs-params">evt</span>) </span>{
|
||||
<span class="hljs-keyword">var</span> item = myChart.getElementAtEvent(evt)[<span class="hljs-number">0</span>];
|
||||
<span class="hljs-keyword">var</span> firstPoint = myChart.getElementAtEvent(evt)[<span class="hljs-number">0</span>];
|
||||
|
||||
<span class="hljs-keyword">if</span> (item) {
|
||||
<span class="hljs-keyword">if</span> (firstPoint) {
|
||||
<span class="hljs-keyword">var</span> label = myChart.data.labels[firstPoint._index];
|
||||
<span class="hljs-keyword">var</span> value = myChart.data.datasets[firstPoint._datasetIndex].data[firstPoint._index];
|
||||
}
|
||||
@@ -1022,7 +1035,7 @@ myLineChart.clear();
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Chart.js API","level":"1.7.1","depth":2,"next":{"title":"Updating Charts","level":"1.7.2","depth":2,"path":"developers/updates.md","ref":"developers/updates.md","articles":[]},"previous":{"title":"Developers","level":"1.7","depth":1,"path":"developers/README.md","ref":"developers/README.md","articles":[{"title":"Chart.js API","level":"1.7.1","depth":2,"path":"developers/api.md","ref":"developers/api.md","articles":[]},{"title":"Updating Charts","level":"1.7.2","depth":2,"path":"developers/updates.md","ref":"developers/updates.md","articles":[]},{"title":"Plugins","level":"1.7.3","depth":2,"path":"developers/plugins.md","ref":"developers/plugins.md","articles":[]},{"title":"New Charts","level":"1.7.4","depth":2,"path":"developers/charts.md","ref":"developers/charts.md","articles":[]},{"title":"New Axes","level":"1.7.5","depth":2,"path":"developers/axes.md","ref":"developers/axes.md","articles":[]},{"title":"Contributing","level":"1.7.6","depth":2,"path":"developers/contributing.md","ref":"developers/contributing.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["-lunr","-search","search-plus","anchorjs","chartjs","ga"],"root":"./docs","styles":{"website":"style.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"anchorjs":{"icon":"#","placement":"left","visible":"always"},"ga":{"configuration":"auto","token":"UA-28909194-3"},"theme-default":{"styles":{"website":"style.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"search-plus":{},"chartjs":{"defaults":null},"highlight":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}},"theme":"default","author":"chartjs","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"gitbook":"3.2.2"},"file":{"path":"developers/api.md","mtime":"2017-10-28T15:03:49.266Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-10-28T15:09:53.587Z"},"basePath":"..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Chart.js API","level":"1.7.1","depth":2,"next":{"title":"Updating Charts","level":"1.7.2","depth":2,"path":"developers/updates.md","ref":"developers/updates.md","articles":[]},"previous":{"title":"Developers","level":"1.7","depth":1,"path":"developers/README.md","ref":"developers/README.md","articles":[{"title":"Chart.js API","level":"1.7.1","depth":2,"path":"developers/api.md","ref":"developers/api.md","articles":[]},{"title":"Updating Charts","level":"1.7.2","depth":2,"path":"developers/updates.md","ref":"developers/updates.md","articles":[]},{"title":"Plugins","level":"1.7.3","depth":2,"path":"developers/plugins.md","ref":"developers/plugins.md","articles":[]},{"title":"New Charts","level":"1.7.4","depth":2,"path":"developers/charts.md","ref":"developers/charts.md","articles":[]},{"title":"New Axes","level":"1.7.5","depth":2,"path":"developers/axes.md","ref":"developers/axes.md","articles":[]},{"title":"Contributing","level":"1.7.6","depth":2,"path":"developers/contributing.md","ref":"developers/contributing.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["-lunr","-search","search-plus","anchorjs","chartjs","ga"],"root":"./docs","styles":{"website":"style.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"anchorjs":{"icon":"#","placement":"left","visible":"always"},"ga":{"configuration":"auto","token":"UA-28909194-3"},"theme-default":{"styles":{"website":"style.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"search-plus":{},"chartjs":{"defaults":null},"highlight":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}},"theme":"default","author":"chartjs","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Chart.js documentation","gitbook":"3.2.2"},"file":{"path":"developers/api.md","mtime":"2018-03-01T21:46:31.679Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-03-01T21:50:47.970Z"},"basePath":"..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
@@ -1040,7 +1053,7 @@ myLineChart.clear();
|
||||
|
||||
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/3.1.1/anchor.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.1.0/anchor.min.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user