Giter Site home page Giter Site logo

Comments (7)

aishmit avatar aishmit commented on May 22, 2024

Also is there any proper documentation for nameLabelFormat? I feel like this may be a viable solution however all I can find is that nameLabelFormat accepts a string[]

from britecharts-react.

Golodhros avatar Golodhros commented on May 22, 2024

Hi @aishmitk, thanks for creating this issue!

I see the y-axis offset, it feels weird. I would tweak it with CSS as you mention. If you post it as a Codepen I could help you more (You can jumpstart it from this one).

Regarding the x-ticks, you could try to specify a number with xTicks (http://eventbrite.github.io/britecharts/module-Stacked-bar.html#.xTicks__anchor). You could also try to tilt the values with CSS.

Oops, it seems there is an issue with nameLabelFormat, as it is not being used at the moment. I will create an issue to investigate further.

Thanks!

from britecharts-react.

davegomez avatar davegomez commented on May 22, 2024

The problem with the xTicks prop is that as it is explained in the D3 docs is a mere suggestion and in most cases doesn't have any real effect on the number of ticks displayed, specially with high number of datasets.

The specified count is only a hint; the scale may return more or fewer values depending on the domain.

Source: D3 scale.ticks

from britecharts-react.

jjphung avatar jjphung commented on May 22, 2024

This is probably a really elementary question. But how do you apply CSS to the graph? The graph is rendered to a SVG element. I am trying to left align axis tick labels (more specifically x-axis on horizontal bar graph)

I see the y-axis offset, it feels weird. I would tweak it with CSS as you mention. If you post it as a Codepen I could help you more (You can jumpstart it from this one).

Regarding the x-ticks, you could try to specify a number with xTicks (http://eventbrite.github.io/britecharts/module-Stacked-bar.html#.xTicks__anchor). You could also try to tilt the values with CSS.

from britecharts-react.

Golodhros avatar Golodhros commented on May 22, 2024

Hi @jjphung, sorry for the delay!

In order to apply that CSS styling, you would do something like this:

.x.axis .tick .text {
    transform: rotate(-45deg);
}

And probably adjust the x axis position:

.x.axis {
    transform: translateY(420px);
}

(Assuming the original translation was 400px, that could be different in your case)

from britecharts-react.

jjphung avatar jjphung commented on May 22, 2024

@Golodhros Thank you so much! I was trying to apply CSS properties through stuff like: "text-align: left". I didn't notice the text transform properties being applied to the classes. Adjusting the text transform and text-anchor properties did the trick!

And probably adjust the x axis position:

.x.axis {
    transform: translateY(420px);
}

(Assuming the original translation was 400px, that could be different in your case)

from britecharts-react.

Golodhros avatar Golodhros commented on May 22, 2024

Closing due to lack of activity.

from britecharts-react.

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.