var graph2d = new vis.Graph2d(container, dataset, options);
var Graph2d = new vis.Graph2d(container, dataset, options);
</script>
</script>
</body>
</body>
</html>
</html>
@ -278,13 +280,13 @@ groups.add({
<td>slots.slot</td>
<td>slots.slot</td>
<td>Number</td>
<td>Number</td>
<td></td>
<td></td>
<td>The slot the bar chart is plotted in. This has to be used in combination with slots.total. See <ahref="../examples/graph2d/11_barsSideBySideGroups.html">example 11</a> for more information.</td>
<td>The slot the bar chart is plotted in. This has to be used in combination with slots.total. See <ahref="../examples/Graph2d/11_barsSideBySideGroups.html">example 11</a> for more information.</td>
</tr>
</tr>
<tr>
<tr>
<td>slots.total</td>
<td>slots.total</td>
<td>Number</td>
<td>Number</td>
<td></td>
<td></td>
<td>The total amount of slots available. This has to be used in combination with slots.slot. See <ahref="../examples/graph2d/11_barsSideBySideGroups.html">example 11</a> for more information.</td>
<td>The total amount of slots available. This has to be used in combination with slots.slot. See <ahref="../examples/Graph2d/11_barsSideBySideGroups.html">example 11</a> for more information.</td>
</tr>
</tr>
</table>
</table>
@ -316,7 +318,7 @@ The options colored in green can also be used as options for the groups. All opt
<tdclass="greenField">yAxisOrientation</td>
<tdclass="greenField">yAxisOrientation</td>
<td>String</td>
<td>String</td>
<td>'left'</td>
<td>'left'</td>
<td>This defines with which axis, left or right, the graph is coupled. <ahref="../examples/graph2d/05_bothAxis.html">Example 5</a> shows groups with different Y axis. If no groups are coupled
<td>This defines with which axis, left or right, the graph is coupled. <ahref="../examples/Graph2d/05_bothAxis.html">Example 5</a> shows groups with different Y axis. If no groups are coupled
with an axis, it will not be shown.</td>
with an axis, it will not be shown.</td>
</tr>
</tr>
<tr>
<tr>
@ -336,7 +338,7 @@ The options colored in green can also be used as options for the groups. All opt
<tdclass="greenField">sampling</td>
<tdclass="greenField">sampling</td>
<td>Boolean</td>
<td>Boolean</td>
<td>true</td>
<td>true</td>
<td>If sampling is enabled, graph2D will automatically determine the amount of points per pixel.
<td>If sampling is enabled, Graph2d will automatically determine the amount of points per pixel.
If there are more than 1 point per pixel, not all points will be drawn. Disabling sampling will cause a decrease in performance.</td>
If there are more than 1 point per pixel, not all points will be drawn. Disabling sampling will cause a decrease in performance.</td>
</tr>
</tr>
<tr>
<tr>
@ -388,8 +390,8 @@ The options colored in green can also be used as options for the groups. All opt
<td>Boolean</td>
<td>Boolean</td>
<td>true</td>
<td>true</td>
<td>When true, bars that have the same x coordinate are plotted on top of eachother (not stacking).
<td>When true, bars that have the same x coordinate are plotted on top of eachother (not stacking).
See <ahref="../examples/graph2d/10_barsSideBySide.html">example 10</a> for more information.
When using groups, see <ahref="../examples/graph2d/11_barsSideBySideGroups.html">example 11</a>.
See <ahref="../examples/Graph2d/10_barsSideBySide.html">example 10</a> for more information.
When using groups, see <ahref="../examples/Graph2d/11_barsSideBySideGroups.html">example 11</a>.
</td>
</td>
</tr>
</tr>
<tr>
<tr>
@ -408,7 +410,7 @@ The options colored in green can also be used as options for the groups. All opt
<td>Define the type of parametrizaion. <ahref="../examples/graph2d/07_scrollingAndSorting.html">Example 7</a> shows the different methods. The options are 'centripetal' (best results), 'chordal' and 'uniform'. Uniform is the computationally cheapest variant.
<td>Define the type of parametrizaion. <ahref="../examples/Graph2d/07_scrollingAndSorting.html">Example 7</a> shows the different methods. The options are 'centripetal' (best results), 'chordal' and 'uniform'. Uniform is the computationally cheapest variant.
If catmullRom is disabled, linear interpolation is used.</td>
If catmullRom is disabled, linear interpolation is used.</td>
</tr>
</tr>
<tr>
<tr>
@ -512,7 +514,7 @@ The options colored in green can also be used as options for the groups. All opt
<h3id="timelineOptions">Timeline Options</h3>
<h3id="timelineOptions">Timeline Options</h3>
<p>
<p>
Graph2d is built upon the framework of the timeline. These options from the timeline can be used with graph2D.
Graph2d is built upon the framework of the timeline. These options from the timeline can be used with Graph2d.
Graph2d can be localized. For localization, Graph2d depends largely on the localization of <ahref="http://momentjs.com">moment.js</a>. Locales are not included in vis.js by default. To enable localization, moment.js must be loaded with locales. Moment.js offers a bundle named "moment-with-locales.min.js" for this and there are various alternative ways to load locales.
</p>
<p>
To set a locale for the Graph2d, specify the option <code>locale</code>:
</p>
<preclass="prettyprint lang-js">var options = {
locale: 'nl'
};
</pre>
<h3>Create a new locale</h3>
To load a locale into the Graph2d not supported by default, one can add a new locale to the option <code>locales</code>:
<preclass="prettyprint lang-js">var options = {
locales: {
// create a new locale
mylocale: {
current: 'current',
time: 'time',
}
},
// use the new locale
locale: 'mylocale'
};
</pre>
<h3id="available-locales">Available locales</h3>
Graph2d comes with support for the following locales:
<table>
<tr><th>Language</th><th>Code</th></tr>
<tr>
<td>English</td>
<td>
<code>en</code><br>
<code>en_EN</code><br>
<code>en_US</code>
</td>
</tr>
<tr>
<td>Dutch</td>
<td>
<code>nl</code><br>
<code>nl_NL</code><br>
<code>nl_BE</code>
</td>
</tr>
</table>
<h2id="Styles">Styles</h2>
<h2id="Styles">Styles</h2>
<p>
<p>
All parts of the Graph2d have a class name and a default css style just like the Timeline.
All parts of the Graph2d have a class name and a default css style just like the Graph2d.
The styles can be overwritten, which enables full customization of the layout
The styles can be overwritten, which enables full customization of the layout
of the Graph2d.
of the Graph2d.
</p>
</p>
<p>
<p>
Additionally, Graph2d has 10 preset styles for graphs, which are cycled through when loading groups. These styles can be overwritten
Additionally, Graph2d has 10 preset styles for graphs, which are cycled through when loading groups. These styles can be overwritten
as well, along with defining your own classes to style the graphs! <ahref="../examples/graph2d/04_rightAxis.html">Example 4</a> and
<ahref="../examples/graph2d/05_bothAxis.html">example 5</a> show the usage of custom styles.
as well, along with defining your own classes to style the graphs! <ahref="../examples/Graph2d/04_rightAxis.html">Example 4</a> and
<ahref="../examples/Graph2d/05_bothAxis.html">example 5</a> show the usage of custom styles.
<td>Select a locale for the Timeline. See section <a>Localization</a> for more information.</td>
</tr>
<tr>
<td>locales</td>
<td>Object</td>
<td>none</td>
<td>A map with i18n locales. See section <a>Localization</a> for more information.</td>
</tr>
<tr>
<tr>
<td>margin.axis</td>
<td>margin.axis</td>
<td>Number</td>
<td>Number</td>
@ -985,11 +1000,67 @@ var options = {
callback(null); // cancel updating the item
callback(null); // cancel updating the item
}
}
}
}
}
};
</pre>
</pre>
A full example is available here: <ahref="../examples/timeline/08_edit_items.html">08_edit_items.html</a>.
A full example is available here: <ahref="../examples/timeline/08_edit_items.html">08_edit_items.html</a>.
<h2id="Localization">Localization</h2>
<p>
Timeline can be localized. For localization, Timeline depends largely on the localization of <ahref="http://momentjs.com">moment.js</a>. Locales are not included in vis.js by default. To enable localization, moment.js must be loaded with locales. Moment.js offers a bundle named "moment-with-locales.min.js" for this and there are various alternative ways to load locales.
</p>
<p>
To set a locale for the Timeline, specify the option <code>locale</code>:
</p>
<preclass="prettyprint lang-js">var options = {
locale: 'nl'
};
</pre>
<h3>Create a new locale</h3>
To load a locale into the Timeline not supported by default, one can add a new locale to the option <code>locales</code>:
<preclass="prettyprint lang-js">var options = {
locales: {
// create a new locale
mylocale: {
current: 'current',
time: 'time',
}
},
// use the new locale
locale: 'mylocale'
};
</pre>
<h3id="available-locales">Available locales</h3>
Timeline comes with support for the following locales:
<table>
<tr><th>Language</th><th>Code</th></tr>
<tr>
<td>English</td>
<td>
<code>en</code><br>
<code>en_EN</code><br>
<code>en_US</code>
</td>
</tr>
<tr>
<td>Dutch</td>
<td>
<code>nl</code><br>
<code>nl_NL</code><br>
<code>nl_BE</code>
</td>
</tr>
</table>
<h2id="Styles">Styles</h2>
<h2id="Styles">Styles</h2>
<p>
<p>
@ -1008,7 +1079,6 @@ A full example is available here:
</style>
</style>
</pre>
</pre>
<h2id="Data_Policy">Data Policy</h2>
<h2id="Data_Policy">Data Policy</h2>
<p>
<p>
All code and data is processed and rendered in the browser.
All code and data is processed and rendered in the browser.