GithubHelp home page GithubHelp logo

formatting x-axis legend about chartkick HOT 8 CLOSED

ankane avatar ankane commented on May 2, 2024
formatting x-axis legend

from chartkick.

Comments (8)

ankane avatar ankane commented on May 2, 2024

I don't think there's any easy way to do this right now (but I'd like there to be). You would have to hack on the library. Right now, Chartkick uses a continuous axis type in order to plot irregular time intervals, and Google Charts automatically decides the labels. https://developers.google.com/chart/interactive/docs/customizing_axes

I believe the approach taken in "My domain axis type is not string but I still want a discrete domain axis" will solve this issue. I'll try it out when I get a chance but would gladly accept a pull request if you get it working.

from chartkick.

StephenOTT avatar StephenOTT commented on May 2, 2024

@nicholasjstock Can you use the vAxis Object in the Google charting library.?
screen shot 2013-10-19 at 2 31 43 am

from chartkick.

nicholasjstock avatar nicholasjstock commented on May 2, 2024

@StephenOTT thanks for your suggestion. The issue is not just with font size. I have a chart over 24 months with points every week, currently, each and every date displays a value in the '2012-03-03 timestamp" format.
I'd like to be able to control the axis more fully. as @ankane was saying, the aproach is discussed under the "My domain axis type is not string but I still want a discrete domain axis:" section of https://developers.google.com/chart/interactive/docs/customizing_axes#Terminology would work.

from chartkick.

StephenOTT avatar StephenOTT commented on May 2, 2024

Can you post a image of your chart to show the problem?

from chartkick.

nicholasjstock avatar nicholasjstock commented on May 2, 2024

screen shot 2013-10-21 at 9 15 47 am
Here ya go!

from chartkick.

ankane avatar ankane commented on May 2, 2024

Chartkick now has a discrete: true option (finally). Does this take care of the issue?

from chartkick.

ankane avatar ankane commented on May 2, 2024

Cleaning up issues - feel free to reopen if this is still an issue.

from chartkick.

martinwells avatar martinwells commented on May 2, 2024

Just for reference in case anyone needs it; this is how you can format axis as a passthrough to google charts:

= column_chart formatted, library: {title: "A Title", vAxis:{textStyle:{color:'gray', fontSize:"8pt"}}, hAxis:{textStyle:{color:'green', fontSize:"8pt"}}}, height:'200px'

from chartkick.

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.