Code Monkey home page Code Monkey logo

Comments (10)

ankane avatar ankane commented on May 6, 2024 2

To keep chartkick as flexible as possible, I added the library option, so you can now do:

<%= line_chart series, library: {legend: {position: "left"}} %>

It's not as clean as your proposed implementation, but I'd like to keep library-specific options separate for now.

from chartkick.

ankane avatar ankane commented on May 6, 2024

The options are pretty limited right now (just min and max), but I'm open to adding ones that are requested often.

from chartkick.

michiels avatar michiels commented on May 6, 2024

Cool! I understand you'd like to have specific options over inserting a hash to override the defaults?

Op 14 mei 2013 om 18:16 heeft Andrew Kane [email protected] het volgende geschreven:

The options are pretty limited right now (just min and max), but I'm open to adding ones that are requested often.


Reply to this email directly or view it on GitHub.

from chartkick.

ankane avatar ankane commented on May 6, 2024

Correct, I'd like the options to be independent of the charting library. This way, we can do

:min => 0

vs

options.vAxis.viewWindow.min = 0

from chartkick.

michiels avatar michiels commented on May 6, 2024

Thanks! Actually, I think this is even nicer.

from chartkick.

genlighten avatar genlighten commented on May 6, 2024

I'm trying to pass the lineTension: 0 option to charts.js so I can get straight lines between points instead of Bezier curves. I've tried
line_chart series, library: { lineTension: 0 }
and
line_chart series, library: { options: { lineTension: 0 }}
with no effect.

Any suggestions for the right syntax in this situation?

Thanks!

--Dean

from chartkick.

aishmita-aggarwal avatar aishmita-aggarwal commented on May 6, 2024

I am facing a similar problem as @genlighten. Did we find any results?

from chartkick.

walreyes avatar walreyes commented on May 6, 2024

Someone found a solution to your problem @genlighten?

from chartkick.

deztrucktor avatar deztrucktor commented on May 6, 2024

@genlighten I had the same problem, but the following workaround seems to work:
Chart.defaults.global.elements.line.tension = 0.001;

Setting it to 0 doesn't work, but 0.001 does.

from chartkick.

ndbroadbent avatar ndbroadbent commented on May 6, 2024

If anyone else finds this issue, I figured out how to get straight lines with Chart.js 2.7.0 and chartkick 2.3.5:

line_chart data, library: { elements: { line: { tension: 0 }}}

Setting it to 0 works fine now, they must have fixed that issue.

(Reference: chartjs/Chart.js#2170 (comment))

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.