Charts and graphs - Thousands separator and custom preset functions
Looking for WET v3.1?
WET v4.0 is now the current version. There is a new location for the current page in WET v3.1.
- Charts and graphs - Simple and easy
- Labels and reference values
- Customization, custom presets and multiple charts and graphs types
- Customizing pie charts
- Specific test cases
Thousands separator
Comma separator
Default
Contributor | Commits | Additions | Deletions |
---|---|---|---|
pjackson28 | 1,713 | 1,483,907 | 928,648 |
nschonni | 506 | 90,412 | 72,797 |
LaurentGoderre | 398 | 52,983 | 29,957 |
duboisp | 289 | 168,976 | 106,100 |
patheard | 135 | 6,820 | 3,639 |
cfarquharson | 85 | 18,572 | 3,518 |
With the CSS option (wb-charts-thousandcomma
)
Contributor | Commits | Additions | Deletions |
---|---|---|---|
pjackson28 | 1,713 | 1,483,907 | 928,648 |
nschonni | 506 | 90,412 | 72,797 |
LaurentGoderre | 398 | 52,983 | 29,957 |
duboisp | 289 | 168,976 | 106,100 |
patheard | 135 | 6,820 | 3,639 |
cfarquharson | 85 | 18,572 | 3,518 |
Dot separator
Default
Contributor | Commits | Additions | Deletions |
---|---|---|---|
pjackson28 | 1.713 | 1.483.907 | 928.648 |
nschonni | 506 | 90.412 | 72.797 |
LaurentGoderre | 398 | 52.983 | 29.957 |
duboisp | 289 | 168.976 | 106.100 |
patheard | 135 | 6.820 | 3.639 |
cfarquharson | 85 | 18.572 | 3.518 |
With the CSS option (wb-charts-thousanddot
)
Contributor | Commits | Additions | Deletions |
---|---|---|---|
pjackson28 | 1.713 | 1.483.907 | 928.648 |
nschonni | 506 | 90.412 | 72.797 |
LaurentGoderre | 398 | 52.983 | 29.957 |
duboisp | 289 | 168.976 | 106.100 |
patheard | 135 | 6.820 | 3.639 |
cfarquharson | 85 | 18.572 | 3.518 |
Using functions within your custom preset
Goal: Extracting and parsing custom tabular data to create your chart or graph.
Declaring your custom preset
<script>
window[ "wb-charts" ] = {
charts: {
custom: {
fn: {
"/getcellvalue": function(elem){
var raw = $(elem).text().replace(/\s\s+/g, ' ').replace(/^\s+|\s+$/g, '').replace(/N/g, '');
return [parseFloat(raw.match(/[\+\-0-9]+[0-9,\. ]*/)), raw.match(/[^\+\-\.\, 0-9]+[^\-\+0-9]*/)];
}
}
}
}
};
</script>
The key for the fn
object is similar to the JSON pointer defined in RFC 6901. The key identifies what should be overwritten with the function.
<table class="wb-charts wb-charts-custom table">
Contributor | Commits | Additions | Deletions |
---|---|---|---|
pjackson28 | 1N713 | 1N483N907 | 928N648 |
nschonni | 506 | 90N412 | 72N797 |
LaurentGoderre | 398 | 52N983 | 29N957 |
duboisp | 289 | 168N976 | 106N100 |
patheard | 135 | 6N820 | 3N639 |
cfarquharson | 85 | 18N572 | 3N518 |
- Date modified: