Giter Club home page Giter Club logo

Comments (5)

jolo-dev avatar jolo-dev commented on May 1, 2024

Hi @valendinosaurus,
could you provide your code?

from roughviz.

valendinosaurus avatar valendinosaurus commented on May 1, 2024

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.

jolo-dev avatar jolo-dev commented on May 1, 2024

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.

vcheeze avatar vcheeze commented on May 1, 2024

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.

jolo-dev avatar jolo-dev commented on May 1, 2024

Hi @vcheeze,

Sorry, totally forgot about this.
I would love your contribution :)

from roughviz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.