Comments (5)
Hi @valendinosaurus,
could you provide your code?
from roughviz.
Hi @jolo-dev
In my service, I create the chart like this
new roughViz.Pie({
element: element,
data: data,
width: width,
height: height,
roughness: roughness,
fillStyle: 'hachure',
fillWeight: 4,
innerStrokeWidth: 1,
simplification: 0.5,
axisFontSize: '1rem',
tooltipFontSize: '1rem',
labelFontSize: '1rem',
titleFontSize: '1rem',
axisRoughness: 0.5
});
and my data gets created like following
mapAccountsForRoughViz(accounts: AccountNormalized[]): {} {
let labels = [];
let values = [];
accounts.forEach(a => {
labels.push(a.name);
values.push(a.saldo);
});
return {labels, values};
}
resulting in this effective data
{
"labels":
["Hauptkonto","Sparkonto"],
"values":
[1064.5899999999701,3497.4500000000007]
}
I also tried to round the numbers with Math.round()
resulting in
{
"labels":
["Hauptkonto","Sparkonto"],
"values":
[1065,3497]
}
but the result is the same. I have another chart at a different place with more than two elements, there I never saw this behaviour. Funny enough, from time to time the chart with only two elements gets drawin correctly, but I couldn't reproduce the behaviour.
I suspect it has something to do with having only two elements, if I alter my function mapAccountsForRoughViz
that it pushes everything twice (resulting in 4 elements), the chart gets drawn correctly.
from roughviz.
Oh yes, you're right. With two elements there is "weird" behavior.
I have tested that in the example:
https://blockbuilder.org/jwilber/d117e0b0864a161bec2d914013ed69da
Let me check what I can do.
from roughviz.
Hi @jolo-dev, just wondering if you have any updates on this or any suggestions/direction for me to try and resolve it if I can?
from roughviz.
Hi @vcheeze,
Sorry, totally forgot about this.
I would love your contribution :)
from roughviz.
Related Issues (20)
- Clickable bar charts HOT 2
- Ability to clear and re-draw HOT 4
- Vue-Wrapper HOT 1
- Crash with a zero value in Pie/Donut chart with Firefox 70.0.1
- some options with a value of `0` are overridden with the defaults HOT 1
- HTML links to labels/titles HOT 1
- Abstract Class HOT 1
- Make charts responsive
- Python Implementation HOT 1
- A spell error in readme.md HOT 1
- Save roughViz resulting chart to SVG
- Unifiy titleFontSize HOT 1
- Line data as Object (no csv or tsv) HOT 2
- Deploy a 1.0.7 HOT 1
- fillStyle in react-roughviz.Line doesn't work
- Legend for `roughViz.StackedBar` HOT 1
- Example links in README are 404 HOT 4
- Line chart with local data HOT 1
- Legend overlaps title
- Label names overlap each other
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from roughviz.